Build developer CLIs and API collections. Use when adding commands, completions, or generating a Postman collection from routes. It does not design the SDK API (that's `sdk-craft`).
68
83%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Build the tools your developers reach for daily: CLIs they tab-complete without thinking, API collections they import on day one.
Two domains:
| Domain | What you build | When to use |
|---|---|---|
| CLI tools | Command-line interfaces with subcommands, flags, completions, interactive prompts | "Build a CLI", "add a command", "shell completions", "progress bar" |
| API collections | Postman/OpenAPI artifacts generated from your codebase | "Generate Postman collection", "export API endpoints", "create collection from routes" |
State which domain you need, or describe what you're building.
For expanded implementation patterns per language (Node.js/commander, Python/click+typer, Go/cobra), load
references/cli-patterns.md.
Design the tree before writing code:
mytool # Root
├── init [options] # Setup
├── config
│ ├── get <key> # Nested subcommands
│ ├── set <key> <value>
│ └── list
├── deploy [environment] # Positional + flags
│ ├── --dry-run
│ ├── --force
│ └── --config <file>
└── plugins
├── install <name>
├── list
└── remove <name>Rules:
-v, --verbose)#!/usr/bin/env node
const { program } = require('commander');
program.name('mytool').description('Developer platform CLI').version('1.0.0');
program
.command('deploy <environment>')
.description('Deploy to target environment')
.option('-f, --force', 'skip confirmation')
.option('-d, --dry-run', 'preview changes')
.action((env, opts) => {
if (!opts.force && env === 'production') {
// prompt for confirmation in interactive mode
}
console.log(`Deploying to ${env}...`);
});
program.parse();For Python (click/typer) and Go (cobra) examples, load
references/cli-patterns.md.
Every CLI error follows: context → problem → solution. Never show raw stack traces or codes like ENOENT.
Use commander (Node.js), click/typer (Python), or cobra (Go). For details and alternatives, load references/cli-patterns.md.
Must do:
--help and --versionMust not:
os.homedir() / Path.home() / os.UserHomeDir()For the full Postman collection v2.1 schema and framework-specific scanner implementations, load
references/api-collection-generators.md.
| Framework | Route pattern | Detection |
|---|---|---|
| Express | app.get(), router.post() | Method chaining on app/router |
| Next.js | app/api/**/route.ts | File-based routing, exported methods |
| Fastify | fastify.get(), route schema | Method + schema decorators |
| Hono | app.get(), app.post() | Similar to Express |
| NestJS | @Get(), @Post() decorators | Decorator-based |
| Koa | router.get(), router.post() | Koa-router patterns |
{
"info": {
"name": "My API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Users",
"item": [
{
"name": "GET users",
"request": {
"method": "GET",
"url": { "raw": "{{baseUrl}}/users", "host": ["{{baseUrl}}"], "path": ["users"] }
}
}
]
}
],
"variable": [
{ "key": "baseUrl", "value": "http://localhost:3000/api" },
{ "key": "authToken", "value": "" }
]
}{{baseUrl}}, {{authToken}}) for environment flexibilityCLI: after implementation: Run mytool --help and verify all commands render. Run mytool --version. Test in non-interactive mode: CI=true mytool deploy staging --force.
CLI: before release: Generate completions and test in bash/zsh: source <(mytool completion bash) && mytool <TAB>. Run on macOS, Linux, and Windows (or CI matrix).
API collection: after generation: Validate the JSON: npx ajv validate -s postman-collection-v2.1-schema.json -d collection.json. Import into Postman and confirm all endpoints render.
--help renders correctly for all commandssdk-craftmcp-server-craftAt the end of every session, ask: "Did this solve what you were trying to do?"
df60de1
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.