audit-agentic-cli
Use if auditing or designing a CLI for agent/LLM use — JSON output, exit codes, non-interactive.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use if auditing or designing a CLI for agent/LLM use — JSON output, exit codes, non-interactive.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Use skill if you are exhaustively testing or release-gating martool CLI commands in a source checkout or deployed Coolify container over SSH, without local Docker or provider spend.
Use if driving agent-browser for Chrome/CDP automation, @ref snapshots, tabs, or verification.
Use if testing or debugging an iOS app via agent-device CLI — simulator flows, evidence, bug triage.
Use if supervising Jean agents through MCP and Computer Use for monitoring, recovery, or closure.
Use if auditing or designing an MCP server for agent-readiness — framework, security, context.
Use if verifying claimed-done work or auditing session/plan/branch completion with evidence.
| name | audit-agentic-cli |
| description | Use if auditing or designing a CLI for agent/LLM use — JSON output, exit codes, non-interactive. |
Make a CLI an agent can drive without human babysitting. The contract: pure machine-readable stdout, semantic exit codes, non-interactive defaults, structured errors with retry guidance, and — for workflows that produce repairable artifacts — an iterative feedback loop the agent can finish on its own.
Trigger this skill when the user is doing CLI-only agent-readiness work:
Do not use this skill for:
audit-agentic-mcp for audit/architecture, build-mcp-server-sdk-v1 / build-mcp-server-sdk-v2 / build-mcp-use-server for implementation, test-by-mcpc-cli for live MCP verification.run-railway instead.Before recommending features, verify these. If any fail, fix them first.
--json (or equivalent) exists and stdout is pure machine output — no progress, no banners, no prose.0 or 1.--no-input/--yes path or a clear non-interactive error.When a command must emit a non-JSON artifact (patch, diff, query, prompt, translation), keep stdout one canonical artifact format and put status on stderr or in a sidecar — never mix prose into the data channel.
Classify findings in agent terms, not human-UX terms.
| Severity | Use when |
|---|---|
| Critical | Agents cannot safely parse, continue, or avoid unintended side effects (e.g. JSON mixed with progress on stdout; destructive command with no --dry-run/--yes). |
| High | Agents act but are likely to fail, retry incorrectly, or block (e.g. prompt with no --no-input; opaque exit 1 for every error class). |
| Medium | Agents finish only with extra probing or brittle assumptions (e.g. undocumented output fields, missing help examples). |
| Low | Polish or consistency only (e.g. nonstandard alias when long flag is documented). |
Aim for one stable JSON envelope across all commands.
Success:
{ "ok": true, "result": {}, "error": null, "schema_version": "v1" }
Failure:
{
"ok": false,
"result": null,
"error": {
"class": "validation",
"code": "MISSING_FLAG",
"message": "Flag --target is required.",
"retryable": false,
"suggestion": "Run `mycli deploy --target <name>`."
},
"schema_version": "v1"
}
Stdout = data channel. Stderr = operator channel. Exit code = semantic class. All three must agree.
When fixing an existing CLI, do the work in this order. Skipping ahead wastes effort.
--no-input, --yes, --dry-run).Before recommending changes:
scripts/audit-cli-help.sh (read scripts/audit-cli-help.md first) to capture standard flags, examples, and missing affordances.--json, --output json, --quiet, --fields, --jq.--dry-run, --yes, --force, explicit confirmation semantics.scripts/diff-cli-help.sh (read scripts/diff-cli-help.md first) to spot command/flag drift.Use this pattern when an agent generates an artifact, the CLI validates it, and the agent must repair on rejection.
input artifact -> CLI validation -> structured diff/errors -> agent repair -> retry -> accepted -> finalize
Typical fits: translation/localization batches, code generation with validation gates, manifest/config/migration generation, bulk import or sync.
Each iteration must tell the agent:
next_action.command)One-shot read/list/get/status commands do not need this — use the simpler envelope.
For the full design pattern and a worked case study, read references/iterative-cli.md.
--yes, --force, --dry-run.--help documents examples, output fields, and exit codes.Pick one based on the task.
Audit report: scorecard by audit dimension, severity-ranked findings, command evidence (exact safe command + observed stdout/stderr/exit), why it matters for agents, recommended fix, verification command.
Refactored CLI contract: proposed command grammar, flags and non-interactive behavior, stdout/stderr rules, JSON envelope and stream format, exit-code map, migration notes for existing users and scripts.
Iterative repair-loop design: phases and command family, artifact channel, validation response shape, retry budget, next_action.command, finalization criteria.
linear-cli — strong agent-ready CLI: JSON everywhere, --dry-run, --id-only, non-pager flags, exit-code contract, bulk-mutation gates.run-railway — drift-aware CLI: installed-help snapshot, upstream-vs-local distinction, refresh scripts, version-drift routing.Read the smallest reference set that matches the task.
| Problem | Read |
|---|---|
| JSON envelopes, schemas, error fields, stream separation, exit-code taxonomy | references/output-contracts.md |
| Retries, idempotency, async jobs, batch, timeout, pagination, rate limits | references/execution-patterns.md |
| Help, auth, config, flags, environment detection | references/discovery-and-auth.md |
| Iterative repair-loop CLI design and case study | references/iterative-cli.md |
| CLI vs MCP vs hybrid (when surface is still in question) | references/mcp-vs-cli-decision.md |
| Worked code examples (Go, Python, Node, Rust, Shell) and real-world audits | references/examples.md |
| Patterns for the agent or service that calls the CLI | references/agent-integration.md |
These are canonical homes — do not duplicate their content here.
Read-only discovery support. Do not treat them as agent-readiness proofs.
| Script | Read first | Use for |
|---|---|---|
scripts/audit-cli-help.sh | scripts/audit-cli-help.md | Inspect top-level and subcommand help for standard flags, examples, exit-code docs, and missing affordances. |
scripts/diff-cli-help.sh | scripts/diff-cli-help.md | Compare captured help snapshots for command/flag additions, removals, and likely breaking changes. |
These cover discoverability and drift only. They do not replace stdout/stderr, exit-code, non-interactive, and destructive-flow checks — run those by hand.
Do not call a CLI agent-ready until:
--help documents the command contract (examples, output fields, exit codes).