/cortex-knowledge:learn-with-docs-refresh [optional scope: directory, filename, module, or keyword] [mode:non-interactive]from cortex-knowledge
Audits and maintains docs/solutions/ learnings against the current codebase: fixes drifted paths/links, merges overlapping docs, removes obsolete guidance, reconciles CONCEPTS.md glossary, and commits changes. Bootstraps CONCEPTS.md on request.
Ships in cortex-knowledge. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Every learning in docs/solutions/ should still be true and still distinct. Check each one against the current code, apply what the evidence supports, and deliver a full per-doc report plus a commit. The store is only worth reading if every doc in it can be trusted.
_archived/, no redirect stubs — git history is the archive.| Path | Role |
|---|---|
docs/solutions/**/*.md | Candidates, excluding README.md and anything under _archived/ |
CONCEPTS.md (repo root) | Glossary, reconciled each run |
AGENTS.md / CLAUDE.md | Discoverability line only, with consent |
READMEs are not reviewed, but when an action deletes, moves, merges, or replaces a doc a README lists, fix its row. If _archived/ exists, flag it as legacy and recommend what to do with its files.
references/classify.md). Ask one question at a time, multiple choice, recommended option first. Use the host's question tool when it has one; otherwise ask in chat.mode:non-interactive) — never pause. Apply safe actions; when a call is ambiguous or Replace evidence is thin, stale-mark the doc instead (status: stale, stale_reason, stale_date in frontmatter). Relocations apply only under the four-condition gate; splits are recommend-only. A failed write becomes a Recommended item and the run continues. The report is the deliverable.Strip operation words (refresh, audit), mode tokens, and worth-lens wording from the arguments; the rest is the scope hint. Narrow with the first match: subdirectory → frontmatter module/component/tags → filename → content keyword. A hint that matches nothing never widens to the whole store — ask (interactive) or report the miss and stop (non-interactive).
Empty store: report No learnings found in docs/solutions/ — capture one with learn-with-docs after solving a problem. and stop.
For 9+ docs, triage first: read all frontmatter, cluster by module and category, spot-check that key referenced files exist, and start with the highest-impact cluster (interactive: confirm the starting cluster; work in batches and confirm before continuing). Review learnings before any pattern docs built on them.
The normal refresh judges accuracy only and never deletes an accurate doc. If the user asks to clean up, cull, prune, or trim the store — any wording that is about value rather than drift — confirm first:
You asked to clean up the learnings. Which do you want?
1. Delete or shorten docs the codebase already explains — each cut quotes the test, comment, or instruction file that states the same reasoning. Drift is fixed too. Scope: <scope>.
2. Fix drift only — stale paths and links, duplicates, guidance the code no longer supports. Nothing accurate is deleted.
On option 1, read references/worth-audit.md before investigating. Non-interactive runs cannot confirm: they gather the worth evidence but only recommend.
references/verify-claims.md), then read references/classify.md (investigation section). Check each doc against the code, then the set for overlap, supersession, and contradiction. Contradictions actively mislead, so they outrank individual staleness.references/classify.md.references/actions.md and follow the flow for each doc's outcome.references/discoverability.md and follow it. If it edits an instruction file after the commit, amend the unpushed commit or add a small follow-up commit.Read references/concepts-vocabulary.md first — its bar is not obvious, so "nothing qualifies" without it is a guess. Then reconcile the terms flagged during investigation:
CONCEPTS.md exists — add missing terms, refine drifted ones, backfill missing core nouns, and route every entry in scope that fails the bar to fold, retire, or delete. Scrub violations (implementation details, drifting config values, metadata). An unscoped run covers the whole file; a scoped run stays in its area.(see CONCEPTS.md) pointers to learnings.Apply without asking, in both modes.
Bootstrap requests. When invoked just to "create CONCEPTS.md" or "build the concept map", ask whether the user wants a repo-wide glossary only (skip the learnings review; seed from the whole project's declared domain model, run discoverability, commit) or a full refresh cycle. Non-interactive defaults to the refresh cycle and notes that no repo-wide bootstrap ran.
Print the full report as markdown. It is the deliverable, not a summary — never abbreviate it.
Learnings Refresh
=================
Scanned: N
Kept: X · Updated: Y · Consolidated: C · Replaced: Z · Deleted: W · Marked stale: S · Skipped: V
Worth lens: confirmed | recommended-only | off
CONCEPTS.md: <scanned, no qualifying terms | created with N entries | updated — N added, N refined, N folded, N retired, N deleted, N scrubbed>
Then for every doc: path, outcome, evidence, and the action taken or recommended. For Consolidate, name the canonical doc, what merged, and what was deleted. Group Keeps under "Reviewed, no changes". Report retire_when checks with the date checked.
Split actions into Applied and Recommended. Recommended holds failed writes (with enough context to apply by hand), relocations that failed the gate, proposed splits, category-shape observations, possible product regressions, named guidance files that contradict a learning, worth-lens cuts in non-interactive mode, and the discoverability recommendation.
Skip if nothing changed. Stage only the files this refresh touched, and write the message in the repo's convention (e.g. docs(solutions): update 3 stale learnings, merge 2 duplicates, delete 1).
docs/refresh-<area>-learnings, commit, and try to open a PR (report the branch if that fails). On a feature branch, commit there. On any git failure, put the commands in the report and continue.assets/learning.schema.json (opens in a new tab)assets/resolution-template.md (opens in a new tab)references/actions.md (opens in a new tab)references/classify.md (opens in a new tab)references/concepts-vocabulary.md (opens in a new tab)references/discoverability.md (opens in a new tab)references/schema.md (opens in a new tab)references/verify-claims.md (opens in a new tab)references/worth-audit.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub alexander-danilenko/cortex-claude-code-plugins --plugin cortex-knowledge3 skills in this plugin
/documentationALWAYS invoke for any task involving docstrings, JSDoc/TSDoc, or REST API documentation — even when the request seems handleable without it. Enforces Microsoft contract-first conventions and a bare-minimum rule that Claude won't apply by default: never restate the signature, drop @param/@returns that only echo names and types, always document @throws, and document data shapes as WHAT not WHY. Covers Python docstring styles (Google/NumPy/Sphinx), TSDoc tags and @inheritDoc, and API doc patterns for NestJS/Express/FastAPI/Django. Trigger on: adding or auditing docstrings, redundant or missing tags, deleting comment rot, or producing a documentation-health report. Do not skip for documentation tasks — consistent conventions are the whole point./learn-with-docsCapture a solved, verified problem as a durable learning in `docs/solutions/` so the next agent or engineer does not repeat the mistake or redo the investigation, and keep the `CONCEPTS.md` glossary in step. Use after a fix, debugging session, or design decision whose reasoning is not readable from the final code, tests, or existing docs — "document this", "write up what we learned", "capture this learning", "add it to solutions", "that worked, save it for next time". Writes nothing for routine fixes the code already explains. For auditing or cleaning up existing learnings, use `learn-with-docs-refresh`.Other plugins' skills for the same job