/cortex-knowledge:learn-with-docs [optional context] [mode:non-interactive] [depth:lightweight]from cortex-knowledge
Captures solved problems as durable learnings in docs/solutions/ and keeps CONCEPTS.md glossary in sync. Use after a fix or debugging session whose reasoning isn't readable from code alone.
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.
Turn one solved problem into one learning under docs/solutions/, checked against the current tree and findable by the next agent.
Write a learning only when it holds reasoning a future engineer could not recover from the final code, tests, types, comments, or existing docs — and losing it would plausibly cause the mistake to recur, real risk, or a substantial re-investigation. Test it with a counterfactual: if this doc vanished, would someone reading the final implementation still likely repeat the mistake or redo the digging? Effort spent and diff size do not count.
The problem must also be solved and verified. If either test fails, write nothing and say why. Judge from the session; do not ask. An explicit invocation asks for the judgment now — it does not lower the bar.
An existing learning that became wrong or incomplete qualifies: update it instead of adding a duplicate.
One learning per run. Overlap detection and claim checks assume a single problem; batching several into one run leaks drafting labels ("Learning 3") into the docs. For several learnings, run the skill several times.
| Path | Holds |
|---|---|
docs/solutions/<category>/ | One learning per file, kebab-case slug, no date in name |
CONCEPTS.md (repo root) | Project glossary — see references/concepts-vocabulary.md |
AGENTS.md / CLAUDE.md | Edited only to make the store discoverable, with consent |
These are the only files this skill writes. Edits to other learnings belong to learn-with-docs-refresh.
mode:non-interactive or an unmistakable "run unattended / without questions". Asks nothing, never edits instruction files, and ends on Documentation complete or Documentation skipped — <reason> so a calling workflow can parse it.depth:lightweight is passed. Strip mode: and depth: tokens before reading the rest as context.Do this in the main context — only it holds the conversation.
references/schema.md. Sample the frontmatter and directory names already under docs/solutions/; the corpus vocabulary wins over the defaults.component, root_cause, and a slug filename.assets/resolution-template.md. The failed attempts and the reasoning behind the fix are the point — a later reader cannot get them from the diff.file:line; soften anything you cannot verify ("per this session's conclusion…"). Cite PR numbers, not commit SHAs (rebases rewrite them). Phrase unmerged fixes as pending.CONCEPTS.md exists, use its terms.Dispatch one read-only subagent so its corpus reading stays out of your context. Give it a few lines on the problem (what broke, module and file names, error text, the fix) — it cannot see this conversation. Ask it to:
docs/solutions/ for related learnings: grep frontmatter (title, tags, module, component) first, read only strong candidates in full.gh issue list --search "<keywords>" --state all --limit 5 when gh is available.| Overlap | Action |
|---|---|
| High | Update the existing doc in place: keep its path, title, and frontmatter shape; add last_updated: YYYY-MM-DD. |
| Moderate | Write a new doc; flag the pair for the refresh check (step 6). |
| Low/none | Write a new doc. |
Two docs on the same problem drift apart, so fold fresher context into the existing one rather than adding a second.
Write to docs/solutions/<category>/<slug>.md, creating the directory if needed.
Read references/concepts-vocabulary.md first — its bar is not obvious, and qualifying terms often sit in the conversation, not the doc. Then scan both.
CONCEPTS.md exists — add, refine, fold, or scrub entries. Retiring and deleting belong to the refresh skill.Verify any behavior an entry asserts against source before writing it. Apply edits without asking.
Read references/verify-claims.md and check the written doc and any glossary entries you touched against the code — reading the source, and git blame / git log / commit messages where the code alone does not explain it. Fix or soften what does not hold.
Decide whether the new learning makes older docs stale. Recommend or run learn-with-docs-refresh with the narrowest scope (a file, module, or category) only when: a related doc now contradicts the new fix, the new fix supersedes one, a rename/migration/upgrade likely broke references, or overlap was moderate. Skip it when nothing related was found or related docs still agree.
Read references/discoverability.md and follow it. It checks that AGENTS.md / CLAUDE.md point agents at docs/solutions/ (and CONCEPTS.md), and proposes the smallest addition when they do not.
End with the report; do not offer a follow-up menu.
✓ Documentation complete (or: ✓ Documentation updated — high overlap with <path>)
File: docs/solutions/<category>/<slug>.md (created | updated)
Track: bug | knowledge — category <category>, component <value> (corpus | default)
Related: <N docs linked, overlap low | moderate — <path> | high>
Verified: <N claims checked; N fixed, N softened, N unverified>
CONCEPTS.md: <scanned, no qualifying terms | created with N entries | updated — N added, N refined, N folded, N scrubbed>
Instruction file: <no gap | edited <file> | gap — proposed text below>
Refresh: <none | learn-with-docs-refresh <scope>>
"Scanned, no qualifying terms" is correct only when CONCEPTS.md is byte-for-byte unchanged. Non-interactive runs end with a last line of Documentation complete, or emit ✗ Documentation skipped with a reason and end with Documentation skipped.
One pass in the main context, no subagents:
CONCEPTS.md; never create one.(lightweight) in the header and a note that a Full run adds overlap detection and a full claim check.What SKILL.md sets; muted values are Claude Code's defaults
3 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-docs-refreshAudit and maintain the learnings in `docs/solutions/` against the current codebase — fix drifted paths and links, merge overlapping docs, replace guidance the code no longer supports, delete obsolete docs, reconcile the `CONCEPTS.md` glossary, then report and commit. Also bootstraps `CONCEPTS.md` on request and, when asked, culls docs whose reasoning the code already explains. Use for "refresh the learnings", "audit docs/solutions", "are our solution docs still accurate", "clean up / prune the learnings", "create a CONCEPTS.md", or after a refactor, rename, migration, or dependency upgrade that likely invalidated documented solutions. Not for capturing a new learning — use `learn-with-docs`.npx claudepluginhub alexander-danilenko/cortex-claude-code-plugins --plugin cortex-knowledgeOther plugins' skills for the same job