Create cli

From gupsammy/Claudest · View interactive version

Create cli is an AI agent skill from the GitHub repository gupsammy/Claudest. This skill should be used when the user asks to "design a CLI", "help me design command-line flags", "what flags should my tool have", "create a CLI spec", "refactor my CLI interface", "design a CLI my agent can call", or wants to design command-line UX (args/flags/subcommands/help/output/errors/con

How to use this skill

Skill file

Create CLI

Design CLI surface area (syntax + behavior), agent-aware, human-friendly.

Phase 1 — Prepare

Read ${CLAUDE_PLUGIN_ROOT}/skills/create-cli/references/cli-guidelines.md. Apply it as the default CLI rubric, including the Agent Ergonomics section.

For new CLI designs, also read ${CLAUDE_PLUGIN_ROOT}/skills/create-cli/references/language-selection.md to inform the language recommendation in Phase 2. Skip it for audits — the language is already chosen.

Proceed when cli-guidelines.md is loaded.

Phase 2 — Clarify

Determine whether this is a new design or an audit from the user's trigger.

New design

Ask, then proceed with best-guess defaults if user is unsure:

or HAR capture (undocumented/browser-fed)? (cli-guidelines.md → Wrapping an existing API.)

recommend one. Ask whether a single binary (no runtime needed on target machine) is required,

or whether a runtime dependency is acceptable. Apply language-selection.md to recommend if

the user is unsure. Platform: macOS/Linux/Windows.

If an existing CLI spec or tool description is provided, read it first — skip questions already answered by it.

Data Layer gate — required when the tool reads from a backend. Run the Data Layer Decision

scorecard (cli-guidelines.md → Stateful CLIs); record adopt cache or stateless + a one-line

rationale. Decide this before drawing the command tree — it changes whether sync/local-read

subcommands exist at all.

Audit

Ask:

Then explore the codebase: use Glob/Grep to find command definitions, flag registrations, output formatting, and error handling. Run <cli> --help via Bash to capture actual behavior.

Proceed when answers are confirmed or user is unsure — use best-guess defaults.

Phase 3 — Conventions

Apply the conventions from cli-guidelines.md (loaded in Phase 1), including the Agent Ergonomics section. The rules below are the key conventions to enforce — cli-guidelines.md provides the full rubric for edge cases.

If primary consumer is human-only, the Errors and Reduce Tool Calls subsections are optional — apply them only if the user wants script-friendliness.

Output

Errors (agent/mixed consumers only)

Flags

Reduce Tool Calls (agent/mixed consumers only)

Apply all applicable conventions, then proceed to Phase 4.

Phase 4 — Deliver

Audits

Evaluate the existing CLI against every Phase 3 subsection. For each convention, state: what the CLI does today, whether it conforms, and what to change. Also check:

Produce a gap report organized by severity: Breaking (requires API change), Major (agent-breaking or convention violation), Minor (cosmetic/polish). Each finding: current behavior, convention violated, recommended fix with migration risk (none/low/breaking).

New designs

Produce a compact spec the user can implement. Include all relevant sections:

Use this skeleton, dropping irrelevant sections:

  1. Language & distribution: Go · cobra · single binary · goreleaser for CI

(Omit if language was not determined.)

  1. Name: mycmd
  2. One-liner: ...
  3. USAGE:
  1. Subcommands:
  1. Global flags:
  1. I/O contract:
  1. Exit codes:
  1. Env/config:
  1. Data Layer Decision (required when the tool reads from a backend; omit if no backend):

adopt cache | stateless + one-line rationale. If adopt: sync command, local schema

sketch, local-vs-live reads, write invalidation note.

  1. API Provenance (only when wrapping an existing API; omit for from-scratch tools):

source (OpenAPI/URL/HAR); subcommand ← method+path mapping; for HAR, the five checks.

  1. Examples:

See ${CLAUDE_PLUGIN_ROOT}/skills/create-cli/examples/example-cli-spec.md for a complete worked example.

If the spec is destined for a skill body or CLAUDE.md, omit unused sections entirely (do not mark them "N/A") and limit examples to ≤5 invocations that each demonstrate multiple patterns.

Phase 5 — Verify

For new specs: confirm the spec covers all applicable sections from the Phase 4 skeleton. Verify the examples section demonstrates at least: --json output, error recovery (if agent/mixed consumer), and one piped/stdin usage.

For backend/API-wrapping specs: confirm a Data Layer Decision verdict is recorded with a rationale (not left implicit), and — when the source is a HAR/undocumented API — that no secret values appear anywhere in the spec (only env-var names) and the coverage/fragility caveats are stated.

For audits: confirm the gap report addresses every Phase 3 subsection and includes at least one example invocation showing the recommended fix for each Major finding.

Skill is complete when verification passes.

Notes

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.