init
Bootstrap a repo with the context-engineering scaffolding every other command assumes. Run it once.
When to use it
- A brand new repo with no context files.
- A mature repo that has never had context engineering.
- Standardising context engineering across an org's repos.
When not to
- Any of the files above already exist. Use
document. - You want to add a new harness to an existing setup. Same:
documentwith a different target set.
What it produces
AGENTS.md: canonical, hand-edited, under ~80 lines.CLAUDE.md→AGENTS.md: symlink (default) or two-file mirror..cursor/rules/main.mdc: 5-line pointer (Cursor)..github/copilot-instructions.md: 5-line pointer (Copilot)..windsurf/rules/main.md: 5-line pointer (Windsurf).docs/decisions/: README and a negative-space stub. A first ADR is opt-in (the eighth question); skip it and write one later withadr..context/hooks/check-context.sh: slim pre-commit hook.
How it works
- Safety check. If any context files exist, stop and ask whether you meant
document. - Detect stack and sample the code. Reads manifests, scripts, README, plus up to 25 recent source files. Extracts dominant patterns (component shape, error handling, imports, naming) with real-file examples.
- Ask up to eight questions. Harnesses; verification commands; style rules (confirm detected patterns + add anything missed); three-tier boundaries; symlink-or-two-files; rejected approaches; preservation paths; an optional first ADR.
- Write
AGENTS.mdfrom the answers. Each Style rule must be anchored: verb plus a named technology, command, or pattern. Vague rules are dropped at write time, not shipped. Overflow goes todocs/agents/<area>.md. - Wire
CLAUDE.mdand the per-harness pointers. - Set up ADRs and the pre-commit hook. Suggests the install command if no hook runner is present. Does not silently install. Rejected approaches from Q6 land in
docs/decisions/negative-space.mdso the file ships populated. - Run verification. The commands you picked actually execute. Failures are surfaced, not hidden.