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: document with a different target set.

What it produces

  • AGENTS.md: canonical, hand-edited, under ~80 lines.
  • CLAUDE.mdAGENTS.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 with adr.
  • .context/hooks/check-context.sh: slim pre-commit hook.

How it works

  1. Safety check. If any context files exist, stop and ask whether you meant document.
  2. 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.
  3. 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.
  4. Write AGENTS.md from 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 to docs/agents/<area>.md.
  5. Wire CLAUDE.md and the per-harness pointers.
  6. 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.md so the file ships populated.
  7. Run verification. The commands you picked actually execute. Failures are surfaced, not hidden.