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
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.
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).
Find the invariants. The most valuable part of a
CLAUDE.mdis 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.Draft
CLAUDE.mdusing the structure in${CLAUDE_SKILL_DIR}/../../../templates/CLAUDE.md.tmplas 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.
Make
AGENTS.mdtrack it. Most non-Claude tools (Codex, etc.) readAGENTS.md. Either symlink it (ln -s CLAUDE.md AGENTS.md) so there's one source of truth, or write a thinAGENTS.mdthat says "see CLAUDE.md". Prefer the symlink unless the repo already has a divergentAGENTS.md.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.
Source: dshakes/compass — distributed by TomeVault.