skills/retro-notes-refactor/SKILL.md
Refactor an accumulated `l-lessons-*` skill (created by /retro-notes) when later entries partially supersede or extend earlier ones, so future planning agents see the cross-cutting wisdom first instead of having to read every dated entry. Use when (1) the user says "lessons refactor", "retro refactor", "retro-notes refactor", "refactor lessons", or "synthesize lessons", (2) a `/retro-notes` session just added a new dated entry that broadens / narrows / contradicts a claim in an earlier entry on the same area, (3) an `l-lessons-*/SKILL.md` has 5+ dated entries on the same problem area OR exceeds ~500 lines, (4) the next `/big-plan` run in that area would have to scan many entries to find the relevant pattern. Produces a top-of-file "Recurring patterns (synthesized)" section in Trigger/Action/See format, adds Caveat notes to entries whose claims were later widened, updates the frontmatter description with pattern keywords, and formats with mdx-formatter. Does NOT delete historical entries — they remain as terse drill-down postmortems. Pair with /retro-notes (which writes new entries) and /big-plan (which reads the synthesized section first).
npx skillsauth add takazudo/claude-resources retro-notes-refactorInstall 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.
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.
development
Link Claude Code skill names mentioned in a CodeGrid article (data/{series}/{n}.md) to the author's public claude-resources repo, pinned to the latest commit hash so links don't rot. Use when: (1) user says 'linkify cc resources', 'link the skills', 'link skill names', or invokes /dev-linkify-cc-resources; (2) editing a CodeGrid article that mentions `/commits`, `/pr-complete`, `/skill-creator` or other Claude Code skills and they should point to claude-resources. Only links skills that actually exist in the public repo; skips hypothetical examples and code blocks.
development
Second opinion from Claude Opus on a plan or approach. Use when: (1) Planning phase of /big-plan needs a higher-quality review than /codex-2nd / /gco-2nd / /gcoc-2nd, (2) User says 'opus 2nd' or 'opus opinion', (3) Wanting Anthropic's larger model to critique a plan. Spawns a general-purpose Agent with model: opus that reads the plan file and returns structured feedback. Anthropic quota — not free.
tools
AI-based testing via subagent + a per-task test-flow skill. Use when the user wants to verify something that mechanical assertions can't fully capture — image recognition, visual size/position comparison, animation smoothness, multi-step manual flows that need AI judgment. Triggers: 'AI-based test', 'AI test', 'visual verify', 'image recognition test', 'manual operation test', 'human-eye check', 'verify visually', 'compare screenshots', 'looks the same', 'looks correct'. The skill's job is to (1) author a focused test-flow skill that captures the exact procedure + verdict criteria, then (2) dispatch a verification subagent via the Agent tool that loads BOTH the test-flow skill AND a browser-driving skill (/verify-ui primary, /headless-browser fallback) so the subagent has clear context and consistent verdicts. NEVER uses `claude -p` — subagent dispatch goes through the Agent tool exclusively.
development
End-of-workflow audit of touched GitHub issues, PRs, and branches via a Sonnet subagent. Use when: (1) /big-plan, /x-as-pr, or /x-wt-teams finishes its main work and needs to verify every touched resource is in the right state (closed when done, kept when ongoing, deleted when dead), (2) User says 'cleanup resources', 'audit cleanup', or 'check what should be closed', (3) A long workflow ends and the manager wants a structured paper trail of what it closed/kept/deleted. Auto-execute by default — the Sonnet agent proposes, the manager (you) executes safe actions and prints a final report.