一键导入
commands-standards
Standards for authoring SDD plugin commands — frontmatter, user interaction, skill/agent invocation, CLI integration, and output formatting.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Standards for authoring SDD plugin commands — frontmatter, user interaction, skill/agent invocation, CLI integration, and output formatting.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Orchestrates SDD project initialization — version detection, environment verification, scaffolding, and git setup.
Manage project settings in sdd/sdd-settings.yaml including component settings that drive scaffolding.
Single gateway for all core↔tech-pack interactions. Reads manifests, resolves paths, loads skills/agents, routes commands.
Manage tasks and plans using the .tasks/ directory.
Standards for authoring SDD plugin agents — frontmatter, self-containment, skill references, and no-user-interaction rules.
Create a commit following repository guidelines with proper versioning and changelog updates.
| name | commands-standards |
| description | Standards for authoring SDD plugin commands — frontmatter, user interaction, skill/agent invocation, CLI integration, and output formatting. |
Standards for every command in the plugin. Apply when creating or reviewing plugin commands.
This standard applies to commands shipped with the SDD plugin — all .md files found in plugin/core/commands/. It does not apply to the repo's own .claude/skills/.
Every command file must start with YAML frontmatter containing exactly these fields:
---
name: sdd-my-command # REQUIRED — kebab-case, prefixed with "sdd-"
description: > # REQUIRED — what this command does, shown in help
Manage project configuration - generate merged configs,
validate, diff environments.
---
| Field | Type | Rule |
|---|---|---|
name | string | kebab-case, prefixed with sdd-, matches the filename without .md extension |
description | string | 1-2 sentences. What the command does from the user's perspective. Written for the help listing — concise and action-oriented. |
No other frontmatter fields. Additional metadata belongs in the command body.
Commands are the user-facing entry points of the plugin. Users invoke them via /command-name in Claude Code. A command's job is to orchestrate — not to implement logic directly. Commands:
INVOKE) and the CLI (via sdd-system)Commands sit at the top of the invocation hierarchy:
User → Command (user-facing, orchestrates)
Command → Skill (prompt-layer work: solicitation, decomposition, planning)
Command → Agent (specialized implementation: backend-dev, api-designer)
Command → CLI (system-layer work: scaffolding, validation, file operations)
A command must never contain implementation logic that belongs in a skill, agent, or the CLI. If a command's action section grows beyond orchestration (argument parsing, INVOKE directives, state transitions, output formatting), the logic should be extracted into a skill.
A command must be fully understandable on its own. An LLM reading a single command file should know exactly what the command does, what arguments it accepts, what it invokes, and what the user sees — without reading other commands.
.sdd/sdd-settings.yaml), state that as a precondition.plugin/core/commands/) have no runtime access to anything outside plugin/. Never reference .claude/, .tasks/, or root-level files from within a plugin command.Commands are the only layer that interacts directly with the user. Unlike agents (which have no user channel) and skills (which are instructional context), commands define the conversation flow.
NEXT STEPS section telling the user what to do next. The user should never be left wondering "what now?".## Flow
1. Check if branch is main
2. Ask user about the branch
3. Continue
The reader doesn't know what the user sees, what the options are, or what happens for each choice.
## Flow
1. Run `git branch --show-current`
2. If on `main`/`master`:
You're on the main branch. Feature work should happen on a feature branch.
Suggested branch: feature/user-auth
[1] Create branch and switch (recommended) [2] Continue on main [3] Cancel
3. If user selects [1]: create and checkout the branch
4. Otherwise proceed on current branch
The reader knows exactly what the user sees and what each option does.
Commands delegate work to skills and agents using the INVOKE directive. This is the standard format for documenting delegation in command files.
INVOKE <skill-or-agent-name> with:
param1: <value or description>
param2: <value or description>
For skills with methods (e.g., workflow-state):
INVOKE <skill-name>.<method> with:
param1: <value>
<angle brackets> for dynamic values and plain text for literals.workflow_id for tracking."). The reader should know the shape of the result without reading the skill.SKILL.md somewhere under plugin/core/skills/ or plugin/fullstack-typescript/skills/ (scan recursively). Every agent name must correspond to an .md file in plugin/fullstack-typescript/agents/. Referencing nonexistent skills or agents creates silent failures.workflow_id: <from step 3>).Commands may call the sdd-system CLI for deterministic, system-layer operations (file creation, validation, version bumping). This is a different delegation path than INVOKE — CLI calls are shell executions, not prompt-layer context loading. For the canonical invocation pattern, output contracts, and authority boundaries, see the system-cli-standards skill.
## Implementation
This command invokes `sdd-system` CLI subcommands:
```bash
sdd-system <namespace> <action> [args] [options]
Or inline within a flow step:
```markdown
4. Run `sdd-system config validate --env <env>`
5. If validation fails, display errors and exit
sdd-system by name — Always reference the CLI as sdd-system, not by its file path. The execution wrapper (node --enable-source-maps "<plugin-root>/system/dist/cli.js") should appear at most once in the command, in an ## Execution section.Commands must be designed with clear argument requirements and provide helpful guidance when invoked incorrectly.
Never run without arguments unless designed for it — Commands should not execute their primary workflow when called without arguments, unless the command's only intended use is without arguments (e.g., /sdd-run init which initializes a new project). Multi-action commands like /sdd-run config or /sdd-run change must require at least an action argument.
Show focused usage guide for insufficient arguments — When a command is invoked with missing or insufficient required arguments, display a focused usage guide showing:
NEXT STEPS section pointing to how to proceedThe usage guide should be tailored to what's missing. For example:
/sdd-run config without operation) → show all available actions/sdd-run config generate without --env) → show that action's usage with required flags highlightedFail fast on missing arguments — Don't prompt for missing arguments interactively when the argument structure is invalid. Show the usage guide and exit. Interactive prompts should only happen during valid workflow execution (e.g., asking which option to select), not to recover from invalid invocation.
Consistent help patterns — Commands with a --help or -h flag should show the same usage guide as when invoked without arguments. The usage guide is the canonical reference.
$ /sdd-run config
⚠ Missing required action argument.
USAGE:
/sdd-run config <action> [options]
ACTIONS:
generate Generate merged configuration for an environment
validate Validate configuration against schema
diff Compare configurations between environments
EXAMPLES:
/sdd-run config generate --env production
/sdd-run config validate
/sdd-run config diff --from dev --to staging
NEXT STEPS:
Run /sdd-run config <action> to get started, or /sdd-run config <action> --help for details.
$ /sdd-run init
# This command is designed to run without arguments, so it proceeds directly
# to its initialization workflow. It does not show a usage guide.
Commands with multiple operations use an actions pattern. Each action is a distinct workflow the user can invoke.
## Usage
/sdd-command [args] [options]
## Actions
| Action | Description | Example |
|--------|-------------|---------|
| `new` | Create a new item | `/sdd-command new --name foo` |
| `status` | Show current state | `/sdd-command status` |
## Action: new
### Usage
...
### Arguments
| Argument | Required | Description |
...
### Flow
1. ...
2. ...
### Output
...
## Action: <name> section (or ### <name> for simpler commands). Never mix multiple actions in one section./sdd-run init) don't need the actions pattern. Use ## Workflow or ## Flow directly.Commands produce user-facing terminal output. Consistent formatting makes the plugin feel cohesive and professional.
| Element | Format |
|---|---|
| Section headers | ═══════ box with centered title |
| Success indicator | ✓ (check mark) |
| Failure indicator | ✗ (cross mark) |
| Warning indicator | ⚠ (warning sign) |
| Indented details | Two-space indent under parent |
| Status tables | Aligned columns with ───── separator |
| Next steps | NEXT STEPS: header with numbered items |
| File references | [filename.ext](relative/path/to/file.ext) for clickable links |
| Line-specific refs | [filename.ts:42](path/to/filename.ts#L42) for specific lines |
| Directory refs | [dirname/](path/to/dirname/) for folders |
| Change ID refs | [a1b2-1](changes/.../01-registration/) linking to change directory |
| Task refs | [#19](.tasks/.../19/task.md) following tasks skill convention |
✓/✗/⚠ across all commands. Don't invent custom indicators.═══════ box format for completion messages and major state transitions. Don't use it for intermediate steps.Commands that span multiple sessions must persist their state to disk so work survives session boundaries.
.sdd/workflows/) must be explicitly documented in the command. The reader should know where to look.spec_review → plan_review).After the frontmatter, organize the command body as follows:
# /command-name <- H1, with leading slash
One-line summary paragraph. <- What this command does
## Usage <- Syntax with code block
## Actions <- (if multi-action) Summary table
## Action: <name> <- (if multi-action) Per-action detail
### Usage
### Arguments
### Flow
### Output
## <Supporting Sections> <- Merge algorithm, workflow, etc.
## Important Notes <- (recommended) Key constraints, edge cases
## Related <- (recommended) Related commands and skills
# /sdd-run config), matching how the user invokes it.bash, yaml, typescript). Use no language tag for terminal output (the formatted text the user sees).yaml language tag for INVOKE directives within flow steps.--no-verify).Some commands are structurally more likely to drift than others. During audit or review, score each command to prioritize monitoring effort. Higher scores mean more drift surfaces — not that the command is broken today, but that it is more likely to break tomorrow.
| Risk Factor | Points | Rationale |
|---|---|---|
| Each INVOKE directive (skill/agent) | +1 | More invocations = more surfaces that can change |
| Each vague INVOKE (no inputs/outputs specified) | +2 | Vague invocations drift silently — the skill evolves but the command's assumption doesn't |
| Each CLI command reference | +1 | CLI interfaces change across versions; the command may reference stale subcommands or flags |
| Each hardcoded file path | +1 | Paths change during refactors; the command won't know |
| Each duplicated concept from a skill or agent | +3 | Duplicated content drifts silently; the source of truth evolves but the copy doesn't |
| Each cross-command file reference | +3 | Hidden coupling that breaks on restructure |
| Each environment assumption without documented precondition | +1 | Implicit assumptions break silently in new environments |
| Each action with more than 8 flow steps | +1 | Long flows are harder to maintain and more likely to accumulate drift |
| Score | Tier | Action |
|---|---|---|
| 0–3 | Low | Standard audit cadence |
| 4–6 | Moderate | Review when any invoked skill, agent, or CLI command changes |
| 7+ | High | Prioritize in every audit; consider splitting into subcommands or extracting logic into skills |
Include a drift risk summary table:
## Drift Risk Scores
| Command | Score | Tier | Top Factors |
|---------|-------|------|-------------|
| sdd-run (config namespace) | 3 | Low | 4 CLI refs (+4) |
| sdd-run (change namespace) | 12 | High | 8 INVOKEs (+8), 3 vague refs (+6), 12-step flow (+1) |
Use when creating or reviewing a plugin command:
name and descriptionname is kebab-case, prefixed with sdd-, and matches the filename (without .md)description is 1-2 sentences: what the command does from the user's perspective# /sdd-run config)## Usage section with syntax code blocksdd-run init)plugin/core/skills/ or plugin/fullstack-typescript/skills/ (recursive scan by name frontmatter)plugin/fullstack-typescript/agents/ (match filename without .md)✓/✗/⚠, ═══ boxes, aligned tables)sdd-system by name, not by file pathRun this audit against all plugin commands to produce a fresh violations report. Find every .md file in plugin/core/commands/, then check each command against the categories below.
For each command file, check every item in the Checklist section above. Additionally:
SKILL.md somewhere under plugin/core/skills/ or plugin/fullstack-typescript/skills/ (glob recursively, match on the name frontmatter field). For agent references, verify a matching .md file exists in plugin/fullstack-typescript/agents/.Produce the report with these sections:
# Commands Standards Audit — YYYY-MM-DD_HH-MM
## Summary
| Category | Passing | Failing | Total |
|----------|---------|---------|-------|
| Frontmatter | X | Y | Z |
| Self-containment | ... | ... | ... |
| User interaction | ... | ... | ... |
| INVOKE directives | ... | ... | ... |
| CLI integration | ... | ... | ... |
| Output formatting | ... | ... | ... |
| State persistence | ... | ... | ... |
## Drift Risk Scores
| Command | Score | Tier | Top Factors |
|---------|-------|------|-------------|
## Staleness Report
<!-- Per-command skill/agent/CLI reference validation -->
## Output Consistency Report
<!-- Cross-command formatting comparison -->
## Per-Command Violations
<!-- One subsection per failing command, with quoted violations -->
## Recommended Fix Priority
<!-- Ordered by impact and effort -->
Never write audit reports inside plugin/core/commands/. The plugin folder is for shipped command files only — no reports, scratch files, or artifacts.
After presenting the report, ask the user whether to create a task to track the fixes or whether the report is temporary (e.g., for quick review or one-off investigation). If the user wants a task:
Create a task via /tasks add "Fix commands standards violations from audit report". The task's purpose is to fix the violations — the audit report is supporting evidence, not the deliverable. Save the report with a timestamped filename inside the task folder:
.tasks/0-inbox/<N>/
├── task.md # Task to fix violations, with key findings summary
└── commands-audit-YYYY-MM-DD_HH-MM.md # Full audit report (e.g., commands-audit-2026-02-07_14-30.md)
If the user declines, present the report inline without creating any files or tasks.
Ask: "Audit all plugin commands against the commands-standards skill and produce a violations report."
Run the audit directly (do not delegate to subagents):
plugin/core/commands/*.md filesplugin/core/skills/**/SKILL.md and plugin/fullstack-typescript/skills/**/SKILL.md (recursive) and match each referenced skill name against the name frontmatter field of found skillsplugin/fullstack-typescript/agents/*.md and match agent names against filenames/tasks add "Fix commands standards violations from audit report") or keep the report temporaryThis skill defines no input parameters or structured output.