cli-agent-spec/cli-agent-spec

cli-agent-implement

Guide implementing the CLI Agent Spec specification in a CLI framework or tool.

Ver código-fonte
Documento original do Skill

Renderizado do repositório de origem, preservando títulos, exemplos, código, tabelas, links e imagens.

CLI Agent Implement

Runtime requirements

  • Requires a CLI framework project to implement into
  • Requires language-specific codegen tools when schema type generation is requested

Guide an agent through implementing the CLI Agent Spec specification.

Setup

Read `references/IMPLEMENTING.md` fully before proceeding.


Step 0 — Audit naming conventions

Read `references/guides/unix-naming-conventions.md` fully.

Then inspect the target CLI's existing command tree (run tool --help and enumerate subcommands):

  1. Corpus alignment — which row in the "Training Corpus Alignment" table best describes this tool? Name it. This determines which patterns to prioritize.
  2. Verb audit — for each subcommand, check whether it uses a verb from the "Command Naming" table. Flag non-standard verbs (e.g. upsert instead of apply, nuke instead of delete) as recommendations.
  3. Flag audit — check whether the tool has --format json, --dry-run, --output, --verbose, --no-* variants. Flag any missing from the "Flags worth inheriting" table that are relevant to the tool's domain.
  4. Override audit — check whether the tool uses positional arguments, combined short flags, or locale-dependent output. Flag these as issues to address during REQ-F implementation.

Produce a short report:

  • Corpus: <name>
  • Naming gaps: list of non-standard verbs with suggested replacements
  • Missing flags: list of high-value flags not yet present
  • Override issues: list of Unix mechanics inherited that need replacing

This is advisory — naming gaps do not block requirement implementation. Present findings and proceed to Step 1.


Step 1 — Understand the target

Ask (if not already provided):

  • What language and framework is being implemented?
  • Is this a new framework or extending an existing one?
  • Which tier to start from? (Default: always REQ-F first)

Step 2 — Generate schema types

Before implementing requirements, generate language-specific types from the schemas.

Read `references/schemas/codegen-guide.md` and follow the workflow for the user's language. Schema files are in references/schemas/.

Post-generation invariant — code generators do not enforce this:

retryable: true implies side_effects: "none" in ExitCodeEntry

Add the validation snippet for the user's language from the "Validation after generation" section in the codegen guide.


Step 3 — Implement requirements tier by tier

Read `references/requirements/index.md` for the full list.

Implement in this order:

Tier 1 — REQ-F (Framework-Automatic)

These establish the exit code table, response envelope, and phase boundary that everything else depends on. Start here.

Suggested order:

  1. REQ-F-001ExitCode enum, 14-code table
  2. REQ-F-004 — JSON response envelope (ok, data, error, warnings, meta)
  3. REQ-C-001 — command registration with exit_codes map
  4. REQ-C-013 — wire ExitCode into error.code
  5. REQ-F-002 — validation/execution phase boundary for ARG_ERROR
  6. Remaining REQ-F requirements

Tier 2 — REQ-C (Command Contract)

After all REQ-F requirements pass. These are declared by the command author at registration.

Tier 3 — REQ-O (Opt-In)

Implement as the application needs them — these are explicitly enabled.


Step 4 — Work through each requirement

For each requirement file at references/requirements/<id>.md:

  1. Read the file — focus on Acceptance Criteria and Wire Format
  2. Implement until every acceptance criterion is satisfied
  3. Validate output matches the Wire Format JSON exactly
  4. Check the Related table for dependencies to implement first

Step 5 — Verify

When a tier is complete, re-read every requirement's Acceptance Criteria in that tier and confirm each bullet passes. Use Wire Format examples as test fixtures.


Rules

  • Always run Step 0 naming audit before writing any code — naming changes are cheapest before implementation starts
  • Always complete all REQ-F before starting REQ-C
  • Load requirement files on demand — do not read all at once
  • Use the generated schema types throughout — never use literal integer exit codes
  • If the user's language is not in the codegen guide, produce equivalent types manually from the schema field definitions in references/schemas/
do mesmo repositório

Mais Skills

Todos os Skills
cli-agent-spec
Comunidade

cli-agent-audit

Autonomous end-to-end CLI audit pipeline. Downloads and installs the CLI non-interactively, onboards it, scores proactive readiness, evaluates all Critical failure modes, and generates the full report bundle (dev, agent-dev, runtime, issues, index, LinkedIn post). Single command, zero human steps required in the happy path.

instalações
1
GitHub Stars
9
Atualizado
7 de ago.
cli-agent-spec
Comunidade

cli-agent-diagnose

Classify a failed agent CLI tool call against the CLI Agent Spec §N failure taxonomy. Given a failed command with stdout, stderr, and exit code, identifies the matching failure mode, returns an actionable workaround, and produces a memory string and skill patch to prevent recurrence. Use when a CLI invocation fails and you need to understand why and how to work around it.

instalações
1
GitHub Stars
9
Atualizado
7 de ago.
cli-agent-spec
Comunidade

cli-agent-evaluate

Evaluate a CLI tool against a single CLI Agent Spec failure mode. Runs the failure mode's check, scores 0–3, and provides an applicable agent workaround if the score is below 3. Use this for targeted single-failure-mode evaluation. For multi-failure-mode evaluation use cli-agent-evaluate-batch.

instalações
1
GitHub Stars
9
Atualizado
7 de ago.
cli-agent-spec
Comunidade

cli-agent-evaluate-batch

Evaluate a CLI tool against multiple CLI Agent Spec failure modes in one run. Accepts a severity filter, part number, or an explicit list of §N identifiers. Skips already-evaluated failure modes (resumable). Emits a scorecard table when done.

instalações
1
GitHub Stars
9
Atualizado
7 de ago.