name: new-command description: Scaffold a new Cobra CLI command following the project's patterns. disable-model-invocation: true argument-hint: "<verb> [noun] — what the command does" allowed-tools: mcp__flow__execute, mcp__flow__run_command, mcp__flow__list_executables, Bash(flow build:), Bash(go build:), Read
Scaffold a new Cobra CLI command for: $ARGUMENTS
Before writing any code, read a similar existing command to match the exact style:
- Simple verb commands:
cmd/internal/exec.go - Noun/verb subcommands:
cmd/internal/workspace.goorcmd/internal/vault.go— each groups its subcommands in a single file rather than a directory
Then follow these patterns:
- File location:
cmd/internal/<noun>.go. Onlyroot.golives directly incmd/; every command handler is undercmd/internal/. Shared helpers go incmd/internal/helpers.go, flags incmd/internal/flags/, output shaping incmd/internal/response/. - Command registration: register on the parent command, or add to
rootCmdincmd/root.go - Error handling:
- Runtime errors →
errhandler.HandleFatal(ctx, cmd, err) - Flag/arg misuse →
errhandler.HandleUsage(ctx, cmd, "message", args...) - Never use
log.Fatal,os.Exit, orlogger.Log().FatalErr()incmd/
- Runtime errors →
- Context: resolve workspace context via
pkg/contextbefore delegating tointernal/services - Output: respect
--outputflag (text/json/yaml) for structured responses
After scaffolding, verify it builds — prefer mcp__flow__execute with ref build binary and
argument ./bin/flow over a raw shell call.
Skills similaires
Expert Next.js App Router
Developpement
Un skill qui transforme Claude en expert Next.js App Router.
Claude CodeCursoradvanced
890
234
3,226
Générateur de README
Developpement
Crée des README.md professionnels et complets pour vos projets.
claudeCursorWindsurfbeginner
259
72
1,129
Rédacteur de Documentation API
Developpement
Génère de la documentation API complète au format OpenAPI/Swagger.
claudeCursorWindsurfintermediate
156
44
999