compound-graduate
Promote recurring lessons into your living CLAUDE.md / AGENTS.md.
npx skills
npx skills add joshuaoliphant/claude-plugins --skill compound-graduate
Works for Codex, Cursor and other harnesses. Use -a <agent> to target one, e.g. -a codex.
Claude Code
/plugin marketplace add joshuaoliphant/claude-plugins
/plugin install compound-knowledge@oliphant-plugins
Compound Graduate
Goal
Close the compound loop's "improve" edge. Graduate has two faces:
- Promote turns captured knowledge into visible improvements to the always-loaded living
context (
CLAUDE.md/AGENTS.md). - Garden keeps the solutions corpus small and true, so retrieval keeps landing on the right file as it grows.
Pick the face from the request; when it is unclear, garden first, since promoting from a corpus full of duplicates promotes the duplicates.
When to run
Promote after enough knowledge has accumulated that patterns recur, or on explicit request. Promotion edits the file read every session, so it is high-trust: always propose before applying.
Garden when retrieval starts returning near-duplicates or stale fixes, or on explicit request. It rewrites what retrieval returns, so it also proposes before applying.
Promote
- Resolve the corpus. Run the resolver to get the read corpus and semantic root:
bash
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/resolve_paths.py" "$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
Use read_paths as the scan corpus and vault_root (if set) for semantic queries. If it
exits 1, the solutions directory (write_path) does not exist: pass on the fix it printed to
stderr, and scan only the read_paths entries that exist. Any other failure prints no JSON:
report the error rather than guessing paths.
- Gather candidates (prefer the most synthesized layer first):
- Theses with frontmatter
confidence: solid(thenevolving) under anywiki/theses/directory inread_paths. Read the YAMLconfidence:field — do NOT grep for inline[solid]markers; wiki pages encode confidence in frontmatter, not the body. - High-severity solution files (
severity: criticalorseverity: high) and anycritical-patterns.mdinread_paths. Skip anything under_archive/: garden retired it. -
Use
Grepfor keywords; whenvault_rootis set, use thevault-recommenderMCP for topic clusters keyword search would miss. Seereferences/promote-workflow.mdfor the two confidence conventions and full candidate heuristics. -
Identify the target. Use
CLAUDE.mdat the project root if present, elseAGENTS.md. -
Propose, do not apply yet. For each candidate draft a concrete, minimal, evergreen edit to the target (one pattern; no temporal phrasing like "recently" or "now we"). Show the proposed diff and get confirmation. Never edit wiki files here — promote reads theses; only
wiki-ingestwrites the wiki. -
Apply confirmed edits with
Edit. The propose-before-apply gate above is for the living context (CLAUDE.md/AGENTS.md). Elevating a broadly-useful pattern into{write_path}/critical-patterns.mdis lower-trust and may be applied directly, then reported — seereferences/promote-workflow.md. -
Verify each promotion: ask "would the system catch this automatically next session now that it lives in the always-loaded context?" If not, refine the edit.
See references/promote-workflow.md for candidate heuristics, the propose-then-apply protocol,
and the verification checklist.
Garden
-
Resolve the corpus with the same resolver as promote. Garden tends
write_pathonly; it never edits otherread_pathsentries (the wiki belongs towiki-ingest). If the resolver exits 1 there is nothing to garden: pass on its fix and stop. -
Find candidates from frontmatter alone: duplicates (shared
componentwith overlappingsymptomsortags), rot (a path, command, or tool the project no longer has, checked withGrep/Glob, not guessed), contradictions (two fixes for one symptom), and retirements. Skipcritical-patterns.mdand anything under_archive/. -
Sort each candidate into exactly one verdict: keep, update (fix the stale detail in place), merge (fold duplicates into the strongest file), replace (archive a file a newer one supersedes), or archive (the lesson no longer applies).
-
Propose, do not apply yet. Show one table of file, verdict, and the evidence for it, and get confirmation.
-
Apply confirmed verdicts. Never delete: archiving moves a file to
{write_path}/_archive/<category>/, which retrieval skips. Then repair the corpus: repoint or droprelated_solutionslinks (they stay bidirectional), repointcritical-patterns.mdcitations, and update the registry count. -
Verify that a retrieval-style frontmatter
Grepfor each merged lesson's symptoms, with_archive/hits dropped as retrieval drops them, lands on the survivor alone, and report the counts before and after.
See references/garden-workflow.md for the verdict table, candidate heuristics, and the
consistency rules.
Additional Resources
scripts/resolve_paths.py— resolveswrite_path,read_paths,vault_rootfrom config.references/promote-workflow.md— detailed promotion procedure.references/garden-workflow.md— detailed garden procedure.