By sancovp
The doc-mirror claude system: a 1:1 documentation mirror of any codebase, maintained by an invariant doc-mirror STATE MACHINE (per-module doc(m), 6 context/ index files, fork-on-change, no random documents). Bundles doc-mirror-boot (entry + core-loop prime + router), the doc-mirror-{init,seework,change,prompts} state-skills, doc-mirror-install (the host-setup WIZARD), ship-a-plugin (the build+distribute dev-flow), doc-mirror (THE LAW), and make-ai-operating-system (the architect for new systems of this class); the brainhook work-loop + session-start + transition-guard + readonly-guard hooks (plugin-native via CLAUDE_PLUGIN_ROOT); the journal/projects/vision/plan/tracker/commit/cursor + docmirror-search CLI tools; and the doc-mirror law + behavior rules.
Based on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
WHAT: a thinking maneuver for taking a complex system you already built and unveiling its stupid-simple ESSENTIAL TRANSFORM — one sentence of pure input→output→(published artifact) — then re-realizing that transform at the LOWEST sufficient mechanism (usually just INSTRUCTIONS / a skill, sometimes a thin util), borrowing reliability from an execution substrate you do NOT own rather than your own stack. The implementation you built was incidental complexity wrapped around a simple, statable transform; name the transform and you can rebuild it minimally and reliably. WHEN: when a system feels too heavy / complex / unreliable to depend on; when a thing you built got FORGOTTEN but its FUNCTION keeps recurring as a live CONCEPT elsewhere; when you want to turn a built system into a reusable util or skill; when you're about to depend on a fragile in-house stack for something simple; or when the user says distill / collapse / simplify / 'what does this actually do' / 'make it just instructions' / 'make it a util/skill/plugin' (any of).
WHAT: the entry point for a doc-mirror working session — primes you with the CORE LOOP (the resident attention chain that shapes every turn), explains the doc-mirror STATE MACHINE (a cursor + state-skills + a transition hook), and routes you to the state your cursor names. BOOTS THE SESSION (the first thing every start/compact) — it does NOT mirror a codebase (that is doc-mirror-init). WHEN: at the START of any doc-mirror session, after a compact/restart, when the transition hook tells you to 'use the doc-mirror-boot skill', or when the user mentions doc-mirror, documenting/understanding/mirroring a codebase, or asks how the system/compiler/state-machine works (any of).
WHAT: the CHANGE state of the doc-mirror machine — a specific module changed or has code/doc to write: read the full module boundary, make ONE correct change (dispatch an agent in USING-mode, or author directly when building the system WITH Isaac), re-derive its doc(m), doc-mirror-commit with an ORIGIN, run closure, graduate the realized idea vision(m) → doc(m). WHEN: Use immediately when the situation is — a named module changed, or there is code/doc to write for one specific module: after seework picked a code gap, or after a prompt produced an artifact to verify+commit (any of).
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).
WHAT: the install/setup WIZARD for the doc-mirror plugin — it places doc-mirror's command-line tools (journal, vision, cursor, commit, search) on your PATH and records where the plugin lives, performing the host setup itself and telling you exactly what to run if the environment blocks it; non-destructive. WHEN: right after installing or enabling the doc-mirror plugin (first-time setup), or when a doc-mirror command is 'command not found', or when 'docmirror search' cannot find its prompt store (any of).
Executes bash commands
Hook triggers when Bash tool is used
Modifies files
Hook triggers on file write and edit operations
⭐ 0 stars • 🕑 Updated 2026-06-17
📦 Auto-published from the monorepo • CHANGELOG • sancovp/doc-mirror
A Claude Code plugin that turns your Claude Code into a documentation-and-development operating system for any codebase.
doc-mirror is a claude system (an "AI operating system"): not a single command, but a folder the agent lives in + a core loop it runs every turn + skills, hooks, rules, and CLIs on top. Installing this plugin gives your Claude Code that operating system — it adds skills, hooks, rules, and CLI tools, and changes nothing else about your setup.
What it does: it keeps a 1:1 documentation mirror of a codebase — one explanation file per source module — and it develops the codebase through a small, fixed state machine so the documentation never drifts from the code, and the agent never improvises a flow.
Two agents running doc-mirror on the same codebase produce the same structure. That invariance is the whole point. It comes from three rules:
Every session (and after every compaction), the first thing the agent does is use the doc-mirror-boot
skill. Boot primes the agent with the core loop, shows it the whole state machine, and routes it — via
the cursor (a persisted "you are here" pin) — into the one state it is currently in:
doc-mirror-boot → read the cursor → enter the state it names → do that state's leg
→ advance the cursor + journal the why → loop (back to boot, or exit)
The states are skills:
| state (skill) | what it is |
|---|---|
doc-mirror-init | first-time mirror an unmirrored codebase (enumerate modules → write a doc per module → synthesize the index files → closure test) |
doc-mirror-seework | the dispatcher: read the backlog, pick the next gap, route to the state that does it |
doc-mirror-change | a module changed → re-derive its doc → commit code+doc together → run the closure test |
doc-mirror-prompts | need an agent to do a task → search a reusable, reliability-scored prompt library, or author one |
Transitions are each state's reasoning chain plus the cursor; a hook keeps the moves sensical; the loop prompt + an always-on rule keep the machine in front of the agent every turn, even after a compaction.
For a codebase C, every file in its documentation layer is exactly one of:
doc(m) — the impl doc: a 1:1 explanation of what one module's code actually is, at
docs/mirror/<relpath>.md. Written first, always. Records only what exists.vision(m) — the vision doc: every idea/decision about a module not yet built, at
docs/vision/<relpath>.md. The gap between vision and impl is the backlog.context/ index files, a repo-local rule/skill, or the
dated journal (context/journal/).Nothing else is legal. The closure test is the gate: the doc set must biject 1:1 with the module set, and every file must classify under the kinds above. A run is "done" only when it passes.
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimnpx claudepluginhub sancovp/doc-mirror --plugin doc-mirrorAutopoiesis Plugin - Self-maintaining promise loops for honest AI work
CodeNose - Configurable code smell detection for LLMs. Sniffs out duplicate logic, architecture violations, missing logging, and other blind spots.
Instantiate a TWI Jobworld — AI-powered company with agents that run themselves. Enable this plugin and a CEO agent spawns, ready to bootstrap your company.
SDNA (Sanctuary DNA) - Gnostic agent workflow DSL with skills for chain development
PromptWorld — the meta-compiler *World: a WrightMaster Engineer-CEO that has every skill plus a native subagent per component type (skill / mcp / harness / operating_system / prompt / team / workflow), and 7 PromptGym specialist AIOS agents, that compile / compose / publish prompt systems through the nomicon. Bundles the install-promptworld deploy WIZARD (the agent builds the docker image, boots the container running the Engineer-CEO + PromptGym + the assistant-ui chat / Monaco file explorer / embedded terminal, copies the Claude creds in, and hands the user one URL), compile-a-world (the meta-compiler skill — the nomicon folds on itself), and ingest-into-nomicon-app.
Reliable automation, in-depth debugging, and performance analysis in Chrome using Chrome DevTools and Puppeteer
Core skills library for Claude Code: TDD, debugging, collaboration patterns, and proven techniques
Harness-native ECC operator layer - 67 agents, 271 skills, 92 legacy command shims, reusable hooks, rules, selective install profiles, and production-ready workflows for Claude Code, Codex, OpenCode, Cursor, and related agent harnesses
Comprehensive feature development workflow with specialized agents for codebase exploration, architecture design, and quality review
Comprehensive C4 architecture documentation workflow with bottom-up code analysis, component synthesis, container mapping, and context diagram generation