| description | Adopt the current (or a target) repo into the dwarves-kit operate-contract: write a small AGENTS.md pointer (never over a repo's own file) + a CLAUDE.md loader + a WORKFLOW pointer + the proof marker, idempotently, and wire the lane/loop-type/proof classifiers so the ship-gate engages. |
|---|
You are adopting a repo into the dwarves-kit operating layer. This installs the operate-contract so that, from now on, an agent working in that repo classifies the work and picks a lane before coding, and the ship-gate engages on push.
$ARGUMENTS may name a target dir (default: the repo root), --check (status only),
--with <a,b,c> (seed these modules true in a FRESH .kit.toml; ignored once one exists),
or --single-source (see below).
-
Resolve the target: default
.(git rev-parse --show-toplevel). -
Run the driver (idempotent, non-destructive):
bash "${CLAUDE_PLUGIN_ROOT:-$HOME/.claude/dwarves-kit}/lib/adopt.sh" [--check] [--with <a,b,c>] <target> -
Report what it created (or that the repo was already adopted). Tell the user the one next step: open a session in the adopted repo and run
/kit:startto classify the first task.
AGENTS.md-- a small pointer (about 1KB: four rules plus where the full contract lives), not a copy of the 18KB contract. A repo's ownAGENTS.mdis never overwritten; an unmodified old kit copy is replaced only by--refresh --swap-agents, and an edited file gets a drift line.- a
CLAUDE.mdloader pointer (Claude Code auto-loads CLAUDE.md, not AGENTS.md). WORKFLOW.md-- a pointer to the installed kit's lane x phase matrix (not a 49KB copy).docs/verification/README.md-- the proof marker that makes the ship-gate engage..kit.toml-- an OPT-IN starter override of the kit-root defaults. Created only on a fresh adopt (never overwritten afterward);--withseeds the named modulestrueinstead of inheriting the kit-root default. Edit[modules]any time and re-run/kit:adopt(or--refresh) to re-wire. Its[gate]block is where the blocking quality gates are turned on for this repo (they are OFF by default): adopt seedsproof_of_done,lane_gates,understanding_gate, andcommit_formatwith the values that resolved at adopt time and a comment explaining each; set one totrue, commit, and it applies from the next hook fire (no re-adopt). Safety gates have no key. Detail:lib/gate/README.md"Turning a gate on"..claude/settings.jsonhook entries for this project's currently-enabled hook-bearing modules (board,session,advisor,cosmetic) -- a targeted jq MERGE, re-wired on every adopt run from the project's CURRENT.kit.toml, never a wholesale file rewrite. Command/skill modules (queue,stats,quiz_gate,weekend_batch,bridge) need no settings.json entry.
To adopt several repos at once, use bin/wrap adopt <repo>... instead of running the driver per repo. It dry-runs by default, and with --apply it opens and lands one adoption PR per repo. See the adopt bullet in commands/wrap.md.
The classifiers (lane-classify, task-type-classify, proof-gate) run from the installed kit;
adoption wires the contract to reference them. It never copies the engine.
For a repo that wants to keep exactly one agent guide instead of a CLAUDE.md/AGENTS.md pair.
An existing CLAUDE.md (and no AGENTS.md) folds into AGENTS.md via git mv; CLAUDE.md
becomes a one-line @AGENTS.md import (still auto-loaded by Claude Code, still importing the
single source), and the operate-contract block lands in AGENTS.md instead of CLAUDE.md.
Already in that shape: a no-op. Both files exist and genuinely differ, or neither exists:
refuses (exit 1) and writes nothing, so the operator merges by hand. The root-only knob
adopt.single_source (default false) turns this mode on without the flag; --no-single-source
overrides a true knob back off.
Adoption installs the engine alone; no [modules] entry requires a companion kit. Two overlays
exist today. context-kit is the data plane: it owns the context tree and recall over it, and
fills [knowledge] root plus the PROSE_RAG_BIN binary. learning-kit is a study overlay on the
engine; it fills [wrap] before with its concept flush.
A seam is a key in the operator kit.toml, never this repo's .kit.toml, that the engine reads
with kit_config_get_root. bash "$KIT/bin/config" seams lists every seam with its state
(default, filled, unresolved, absent); --check exits 1 on an unresolved row, for an
installer. With nothing filled, every seam reads default or absent and the adopted repo works
the same. Table: lib/config/module-registry.md under ## Seams.
- Overwrite an existing AGENTS.md / CLAUDE.md /
.kit.toml(the driver guards this; never force it;--withon an existing.kit.tomlis a no-op with a note). - Copy
lib/or the fullWORKFLOW.mdinto the consumer.