From claude-resources
Synthesizes cross-cutting patterns from accumulated retro-notes lessons files, producing a top-of-file recurring-patterns section so planning agents read wisdom first instead of every dated entry. Refactors when entries partially supersede earlier claims.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-resources:retro-notes-refactorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Synthesize cross-cutting wisdom across the dated entries in an `l-lessons-*` skill so future planning agents can read patterns first and drill into history second.
Synthesize cross-cutting wisdom across the dated entries in an l-lessons-* skill so future planning agents can read patterns first and drill into history second.
The retro-notes skill writes one dated entry per dev session. Over time multiple entries on the same problem area accumulate, and later entries often extend or partially supersede earlier ones (e.g. R6's "structural fix subsumes R3/R5" claim was itself widened by R7's "the bug class survives at a different layer"). Future readers — primarily future /big-plan runs and other LLM planning agents — should not have to read every dated entry to find the relevant pattern.
Run this skill when ANY of these hold:
/retro-notes session just landed and the new entry's claims widen, narrow, or contradict a claim in an earlier entry on the same area.Skip when:
A refactored lessons file has this structure (top to bottom):
---
name: l-lessons-{area}
description: {...includes pattern keywords AND a hint that file starts with a synthesized section...}
last-updated: YYYY-MM-DD
---
# {Area} Lessons
{1-2 sentence intro}
---
## Recurring patterns (synthesized YYYY-MM-DD, post-{latest entry tag})
{1-paragraph note: "Read this first. Dated entries below are the chronological record."}
### P1 — {short pattern name}
**Trigger.** {Observable conditions that mean this pattern applies.}
**Action.** {Remedial action with concrete tool calls / methodology refs.}
**See.** {Dated entries this derives from, with short descriptors.}
### P2 — ...
...
---
## Quick decision rules ← include only when 5+ patterns
When in doubt, apply these in order:
1. **{condition}?** → P{n} ({short reminder}).
2. ...
---
## YYYY-MM-DD — {original first dated entry title} ← unchanged
{...original entry body, possibly with a "Caveat (added YYYY-MM-DD by R{n} closeout)" section at end...}
## YYYY-MM-DD — {second dated entry title} ← unchanged
...
## YYYY-MM-DD R{latest} — {latest entry title} ← unchanged
Dated entries are NEVER deleted. They may receive a ### Caveat (added YYYY-MM-DD by R{n} closeout) appendix when a later entry widened or narrowed their claim.
Lessons files live at <repo>/.claude/skills/l-lessons-{area}/SKILL.md (project scope) or $HOME/.claude/skills/l-lessons-{area}/SKILL.md (personal scope).
Read the whole file. If it's >25 000 tokens, read in chunks via the Read tool's offset + limit — but read every byte. Pattern synthesis requires complete coverage.
While reading, capture three lists:
Before writing, confirm:
/retro-notes session is mid-write risks merge conflict. If a retro was just written, wait for that file change to settle (usually fine immediately after; just confirm git status shows the file's recent change is committed or that you'll write on top of it).{file} now? It has {N} entries; I see {threads} as patterns." Don't ask permission for every detail — just the go/no-go.For each cross-cutting thread, draft a pattern with this template:
### P{n} — {short pattern name, ≤8 words}
**Trigger.** {1-3 sentences. Use concrete observable conditions: file paths, test outcomes, symptom phrases. Avoid hand-wave like "when something feels off".}
**Action.** {1-3 sentences. Include specific tool calls or methodology refs: "/headless-browser subagent", "ctx.getImageData pixel histogram", "dispatch a 1-hour Node prototype with inlined production math". Avoid vague "investigate carefully".}
**See.** {Comma-separated list of dated-entry refs with 3-6 word descriptors: "R3 (probe-feasibility spike); R4 (probe-surface vs paint-surface); R7 (resize-cycle pixel histogram)."}
Rules of thumb for the pattern list:
If you end up with 5+ patterns, also draft a "Quick decision rules" section: a numbered list of 5-8 triggers, each pointing at one pattern by number. The triggers are short — they're the index, not the explanation.
For each superseded claim identified in Step 1, draft a Caveat block to append at the END of the relevant dated entry (after its existing "Would-skip-if-redoing" or last sub-section):
### Caveat (added YYYY-MM-DD by R{n} closeout)
{1-3 sentences. State which claim of this entry was widened/narrowed, why, and point the reader at the pattern OR the dated entry that subsumes / extends it. Concrete language: "R6's claim '...' was correct for X but R7 surfaced Y at a different layer."}
Caveats are surgical. Don't rewrite the entry. Don't delete the original "Watch for next time" bullets. The Caveat is appended; the historical claim stays.
The frontmatter is what /big-plan and other planning agents see first. After refactoring, the description should:
last-updated: YYYY-MM-DD if the field exists. If it doesn't exist, don't add it — that's the existing skill's convention to respect.Order of edits:
old_string = the H1 intro's last line + immediate --- + first dated entry's ## header; new_string = same + the new patterns section + --- + first dated entry's ## header.old_string = the last line of the entry's "Would-skip-if-redoing" (or last sub-section).description: line with the updated version.Verify after each edit that the file still parses (head -5 SKILL.md shows valid YAML).
pnpm dlx @takazudo/mdx-formatter --write <path-to-SKILL.md>
This normalises bullet indentation, code-fence language tags, and trailing whitespace. Skips on network failure — proceed without if the formatter fails, the file is still valid markdown.
Spot-check:
wc -l SKILL.md — note the new line count. Patterns section typically adds 100-200 lines; that's normal.grep -E "^##|^### P" SKILL.md — should show patterns first, then dated entries in chronological order.head -1 SKILL.md — should still be --- (frontmatter intact).One short message:
git diff --stat)./big-plan runs touching {area} will now load the synthesized patterns first."Do NOT commit automatically. Per project git policy, commits happen only when the user asks. The file change is left staged-but-uncommitted (or unstaged) so the user can run /commits themselves.
name: field is the skill's identity and is referenced by /big-plan and other readers./retro-notes's job. Removing them is never anyone's job.references/ split unless the file exceeds ~800 lines after refactoring. A split adds discovery overhead for future readers. If the file is 600-700 lines after refactoring, keep it as one file.This skill was authored after refactoring l-lessons-ui-verification post-R7 (composerOutputSize ↔ fitDim storage-model divergence). The refactor added 12 patterns (P1-P12) and one Caveat (to R6, noting that R7 widened "asymmetric X is subsumed" to "asymmetric X moved up a layer"). File grew from 557 lines to 685 — within budget. Future /big-plan runs touching packages/pattern-gen-viewer now load the patterns first instead of scanning 10 dated entries.
That refactor is the canonical reference shape. If unsure how the output should look, read .claude/skills/l-lessons-ui-verification/SKILL.md in any pgen worktree.
npx claudepluginhub takazudo/claude-resources --plugin claude-resourcesLogs errors, user corrections, missing features, API failures, knowledge gaps, and best practices to .learnings/ markdown files. Promotes key insights to CLAUDE.md and AGENTS.md for AI agent self-improvement.
Captures structured postmortems from dev sessions into project-scoped lessons files that future planning runs can read to avoid repeating mistakes.
Distills patterns from Claude Code work history, git logs, lessons, and memory to suggest new agents/skills, review roster quality, prune redundancies, or consolidate feedback into rules.