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, or install and remove them for coding agents.
8#[derive(Debug, clap::Args)]
9pub struct SkillArgs {
10 /// The verb to run.
11 #[command(subcommand)]
12 pub command: SkillCommand,
13}
14
15/// Every verb `sdd skill` offers.
16#[derive(Debug, Subcommand)]
17pub enum SkillCommand {
18 /// List every embedded skill.
19 List,
20 /// Print one skill's `SKILL.md`.
21 Show(ShowArgs),
22 /// Install the skills into the agent skill directories.
23 Install(InstallArgs),
24 /// Remove the installed skills from the agent skill directories.
25 Uninstall(UninstallArgs),
26}
27
28/// Print one skill's `SKILL.md`.
29#[derive(Debug, clap::Args)]
30pub struct ShowArgs {
31 /// The skill's name.
32 pub name: String,
33}
34
35/// Install the skills into the agent skill directories.
36#[derive(Debug, clap::Args)]
37pub struct InstallArgs {
38 /// Which agent's skill directory to install into.
39 #[arg(long, value_enum, default_value_t = Agent::All)]
40 pub agent: Agent,
41
42 /// Where the skills land; `user` is the home-directory scope.
43 #[arg(long, value_enum, default_value_t = Scope::User)]
44 pub scope: Scope,
45
46 /// Write the files; without it the install previews.
47 #[arg(long)]
48 pub apply: bool,
49
50 /// Overwrite a destination whose bytes differ from the payload.
51 #[arg(long, requires = "apply")]
52 pub force: bool,
53}
54
55/// Remove the installed skills from the agent skill directories.
56#[derive(Debug, clap::Args)]
57pub struct UninstallArgs {
58 /// Which agent's skill directory to remove from.
59 #[arg(long, value_enum, default_value_t = Agent::All)]
60 pub agent: Agent,
61
62 /// Where the skills live; `user` is the home-directory scope.
63 #[arg(long, value_enum, default_value_t = Scope::User)]
64 pub scope: Scope,
65
66 /// Remove the files; without it the uninstall previews.
67 #[arg(long)]
68 pub apply: bool,
69}
70
71/// Which skill directory family to install into.
72#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
73#[value(rename_all = "kebab-case")]
74pub enum Agent {
75 /// `.claude/skills` — read by Claude Code.
76 Claude,
77 /// `.agents/skills` — read by Codex, Gemini CLI, and Copilot.
78 Codex,
79 /// Both directories.
80 All,
81}
82
83/// Where an install lands.
84#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
85#[value(rename_all = "kebab-case")]
86pub enum Scope {
87 /// The home-directory skill roots, shared across projects.
88 User,
89}