skill-cli-authoring
Skill0 starsChanged 6 months agoMITView on GitHub
Use when creating, refactoring, or promoting a CLI that lives inside an agent skill, especially a skill-local cli/ tool with agent-friendly JSON output, safe write commands, dry-run behavior, exit codes, Taskfile smoke tests, or a companion SKILL.md routing contract. Triggers on 'build a CLI inside a skill', 'skill-local CLI', 'agent-friendly CLI', 'add cli/ to a skill', 'promote skill script to CLI', 'JSON output contract for a skill tool', or 'CLI for agents to use from a skill'.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- attack-architectureSkill
- convention-engineeringSkill
- go-scriptingSkill
- harness-routerSkill
- paper-vettingSkill
- skill-builderSkill
- slock-epic-protocolSkill
- taskfile-authoringSkill
- work-cliSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 7 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
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 20
Use this skill when:
- Distinctive: line 30
Do not use for:
- Distinctive: line 46
Reads and writes stay distinct: Read commands should be safe, parseable, and composable.
- Very specific: line 68
Define the command contract: Write concrete examples first.
- Very specific: line 76
Wire verification: Add smoke tests, fixtures, schema checks, and Taskfile wrappers using references/verification.md and taskfile-authoring.
- Very specific: line 78
Update the parent skill: Keep SKILL.md as the router: command examples, when to run the CLI, and what output proves success.
- Distinctive: line 83
Prefer subcommands with explicit nouns and verbs:
- Distinctive: line 122
When shaping a skill-local CLI, return:
- Distinctive: line 134
Do not hide complex workflow policy inside a CLI just because it is easier than writing a clear skill.
- Distinctive: line 136
Do not make the CLI depend on a hosted service unless that is the domain it wraps and offline failure is explicit.
- Very specific: line 138
Do not duplicate implementation boilerplate from go-scripting.
- Very specific: line 139
Do not duplicate Taskfile recipes from taskfile-authoring.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Skill CLI Authoring
Canonical source:
skill-cli-authoring/SKILL.mdin theagent-repo-kitrepository. Allreferences/...links below resolve from that path. If you are reading this in an adapter mirror (adapters/claude-code/,adapters/codex/,adapters/cursor/), open the canonical file to reach the references.
Design and build small CLIs that live inside skills. The goal is not a clever terminal product; it is a deterministic tool surface an agent can discover, run, parse, retry, and verify.
When To Use
Use this skill when:
- A skill repeatedly asks agents to perform deterministic shell steps.
- A skill needs a local
cli/tool instead of fragile prose or ad hoc scripts. - A skill-local script has grown into multiple commands, flags, or data shapes.
- A command contract needs
--json,--ndjson, exit codes, or output schemas. - A mutating skill operation needs
--dry-run,--yes, idempotency, or audit output. - A skill's
SKILL.mdneeds to route agents to a companion CLI.
Do not use for:
- General Go CLI implementation details — use
go-scripting. - Taskfile mechanics, build caching, or
task cidesign — usetaskfile-authoring. - Deciding whether knowledge belongs in a skill at all — use
skill-builderorharness-router. - One-off shell glue under ~30 lines with no stable contract — keep it as a script.
Core Principles
- CLI only after repetition. Build a CLI when the same deterministic operation is being re-derived, mis-run, or copied across sessions.
- Contracts beat prose. Stable flags, JSON fields, exit codes, and smoke checks are easier for agents to honor than long instructions.
- Reads and writes stay distinct. Read commands should be safe, parseable, and composable. Write commands should be explicit, auditable, and guarded.
- Human text is secondary. Plain output can be friendly, but machine output is the durable contract.
- Skill prose routes, CLI executes.
SKILL.mdshould say when and why to use the CLI. The CLI should own deterministic behavior.
Quality Notes
- Evidence basis: composed from
skill-builder,go-scripting,taskfile-authoring, current agent-tooling docs, and repeated local need for skill-owned CLIs. - Risk tier: high. This skill designs tools that may run shell commands or mutate files, so command contracts, safety classes, and verification are required before implementation.
- Procedural burden: medium. Keep judgment in references and deterministic behavior in the CLI once the pattern stabilizes.
Workflow
- Classify the extraction. Choose
script,skill-local CLI, orrepo-owned CLIusingreferences/layout-and-routing.md. - Define the command contract. Write concrete examples first; then specify
flags, JSON/NDJSON shape, exit codes, and no-op behavior. Use
references/command-contract.md. - Design safety for writes. Mark each command read-only, additive,
idempotent, destructive, or open-world. Add
--dry-run,--yes, or explicit target flags where needed. Usereferences/safety-and-mutations.md. - Choose implementation stack. For Go CLIs, hand off implementation style
to
go-scripting. Keep this skill focused on the agent-facing contract. - Wire verification. Add smoke tests, fixtures, schema checks, and Taskfile
wrappers using
references/verification.mdandtaskfile-authoring. - Update the parent skill. Keep
SKILL.mdas the router: command examples, when to run the CLI, and what output proves success.
Default Command Shape
Prefer subcommands with explicit nouns and verbs:
skill-tool search --query "..." --json
skill-tool show ITEM-ID --json
skill-tool plan --source input.json --json
skill-tool apply PLAN-ID --dry-run --json
skill-tool apply PLAN-ID --yes --jsonFor machine output:
{
"schema_version": "v1",
"ok": true,
"command": "apply",
"changed": false,
"result": {}
}References
| File | Use For |
references/core-principles.md | Product stance and AI-era CLI principles |
references/layout-and-routing.md | Script vs skill-local CLI vs repo-owned CLI decisions |
references/command-contract.md | Command grammar, JSON/NDJSON, errors, exit codes |
references/safety-and-mutations.md | Dry-run, destructive gates, idempotency, audit output |
references/verification.md | Smoke tests, schemas, fixtures, Taskfile wiring |
references/research.md | External references and comparable project patterns |
references/evals.md | Trigger and output eval cases for maintaining the skill |
references/templates/CLI_CONTRACT.md | Starter contract for a skill-local cli/CONTRACT.md |
references/templates/README.skill-cli.md | Starter cli/README.md for agent-facing commands |
references/templates/Taskfile.skill-cli-smoke.yml | Thin smoke-test Taskfile fragment |
Output Shape
When shaping a skill-local CLI, return:
- command examples
- contract decisions
- safety model
- layout and ownership
- verification plan
- parent
SKILL.mdrouting text - open gaps or promotion triggers
Boundaries
- Do not hide complex workflow policy inside a CLI just because it is easier than writing a clear skill.
- Do not make the CLI depend on a hosted service unless that is the domain it wraps and offline failure is explicit.
- Do not duplicate implementation boilerplate from
go-scripting; reference it. - Do not duplicate Taskfile recipes from
taskfile-authoring; reference it.
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.

