/doc-mirror:doc-mirror-initfrom doc-mirror
WHAT: first-time mirror a codebase that has none (enumerate modules -> write doc(m)=IMPL + vision(m)=VISION -> the 6 context files -> closure test). WHEN: the active repo has NO docs/mirror/ and NO progress-tracker yet (a fresh repo to mirror); reached from seework or boot when the active repo is unmirrored.
Ships in doc-mirror. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
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.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub sancovp/doc-mirror --plugin doc-mirror13 skills in this plugin
/check-sophia-progressWHAT: check the live status of the Sophia rollup / cohere worker — is the daemon running, how far BEHIND it is (how many journals not yet cohered / the lag between newest journal and newest momentum), and how many issues meta-Sophia has flagged. WHEN: when you want to know if Sophia is running + caught up, when a rehydration or decided-logic query looks stale, when you suspect the rollup died, or when the user asks 'is sophia running / caught up / how far behind / how many meta issues' (any of)./distill-to-essential-transformWHAT: a thinking move -- collapse a complex system to its one-sentence ESSENTIAL TRANSFORM (input->output->artifact) and rebuild it at the LOWEST sufficient mechanism, borrowing reliability from a substrate you do not own. WHEN: a system feels too heavy/fragile to depend on; a built thing was forgotten but its function keeps recurring; turning a system into a util/skill; user says distill / collapse / simplify / 'what does this actually do' / 'make it just instructions'./doc-mirrorWHAT: THE LAW of doc-mirror -- the 4 legal doc-layer file kinds, deterministic addressing, the doc(m) template, the closure test, fork-on-change. The invariant every state operates under. WHEN: you need the rule for what a doc(m)/vision(m)/journal/tracker IS or where it lives; classifying a doc-layer file; unsure whether an action is legal in the machine.Other plugins' skills for the same job