/doc-mirror:doc-mirror-bootfrom doc-mirror
WHAT: doc-mirror-boot — the MANDATORY first action of EVERY turn in this container. It primes the CORE LOOP, explains the doc-mirror STATE MACHINE (cursor + state-skills + transition hook), and routes you to the state your cursor names. You are ALWAYS inside this machine; no reading, querying, editing, answering, planning, or dispatching is valid until you have booted this session. WHEN: ALWAYS — UNCONDITIONALLY, BEFORE ANY OTHER ACTION. If `doc-mirror-boot` is not ALREADY in your context this session, you MUST use it NOW, first, before you do anything else — at the very start of every session, immediately after every compact/restart, and the instant you are about to do work (read, grep, query CartON, edit, answer the user, dispatch an agent, rehydrate) without having booted. Also when the transition hook says 'use the doc-mirror-boot skill', when you are unsure what state you are in, when you catch yourself freestyling/ad-hoc-querying/ad-hoc-reading, or when the user mentions doc-mirror, the cursor, the state machine, rehydrating, memory, or what to work on. If in doubt: BOOT. Never act before booting. This is not topical — it fires on EVERYTHING.
Trending skills
7-day visitors to each skill page
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.
This is step 0. You read this first, always. It does three things: (1) PRIMES you with the core loop, (2) tells you how the doc-mirror state machine runs, (3) routes you to the state your cursor names. You never improvise — you read your cursor and call the state-skill it names, emitting a CoR that uses the core-loop priming.
The core loop is the resident attention chain that primes you each turn. It is NOT a CoR you paste; it is the standing priming that your per-turn CoR then activates. Hold this as the shape of every turn:
use the doc-mirror-boot skill first thing when a session starts
→ journal as you go (think = a cross-cutting action, every state, the moment a thought occurs)
→ while there is work: enter the appropriate doc-mirror-{state} skill (your CURSOR names which)
→ if it is time to make an agent DO something: use doc-mirror-prompts
→ maybe docmirror-sleep. NOTHING ELSE HAPPENS.
Each turn, primed by this, you EMIT a CoR that uses the priming — a said reasoning chain that names the state you're in, does that state's leg, advances the cursor, and names the next state. The core loop is the tag that primes you; your per-turn CoR is the token that activates it. (Do NOT mistake the core loop for "a CoR I paste" — it is the unsaid priming; the CoR is the said activation.)
The doc-mirror flow is a state machine: states = skills, transitions = each state's CoR + the
cursor, enforcement = the transition hook, reification = the diagrams (STATE_GRAPH.md +
SYSTEM.md + the always-on rule). You are always inside one state; you do its leg, advance the cursor,
and call the next state — the machine loops itself.
Your place in the machine is the CURSOR — docmirror-cursor (persisted at <root>/.docmirror/cursor.json,
survives compacts). It is the authority: your cursor's phase names the state-skill you call. The
skill descriptions are discovery; the cursor is the deterministic router.
stateDiagram-v2
[*] --> doc_mirror_boot: every session / post-compact / new turn
doc_mirror_boot --> R_cursor: docmirror-cursor show (read your phase)
R_cursor --> ROUTE
state ROUTE <<choice>>
ROUTE --> state_init: [phase==init] call doc-mirror-init
ROUTE --> state_seework: [phase==seework] call doc-mirror-seework
ROUTE --> state_change: [phase==change] call doc-mirror-change
ROUTE --> state_prompt: [phase==prompt] call doc-mirror-prompts
ROUTE --> WAIT_open: [phase==open] NEEDS-ASKING — re-echo open_fork, docmirror-sleep
ROUTE --> SELECT: [phase==orient/empty] pick the state whose WHEN matches the situation
SELECT --> ROUTE: set the cursor phase, then route
state_change --> R_cursor: each state's CoR advances the cursor + calls the next state (the machine loops)
note right of ROUTE
STUCK anywhere = the only off-script exit:
journal -t OPEN "<fork>" · docmirror-cursor set --phase open · docmirror-sleep (echoes to Isaac)
IDLE: clean seam / queue empty -> self_compact & (👍) or docmirror-sleep (chunked).
end note
| phase | state-skill | what it is |
|---|---|---|
| boot | doc-mirror-init | mirror an unmirrored codebase the first time (enumerate→doc(m)+vision(m)→synthesize→layers→closure) |
| seework | doc-mirror-seework | the backlog VIEW (vision stats→project→diff) → pick the next gap → route to its state |
| change | doc-mirror-change | a module changed → re-derive doc(m) → doc-mirror-commit w/ ORIGIN → graduate vision→impl |
| prompt | doc-mirror-prompts | need an agent to DO a task → search/author a reliability-scored prompt-skill |
Not states (no transition gate): think (journal-as-you-go) and harvest (noticed a reusable
rule/skill) are CROSS-CUTTING actions inline in every state. idle and open are WAIT states —
docmirror-sleep / self_compact (idle), or journal -t OPEN → sleep → Isaac (open). They live in this
spine, not in their own skills.
Reference docs (not states): doc-mirror = THE LAW (the invariant all states operate under — 4 legal
file kinds, deterministic addressing, doc(m) template, closure test, fork-on-change). make-ai-operating- system = the L2 architect for designing NEW systems of this class.
doc-mirror-{state} skill is exactly this shape)1. {the state's subgraph mermaid} ← the shape (one canonical place for THIS subgraph)
2. {explanation} ← what this state is, the said/symbolic context
3. {CoR — the binding + the transition}:
"Now that I've read {this state}, I will {the state's inner CoR — its concrete steps}, then I
advance the cursor (`docmirror-cursor set --phase {next}`) and call `{next state-skill}`
— or, if {branch condition}, call `{alt state-skill}` instead.
If I hit a fork I cannot resolve (architecture / irreversible / needs Isaac): I `journal -t OPEN
"<fork + why>"`, `docmirror-cursor set --phase open`, and `docmirror-sleep` — I call no next; I wait."
Three invariants the template enforces: conditional next (the CoR names the branch's successors), cursor-coupled (advance the cursor in the same breath as the call, so a compact can resume), and stuck = a defined exit (OPEN → sleep → Isaac), never freestyling.
A PreToolUse hook on the Skill tool checks that each state transition is sensical (per the LEGAL
TRANSITIONS table in STATE_GRAPH.md). If you make a nonsensical jump it blocks you once with a
warning and the line "To gain understanding of the compiler/state machine, just use the
doc-mirror-boot skill." That is the catastrophe-surface guard letting you catch yourself —
if you genuinely meant the jump (an emergent deviation), journal -t DECISION why ("swapped emergently
to X because…") and RE-INVOKE the state-skill to force it through. If you forgot how the machine works,
you're reading the right skill now.
docmirror-cursor, journal, vision, plan, projects, doc-mirror-commit.STATE_GRAPH.md (full machine) + SYSTEM.md (the 4 glance diagrams).DOCMIRROR_MONOREPO / ~/.docmirror_root / git toplevel). journal --where
confirms it.Now that I've read doc-mirror-boot, I am PRIMED with the core loop, and I will ORIENT —
read SYSTEM.md (the 4 diagrams), run docmirror-cursor show to read my phase, and then
RECURSIVELY REHYDRATE via doc-mirror-memory-net (DMN) — this is MANDATORY and is NOT a single
locate: I identify what I am working on, then call DMN OVER AND OVER (tree → drill the domain →
#3 by subdomain/tag → #6 neighborhood), retrieving the ENTIRE set of entries about it in FULL TEXT
(read the overflow file) and following related_to/part_of to adjacent coordinates, until the
entries STOP being about my thing — proving to myself I have contextualized EVERYTHING (a vision = the
recursive grouping of everything ever said about that feature; the decisions are already made and I make
the vision REFLECT them) BEFORE I act. A thin peek + freestyling is the failure that destroys work.
I NEVER ls/cat the flat docs/vision/ files — the graph IS the hierarchy; the ROOT progress-tracker
names the active repo. I call the state-skill for that phase (per the table)
and follow its CoR; if the cursor is empty I SELECT the state whose WHEN matches the situation and set the
phase first. I emit a CoR each turn that USES the core-loop priming. I act ONLY on the named state's leg;
I advance the cursor and journal as I go; on an unresolvable fork I journal -t OPEN and docmirror-sleep.
I never freestyle — I am always inside one state of the machine.
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./doc-mirror-changeWHAT: change ONE module -- read its full boundary, make the change, re-derive its doc(m), doc-mirror-commit with an ORIGIN, run closure, graduate the realized vision(m) -> doc(m). WHEN: a specific module changed or has code/doc to write -- after seework picks a code gap, or after a prompt produced an artifact to verify and commit./doc-mirror-initWHAT: 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./doc-mirror-installWHAT: install/setup wizard -- puts doc-mirror's CLIs (journal, vision, cursor, commit, search) on PATH and records where the plugin lives. WHEN: right after installing/enabling the doc-mirror plugin (first-time setup); or a doc-mirror command is 'command not found'; or 'docmirror search' cannot find its prompt store.Other plugins' skills for the same job