spec_driven_docs/cli/skill.rs
1//! `skill` subcommand: parse-shape.
2//!
3//! Holds the clap derive structs only. No I/O, no business logic.
4
5use clap::{Subcommand, ValueEnum};
6
7/// Read the embedded skills, and remove the copies an earlier release
8/// installed under the home.
9#[derive(Debug, clap::Args)]
10pub struct SkillArgs {
11 /// The verb to run.
12 #[command(subcommand)]
13 pub command: SkillCommand,
14}
15
16/// Every verb `sdd skill` offers.
17#[derive(Debug, Subcommand)]
18pub enum SkillCommand {
19 /// List every embedded skill.
20 List,
21 /// Print one skill's `SKILL.md`, or one file of its package.
22 Show(ShowArgs),
23 /// Retired: the skills land into each instance through `sdd init` and
24 /// `sdd upgrade`.
25 Install(InstallArgs),
26 /// Remove the copies an earlier release installed under the home.
27 Uninstall(UninstallArgs),
28}
29
30/// Print one skill's `SKILL.md`, or one file of its package.
31#[derive(Debug, clap::Args)]
32pub struct ShowArgs {
33 /// The skill's name.
34 pub name: String,
35
36 /// One file of the package, by its path relative to the package root,
37 /// such as `references/pre-flight-gate.md`.
38 #[arg(long, value_name = "PATH")]
39 pub file: Option<String>,
40}
41
42/// The retired install: it states where the skills land now.
43#[derive(Debug, clap::Args)]
44pub struct InstallArgs {
45 /// Which agent's skill directory an earlier release installed into.
46 #[arg(long, value_enum, default_value_t = Agent::All)]
47 pub agent: Agent,
48
49 /// Refuse, naming the landing; without it the same text prints.
50 #[arg(long)]
51 pub apply: bool,
52}
53
54/// Remove the installed skills from the agent skill directories.
55#[derive(Debug, clap::Args)]
56pub struct UninstallArgs {
57 /// Which agent's skill directory to remove from.
58 #[arg(long, value_enum, default_value_t = Agent::All)]
59 pub agent: Agent,
60
61 /// Remove the files; without it the uninstall previews.
62 #[arg(long)]
63 pub apply: bool,
64}
65
66/// Which skill directory family to install into.
67///
68/// The values name the root rather than one host that reads it. `sdd status
69/// --json` reports where each one resolves, including the variable that
70/// moved it, so no help text here has to spell a path.
71#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
72#[value(rename_all = "kebab-case")]
73pub enum Agent {
74 /// The root Claude Code reads.
75 Claude,
76 /// The shared root every other agent reads. `codex` is its old name.
77 #[value(alias = "codex")]
78 Agents,
79 /// Both roots.
80 All,
81}