app-add-commandlisted
Install: claude install-skill Facta-Dev/ai-coding-playbook
# <app> Add Command
A reusable scaffolding workflow for adding a new command to the `<app>` CLI. An agent (for example the planner or the architect role) invokes this skill to produce the command declaration, its contract, its wiring and its boundary checklist together - so a new command never lands without its registration, its output schema and its golden fixture. The output is a wiring sketch plus a boundary checklist, in plain text.
## When to Activate
- A new subcommand (`myapp <module> <resource> <verb>`) is requested.
- An existing command needs a new flag, a new output format or a new exit-code mapping.
- The hexagonal dependency direction must be verified after a wiring change: domain stays pure, application never reaches adapters, slices never import each other.
- A reviewer asks for the command plus contract bundle before approving a surface change.
Do not activate for an in-slice refactor that adds no new command and no new cross-boundary dependency - that is ordinary implementation work.
## Core Principles
- The command is a thin adapter over a use case. The argv handler parses flags and shapes output; the logic lives in `application/use-cases.ts`; a handler that carries business logic is a REVISE.
- The contract comes first. The exit-code mapping and the output schema land in `src/contracts/` before the handler that emits them, because print mode and the TUI render the same event stream.
- stdout is data, stderr is diagnostics. A command writes its result