capability-builder
Skill2 starsChanged 13 days agoMITView on GitHub
Turns a request the user keeps making into a capability that works on its own, everywhere: picks the right kind (skill, hook, mod, rule or plain script), interviews the user, scaffolds it with tests, checks it on macOS, Linux and Windows (Git Bash), and runs the checklist before it is shared in a kit. Use when the user says "make this a skill", "turn this into a hook", "build a capability", "automate this every time", "add it to the kit", "contribute to claude-code-kit", or when you notice the same kind of request coming back in the conversation or the memory.
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ci-reviewSkill
- daily-syncSkill
- handoffSkill
- insta360-montageSkill
- kbSkill
- pr-watchSkill
- remindersSkill
- reopen-sessionsSkill
- sprint-demoSkill
- tech-watchSkill
- test-evidenceSkill
- video-montageSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
Ask only what the examples don't already answer, in one message:
- Very specific: line 36
Follow the layout of the kit it may go to (claude-code-kit shown):
- Very specific: line 39
Setup: when it needs configuration, setup.sh in the part (hooks: hooks/setup/<name>.sh), sourcing hooks/lib/ask.sh: reply KEY PROMPT …
- Distinctive: line 48
Use it for real on the user's machine once, and show the result.
- Distinctive: line 61
Ask once, when it works: "Publish a generic copy to <kit>?".
- Distinctive: line 63
Run the tests and the install sandbox.
- Distinctive: line 64
Commit with the email the user uses for that host, and push only on their yes.
≈ “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
Capability builder
A capability is worth building when the same ask comes back: a third "take screenshots for the PR", the same check before every commit, the same setup explained to every newcomer. Build it in the user's own ~/.claude first, where it is used and tested for real, then offer to share a generic copy in a kit (the public claude-code-kit, a team kit, or one the user keeps).
1. Spot it and say it
Name the repeated ask in one line, with two real examples from this conversation or the memory, and propose the kind that fits (step 2) with the reason. Build nothing before the user's yes.
2. Pick the kind
| Kind | Fits when | Lives in |
| Rule | One sentence Claude must always follow, no code. | a line in ~/.claude/CLAUDE.md (and AGENTS.md for other agents) |
| Skill | A procedure Claude follows on demand, with judgement, maybe scripts. | skills/<name>/SKILL.md + scripts beside it |
| Hook | Must happen every time, deterministically, whatever Claude decides (block, check, record, notify). | hooks/<name>.sh + settings/<name>.json (the hooks config) |
| Mod | Changes Claude Code's own interface: a pane, a band, a slash command, a toast. | mods/<name>/ (load the plugin-authoring skill to build it) |
| Plain script | Useful outside Claude too (CI, other agents, a terminal). | a script in the repo, documented in README / AGENTS.md |
Prefer the lightest that works. A rule Claude forgets is a hook; a hook that needs judgement is a skill; a skill that only runs one command is a script. Tool-agnostic first: the logic in a plain script any agent or a person can run, the skill or hook a thin layer over it.
3. Interview
Ask only what the examples don't already answer, in one message:
- Trigger: the words the user says, or the event (before a commit, at session start, after a reply).
- Input and output: what it reads, what it writes or shows, where.
- What must never happen (the failure that would hurt most), and what to do on error.
- What is personal (names, emails, hosts, paths, tokens, brands, dates). Each becomes a setting or a question the setup asks, never a value in the files.
4. Scaffold
Follow the layout of the kit it may go to (claude-code-kit shown):
- Skill:
SKILL.mdwithnameand adescriptionthat says what it does AND the phrases that should trigger it. Scripts beside it, referred to as "this skill's base directory" ($SK), never by an absolute path. - Hook: reads the event JSON on stdin with jq; denies with
{"hookSpecificOutput": {"hookEventName": "PreToolUse", "permissionDecision": "deny", "permissionDecisionReason": "<what to do instead>"}}; prints nothing and exits 0 otherwise. Fast (it runs on every event), and silent on its own errors (2>/dev/null || truein the settings) so it never blocks the user. The settings fragment uses__HOME__for the home folder. - Setup: when it needs configuration,
setup.shin the part (hooks:hooks/setup/<name>.sh), sourcinghooks/lib/ask.sh:reply KEY PROMPT [DEFAULT]andask KEY PROMPT [y|n], each with a default, so the install test can run it unattended. Explain in two lines what the question is for before asking it. - Catalog: an entry in
parts.json:what,why,when,whoin one short sentence each, itsgroup, andneeds,tools,os,setup,syncwhen they apply. The installer shows those four lines to whoever installs it. - README: one row in the right table.
5. Test
- A test script in
tests/with real cases: the ones that must pass, the ones that must be refused, and an edge case or two (paths with spaces, no git remote, an empty config). Hooks: pipe JSON into the script and check its output. Mods:claude plugin test <mod>, on the latest Claude Code and on the oldest the kit supports (OLDEST_CLAUDEin the kit's tests workflow:npx -y @anthropic-ai/claude-code@<version> plugin test <mod>). - A mod with a pane follows the kit's Rules for mods (CONTRIBUTING.md): folded by default, always grouped (even a lone group), a click on a folded line's text unfolds it unless that part has its own action, long text wraps instead of being cut, and each row fits on one line. Anything a newer build brings gets a fallback for the older ones.
tests/install-sandbox.sh --auto: installs everything in a throwaway home folder and checks paths, settings and setups. 0 problems before going further.- Use it for real on the user's machine once, and show the result.
6. Cross-platform checklist
Everything must work on macOS (bash 3.2, BSD tools), Linux (GNU tools) and Windows (Git Bash, native jq.exe, git.exe):
- No
sed -i,sed -Ewith GNU-only escapes,grep -P,readlink -f,date -d,stat -c,timeout,mapfile, associative arrays (bash 3.2). Use awk, jq, POSIX options, or a checked fallback. - Paths: quote every one (spaces),
$HOMEnot~inside quotes,cygpath -m(kit_path) before handing a path to a Windows program (git config, jq, Claude Code settings). No/proc/self/fd(<(...)given to jq.exe), no hard-coded tool locations. - Source
hooks/lib/jq.sh: it handles jq.exe's CRLF and slow mise shims. - LF line endings, executable bit set (
git update-index --chmod=+xwhen committing from Windows). - Machine-only things behind a platform check (
uname -s: Darwin, Linux, MINGW*/MSYS*).
7. Share it
Ask once, when it works: "Publish a generic copy to <kit>?". On yes:
- Pull the kit (
git pull --ff-only), copy the part, and replace whatever is personal (step 3) by a setting or a setup question. Search the copy for the user's name, emails, hosts, home path and company names before going on. - Run the tests and the install sandbox; show the user the diff.
- Commit with the email the user uses for that host, and push only on their yes. A kit with a team mirror (see the kit's README): push the part there too, on its own yes.
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.

