| name | doc-mirror-install |
| description | WHAT: 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. |
doc-mirror-install — the install wizard (run once, right after enabling the plugin)
This is a WIZARD: you (the agent) perform the host-level setup yourself, verify it at the surface,
and — only if the environment blocks you — tell the user the exact command to run. It is
non-destructive: it places doc-mirror's CLI tools on PATH and records where the plugin lives. It
writes only those, and deletes nothing.
Why this exists (what a plugin can and can't place for itself)
When the doc-mirror plugin is enabled, Claude Code auto-discovers its skills/, hooks/hooks.json,
and rules/ straight from the plugin dir — those need no setup. Exactly two things a plugin manifest
cannot place, which this wizard handles:
- the
bin/ CLIs (journal, vision, docmirror-cursor, doc-mirror-commit, docmirror search,
plan, projects, tracker, docmirror-sleep, …) must be on your PATH to be invocable;
- the
docmirror search bin runs as a host CLI (it does not receive CLAUDE_PLUGIN_ROOT at
call time), so it needs ~/.docmirror_plugin_root written to find the plugin's prompt store.
Do this
- Find the plugin root. It is the grandparent of THIS skill's directory — this skill lives at
<plugin-root>/skills/doc-mirror-install/. (If $CLAUDE_PLUGIN_ROOT is set in your shell, that is
the plugin root.) Confirm <plugin-root>/install.sh exists.
- Run the setup script (non-destructive + idempotent — safe to re-run):
bash "<plugin-root>/install.sh"
Read its output: it reports where it placed the bins, that it recorded the plugin root, and whether
your PATH needs an edit.
- Verify at the surface (do NOT trust step 2's report — check the artifacts):
docmirror-cursor show
docmirror search "doc-mirror" --corpus prompts --limit 3
Both must succeed. "command not found" means PATH isn't updated in this shell yet.
- If the environment blocked you, TELL THE USER (never silently fail — that is the whole point of a
wizard):
- PATH not updated → give them exactly:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc, then re-verify.
~/.local/bin not writable → have them re-run with a writable dir and add it to PATH:
DOCMIRROR_BIN_DST=<dir> bash "<plugin-root>/install.sh".
Done when
docmirror-cursor show and docmirror search … --corpus prompts both work in a fresh shell. doc-mirror
is now operable — start any session with the doc-mirror-boot skill, which cascades everything else.