adding-a-command
Creates a new CLI command following the Commander.js pattern in src/commands/. Handles command registration in src/cli.ts, telemetry tracking via tracked() wrapper, and option parsing. Use when user says add command, new CLI command, create subcommand, or adds files to src/commands/. Do NOT use for modifying existing commands or fixing bugs in existing commands.
npx skills add caliber-ai-org/ai-setup --skill adding-a-command --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Adding a Command ## Critical - **Export pattern**: Command must export a named async function: `export async function myCommand(options?: OptionType)`. Never use default exports. - **Registration in cli.ts**: Every command must be imported and registered with `.command()` chain in `src/cli.ts`, wrapped with `tracked()` for telemetry. - **Error signaling**: Use `throw new Error('__exit__')` to exit gracefully without printing the error message. Use chalk for user-facing messages. - **Options typing**: Commands receiving options must define a TypeScript interface for those options. Pass options as a destructured object parameter. ## Instructions 1. **Create the command file** at `src/commands/{commandName}.ts` with named async export. - Signature: `export async function {commandName}Command(options?: { optionName?: optionType }) { ... }` - Import only what you need (avoid kitchen-sink imports). - Return void (handle all output via console.log or chalk). - Verify the file follows the naming convention: camelCase function + "Command" suffix. 2. **Handle errors consistently**: Wrap error-prone operations in try/catch. Distinguish between user errors and system errors: - User error (ba
- Critical
- Instructions
- Examples
- Example 1: Simple command (status)
- Example 2: Subcommand with arguments
- Example 3: Command with option parsing
- Common Issues
What does the adding-a-command skill do?
Creates a new CLI command following the Commander.js pattern in src/commands/. Handles command registration in src/cli.ts, telemetry tracking via tracked() wrapper, and option parsing. Use when user says add command, new CLI command, create subcommand, or adds files to src/commands/. Do NOT use for modifying existing commands or fixing bugs in existing commands.
How do I install it?
Run `npx skills add caliber-ai-org/ai-setup --skill adding-a-command --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From caliber-ai-org/ai-setup, a repository with 1,235 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
