From Compound Knowledge
Periodic maintenance pass over docs/solutions/. For each doc, classify as Keep / Update / Consolidate / Replace / Delete based on staleness, referenced-code existence, and overlap with newer learnings. Run monthly or after a major refactor. Modes - interactive, autofix, report-only. Triggers: compound refresh, clean up solutions docs, docs/solutions maintenance, solution doc audit.
How this skill is triggered — by the user, by Claude, or both
Slash command
/compound-knowledge:compound-refreshThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
`/compound` writes new learnings; `/compound-refresh` reviews existing ones. Over time, solution docs go stale:
/compound writes new learnings; /compound-refresh reviews existing ones. Over time, solution docs go stale:
This skill walks docs/solutions/**/*.md in the current repo and classifies each doc into one of five outcomes, then applies (or reports) the classification.
Run /compound-refresh:
learnings-researcherDo NOT run during active feature work - the autofix mode will create a large diff that muddies the signal of the feature branch.
Parse $ARGUMENTS for a mode token:
mode:interactive (default) - Classify, then ask per-doc before applying any changemode:autofix - Apply Keep, Update, and Delete automatically; ask for Consolidate and Replacemode:report-only - Strictly read-only; print the classification table and exitWhen composed from other skills (e.g., called from a repo-wide /audit), prefer mode:report-only so the caller decides.
Use the native file-search tool (e.g., Glob) to list every docs/solutions/**/*.md in the current repo. Skip docs/solutions/README.md.
For each doc, read the frontmatter and the body. Record:
title, date, problem_type, category, tags, files, related, severity)git log -1 --format=%ct {path} for the last change time)Skip any doc with invalid frontmatter - surface it at the end as a validation failure for the user to fix before re-running.
For each doc, run two probes in parallel across docs (one per file at a time per doc):
For each path in frontmatter files:
git log --follow -- {path} finds the new locationRecord:
files_missing: count of files no longer presentfiles_moved: count of files that movedidentifiers_missing: count of named symbols in the body no longer present in the codeCompute age in days from the frontmatter date. Combine with severity:
| Severity | Stale after |
|---|---|
| P0 | 180 days |
| P1 | 270 days |
| P2 | 365 days |
| P3 | 540 days |
Rationale: higher severity issues are more likely to have been patched at the root by follow-up work; lower severity evergreen-knowledge docs age slower.
Record:
age_daysis_aged: true if age_days > threshold for that severityFor each doc, output one of five outcomes:
Criteria (all must hold):
files_missing == 0identifiers_missing == 0related: [this-path] and a later date)is_aged is false OR the doc is problem_type: knowledge and still accurateAction: none.
Criteria (any one holds):
files_moved > 0 and files_missing == 0 (paths need rewriting but the substance is intact)is_aged is true but the substance still applies (re-date, optionally freshen language)Action: rewrite paths, bump date, refresh stale wording. Preserve the substance.
Criteria:
Action: Merge content, pick the best slug, set the merged doc's related: [] to the other paths (now deleted), and git rm the obsolete files in the same commit.
Criteria:
files_missing > 0 AND a newer doc already exists that correctly captures the current statesolution is now wrong (contradicted by the current codebase) but the problem described is real and has a better documented fix elsewhereAction: Delete this doc. If the replacement doc does not reference it, add a related entry to the replacement pointing at the deleted slug in case of link collisions.
Criteria (any one holds):
files_missing counts the majority of files in frontmatter (the doc is about code that no longer exists)root_cause and no additional contentAction: git rm the file. If other docs reference it in their related list, remove those references in the same commit.
For each doc classified as anything other than Keep:
Apply | Skip | Show DetailsShow Details, print the full doc and any supersession candidatesApply, execute the action; on Skip, move to the next docApply Keep, Update, and Delete without prompting. For Consolidate and Replace, batch the pending items at the end and ask once per category.
Write a run artifact at docs/solutions/.refresh/{YYYYMMDD-HHMM}.md summarizing:
Print the classification table, one row per doc:
Path Outcome Reason
docs/solutions/build-errors/vite-preflight.md Keep -
docs/solutions/build-errors/old-webpack-quirk.md Delete All referenced files missing
docs/solutions/data-migrations/reserved-words.md Keep -
docs/solutions/testing/flaky-auth.md Consolidate 3-tag overlap with flaky-session-expiry
Do NOT write anything, including the run artifact.
In autofix and interactive modes, stage only the touched docs/solutions/** files and the run artifact. Commit with:
compound-refresh: {kept} kept, {updated} updated, {consolidated} consolidated, {replaced} replaced, {deleted} deleted
Do not mix refresh changes with code or config changes. If the working tree has unrelated staged changes, prompt the user to commit or stash (commit - see git-workflow rules about never stashing) before running.
Update and re-date. A doc that was useful once may be useful again; deletion is destructive.Ported from EveryInc/compound-engineering-plugin's ce-compound-refresh. Kept: the 5-outcome classification, the age/severity table, the staleness probes. Adapted: mode names now match CCGM skill-authoring conventions (see modules/skill-authoring/rules/skill-authoring.md).
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Applies a firm's KYC/AML rules grid to parsed onboarding records: assigns risk rating, checks required documents, outputs rule outcomes with citations, and routes for escalation.
Generates daily or weekly digests of activity from connected sources (chat, email, docs, tasks, CRM), highlighting action items, decisions, mentions, and project updates.
npx claudepluginhub lucasmccomb/ccgm --plugin compound-knowledge