Skip to content

Latest commit

 

History

History
80 lines (63 loc) · 4.94 KB

adopt.md

File metadata and controls

80 lines (63 loc) · 4.94 KB
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.

Run

$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).

  1. Resolve the target: default . (git rev-parse --show-toplevel).

  2. Run the driver (idempotent, non-destructive):

    bash "${CLAUDE_PLUGIN_ROOT:-$HOME/.claude/dwarves-kit}/lib/adopt.sh" [--check] [--with <a,b,c>] <target>
    
  3. 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:start to classify the first task.

What adoption installs

  • 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 own AGENTS.md is never overwritten; an unmodified old kit copy is replaced only by --refresh --swap-agents, and an edited file gets a drift line.
  • a CLAUDE.md loader 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); --with seeds the named modules true instead 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 seeds proof_of_done, lane_gates, understanding_gate, and commit_format with the values that resolved at adopt time and a comment explaining each; set one to true, 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.json hook 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.

--single-source

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.

Overlays and seams

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.

Do NOT

  • Overwrite an existing AGENTS.md / CLAUDE.md / .kit.toml (the driver guards this; never force it; --with on an existing .kit.toml is a no-op with a note).
  • Copy lib/ or the full WORKFLOW.md into the consumer.