bootstrap-agent-config — Claude Code skill
Walks the repository, works out the stack and the real commands, then writes CLAUDE.md and AGENTS.md with rules taken from the code.
npx skills add dshakes/compass --skill bootstrap-agent-config -a claude-codeWhat bootstrap-agent-config does
The skill starts by running detect-stack.sh, a helper that returns a quick inventory: languages, package managers, build/test/lint commands, monorepo layout, whether ADRs and CI exist. Then it checks that inventory against reality, opening the Makefile, package.json or justfile and reading a couple of source files to catch the conventions in use — error handling, test style, naming.
The part that carries the weight is the invariants. The skill hunts for rules whose violation causes incidents: tenant scoping, a trust boundary, a generated file nobody should hand-edit. It looks in ADRs, ARCHITECTURE.md, SECURITY.md and README gotchas, and asks you when the architecture isn't legible.
CLAUDE.md follows a template skeleton and only keeps what was verified. AGENTS.md is a symlink to it, so one file stays the source of truth; a repo that already has its own diverging AGENTS.md is the exception. At the end you get the list of written files and the three invariants the skill encoded. Anything it had to guess is tagged (verify), and that tag stays until a person confirms it. bash is required.
What it helps with
- draft a first agent config for a repo that has none
- recover the exact build and test commands from the project files
- list the rules that break production when ignored
- keep
CLAUDE.mdandAGENTS.mdfrom drifting apart - give Codex and other tools that read
AGENTS.mdsomething to work from
Example prompts for the agent
- Inspect this project and draft a config for the coding agent.
- Build the agent config for the
./services/authpackage. - Write
CLAUDE.mdhere and pointAGENTS.mdat it.
How to install bootstrap-agent-config
1Skills CLI (Vercel)
npx skills add dshakes/compass --skill bootstrap-agent-config -a claude-code2Manually: put the files in place
~/.claude/skills/bootstrap-agent-config/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/bootstrap-agent-config/
1Skills CLI (Vercel)
npx skills add dshakes/compass --skill bootstrap-agent-config -a codex2Manually: put the files in place
.agents/skills/bootstrap-agent-config/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dshakes/compass --skill bootstrap-agent-config -a cursor2Manually: put the files in place
.cursor/skills/bootstrap-agent-config/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dshakes/compass bootstrap-agent-config2Manually: put the files in place
.github/skills/bootstrap-agent-config/SKILL.md1Skills CLI (Vercel)
npx skills add dshakes/compass --skill bootstrap-agent-config -a gemini-cli2Platform CLI
gemini skills install https://github.com/dshakes/compass --path claude/skills/bootstrap-agent-configManually: put the files in place
.devin/skills/bootstrap-agent-config/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add dshakes/compass --skill bootstrap-agent-config -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about bootstrap-agent-config
How to install bootstrap-agent-config in Claude Code?
Run npx skills add dshakes/compass --skill bootstrap-agent-config -a claude-code. The skill file lands at ~/.claude/skills/bootstrap-agent-config/SKILL.md.
What does bootstrap-agent-config do?
It inspects the current repository, detects languages and commands, and drafts CLAUDE.md plus AGENTS.md grounded in what the code actually shows.
What does the skill need to run?
bash for detect-stack.sh and the repository itself. Run it from the project root so the Makefile, package.json, ADRs and source files are in reach.
Source text
SKILL.md · MIT
---
name: bootstrap-agent-config
description: Generate a high-quality project CLAUDE.md and AGENTS.md by inspecting the current repository. Use when a repo has no agent config, when onboarding a new project, or when the user asks to "set up Claude/Codex for this repo" or "write a CLAUDE.md". Detects languages, build/test commands, and structure, then drafts config grounded in what's actually there.
argument-hint: "[optional path, default: current repo]"
allowed-tools: Read, Write, Edit, Grep, Glob, Bash
---
# Bootstrap agent config for a repository
Produce a `CLAUDE.md` and a symlinked/parallel `AGENTS.md` that are *grounded in
the real repo*, not generic boilerplate. A good config is the single highest-ROI
thing for agent productivity in a codebase — it pays for itself on the first task.
## Steps
1. **Detect the stack.** Run the helper to get a fast inventory:
```
bash "${CLAUDE_SKILL_DIR}/detect-stack.sh" .
```
It reports languages, package managers, build/test/lint commands, monorepo
layout, and whether ADRs/CI exist.
2. **Verify, don't trust.** Confirm the detected build/test commands actually exist
(read the Makefile / package.json / justfile). Read 2–3 representative source
files to learn the real conventions (error handling, test style, naming).
3. **Find the invariants.** The most valuable part of a `CLAUDE.md` is the
*load-bearing rules* — the things that cause incidents if violated. Look for
them in: existing ADRs, `ARCHITECTURE.md`, `SECURITY.md`, README "gotchas", and
patterns the code enforces (e.g. tenant scoping, a trust boundary, a generated
file you must not hand-edit). Ask the user if the architecture isn't legible.
4. **Draft `CLAUDE.md`** using the structure in
`${CLAUDE_SKILL_DIR}/../../../templates/CLAUDE.md.tmpl` as a skeleton. Fill every
placeholder with real, verified content. Sections that matter most:
- One-sentence "what this is"
- Languages and *exact* build/test/lint commands (copy-pasteable)
- Repo layout (only the parts an agent needs)
- **Load-bearing invariants** — the "what NOT to do" list
- How to run/verify locally
Cut anything you can't ground in the actual repo. Short and true beats long and
aspirational.
5. **Make `AGENTS.md` track it.** Most non-Claude tools (Codex, etc.) read
`AGENTS.md`. Either symlink it (`ln -s CLAUDE.md AGENTS.md`) so there's one
source of truth, or write a thin `AGENTS.md` that says "see CLAUDE.md". Prefer
the symlink unless the repo already has a divergent `AGENTS.md`.
6. **Report** the files written and the top 3 invariants you encoded, so the user
can correct anything you inferred.
## Quality bar
- Every command in the file runs. Every path exists. Every invariant is real.
- No "best practices" filler that isn't specific to this repo.
- If you had to guess at an invariant, mark it `(verify)` so the user checks it.
© dshakes · MIT · dshakes/compass