From Mind-Vault
Route a just-learned lesson to the right destination — project-local solution doc, mind-vault skill/rule/agent/command, or auto-memory. Uses a hybrid narrative-probe + taxonomy-quiz router. Also consumes review-loop output (Cursor Bugbot or GitHub Copilot) as input. Final stage of the mind-vault sprint workflow; the lever that makes each sprint easier than the last.
How this skill is triggered — by the user, by Claude, or both
Slash command
/mv:compoundThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Fifth and final stage of the five-stage sprint workflow (`idea → brainstorm/plan → work → review → compound`). The novel piece of the workflow and its entire point: every solved problem becomes a candidate for promotion into mind-vault, compounding the knowledge store so the next project (or the next sprint on the same project) starts with a higher floor.
Fifth and final stage of the five-stage sprint workflow (idea → brainstorm/plan → work → review → compound). The novel piece of the workflow and its entire point: every solved problem becomes a candidate for promotion into mind-vault, compounding the knowledge store so the next project (or the next sprint on the same project) starts with a higher floor.
CE's compound writes project-local only. Mind-vault's compound routes to six destinations because mind-vault is the cross-project knowledge store — the routing surface is the whole value.
This skill never commits to main and never merges a PR. It stages, commits to feature branches, pushes, and maintains open PRs per RULE_git-safety.
TRIGGER when:
/review-loop) just cleared findings and there's a non-trivial lesson worth preserving — the review output file is a first-class input source (see references/review-finding-ingest.md)SKIP when:
/idea, not /compoundAccept input in this order of preference:
/compound the HMAC flat-payload trap).<project>/.bugbot-loop/<run-id>/findings.md or <project>/.copilot-loop/<run-id>/findings.md (or wherever the loop writes its artifact) when recent. See references/review-finding-ingest.md for parsing rules — each cleared finding becomes a candidate compound entry. Engine-agnostic: same parsing rules apply to either bot's output./compound pr:123#comment-456).Capture the raw learning into working memory. Do not write anything yet.
Per the sprint-workflow plan's Q6 decision. Two modes, probed in order:
2a. Narrative probe. Ask up to three questions, one at a time, using the platform's blocking question tool when available:
After the narrative probe, propose one destination with a one-sentence rationale and ask the user to confirm. If they confirm, skip 2b.
2b. Taxonomy quiz fallback. If the narrative probe produced ambiguous signal, or the user rejected the proposed destination, present the full 6-way taxonomy from references/routing-decision-tree.md as a numbered list and let the user pick.
Six destinations, each with its own emit procedure:
| Destination | Target path (default) | Template |
|---|---|---|
| Project-local solution | <project>/docs/solutions/<topic>.md | assets/solution-template.md |
| Mind-vault skill update | mind-vault/skills/<name>/references/<TOPIC>.md (default) — fall back to SKILL.md body only if the learning is the first concept of a brand-new skill, or so always-on that every invocation needs it. See § Mind-vault placement. | merge into existing reference / emit new reference file; SKILL.md body gets only a stub-with-pointer if anything |
| Mind-vault skill asset | mind-vault/skills/<name>/assets/<filename> | for templates, scaffolds, or scripts the skill emits — non-prose payloads belong here, not in the SKILL.md body |
| Mind-vault rule update | append to an existing mind-vault/rules/RULE_<name>.md (default) — or, for domain-specific guardrails, route to mind-vault/skills/<owner>/references/<TOPIC>.md per the rules-reorg precedent (PR #106). New top-level rule files only when the guardrail genuinely applies across every stage and stack type. | extend existing rule / promote to skill reference / draft new rule file (last resort) |
| Mind-vault agent pass | mind-vault/agents/AGENT_<persona>.md | append a new bullet to the relevant pass (curator PASS 3, architect PASS 1, etc.) |
| Mind-vault command/tool | mind-vault/commands/<verb>.md or mind-vault/tools/<script>.sh | emit new file; ask the user whether a slash command or a bash helper is the right shape |
| Auto-memory | ~/.claude/projects/<project-id>/memory/{feedback,project,user,reference}_<topic>.md + MEMORY.md index line | use the canonical memory frontmatter from CLAUDE.md's auto-memory section |
For project-local: write and stop. No branch management — this is the target project's own journal.
For mind-vault destinations: apply step 4 before emitting.
For auto-memory: write into the memory filesystem at ~/.claude/projects/<project-id>/memory/ and update MEMORY.md's one-line index. Honour the type classification (feedback / project / user / reference) from the global CLAUDE.md auto-memory rules.
Inside a mind-vault skill or rule destination, the placement choice — references/<TOPIC>.md vs assets/<filename> vs SKILL.md body vs new top-level rules/RULE_<name>.md — is itself a routing decision, and the default is load-on-demand, not always-on.
The cost surface: every line in a SKILL.md body is paid on every Skill <name> invocation; every line in rules/RULE_*.md is paid on every session. Lines in skills/<owner>/references/<TOPIC>.md and skills/<owner>/assets/* cost nothing until they're explicitly loaded. PRs #106 (rules-reorg, −983L unconditional load) and IDEA-002 (skill debloat, −748L across three SKILL.md bodies) established the pattern; this routing rule prevents /compound from re-introducing the bloat those PRs paid to remove.
Decision order when promoting a learning into mind-vault:
skills/<owner>/references/<TOPIC>.md. New file if no good home exists; extend an existing reference if one fits. Add a one-line pointer entry to the parent SKILL.md's References list — that's the only body-level surface needed.skills/<owner>/assets/. Multi-line non-prose payloads (project-agnostic templates, shell scripts, sed-substitution recipes) belong here, never inlined into SKILL.md.skills/<new-domain>/SKILL.md initial commit). After the skill exists, subsequent additions revert to the references-first default.rules/RULE_<name>.md ONLY when the guardrail genuinely fires across multiple skills / stages / stack types (the PR #106 always-on tier criterion). Domain-specific guardrails — even when they're hard "always do X" rules — belong in skills/<owner>/references/<TOPIC>.md and load on demand when their owning skill activates. Examples from PR #106's split:
rules/ — RULE_git-safety (every commit), RULE_self-sweep-before-push (every push), RULE_rename-before-drop (every refactor cycle), RULE_cross-idea-amendments (every IDEA touching another's files). Cross-stage breadth.skills/django/references/I18N_WORKFLOW.md, parallel-worktree-docker → skills/sprint-auto/references/PARALLEL_WORKTREE_DOCKER.md, visual-baseline-bumps → skills/django-frontend/references/VISUAL_BASELINE_BUMPS.md, etc. Domain-bound.The test before opting into bullets 3 or 4: "would this learning fire when the consuming agent loads zero skills, OR only when this specific skill is invoked?" If "only when invoked", that's a reference. If "always on regardless of skill activation", that's a top-level rule. Most learnings are reference-shaped; resist the gravitational pull toward bodies and rules/.
When extending an existing reference: read the current file, decide whether the new learning is a section addition or a sibling concept, edit accordingly. The de-duplication grep from § De-duplication before writing runs first.
When the existing SKILL.md body already documents a section adjacent to the new learning: prefer extracting both the existing section and the new addition to a single reference, rather than appending to the body next to the existing section. The new learning is the prompt to fix the bloat, not to extend it. Phase-2-of-IDEA-002-style: cite the existing section's line range in the commit message, write the reference, replace the body with a 2-paragraph stub + pointer.
Auto-memory lives in ~/.claude/projects/<project-id>/memory/ on the host machine. It does not sync across machines. A user who works from multiple environments — daily workstation + remote VPS for overnight sprint-auto runs + occasional laptop session — will see auto-memory written on machine A vanish from machine B's perspective.
Routing rule: when deciding between auto-memory and mind-vault, ask "would this learning still apply if the same person opened a session on a different machine?"
The default is mind-vault. Auto-memory is the exception, not the equal-weight alternative the table above might suggest. When the routing is genuinely ambiguous, prefer mind-vault — the cost of an unused mind-vault entry is one extra file in a knowledge store; the cost of a missed cross-machine learning is the user re-discovering the same lesson on every fresh environment.
This includes patterns that feel project-local but recur across the user's work: review-loop triage shortcuts, sprint-workflow refinements, debugging-loop conventions. Project-local content (a specific bug fix's recipe with project-specific function names) goes to project-local solution docs, not auto-memory; cross-project patterns go to mind-vault.
The user direction that surfaced this rule: "When deciding compound local memory vs. mind-vault, always remember that mind-vault survives the machine. I use you remotely as well (especially for overnight sprint-auto work) on VPS. If you think the compound is THIS LOCAL MACHINE ONLY, then it's local memory. All other cases — mind-vault."
When the destination is inside mind-vault/, detect the repo's checkout path and apply the branch policy. Full rules in references/mind-vault-promotion.md; short form here.
Detect mind-vault path. If the skill was invoked from inside a target project, compute the mind-vault repo path (default ~/projects/mind-vault, user-overridable). If invoked from inside mind-vault itself, use the current directory.
Check branch. git -C <mind-vault-path> branch --show-current.
Branch policy (Q3 resolution):
main: git checkout -b compound/YYYY-MM-DD-<slug> origin/main. Surface to the user which branch was created.ce-inspired-evolution): stay on it. No new branch. No branch spam.production / deployment branches; refuse if on one.Emit the file(s). Write the target files per step 3.
Prior-project / customer-data scrub gate — MANDATORY (forcing function). Mind-vault is a cross-project knowledge store and must contain zero project/customer-identifying data — nothing that wouldn't be safe in a public repo (private today, public tomorrow). This gate is instruction-driven, not blacklist-driven: there is deliberately no maintained denylist of names. A name blacklist's false-positive cost outweighs its value and it ages badly — a well-written instruction the model reasons from wins long-term. Recognise the category; do not pattern-match a list.
The forcing function — emit a classification before you commit. Do not skip silently. List every proper-noun token in the staged diff (project names, repo names, client/org names, person names, hostnames, absolute paths) and classify each:
| Token kind | Class | Action |
|---|---|---|
| mind-vault's own PR/IDEA/module/function names | mind-vault-own | KEEP |
| any OTHER project / repo / client / org proper noun | foreign | SCRUB (generalise) |
| generic technical terms | generic | KEEP |
A gate you can satisfy without emitting this classification is decorative — emit it.
What "foreign" looks like (recognise the class — these are illustrations, NOT an exhaustive list):
(project-x) IDEA-178, project-x PR #475. ← project-x is a deliberate placeholder; never re-concretise it with a real project name (the gate's own example is the single highest-traffic re-leak vector).https://github.com/<other-repo>/pull/NNN)./Users/<name>/..., /home/<name>/...).Scrub policy (drop the tag, keep the lesson):
project-x) — never a real name.IDEA-NNN / PR #NNN that resolves in mind-vault is KEPT (valid own-provenance); one tied to another project (surrounding prose names it, or it doesn't resolve here) is dropped or qualified.<filename> / <tenant-host>).AttachmentSerializer, <app>/) → KEEP (public-API names future readers need; already grep-able from the cited PR).The "would this be safe in a public repo today?" test is the gate. Answer "no" → scrub before commit.
Optional cheap aid (NOT the enforcement mechanism): git diff --staged | grep -iE 'conversation [0-9]+|record [0-9]+|/Users/[^/]+/|/home/[^/]+/' can surface obvious id/path leaks — but the classification above (model judgment, not regex) is what the gate relies on.
Recurring drift. Provenance accumulates back over time even with this gate. When it does, run the repeatable provenance-scrub runbook (in the IDEA-018 archive — grep PROVENANCE_SCRUB_RUNBOOK) and append a run-log entry — periodic maintenance, not a fresh IDEA each time.
Commit. One commit per invocation, using the standard commit-message format (type(scope): description). Mind-vault self-mode CHANGELOG bump: when the destination is mind-vault itself (self-promotion, not a project-local write), patch-bump CHANGELOG.md in this same commit — pure /compound PRs increment the patch component by 1 (vX.Y.Z → vX.Y.(Z+1), not a bump to 0.0.1) with their own ## v section (no IDEA → /wrap never runs to do it). See references/mind-vault-promotion.md § Self-mode CHANGELOG bump.
Push. git push --set-upstream origin <branch>.
Ensure open PR. gh pr view <branch> to check existence. If no PR exists, gh pr create --title "..." --body "...". If one exists, append a short note to the PR body describing what this /compound invocation added — keeps the PR description current.
Report back. Print the branch, commit SHA, and PR URL. Never suggest the human merge — that's theirs to do.
git log + body carry the foreign-project trail (review id, source PR URL, etc.)./compound invocations can detect duplicates.MEMORY.md pointer — that's the index.Phase 1 does not auto-verify that the new skill/rule/agent is picked up in the next invocation — deferred per the sprint-workflow plan's Q7. Instead, after promotion, print a manual hint:
To verify the new skill fires as expected, start a fresh agent session and
ask for the pattern you just captured. If the skill's description doesn't
match the new trigger, revise the frontmatter and try again.
When the input is a review-loop output file (/review-loop), iterate each cleared finding:
See references/review-finding-ingest.md for the parsing rules and the de-duplication heuristics.
RULE_git-safety is not negotiable./compound is a post-incident skill. If you're still implementing, finish (or abort) and come back./idea./plan with the revision.docs/solutions/). Promotion to mind-vault is the higher bar — reserve for patterns that actually recur./ingest-backlog (for IDEAs) or hand-write solution docs outside this skill./compound may trigger the idea→archive move when post-incident routing classifies an IDEA as superseded or rejected before any execution startedGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub infohata/mind-vault --plugin mv