New command

From flowexec/flow · View interactive version

New command is an AI agent skill from the GitHub repository flowexec/flow. Scaffold a new Cobra CLI command following the project's patterns.

How to use this skill

Skill file

Scaffold a new Cobra CLI command for: $ARGUMENTS

Before writing any code, read a similar existing command to match the exact style:

subcommands in a single file rather than a directory

Then follow these patterns:

  1. File location: cmd/internal/<noun>.go. Only root.go lives directly in cmd/; every

command handler is under cmd/internal/. Shared helpers go in cmd/internal/helpers.go,

flags in cmd/internal/flags/, output shaping in cmd/internal/response/.

  1. Command registration: register on the parent command, or add to rootCmd in cmd/root.go
  2. Error handling:
  1. Context: resolve workspace context via pkg/context before delegating to internal/services
  2. Output: respect --output flag (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.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.