@flowexec/new-command
AScaffold a new Cobra CLI command following the project's patterns.
Install
agr install @flowexec/new-command --target claudeWrites 1 file into .claude/skills/, pinned to git-f8d2e82c.
- .claude/skills/new-command/SKILL.md
Document
name: new-command description: Scaffold a new Cobra CLI command following the project's patterns. disable-model-invocation: true argument-hint: " [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.
Trustgrade A
- passBody integrity
Whether the stored document is plausibly the kind of file the artifact declares, rather than something fetched by mistake.
- passType matchnot applicable to this artifact type
Whether the artifact is really the kind of thing its metadata claims it is.
- passFreshness
How long since the source repository was last pushed to.
- passPrompt injection
Scans the artifact's own text for instructions aimed at your agent rather than at you.
- passLicense
Whether the source repository declares an SPDX license permissive enough to redistribute.
How the grade is calculated
Each check contributes 0 points when it passes, 1 when it warns, and 2 when it fails. The total maps to a letter:
- Aevery check passed
- Bone warning
- Ctwo warnings
- Dprompt injection or body integrity failed, or three warnings
- Fone of those failed, and something else is wrong
These are automated hygiene checks, not a security audit, and not a dependency or vulnerability scan. A grade of A means nothing was flagged — not that the artifact is safe.
Versions
git-f8d2e82ce7492026-07-31