From c2f157c5dbd13ad459f4e866378312690f3d4ef3 Mon Sep 17 00:00:00 2001 From: Rodin Date: Thu, 30 Apr 2026 13:33:43 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20patterns=20mode=20is=20iterative=20?= =?UTF-8?q?=E2=80=94=20keep=20extracting=20until=20done?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Process: Discovery → Deepening → Edge cases → Cross-reference. Repeat until scanning yields no new patterns. Target: 50-200+ patterns for a language stdlib, 15+ per topic. --- SKILL.md | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) 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.