Help us improve
Share bugs, ideas, or general feedback.
From doc-mirror
WHAT: the INIT state of the doc-mirror machine (INITIALIZES a codebase's mirror; NOT the session entry — that is doc-mirror-boot) — first-time mirroring of a codebase that has none (enumerate modules → write doc(m)=IMPL + vision(m)=VISION → synthesize the 6 context files → derive layers → closure test). WHEN: Use immediately when the situation is — the active codebase has NO doc-mirror yet (no docs/mirror/ AND no context/progress-tracker.md): a fresh repo to mirror. Reached from seework (you found an unmirrored repo) or from doc-mirror-boot/SELECT when the active repo isn't mirrored (any of).
npx claudepluginhub sancovp/doc-mirror --plugin doc-mirrorHow this skill is triggered — by the user, by Claude, or both
Slash command
/doc-mirror:doc-mirror-initThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are in the **init** state of the doc-mirror state machine. This initializes the doc-mirror mirror into a
Guides technical evaluation of code review feedback: read fully, restate for understanding, verify against codebase, respond with reasoning or pushback before implementing.
Share bugs, ideas, or general feedback.
You are in the init state of the doc-mirror state machine. This initializes the doc-mirror mirror into a
target dir <C>. It is NOT the compiler — to design a different system of the doc-mirror class, use
make-ai-operating-system. You operate under THE LAW (the doc-mirror skill: the 4 legal file
kinds, deterministic addressing, the doc(m) template, the closure test). Deep ref:
doc-mirror-system/{SYSTEM.md, context/architecture.md} + DOC_MIRROR_SYSTEM.md.
stateDiagram-v2
[*] --> S_guard: R — GUARD (already mirrored? docs/mirror + tracker exist -> stop, resume seework/change)
S_guard --> S_register: `tracker register <C>` (+ `tracker active <C>`) → ROOT REPO ORDER
S_register --> S_sixfile: create <C>/context/ 6 files
S_sixfile --> S_enumerate: enumerate modules -> docs/mirror/_MANIFEST.txt
S_enumerate --> S_docm: team writes doc(m)=IMPL then vision(m)=VISION (templated prompt; via doc-mirror-prompts)
S_docm --> S_synth: synthesizer writes the 6 context files (navigation, point DOWN)
S_synth --> S_layers: docmirror-layers + docmirror-system (derive _LAYERS.json + docs/SYSTEM.md)
S_layers --> CHECK
state CHECK <<choice>>
CHECK --> S_done: [closure prints nothing: manifest<->doc(m) biject; every doc(m) has vision(m); 6 ctx; no illegal files]
CHECK --> S_fix: [comm -3 prints / a file fails to classify]
S_fix --> S_docm
S_done --> [*]: advance cursor -> seework ; journal
GUARD FIRST (idempotent — never double-init). Check the target dir <C>:
C="<target-dir>"
if [ -f "$C/context/progress-tracker.md" ] && [ -d "$C/docs/mirror" ]; then
echo "ALREADY MIRRORED at $C — stop. (mirror + tracker exist.)"; exit 0
fi
If a partial init exists (tracker but no mirror, or vice-versa), REPORT what's present and resume only the missing part — do not overwrite existing doc(m) or context files.
Two altitudes. The ENVIRONMENT (~/.claude strip, the doc-mirror skills+rule, the loop hooks) is
initialized ONCE per machine — guard on the skills + hooks existing; if present, skip (that's one-time machine
setup, see make-ai-operating-system). A CODEBASE <C> is initialized PER-DIR — the common case:
seework/change.tracker register <C> --status NEXT --note "<one-line>" then tracker active <C> — adds/sets <C> in the ROOT REPO ORDER
router table (root = cross-repo order; this lets the machine route to <C>).<C>/context/ with the 6 files (six_file_methodology templates as
scaffolds; progress-tracker = the queue). Leaf gets its own; root already has one.doc-mirror skill):
<C>/docs/mirror/_MANIFEST.txt (the fixed enumerator; record the command).doc(m) per module at <C>/docs/mirror/<relpath>.md, then vision(m) at
<C>/docs/vision/<relpath>.md — dispatched as a TEAM via doc-mirror-prompts (one templated
prompt, never improvised; imitate any existing hand-written doc(m) as the shape).docs/vision/_<topic>.md written before
the code), GRADUATE its entries into the new module vision(m) BY TAG as each module lands:
vision tag <topic> vN +<component> to label, then vision graduate <relpath> --from <topic> --by-tags <component> (the design becomes modular as modules are born; lossless, refuses w/o doc(m)).docmirror-layers <C> then docmirror-system <C> → _LAYERS.json + docs/SYSTEM.md.comm -3 manifest↔doc-set prints NOTHING; every file classifies.doc-mirror-commit.<C> is in the ROOT order table.(Writing the doc(m) team is itself a prompt task — when you reach S_docm you transition to
doc-mirror-prompts to dispatch the templated team, then return here to synthesize + close.)
Now that I've read doc-mirror-init, I will run the init procedure on {{C}} — GUARD first (stop if
already initialized), then register → 6 files → enumerate → (transition to doc-mirror-prompts to dispatch
the templated doc(m)+vision(m) team, verifying the artifacts myself) → synthesize → layers → closure
test must print nothing. When closure passes I docmirror-cursor set --phase seework, journal the
init, and call doc-mirror-seework. If I cannot resolve a fork (which modules count, an irreversible
restructure, anything needing Isaac): I journal -t OPEN "<fork + why>", docmirror-cursor set --phase open, and docmirror-sleep — I call no next; I wait.