skills/cm-extract-learnings/SKILL.md
Use when the user says: "extract learnings", "save this for next time", "remember this pattern", "consolidate memories", "dream", "clean up memories".
npx skillsauth add NodeJSmith/Claudefiles cm-extract-learningsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Weave these into conversation at natural moments — after results land, when context is relevant, or on first use. One or two per run, not all at once.
| Layer | File | Loaded | Purpose |
|-------|------|--------|---------|
| 0 | ~/.claude/CLAUDE.md | Every session, all projects | Universal behavioral preferences |
| 1 | <repo>/CLAUDE.md | Every session, this project | Architecture, conventions, gotchas |
| 2 | memory/MEMORY.md (project dir) | Every session, agent-managed | Evolving notes, working knowledge |
| 3 | memory/*.md topic files | On-demand | Detailed reference too long for L2 |
| Meta | Suggest new skill/command | N/A | Repeatable workflow → automation |
Placement decision: project-independent preference → L0, project-specific technical → L1, concise working note → L2, detailed reference → L3, repeatable pattern → Meta.
If the user said "remember X" with explicit content already in context — and the request is NOT a consolidation trigger ("consolidate", "dream", "extract learnings", "clean up memories", or triggered from the consolidation nudge):
~):
Bash: find $HOME/.claude/projects -name MEMORY.md -path "*<repo-dir-name>*" 2>/dev/null | head -1
The result is the full path to MEMORY.md (a file). Run a second Bash call — dirname <find-result> — to print the memory directory path. Use that printed path in subsequent steps.
If no result, construct the project key by replacing / with - in the current working directory path (e.g., /home/user/myrepo → -home-user-myrepo), then use $HOME/.claude/projects/<project-key>/memory/MEMORY.md.
# Project Memory header. Note that the Memory Auditor has nothing to audit — in Phase 2, spawn only the Signal Discoverer.Steps 2-4 are required and run as parallel tool calls.
Glob memory/*.md from resolved path)~/.claude/CLAUDE.md + <repo>/CLAUDE.md) — required for dedup quality; skipping means proposals may duplicate L0/L1 contentgit log --oneline -20Launch both agent calls in a single message so they run in parallel. Use the Agent tool with:
Memory Auditor: subagent_type: "cm-memory-auditor". In the prompt, include the context snapshot from Phase 1 — memory file contents, git log output, and verification targets list.
Signal Discoverer: subagent_type: "cm-signal-discoverer". In the prompt, include existing memory summaries (for dedup) and the project name.
If Phase 1 noted MEMORY.md was just created (no existing memories), skip the Memory Auditor and spawn only the Signal Discoverer.
Both agents require maxTurns ≥ 30 — verify agent frontmatter at agents/cm-memory-auditor.md and agents/cm-signal-discoverer.md. Agents with low maxTurns exit early and return truncated output that appears non-empty but contains no findings.
Phase 2 is complete when both agents return reports. If either returns empty or clearly truncated (one line, no structured findings), proceed with the other's results — but if the Signal Discoverer fails, also perform a manual fallback: query the 5 most recent session summaries directly from ~/.claude-memory/conversations.db using Bash(python3 -c "import sqlite3; ...") and apply the signal criteria from the Content Quality Rules section below.
### [ACTION] Learning: <summary>
**Target:** <file> → <section>
**Rationale:** <why this layer>
```diff
- <old line>
+ <new line>
~/.claude/CLAUDE.md, warn: "This modifies global instructions loaded in every session across all projects. Confirm?"Apply approved edits. Output summary table:
| Learning | Action | Target | Status |
|----------|--------|--------|--------|
Only if Phase 2 agents ran (not an early-exit capture): write consolidation marker using Bash (Write tool requires prior Read and cannot create new files):
Bash: date -u +%Y-%m-%dT%H:%M:%SZ > <memory-dir>/.last-consolidation
Phase 4 is complete when all approved edits are applied and the summary table is presented.
Every candidate must pass: (1) agent would benefit from knowing this in future sessions, (2) condensed to minimum useful form, (3) placed at correct layer, (4) not already captured in target file, (5) stated as reusable principle not session-specific incident.
Pass: commands discovered through trial-and-error, non-obvious gotchas, architectural decisions with rationale, user behavioral corrections, configuration quirks, version milestones.
Fail: information readable from code, generic best practices, one-off bugs without pattern, verbose explanations, duplicates, temporary state, unverified speculation, incidents without generalizable principle.
development
Use when the user says: 'create an issue', 'file an issue', 'open an issue', 'write an issue', 'new issue for this'. Codebase-aware issue creation — investigates the code to produce well-structured issues with acceptance criteria, affected areas, and enough detail for automated triage.
development
Use when the user says: 'triage issues', 'classify issues by complexity', 'assess issue complexity', 'find quick wins', 'which issues are small', 'batch issue assessment'. Batch codebase-aware issue triage — parallel Haiku subagents assess actual complexity and effort by reading the code, not just titles.
development
Use when the user says: "review my changes", "run the reviewers", "code and integration review", "readability review", "maintainability review", "sniff test this", "WTF check", "code smells", "is this code any good", "fresh eyes on this branch", "review this directory", "check this module". Dispatches three parallel reviewers — code, integration, and a readability pass — and consolidates findings into one prioritized report.
development
Use when the user says: "clean code check", "style review", "LLM smell check", "code hygiene", "nitpick this", "style check", "find style sins", "nitpicker review", "anal retentive review", "exhaustive style review", "no-filter style report". Dispatches three parallel stylistic checkers — llm-checker (training-bias patterns), lazy-checker (deferred debt), and nitpicker (style hygiene) — and consolidates findings into a report organized by checker with a Summary section for orchestration consumption.