release_kit/cli/skill.rs
1//! Arguments for `rk skill`.
2
3use clap::{Args, Subcommand, ValueEnum};
4
5/// Manage the agent skills at user scope.
6#[derive(Debug, Args)]
7pub struct SkillArgs {
8 /// What to do with the skills.
9 #[command(subcommand)]
10 pub action: SkillAction,
11}
12
13/// The skill operations.
14#[derive(Debug, Subcommand)]
15pub enum SkillAction {
16 /// List the skills the binary carries.
17 List,
18 /// Print one skill.
19 Show {
20 /// The skill's name.
21 name: String,
22 },
23 /// Install the skills at user scope, previewing by default.
24 Install {
25 /// Which agent's skill directory to install into.
26 #[arg(long, value_enum, default_value_t = Agent::All)]
27 agent: Agent,
28 /// Where the skills land.
29 #[arg(long, value_enum, default_value_t = Scope::User)]
30 scope: Scope,
31 /// Write the files; without it the destinations are listed.
32 #[arg(long)]
33 apply: bool,
34 /// Overwrite a destination whose bytes differ from the payload.
35 #[arg(long, requires = "apply")]
36 force: bool,
37 /// Emit one JSON object on stdout instead of the human report.
38 #[arg(long)]
39 json: bool,
40 },
41 /// Remove the installed skills, previewing by default.
42 Uninstall {
43 /// Which agent's skill directory to remove from.
44 #[arg(long, value_enum, default_value_t = Agent::All)]
45 agent: Agent,
46 /// Where the skills live.
47 #[arg(long, value_enum, default_value_t = Scope::User)]
48 scope: Scope,
49 /// Remove the files; without it the removals are listed.
50 #[arg(long)]
51 apply: bool,
52 /// Emit one JSON object on stdout instead of the human report.
53 #[arg(long)]
54 json: bool,
55 },
56}
57
58/// Which skill directory family a run touches.
59#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
60#[value(rename_all = "kebab-case")]
61pub enum Agent {
62 /// `.claude/skills`, which Claude Code reads.
63 Claude,
64 /// `.agents/skills`, which Codex, Gemini CLI, and Copilot read.
65 Codex,
66 /// Both directories.
67 All,
68}
69
70/// Where an install lands.
71///
72/// One value, and a flag rather than a silent default, because the scope is
73/// the decision an operator most needs stated: an agent resolves a skill by
74/// name across scopes, so the skills have exactly one owner and no project
75/// scope is offered.
76#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
77#[value(rename_all = "kebab-case")]
78pub enum Scope {
79 /// The home-directory skill roots, shared across every repository.
80 User,
81}