diff --git a/SKILL.md b/SKILL.md index f2c1a0e..ad842f0 100644 --- a/SKILL.md +++ b/SKILL.md @@ -242,13 +242,39 @@ Output: `-patterns` or `-patterns` repo. codebase?" Filter everything through: "If I were writing new code in this language/ecosystem, what rules does this source teach me?" -**`patterns/.md`** — one file per topic area: -- Error handling patterns +**This is iterative, not one-shot.** Keep extracting until you've +identified ALL patterns the source demonstrates. A first pass finds +the obvious ones. Second pass greps for variations and edge cases. +Third pass finds the patterns that break. You're done when scanning +the source no longer reveals new rules. + +**Process:** +1. **Discovery pass** — scan the source by topic area, identify every + distinct pattern (aim for 15-30+ per topic in a large codebase) +2. **Deepening pass** — for each pattern, grep for 5-10 real usages + across the codebase. Note variations. Find the best example. +3. **Edge case pass** — find where each pattern DOESN'T apply. + Grep for violations — are they bugs, or legitimate exceptions? +4. **Cross-reference pass** — which patterns interact? Which ones + conflict? Document the decision framework for choosing between + competing patterns. + +Repeat until scanning the source yields no new patterns. A language +stdlib should produce 50-200+ patterns across all topics. + +**Output structure — one file per topic:** + +`patterns/.md` — topics include: +- Error handling - Naming conventions - Concurrency patterns - Testing patterns - Interface/protocol design - Module organization +- Documentation conventions +- Performance idioms +- Configuration patterns +- Extension/plugin patterns Each pattern entry: - Name (short, linkable heading) @@ -270,6 +296,10 @@ Each pattern entry: structure, TODO culture, and project history unless they directly inform HOW to write code. Focus on patterns a user should copy. +**Done criteria:** You've scanned every major directory in the source. +No new patterns emerge from further grep/read. Each topic file has +15+ patterns with real examples. Edge cases are documented. + --- End all output files with `` sentinel.