cli-for-agent
Skill12 starsChanged 4 months agoMITView on GitHub
Design or review CLIs so coding agents can run them reliably: non-interactive flags first, layered --help with real copy-pasteable examples, stdin/pipeline support, fail-fast errors that include a correct invocation, idempotency, --dry-run/--yes for destructive actions, and machine-useful success output. Use when building a CLI, adding commands or subcommands, writing --help text, or when asked for an "agent-friendly CLI". Not for GUIs, TUIs, or library APIs (no CLI surface to design).
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 3 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 36
Every input should be expressible as a flag or flag value.
- Distinctive: line 38
If flags are missing, then fall back to interactive mode — not the other way around.
- Very specific: line 53
Every subcommand has --help.
- Very specific: line 54
Every --help includes Examples with real invocations.
- Distinctive: line 73
Avoid odd positional ordering and avoid falling back to interactive prompts for missing values.
- Very specific: line 96
Add --dry-run (or equivalent) so agents can preview plans before committing.
- Very specific: line 103
Use a consistent pattern everywhere, e.g.
- Very specific: line 121
Check: non-interactive path, layered help, examples on --help, stdin/pipeline story, error messages with invocations, idempotency, dry-run, …
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/cli-for-agent
Human-oriented CLIs block agents: interactive prompts, huge upfront docs, and help text without copy-pasteable examples. Prefer patterns that work headlessly and compose in pipelines.
Non-interactive first
- Every input should be expressible as a flag or flag value. Do not require arrow keys, menus, or timed prompts.
- If flags are missing, then fall back to interactive mode — not the other way around.
Bad: mycli deploy → ? Which environment? (use arrow keys)
Good: mycli deploy --env staging
Discoverability without dumping context
- Agents discover subcommands incrementally:
mycli, thenmycli deploy --help. Do not print the entire manual on every run. - Let each subcommand own its documentation so unused commands stay out of context.
--help that works
- Every subcommand has
--help. - Every
--helpincludes Examples with real invocations. Examples do more than prose for pattern-matching.
Options:
--env Target environment (staging, production)
--tag Image tag (default: latest)
--force Skip confirmation
Examples:
mycli deploy --env staging
mycli deploy --env production --tag v1.2.3
mycli deploy --env staging --forcestdin, flags, and pipelines
- Accept stdin where it makes sense (e.g.
cat config.json | mycli config import --stdin). - Avoid odd positional ordering and avoid falling back to interactive prompts for missing values.
- Support chaining:
mycli deploy --env staging --tag $(mycli build --output tag-only).
Fail fast with actionable errors
- On missing required flags: exit immediately with a clear message and a correct example invocation, not a hang.
Error: No image tag specified.
mycli deploy --env staging --tag <image-tag>
Available tags: mycli build list --output tagsIdempotency
- Agents retry often. The same successful command run twice should be safe (no-op or explicit "already done"), not duplicate side effects.
Destructive actions
- Add
--dry-run(or equivalent) so agents can preview plans before committing. - Offer
--yes/--forceto skip confirmations while keeping the safe default for humans.
Predictable structure
- Use a consistent pattern everywhere, e.g.
resource+verb: ifmycli service listexists,mycli deploy listandmycli config listshould follow the same shape.
Success output
- On success, return machine-useful data: IDs, URLs, durations. Plain text is fine; avoid relying on decorative output alone.
deployed v1.2.3 to staging
url: https://staging.myapp.com
deploy_id: dep_abc123
duration: 34sWhen reviewing an existing CLI
- Check: non-interactive path, layered help, examples on
--help, stdin/pipeline story, error messages with invocations, idempotency, dry-run, confirmation bypass flags, consistent command structure, structured success output.
Adapted from cursor/plugins
cli-for-agent/skills/cli-for-agents/SKILL.md (MIT, © Cursor). Vendored per
the superskills imported-skills rule; changes here do not track upstream.
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- AgentlyHQ/use-agently★ 72same name
- AgentlyHQ/skills★ 2same 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 repository42 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- a11ySkill
- articleSkill
- basic-reviewSkill
- cache-strategySkill
- clean-codeSkill
- content-writerSkill
- daily-qaSkill
- dbmap-auto-offSkill
- dbmapSkill
- db-optimizeSkill
- debugSkill
- defenseSkill
- diff-walkthroughSkill
- evalSkill
- executing-plansSkill
- finish-branchSkill
- fuzzSkill
- handoffSkill
- humanizeSkill
- iac-scanSkill
- kb-advisorSkill
- minimalist-reviewSkill
- pentestSkill
- perf-profileSkill
- playwrightSkill
- pricingSkill
- qa-fullSkill
- quota-resilienceSkill
- subagent-driven-developmentSkill
- superskills-doctorSkill
- superskills-upgradeSkill
- tapestrySkill
- tddSkill
- test-coverageSkill
- validate-ideaSkill
- verifySkill
- web-perfSkill
- worktreesSkill
- write-planSkill
- youtubeSkill
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.

