agent-cli
Skill1 starsChanged 6 months agoMITView on GitHub
Design and audit CLIs that AI agents (Claude Code, Codex, automated pipelines) consume. Applies ten agent-native principles in two tiers — Tier 1 table stakes (non-interactive default, structured output, errors that enumerate, safe retries, bounded responses) and Tier 2 compounding (cross-CLI vocabulary, three-layer introspection, async-aware execution, persistent profiles, two-way I/O) — with a Blocker / Friction / Optimization severity rubric across six command classes (read, mutate, stream, bootstrap, async, config). Use when building, reviewing, or specifying a CLI for agent invocation, mentions argparse, click, cobra, clap, commander, yargs, oclif, thor, agent-friendly or agent-native CLI design, --json output, exit codes, idempotent commands, --wait flags, agent-context introspection, persistent profiles, --deliver routing, --force bypass, vocabulary consistency, or repos with cli.py, main.go, src/cli.rs, bin/<tool>. Skip general shell scripting and human-only TUIs.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- Stijnus/dsh-rev-engtheir own version, first seen Nov 8, 2026
- daveebbelaar/bawatheir own version, first seen Nov 8, 2026
- devin-thomas/skillstheir own version, first seen Nov 1, 2026
- daveebbelaar/bamatheir own version, first seen Nov 1, 2026
- glebis/claude-skillstheir own version, first seen Jul 1, 2026
- JAVICHILEON/claude---Skillstheir own version, first seen Jul 1, 2026
Used with
Projects with it also use app-brief, design-from-app and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
StijnusSkillapp-brief
One-page brief (docs/BRIEF.md) for a new macOS app, written before any code. Use when the user has an app idea, wants to replace an app they pay for, or the research and clone skills are done.
Also in 3 projects that use this
StijnusSkilldesign-from-app
Rebuild the look of an app the user likes as a native SwiftUI design kit, by measuring its screenshots (sizes, spacing, type, colors, icons), building its parts, and comparing pixel by pixel until they match. Use when the user names an app whose look they want, shares screenshots of one, or says "make it look like X".
Also in 3 projects that use this
launchapp-devSkilllayout-grid
Define responsive layout grid systems with columns, gutters, margins, and breakpoint behavior.
Also in 3 projects that use this
MohamedAbdallah-14Skillapp-icon
Generate an app icon from a single 1024² master and fan out to iOS (AppIcon.appiconset with squircle-ready 1024 opaque), Android (adaptive foreground + background + Android 13 monochrome), PWA (192/512 + 512 maskable with 80% safe zone), and visionOS (3-layer parallax).
Also in 3 projects that use this
timeplus-ioSkillbuild-and-verify
Build, compile, run server/client/cluster, execute unit/stateless/SQL tests, verify results, and troubleshoot build/test failures. Make sure to use this skill whenever the user mentions building, compiling, ninja, cmake, running tests, test failures, starting the server, or pre-commit checks, even if they just say 'it doesn't build' or 'the test broke'.
Also in 3 projects that use this
bborok1234Skilldesign-kit
새 프로젝트/화면의 디자인 시스템을 프로덕션급으로 빠르게 세우고(부트스트랩), 이미 만든 UI의 퀄이 안 잡힐 때 진단→교정하고, AI 슬롭 없이 폴리싱하는 개인 디자인 게이트. "디자인 시스템 잡아줘", "랜딩/UI 만들어", "슬롭 잡아줘", "이 화면 폴리싱", "퀄리티가 안 잡혀/디자인 고쳐줘/왜 싸구려 같지", 새 프론트엔드 시작 시 적용. 미학(팔레트·폰트·정체성)은 인터뷰로 함께 설계하고, 시스템 구성법·판단룰·안티슬롭·진단교정·빌드루프는 프로젝트 무관하게 재사용.
Also in 3 projects that use this
- +1 more from Stijnus
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- daveebbelaar/bama★ 1.7ksame name
- glebis/claude-skills★ 410same name
- daveebbelaar/bawa★ 17same name
- devin-thomas/skills★ 1same name
- Stijnus/dsh-rev-eng★ 1same name
- JAVICHILEON/claude---Skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository13 other files it gives its agents.
- askSkill
- blueprintSkill
- brainstormSkill
- carveSkill
- dispatchSkill
- handoffSkill
- improve-claude-mdSkill
- leanSkill
- llm-councilSkill
- orientSkill
- react-auditSkill
- shipSkill
- tddSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 7 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
Don't break the agent. When these aren't met, the deck is stacked against the agent on every call.
- Distinctive: line 54
Every finding maps to one of three levels.
- Distinctive: line 83
Use the decision tree in audit-checklist.md for ambiguous cases.
- Distinctive: line 91
Use the format in Output Format.
- Distinctive: line 141
Do not flag idempotency issues on streaming or read-only commands.
- Very specific: line 142
Do not flag --json absence on bootstrap/install/wizard commands a human would always run.
- Distinctive: line 143
Do not flag profile system absence on CLIs with ≤2 commands or no credential state — surface as Optimization at most.
- Very specific: line 144
Do not flag agent-context absence on CLIs with <5 commands.
- Very specific: line 145
When proposing a fix, prefer framework-idiomatic patterns over generic advice — pull from framework-recipes.md.
- Distinctive: line 146
When a fix needs a regression test, link to the matching snippet in test-recipes.md (pytest, vitest) so the user gets a CI-enforceable …
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agent CLI — Design & Audit Skill
Audit an existing CLI (or design a new one from scratch) against ten agent-native principles, classifying every finding by severity so the user can prioritize fixes. Principles are organized into two tiers: Tier 1 (table stakes — defensive, prevent breakage) and Tier 2 (compounding — empowering, make the CLI more useful as agents accumulate persistent identity, async workflows, and feedback channels).
Usage
/agent-cli -- ask which mode (audit existing or design new)
/agent-cli audit -- review CLI source/spec in current repo
/agent-cli design <name> -- guide design of a new CLI from zeroThe skill also auto-loads when the conversation surfaces CLI design topics (frameworks, --json outputs, exit codes, idempotency, --wait flags, agent-context introspection, persistent profiles, --deliver routing, vocabulary consistency, agent invocation patterns).
Core Principle
Agents pay real costs for every prompt that hangs, every line of unstructured output, every vague error, every retry that silently duplicates work, and every workflow that requires the agent to write its own polling loop. Designing for agents first removes the tax that the forgiving consumer (humans) was silently paying. A CLI optimized for agents is also better for humans — the reverse is not true.
The Ten Principles
Tier 1 — Table Stakes (defensive)
Don't break the agent. When these aren't met, the deck is stacked against the agent on every call.
| # | Principle | One-line test |
| 1 | Non-interactive by default | Run with stdin=DEVNULL; does it exit instead of hanging? |
| 2 | Structured, parseable output | Is --json (singular, canonical) available on every data-bearing command? |
| 3 | Errors that teach, and enumerate | Does the error name the fix and list the valid set inline? |
| 4 | Safe retries & explicit mutation boundaries | Does running the same mutating or async command twice corrupt state? |
| 5 | Bounded responses, at every layer | Does a routine query teach the agent how to narrow further, and does the MCP tool description fit a budget? |
Tier 2 — Compounding (empowering)
Tier 1 keeps you in the game. Tier 2 makes the CLI better the more it gets used.
| # | Principle | One-line test |
| 6 | Cross-CLI vocabulary consistency | Are verbs get/list/create/update/delete and flags --force/--json/--limit/--profile? |
| 7 | Three-layer introspection | Does <cli> --help, <cli> agent-context (versioned JSON), and a skill manifest all describe the same surface? |
| 8 | Async-aware execution | Does --wait block until completion, and does a jobs ledger survive disconnect? |
| 9 | Persistent identity through profiles | Can the agent save a --profile once and reuse it across sessions, with explicit-flag > env > profile precedence? |
| 10 | Two-way I/O | Does --deliver route artifacts to stdout/file/webhook, and does <cli> feedback close the loop back to maintainers? |
Full explanation, rationale, and worked examples in cli-principles.md.
Severity Rubric
Every finding maps to one of three levels. The level depends on what the command does — idempotency matters for mutating and async commands, irrelevant for streaming logs.
| Severity | Meaning | Example |
| Blocker | Prevents reliable agent use | Command hangs awaiting input; no --json on data command; silent state corruption on retry; async submit returns job_id with no --wait; verbs contradict universal conventions (info instead of get) |
| Friction | Works but wastes tokens / retries | Errors name the problem but not the fix; inconsistent --json coverage; ANSI codes in piped output; agent-context exists but unversioned; profiles saved but not surfaced in introspection |
| Optimization | Functional but improvable | Help lacks examples; --limit defaults too broad; framework-idiomatic patterns missing; codegen recommendation for >20-command CLIs |
Tier-aware default skew: Tier 1 violations skew Blocker by default — they're table stakes. Tier 2 violations skew Friction by default unless the CLI is large enough that absence becomes load-bearing (see severity scaling under each principle in audit-checklist.md).
Per-principle × per-command-class severity mapping lives in audit-checklist.md.
Workflow — Audit Mode
1. Locate the CLI surface
Find the entry point and command tree. Common patterns: cli.py (argparse/click), cmd/ (cobra), src/main.rs (clap), bin/<tool> (commander/yargs/oclif).
2. Classify commands
For each command, pick a class from six options:
- read — query, list, get, search, describe (no side effects)
- mutate — create, update, delete, deploy, publish, send (sync state change)
- stream — tail, follow, watch (long-running ongoing output)
- bootstrap — init, install, setup wizards (one-shot, often interactive by design)
- async — submit a job that completes off-band; returns job_id; wants
--wait(Principles 4 + 8) - config — profile, auth, preferences, local state (Principle 9)
Use the decision tree in audit-checklist.md for ambiguous cases. Severity weighting differs by class.
3. Run the checklist
Walk all 10 principles in audit-checklist.md, Tier 1 first then Tier 2. For each finding record: principle number, command path, observed behavior, expected behavior, severity, suggested fix.
4. Output the report
Use the format in Output Format. Sort findings by severity (Blocker first), then by principle. Reference framework-recipes.md when the fix is framework-specific.
Workflow — Design Mode
1. Establish constraints
Confirm: target framework, command scope (1 command vs. multi-resource tool), command classes likely to appear (read-only? async-heavy? config-driven?), primary agent consumers (Claude Code subagents? CI pipeline? interactive humans too?). Constraint set drives recipe choices.
2. Sketch the surface
Draft the command tree, flag set, output formats, and Tier 2 surfaces up front. For each command propose: invocation shape, --json schema, error catalog (with enumerated valid sets), dry-run behavior (mutating only), pagination defaults (read only), --wait and ledger entry (async only), profile resolution (config-aware only), --deliver schemes (artifact-emitting only). Sketch agent-context JSON shape at the top level.
3. Verify against all 10 principles
Walk every principle, both tiers, with the proposed surface. A design-mode pass fails the same way as an audit — write findings as if reviewing a finished tool.
4. Output the design doc
Same format as audit, plus a "Surface Sketch" section showing the proposed command tree and flag set in code blocks, plus a agent-context skeleton.
Output Format
# CLI Agent Readiness — <tool name> (<audit|design>)
## Summary
<1–3 sentence verdict — overall readiness, headline issues>
## Findings (sorted by severity)
### Blocker — <Principle #N>: <command path>
**Observed:** <what the CLI does today / what the design proposes>
**Expected:** <what an agent-native CLI would do>
**Fix:** <concrete change, framework-idiomatic if possible>
### Friction — <Principle #N>: <command path>
...
### Optimization — <Principle #N>: <command path>
...
## Recommendations
<3–5 bullet prioritized list — what to fix first, what to defer>
## Architectural backstop (only if applicable)
<surfaced when CLI has >20 commands, repeated vocabulary inconsistencies,
or agent-context drift; recommend codegen/schema-driven approach>Skill-Specific Rules
- Do not flag idempotency issues on streaming or read-only commands.
- Do not flag
--jsonabsence on bootstrap/install/wizard commands a human would always run. - Do not flag profile system absence on CLIs with ≤2 commands or no credential state — surface as Optimization at most. For 3-5 commands using credentials, Friction. For >5, Blocker for daily use.
- Do not flag
agent-contextabsence on CLIs with <5 commands; for 5-20 commands surface as Friction; for >20 commands surface as Blocker, AND additionally recommend schema/codegen approach (architectural backstop, see cli-principles.md). - When proposing a fix, prefer framework-idiomatic patterns over generic advice — pull from framework-recipes.md. Tier 2 recipes ship for Click/Cobra/Commander/oclif; for argparse/clap/yargs the pattern transfers verbatim, just lift the helper functions.
- When a fix needs a regression test, link to the matching snippet in test-recipes.md (pytest, vitest) so the user gets a CI-enforceable assertion alongside the fix.
- Severity is contextual: a missing
--jsonon the only data command is Blocker; on one of fifteen is Friction. Same logic applies to Tier 2 (severity scaling tables in audit-checklist). - Cite the principle number in every finding so the user can cross-reference cli-principles.md.
Acceptance Checklist
- Every command in the CLI surface was classified into one of six classes (read / mutate / stream / bootstrap / async / config)
- All 10 principles (Tier 1 + Tier 2) were evaluated against the relevant command classes
- Each finding has principle reference, severity, observed/expected, and concrete fix
- Findings are sorted by severity in the output
- Recommendations section prioritizes Blockers over Friction over Optimizations
- Framework-specific fixes reference framework-recipes.md where applicable
- CI-enforceable test snippets from test-recipes.md are linked for fixes that warrant regression coverage
- Architectural backstop (codegen / schema) surfaced as a recommendation when the CLI has >20 commands, repeated vocabulary inconsistencies, or
agent-context/--helpdrift
Attribution
The ten principles are adapted from Trevin Chow, "10 Principles for Agent-Native CLIs" (trevinsays.com, 2026-05-01). This supersedes the earlier "7 Principles for Agent-Friendly CLIs" (2026-03-26) per the author's own "replacement, not a sequel" framing — Tier 1 condenses the original seven into five with three substantive upgrades (single-canonical --json, errors that enumerate the valid set, MCP description budgets), and Tier 2 adds five new compounding principles. Full credit, original wording references, and architectural backstop note are preserved in cli-principles.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

