Skip to main content

release_kit/cli/
skill.rs

1//! Arguments for `rk skill`.
2
3use clap::{Args, Subcommand, ValueEnum};
4
5/// Read the agent skills this binary carries, and remove the copies an
6/// earlier release installed under the home.
7#[derive(Debug, Args)]
8pub struct SkillArgs {
9    /// What to do with the skills.
10    #[command(subcommand)]
11    pub action: SkillAction,
12}
13
14/// The skill operations.
15#[derive(Debug, Subcommand)]
16pub enum SkillAction {
17    /// List the skills the binary carries.
18    List,
19    /// Print one skill's `SKILL.md`, or one file of its package.
20    Show {
21        /// The skill's name.
22        name: String,
23        /// One file of the package, relative to the skill's folder, such
24        /// as `references/pre-flight-gate.md`.
25        #[arg(long)]
26        file: Option<String>,
27    },
28    /// Retired: every landing carries the skills. Names the landing, and
29    /// refuses under `--apply`.
30    Install {
31        /// Kept so that an older call reads the retirement, not a usage
32        /// error.
33        #[arg(long, value_enum, default_value_t = Agent::All)]
34        agent: Agent,
35        /// Refuse, because no rk verb writes a skill under the home.
36        #[arg(long)]
37        apply: bool,
38        /// Emit one JSON object on stdout instead of the human report.
39        #[arg(long)]
40        json: bool,
41    },
42    /// Remove the skill copies an earlier release installed under the
43    /// home, previewing by default.
44    Uninstall {
45        /// Which agent's skill directory to remove from.
46        #[arg(long, value_enum, default_value_t = Agent::All)]
47        agent: Agent,
48        /// Remove the files; without it the removals are listed.
49        #[arg(long)]
50        apply: bool,
51        /// Emit one JSON object on stdout instead of the human report.
52        #[arg(long)]
53        json: bool,
54    },
55}
56
57/// Which skill directory family a run touches.
58#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
59#[value(rename_all = "kebab-case")]
60pub enum Agent {
61    /// `.claude/skills`, which Claude Code reads.
62    Claude,
63    /// `.agents/skills`, which Codex, Gemini CLI, and Copilot read.
64    Codex,
65    /// Both directories.
66    All,
67}