devflow-kit 3.11.0 → 3.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/dist/agents/architect.md +91 -0
  3. package/dist/agents/code.md +21 -25
  4. package/dist/agents/debug.md +22 -50
  5. package/dist/agents/design.md +9 -43
  6. package/dist/agents/fix.md +15 -29
  7. package/dist/agents/git.md +19 -22
  8. package/dist/agents/harden.md +14 -19
  9. package/dist/agents/knowledge.md +11 -19
  10. package/dist/agents/refactor.md +9 -14
  11. package/dist/agents/research.md +11 -34
  12. package/dist/agents/review.md +22 -52
  13. package/dist/agents/skim.md +7 -17
  14. package/dist/agents/triage.md +7 -14
  15. package/dist/cli/commands/uninstall.js +1 -1
  16. package/dist/commands/bug-analysis.md +32 -63
  17. package/dist/commands/code-review.md +39 -88
  18. package/dist/commands/debug.md +32 -82
  19. package/dist/commands/dynamic-build.md +157 -211
  20. package/dist/commands/dynamic-plan.md +71 -93
  21. package/dist/commands/dynamic-profile.md +7 -155
  22. package/dist/commands/dynamic-tickets.md +65 -186
  23. package/dist/commands/explore.md +27 -70
  24. package/dist/commands/implement.md +101 -189
  25. package/dist/commands/plan.md +61 -108
  26. package/dist/commands/release.md +26 -92
  27. package/dist/commands/research.md +37 -106
  28. package/dist/commands/resolve.md +65 -129
  29. package/dist/commands/self-review.md +36 -100
  30. package/dist/compliance-off/agents/git.md +15 -18
  31. package/dist/compliance-off/agents/triage.md +7 -14
  32. package/dist/compliance-off/commands/bug-analysis.md +32 -63
  33. package/dist/compliance-off/commands/code-review.md +35 -83
  34. package/dist/compliance-off/commands/dynamic-build.md +151 -205
  35. package/dist/compliance-off/commands/dynamic-tickets.md +65 -186
  36. package/dist/compliance-off/commands/implement.md +97 -183
  37. package/dist/compliance-off/commands/plan.md +61 -108
  38. package/dist/compliance-off/commands/release.md +26 -91
  39. package/dist/compliance-off/commands/resolve.md +55 -129
  40. package/dist/compliance-off/skills/git/references/tracker/github/ensure-pr-ready.md +3 -3
  41. package/dist/compliance-off/skills/git/references/tracker/jira/ensure-pr-ready.md +3 -3
  42. package/dist/compliance-off/skills/git/references/tracker/linear/ensure-pr-ready.md +3 -3
  43. package/dist/core/plugins.js +3 -3
  44. package/dist/curation-compliance-off/agents/triage.md +7 -13
  45. package/dist/curation-compliance-off/commands/bug-analysis.md +22 -42
  46. package/dist/curation-compliance-off/commands/code-review.md +26 -63
  47. package/dist/curation-compliance-off/commands/dynamic-build.md +144 -194
  48. package/dist/curation-compliance-off/commands/dynamic-tickets.md +54 -173
  49. package/dist/curation-compliance-off/commands/implement.md +89 -164
  50. package/dist/curation-compliance-off/commands/plan.md +52 -87
  51. package/dist/curation-compliance-off/commands/release.md +18 -79
  52. package/dist/curation-compliance-off/commands/resolve.md +46 -109
  53. package/dist/curation-off/agents/architect.md +85 -0
  54. package/dist/curation-off/agents/code.md +20 -23
  55. package/dist/curation-off/agents/debug.md +20 -48
  56. package/dist/curation-off/agents/design.md +8 -41
  57. package/dist/curation-off/agents/fix.md +14 -27
  58. package/dist/curation-off/agents/harden.md +13 -18
  59. package/dist/curation-off/agents/knowledge.md +9 -17
  60. package/dist/curation-off/agents/refactor.md +8 -12
  61. package/dist/curation-off/agents/research.md +9 -32
  62. package/dist/curation-off/agents/review.md +11 -40
  63. package/dist/curation-off/agents/skim.md +7 -17
  64. package/dist/curation-off/agents/triage.md +7 -13
  65. package/dist/curation-off/commands/bug-analysis.md +22 -42
  66. package/dist/curation-off/commands/code-review.md +30 -68
  67. package/dist/curation-off/commands/debug.md +24 -63
  68. package/dist/curation-off/commands/dynamic-build.md +150 -200
  69. package/dist/curation-off/commands/dynamic-plan.md +60 -80
  70. package/dist/curation-off/commands/dynamic-tickets.md +54 -173
  71. package/dist/curation-off/commands/explore.md +18 -50
  72. package/dist/curation-off/commands/implement.md +93 -170
  73. package/dist/curation-off/commands/plan.md +52 -87
  74. package/dist/curation-off/commands/release.md +18 -80
  75. package/dist/curation-off/commands/research.md +26 -84
  76. package/dist/curation-off/commands/resolve.md +56 -109
  77. package/dist/curation-off/commands/self-review.md +27 -79
  78. package/dist/hud/components/version-badge.js +1 -1
  79. package/dist/skills/git/references/pr/update-pr-evidence.md +2 -1
  80. package/dist/skills/git/references/tracker/github/ensure-pr-ready.md +3 -3
  81. package/dist/skills/git/references/tracker/jira/ensure-pr-ready.md +3 -3
  82. package/dist/skills/git/references/tracker/linear/ensure-pr-ready.md +3 -3
  83. package/dist/targets/claude-code/curation-install.js +2 -2
  84. package/dist/variant-axes.json +5 -1
  85. package/package.json +1 -1
  86. package/src/assets/agents/_partials/_code.mds +3 -5
  87. package/src/assets/agents/_partials/_design.mds +86 -0
  88. package/src/assets/agents/architect.mds +45 -0
  89. package/src/assets/agents/code.mds +18 -20
  90. package/src/assets/agents/curate.md +26 -35
  91. package/src/assets/agents/debug.mds +22 -50
  92. package/src/assets/agents/design.mds +11 -114
  93. package/src/assets/agents/evaluate.md +6 -16
  94. package/src/assets/agents/explore.md +1 -2
  95. package/src/assets/agents/fix.mds +12 -24
  96. package/src/assets/agents/git.mds +20 -23
  97. package/src/assets/agents/harden.mds +14 -19
  98. package/src/assets/agents/knowledge.mds +10 -38
  99. package/src/assets/agents/polish.md +13 -39
  100. package/src/assets/agents/refactor.mds +6 -9
  101. package/src/assets/agents/research.mds +11 -34
  102. package/src/assets/agents/review.mds +12 -84
  103. package/src/assets/agents/skim.mds +7 -17
  104. package/src/assets/agents/synthesize.md +3 -21
  105. package/src/assets/agents/test.md +31 -32
  106. package/src/assets/agents/tracker.md +116 -229
  107. package/src/assets/agents/triage.mds +7 -26
  108. package/src/assets/agents/validate.md +1 -3
  109. package/src/assets/commands/_partials/_compliance.mds +2 -2
  110. package/src/assets/commands/_partials/_decisions.mds +17 -24
  111. package/src/assets/commands/_partials/_docs_root.mds +31 -10
  112. package/src/assets/commands/_partials/_engine.mds +36 -56
  113. package/src/assets/commands/_partials/_evidence_policy.mds +1 -1
  114. package/src/assets/commands/_partials/_factory.mds +10 -104
  115. package/src/assets/commands/_partials/_knowledge.mds +48 -52
  116. package/src/assets/commands/_partials/_plan_contract.mds +2 -2
  117. package/src/assets/commands/_partials/_preamble.mds +21 -21
  118. package/src/assets/commands/_partials/_publication.mds +3 -3
  119. package/src/assets/commands/_partials/_roster.mds +12 -13
  120. package/src/assets/commands/_partials/_settings.mds +6 -3
  121. package/src/assets/commands/_partials/_ticket_template.mds +3 -7
  122. package/src/assets/commands/_partials/_tracker.mds +10 -5
  123. package/src/assets/commands/_partials/_wave.mds +23 -32
  124. package/src/assets/commands/bug-analysis.mds +3 -7
  125. package/src/assets/commands/code-review.mds +12 -33
  126. package/src/assets/commands/debug.mds +5 -47
  127. package/src/assets/commands/dynamic-build.mds +48 -70
  128. package/src/assets/commands/dynamic-plan.mds +23 -42
  129. package/src/assets/commands/dynamic-profile.mds +7 -57
  130. package/src/assets/commands/dynamic-tickets.mds +9 -29
  131. package/src/assets/commands/explore.mds +5 -44
  132. package/src/assets/commands/implement.mds +77 -119
  133. package/src/assets/commands/plan.mds +27 -57
  134. package/src/assets/commands/release.mds +4 -62
  135. package/src/assets/commands/research.mds +9 -55
  136. package/src/assets/commands/resolve.mds +40 -87
  137. package/src/assets/commands/self-review.mds +5 -45
  138. package/src/assets/mds/git/_ops_pr.mds +1 -0
  139. package/src/assets/mds/git/_ops_steps.mds +4 -4
  140. package/src/assets/mds/git/_pr.mds +1 -1
  141. package/src/assets/rules/engineering.md +1 -1
  142. package/src/assets/rules/quality.md +2 -2
  143. package/src/assets/scripts/ci-wait.cjs +154 -19
  144. package/src/assets/scripts/hooks/assets/orchestrator-charter.md +3 -3
  145. package/src/assets/scripts/hooks/preamble +2 -3
  146. package/src/assets/scripts/pr-evidence.cjs +1 -0
  147. package/src/assets/scripts/resolve-evidence-policy.cjs +14 -13
  148. package/src/assets/scripts/resolve-root.cjs +190 -0
  149. package/src/assets/scripts/resolve-settings.cjs +14 -9
  150. package/src/assets/scripts/verify-evidence.cjs +551 -25
  151. package/src/assets/skills/accessibility/SKILL.md +28 -95
  152. package/src/assets/skills/agent-references/SKILL.md +2 -4
  153. package/src/assets/skills/agent-references/references/commands/implement-evidence-asks.md +1 -1
  154. package/src/assets/skills/agent-references/references/commands/implement-levels.md +4 -7
  155. package/src/assets/skills/agent-references/references/commands/implement-revalidate.md +1 -1
  156. package/src/assets/skills/agent-references/references/commands/plan-levels.md +2 -2
  157. package/src/assets/skills/apply-decisions/SKILL.md +5 -6
  158. package/src/assets/skills/apply-feature-knowledge/SKILL.md +3 -13
  159. package/src/assets/skills/architecture/SKILL.md +29 -105
  160. package/src/assets/skills/boundary-validation/SKILL.md +27 -78
  161. package/src/assets/skills/complexity/SKILL.md +8 -104
  162. package/src/assets/skills/compliance/SKILL.md +9 -67
  163. package/src/assets/skills/consistency/SKILL.md +7 -107
  164. package/src/assets/skills/database/SKILL.md +7 -72
  165. package/src/assets/skills/dependencies/SKILL.md +9 -109
  166. package/src/assets/skills/dependencies/references/detection.md +10 -0
  167. package/src/assets/skills/dependency-research/SKILL.md +9 -63
  168. package/src/assets/skills/design-review/SKILL.md +14 -37
  169. package/src/assets/skills/docs-framework/SKILL.md +4 -47
  170. package/src/assets/skills/documentation/SKILL.md +7 -71
  171. package/src/assets/skills/documentation/references/patterns.md +1 -1
  172. package/src/assets/skills/documentation/references/violations.md +1 -1
  173. package/src/assets/skills/feature-knowledge/SKILL.md +19 -222
  174. package/src/assets/skills/feature-knowledge/references/new-kb.md +128 -0
  175. package/src/assets/skills/gap-analysis/SKILL.md +1 -31
  176. package/src/assets/skills/git/SKILL.md +2 -22
  177. package/src/assets/skills/go/SKILL.md +24 -113
  178. package/src/assets/skills/java/SKILL.md +12 -98
  179. package/src/assets/skills/patterns/SKILL.md +8 -93
  180. package/src/assets/skills/performance/SKILL.md +29 -88
  181. package/src/assets/skills/python/SKILL.md +22 -120
  182. package/src/assets/skills/qa/SKILL.md +16 -54
  183. package/src/assets/skills/qa/references/browser-testing.md +0 -24
  184. package/src/assets/skills/qa/references/sources.md +2 -2
  185. package/src/assets/skills/quality-gates/SKILL.md +13 -100
  186. package/src/assets/skills/react/SKILL.md +33 -95
  187. package/src/assets/skills/regression/SKILL.md +8 -73
  188. package/src/assets/skills/reliability/SKILL.md +11 -120
  189. package/src/assets/skills/research-codebase/SKILL.md +7 -49
  190. package/src/assets/skills/research-competitor/SKILL.md +4 -39
  191. package/src/assets/skills/research-external/SKILL.md +5 -43
  192. package/src/assets/skills/research-market/SKILL.md +5 -43
  193. package/src/assets/skills/research-technology/SKILL.md +8 -68
  194. package/src/assets/skills/review-methodology/SKILL.md +10 -56
  195. package/src/assets/skills/rust/SKILL.md +19 -109
  196. package/src/assets/skills/security/SKILL.md +39 -66
  197. package/src/assets/skills/software-design/SKILL.md +20 -105
  198. package/src/assets/skills/software-design/references/patterns.md +84 -2
  199. package/src/assets/skills/software-design/references/violations.md +1 -1
  200. package/src/assets/skills/test-driven-development/SKILL.md +32 -107
  201. package/src/assets/skills/test-driven-development/references/rationalization-prevention.md +33 -1
  202. package/src/assets/skills/testing/SKILL.md +35 -53
  203. package/src/assets/skills/typescript/SKILL.md +23 -102
  204. package/src/assets/skills/ui-design/SKILL.md +26 -74
  205. package/src/assets/skills/worktree-support/SKILL.md +4 -10
  206. package/dist/curation-off/commands/dynamic-profile.md +0 -214
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: feature-knowledge
3
- description: Structures codebase exploration into a feature knowledge base
3
+ description: Use when building a feature knowledge base.
4
4
  user-invocable: false
5
5
  allowed-tools:
6
6
  - Read
@@ -23,61 +23,22 @@ allowed-tools:
23
23
 
24
24
  ## The Four Phases
25
25
 
26
- Follow these four phases in order. Do not skip ahead.
26
+ Follow these four phases in order.
27
27
 
28
28
  ### Phase 1: Scan
29
29
 
30
- Map the landscape. Get a high-level understanding before going deep.
30
+ Map where the code of this area lives and how it is structured: directories, languages and frameworks, entry points, configuration and existing documentation.
31
31
 
32
- - Use `Glob` to discover directory structure and file organization
33
- - Identify language(s), framework(s), and major dependencies
34
- - Locate key entry points, configuration files, and existing documentation
35
- - Note how the code is organized — monorepo, modules, layers, etc.
36
-
37
- **Goal**: Answer "Where does the code related to this area live, and how is it structured?"
32
+ With your first scan calls, Glob the target `KNOWLEDGE.md` and run `d="${CLAUDE_CONFIG_DIR:-}"; case "$d" in /*) ;; *) d="$HOME/.claude" ;; esac; printf '%s\n' "$d"` in Bash.
33
+ **New KB only** (the Glob finds no file): Read `<that directory>/skills/devflow:feature-knowledge/references/new-kb.md` once, with your next reads. It holds the category table, the category templates and a worked example. If the Read fails, choose the category from the frontmatter list and main sections that fit it.
38
34
 
39
35
  ### Phase 2: Extract
40
36
 
41
- Go deep. Read the actual code and pull out the real patterns.
42
-
43
- - Read key files using `Read`
44
- - Use `Grep` to find recurring patterns across the codebase
45
- - Trace data flow: how does information move through the system?
46
- - Identify naming conventions, structural patterns, error handling approaches
47
- - Look for implicit rules — things the team clearly follows but never wrote down
48
- - Pay attention to what's consistent (conventions) vs. what varies (knowledge gaps)
49
- - Look at how similar things are implemented — find ALL instances and see what they share
50
-
51
- **For complex domains, go further:**
52
- - Map core entities and their relationships
53
- - Identify decision points — where does business logic branch?
54
- - Extract implicit knowledge — what's obvious to current developers but invisible to newcomers?
55
- - Document state transitions, business rules, and edge case handling
56
-
57
- **Self-check before moving on:**
58
- - "Am I understanding the full scope of what's being requested?"
59
- - "What connections am I seeing that weren't obvious initially?"
60
- - "Are there patterns I'm missing because I'm too focused on one area?"
37
+ Read the key files and trace how data moves through the area. Find ALL instances of similar things and see what they share: naming, structure, error handling, and the implicit rules the team follows but never wrote down. For a complex domain, also map the core entities, the decision points, the state transitions and the edge cases.
61
38
 
62
39
  ### Phase 3: Distill
63
40
 
64
- Organize and validate findings. Raw observations become structured knowledge.
65
-
66
- **Choose a knowledge category:**
67
-
68
- | The knowledge is about... | Category | Language Style |
69
- |---|---|---|
70
- | How the overall system is designed | `architecture` | Descriptive — explains what systems are and why they exist |
71
- | Patterns followed across the whole project | `conventions` | Prescriptive — "Do this," "Avoid that" |
72
- | How a specific type of component works | `component-patterns` | Prescriptive — enforces conventions |
73
- | A specific business domain or module | `domain-knowledge` | Descriptive — builds mental models |
74
- | Hard-won lessons from incidents or edge cases | `lessons-learned` | Narrative — tells the story of discovery |
75
-
76
- **Validate each finding:**
77
- - Is this specific to THIS codebase, or generic advice? (only keep specific)
78
- - Does this reflect what the code actually does NOW, or is it speculative? (only keep current)
79
- - Would a developer actually use this to build something? (only keep actionable)
80
- - Is this obvious from reading one file, or does it require cross-cutting knowledge? (prefer cross-cutting)
41
+ Keep a finding only if it is specific to THIS codebase, true of the code NOW, actionable for a developer, and preferably cross-cutting rather than obvious from one file.
81
42
 
82
43
  ### Phase 4: Forge
83
44
 
@@ -109,7 +70,7 @@ updated: {ISO date}
109
70
  ## Overview
110
71
  [1-2 paragraphs: what this knowledge covers and why it matters for this codebase]
111
72
 
112
- ## [Main Sections — vary by category, see Category Templates below]
73
+ ## [Main Sections — vary by category]
113
74
 
114
75
  ## Anti-Patterns
115
76
  [The longer explanation of each anti-pattern, headed by its ID — never a restatement of the Rules bullet]
@@ -141,94 +102,21 @@ Per KB: target 30,000 characters, ceiling 40,000. An index line is at most 300 c
141
102
 
142
103
  When `EXISTING_KB` is provided, change only the sections the new work touches, and add or update Rules bullets for what changed. Never renumber, and never rewrite untouched sections to meet the budget. A KB still above the ceiling after a refresh is written as it stands, and the final message says so.
143
104
 
144
- ### Category Templates
145
-
146
- Use the matching template as your main sections. Anti-Patterns, Gotchas, Key Files, and Related are shared across all categories.
105
+ ### Description Field
147
106
 
148
- **Architecture:**
149
- - System Context (purpose, role in larger system, external dependencies)
150
- - Component Architecture (major building blocks, data stores, APIs)
151
- - Component Interactions (how pieces communicate, data flow)
152
- - Integration Patterns (how this connects to external systems)
153
- - Constraints (security boundaries, performance considerations, scaling limits)
154
-
155
- **Conventions:**
156
- - Code Organization Principles (principle with rationale)
157
- - Standard Patterns (pattern with annotated code example)
158
- - Error Handling Standards (approach with code example)
159
-
160
- **Component Patterns:**
161
- - Core Responsibilities (what this component should/should NOT do)
162
- - Standard Structure (complete annotated code example)
163
- - Dependency Patterns (how dependencies are managed)
164
- - Error Handling (component-specific error patterns)
165
- - Integration Guidelines (how to interact with other component types)
166
-
167
- **Domain Knowledge:**
168
- - Business Context (purpose, business value, compliance constraints)
169
- - Core Business Rules (rules with examples and edge cases)
170
- - State Transitions (workflow states and triggers)
171
- - Technical Implementation Patterns (code patterns specific to this domain)
172
- - Error Handling and Recovery (domain-specific failure modes)
173
-
174
- **Lessons Learned:**
175
- - Per lesson: Incident Context → Root Cause → Impact → Code showing problem and solution → Prevention Strategy
176
-
177
- ### Description Field Rules
178
-
179
- The `description` field is how this feature knowledge entry gets discovered. It must:
180
- - Start with "Use when"
181
- - Name specific scenarios where this knowledge applies
182
- - Include keywords a developer would search for
183
- - Stay within 220 characters
184
-
185
- Good: `"Use when adding a new vendor integration, implementing API clients, or connecting to external services. Keywords: integration, vendor, API client, webhook."`
186
- Bad: `"Integration stuff"`
107
+ The `description` field is how this entry gets discovered. It starts with "Use when", names the specific scenarios where the knowledge applies, includes the keywords a developer would search for, and stays within 220 characters. Example: `"Use when adding a new vendor integration, implementing API clients, or connecting to external services. Keywords: integration, vendor, API client, webhook."`
187
108
 
188
109
  ### Cross-References
189
110
 
190
- Knowledge files must not exist in isolation. The **Related** section must link to:
191
- - Other feature knowledge entries that cover related topics
192
- - Key source files referenced in the knowledge
111
+ The **Related** section links the other feature knowledge entries that cover related topics and the key source files the knowledge references. When a new entry relates to an existing one, note the connection in both.
193
112
 
194
113
  A decision or pitfall from DECISIONS_CONTEXT that shapes this area is stated in words in the section it governs, never by its ADR/PF ID: KNOWLEDGE.md is git-tracked and shared with every clone, and ledger IDs resolve only on the machine that recorded them.
195
114
 
196
- References should be bidirectional — when creating a new feature knowledge entry that relates to an existing one, note the connection.
197
-
198
115
  ---
199
116
 
200
117
  ## Rules for Code Examples
201
118
 
202
- Every code example must have three parts:
203
- 1. **Description before**: what it demonstrates and why
204
- 2. **Inline comments**: explaining the important lines
205
- 3. **Takeaways after**: key points
206
-
207
- Before including an example, verify it adds **significant unique value** beyond what descriptive text alone provides. If the pattern can be fully explained in a sentence, skip the code block. Only show codebase-specific patterns — never generic language features.
208
-
209
- Never include bare code snippets without context.
210
-
211
- ---
212
-
213
- ## What to Avoid
214
-
215
- - **Generic advice**: "Use dependency injection" without showing how THIS project does it
216
- - **Speculation**: "We might want to add caching later" — only document what exists
217
- - **Bare examples**: Code without explanation of what it shows and why it matters
218
- - **Low-value examples**: Code that restates generic language features. If it doesn't show something unique to THIS project, cut it.
219
- - **Everything-bagel files**: Covering too many topics in one file — stay focused
220
- - **Obvious things**: If reading one file makes it clear, it doesn't need a feature knowledge entry
221
- - **Testing knowledge**: Don't include test patterns unless explicitly requested
222
- - **Isolated knowledge islands**: Every feature knowledge entry must reference related files and source code
223
-
224
- | Red Flag | What It Indicates |
225
- |----------|-------------------|
226
- | "Always follow best practices" | Generic, not codebase-specific |
227
- | No code examples at all | Insufficient actionable guidance |
228
- | Examples without inline comments | Missing required context |
229
- | "In the future, we might..." | Speculative — remove it |
230
- | Over 40,000 characters, or volatile numbers in Rules | Curate it; name the pinning test or constant instead of a count |
231
- | No cross-references in Related | Isolated knowledge island |
119
+ Include a code example only when it adds significant unique value beyond a sentence, and only for a codebase-specific pattern, never a generic language feature. Every example has a description before it (what it shows and why), inline comments on the important lines, and takeaways after it.
232
120
 
233
121
  ---
234
122
 
@@ -237,10 +125,11 @@ Never include bare code snippets without context.
237
125
  Run through this before writing. If any check fails, go back and fix it.
238
126
 
239
127
  **Content:**
240
- - [ ] Knowledge provides codebase-specific insights (not generic guidance)
241
- - [ ] All content reflects current patterns (no speculation)
128
+ - [ ] Knowledge provides codebase-specific insights, not generic advice ("use dependency injection" without how THIS project does it)
129
+ - [ ] All content reflects current code; no speculation ("we might add caching later")
242
130
  - [ ] Business context and domain constraints captured where relevant
243
131
  - [ ] Every claim is verifiable in actual code
132
+ - [ ] One focused topic, not an everything-bagel file; no test patterns unless requested
244
133
 
245
134
  **Examples:**
246
135
  - [ ] Every code example has description before, inline comments, and takeaways after
@@ -248,26 +137,21 @@ Run through this before writing. If any check fails, go back and fix it.
248
137
  - [ ] Anti-patterns documented with explanation of consequences
249
138
 
250
139
  **Structure:**
251
- - [ ] Category is correct and main sections follow the matching template
140
+ - [ ] Category is correct; a new KB follows its category template, and a refresh keeps the existing sections
252
141
  - [ ] Description field starts with "Use when" and includes keywords
253
142
  - [ ] `## Rules` comes first: one-line bullets with `KB-AP-n` / `KB-INV-n` IDs, about 3–5K characters, no volatile numbers
254
143
  - [ ] File within the 40,000-character ceiling (curate, never truncate); description at most 220 characters
255
144
 
256
145
  **Connections:**
257
146
  - [ ] Cross-references to related feature knowledge entries in Related section; decisions and pitfalls stated in words, with no ADR/PF ID anywhere in the file
258
- - [ ] No isolated knowledge islands — file connects to the broader knowledge network
259
147
  - [ ] Key source files listed in Key Files section
260
148
 
261
149
  ---
262
150
 
263
151
  ## Index Registration
264
152
 
265
- After writing KNOWLEDGE.md, update the index cache directly:
266
-
267
- **File**: `{worktree}/.devflow/features/index.md`
268
- **Operation**: Read-modify-write — replace the existing line for this slug if present, or append.
153
+ After writing KNOWLEDGE.md, register it in `{worktree}/.devflow/features/index.md` with this line:
269
154
 
270
- **Line format**:
271
155
  ```
272
156
  - **{slug}** — {areas} — {Use-when description}
273
157
  ```
@@ -277,97 +161,10 @@ The whole line is at most 300 characters; reword a longer one, never cut it. Whe
277
161
  - `{areas}` is a comma-separated summary of the `directories:` frontmatter field
278
162
  - `{Use-when description}` is the `description:` frontmatter field value (the full "Use when..." sentence, at most 220 characters)
279
163
 
280
- If `index.md` does not exist, create it with just this line. If the file already has an entry for this slug, replace that line in-place. This is the discoverable cache read by `knowledge_load()` — the KNOWLEDGE.md frontmatter is always authoritative.
281
-
282
- ---
283
-
284
- ## Worked Example
285
-
286
- This is what a complete, well-structured feature knowledge entry looks like. Use it as a reference for quality and format.
287
-
288
- ````markdown
289
- ---
290
- feature: integrations
291
- name: Third-Party Integrations
292
- description: "Use when adding a new vendor integration, implementing API clients, or connecting to external services. Keywords: integration, vendor, API client, webhook, spawn, config."
293
- category: component-patterns
294
- directories: [src/lib/]
295
- created: 2026-04-30
296
- updated: 2026-04-30
297
- ---
298
-
299
- # Third-Party Integrations
300
-
301
- ## Rules
302
-
303
- - **KB-AP-1** Fetch logic never lives in a command file: it breaks the lib/command split and cannot be tested alone.
304
- - **KB-AP-2** URLs never live in lib modules: they go through `config.ts`.
305
- - **KB-AP-3** A lib module never calls `showError()`: lib modules throw, commands catch and display.
306
- - **KB-AP-4** `spawn` needs the binary on PATH: detect `ENOENT` and give an install URL.
307
- - **KB-INV-1** Every external constant lives in `src/lib/config.ts`.
308
-
309
- ## Overview
310
-
311
- This project integrates with external systems by spawning CLI processes, fetching files from remote registries, and writing to directories that AI editors watch. Each integration lives in its own module under `src/lib/` and is wired into a command in `src/commands/`. All external constants are centralized in `src/lib/config.ts`.
312
-
313
- The key cross-cutting pattern is the separation between lib modules (which integrate) and commands (which orchestrate). Violating this creates coupling that breaks the error handling model.
314
-
315
- ## Core Responsibilities
316
-
317
- - Lib modules: integrate with external systems, export async functions, throw on failure
318
- - Commands: orchestrate lib modules, catch errors, route to UI via `showError()`
319
- - Config: centralize all external constants, expose env var overrides
320
-
321
- ## Standard Structure
322
-
323
- Every integration follows the same file organization. This example shows the pattern that every existing integration (Claude CLI, GitHub, AI editors) follows:
324
-
325
- ```
326
- src/lib/
327
- claude.ts # Claude Code CLI (spawn + stream JSON)
328
- skill-installer.ts # GitHub (git clone, sparse checkout)
329
- deploy.ts # AI editors (.claude/, .cursor/ dirs)
330
- config.ts # All constants for the above
331
- ```
332
-
333
- A new integration means a new file here. The module exports async functions, imports from `config.ts`, and never imports from `src/ui/` or `src/commands/`.
334
-
335
- ### Config Centralization
336
-
337
- URLs, subpaths, install directories — these change together. One file to update when an upstream moves:
338
-
339
- All constants use `SCREAMING_SNAKE_CASE` with a descriptive prefix. If a value can be overridden by the user, expose an env var with a sensible default.
340
-
341
- ## Anti-Patterns
342
-
343
- - **KB-AP-1, putting fetch logic in a command file** — breaks the lib/command separation and makes the integration untestable in isolation.
344
- - **KB-AP-2, hardcoding URLs in lib modules** — always use `config.ts`. Scattered strings become stale and hard to find.
345
- - **KB-AP-3, calling `showError()` from a lib module** — lib modules throw; commands catch and display.
346
-
347
- ## Gotchas
348
-
349
- - **KB-AP-4**: `spawn` requires the binary on PATH. If integrating a tool that may not be globally installed, detect `ENOENT` and provide an install URL.
350
- - Temp files use `Date.now()`. If two processes run simultaneously, add a random suffix to avoid collisions.
351
-
352
- ## Key Files
353
-
354
- - `src/lib/config.ts` — add constants here before writing integration code
355
- - `src/lib/claude.ts` — reference implementation for spawn-and-stream pattern
356
- - `src/lib/skill-installer.ts` — reference implementation for fetch-from-remote pattern
357
-
358
- ## Related
359
-
360
- - `.devflow/features/cli-commands/KNOWLEDGE.md` — the command side of the lib/command split: catching errors and routing them to `showError()`
361
- - `src/commands/` — where each integration is wired into a command
362
- ````
164
+ If `index.md` does not exist, create it with just this line. The KNOWLEDGE.md frontmatter is always authoritative; the index line is a cache.
363
165
 
364
166
  ---
365
167
 
366
168
  ## Scope and Limitations
367
169
 
368
- Only document what you can verify in the codebase. When you encounter:
369
- - Knowledge outside the provided codebase
370
- - External systems without accessible documentation
371
- - Information that requires context you don't have
372
-
373
- Acknowledge the limitation clearly and focus on what IS extractable. Never fill gaps with generic knowledge or speculation.
170
+ Only document what you can verify in the codebase. Where knowledge lies outside it, or needs context you do not have, say so and focus on what IS extractable. Never fill gaps with generic knowledge or speculation.
@@ -0,0 +1,128 @@
1
+ # New Knowledge Base
2
+
3
+ Read this file only when you create a knowledge base. A refresh keeps the category and the sections of the existing file.
4
+
5
+ ## Category
6
+
7
+ Choose the category of the new knowledge base:
8
+
9
+ | The knowledge is about... | Category | Language Style |
10
+ |---|---|---|
11
+ | How the overall system is designed | `architecture` | Descriptive — explains what systems are and why they exist |
12
+ | Patterns followed across the whole project | `conventions` | Prescriptive — "Do this," "Avoid that" |
13
+ | How a specific type of component works | `component-patterns` | Prescriptive — enforces conventions |
14
+ | A specific business domain or module | `domain-knowledge` | Descriptive — builds mental models |
15
+ | Hard-won lessons from incidents or edge cases | `lessons-learned` | Narrative — tells the story of discovery |
16
+
17
+ ## Category Templates
18
+
19
+ Use the matching template as your main sections. Anti-Patterns, Gotchas, Key Files, and Related are shared across all categories.
20
+
21
+ **Architecture:**
22
+ - System Context (purpose, role in larger system, external dependencies)
23
+ - Component Architecture (major building blocks, data stores, APIs)
24
+ - Component Interactions (how pieces communicate, data flow)
25
+ - Integration Patterns (how this connects to external systems)
26
+ - Constraints (security boundaries, performance considerations, scaling limits)
27
+
28
+ **Conventions:**
29
+ - Code Organization Principles (principle with rationale)
30
+ - Standard Patterns (pattern with annotated code example)
31
+ - Error Handling Standards (approach with code example)
32
+
33
+ **Component Patterns:**
34
+ - Core Responsibilities (what this component should/should NOT do)
35
+ - Standard Structure (complete annotated code example)
36
+ - Dependency Patterns (how dependencies are managed)
37
+ - Error Handling (component-specific error patterns)
38
+ - Integration Guidelines (how to interact with other component types)
39
+
40
+ **Domain Knowledge:**
41
+ - Business Context (purpose, business value, compliance constraints)
42
+ - Core Business Rules (rules with examples and edge cases)
43
+ - State Transitions (workflow states and triggers)
44
+ - Technical Implementation Patterns (code patterns specific to this domain)
45
+ - Error Handling and Recovery (domain-specific failure modes)
46
+
47
+ **Lessons Learned:**
48
+ - Per lesson: Incident Context → Root Cause → Impact → Code showing problem and solution → Prevention Strategy
49
+
50
+ ## Worked Example
51
+
52
+ This is what a complete, well-structured feature knowledge entry looks like. Use it as a reference for quality and format.
53
+
54
+ ````markdown
55
+ ---
56
+ feature: integrations
57
+ name: Third-Party Integrations
58
+ description: "Use when adding a new vendor integration, implementing API clients, or connecting to external services. Keywords: integration, vendor, API client, webhook, spawn, config."
59
+ category: component-patterns
60
+ directories: [src/lib/]
61
+ created: 2026-04-30
62
+ updated: 2026-04-30
63
+ ---
64
+
65
+ # Third-Party Integrations
66
+
67
+ ## Rules
68
+
69
+ - **KB-AP-1** Fetch logic never lives in a command file: it breaks the lib/command split and cannot be tested alone.
70
+ - **KB-AP-2** URLs never live in lib modules: they go through `config.ts`.
71
+ - **KB-AP-3** A lib module never calls `showError()`: lib modules throw, commands catch and display.
72
+ - **KB-AP-4** `spawn` needs the binary on PATH: detect `ENOENT` and give an install URL.
73
+ - **KB-INV-1** Every external constant lives in `src/lib/config.ts`.
74
+
75
+ ## Overview
76
+
77
+ This project integrates with external systems by spawning CLI processes, fetching files from remote registries, and writing to directories that AI editors watch. Each integration lives in its own module under `src/lib/` and is wired into a command in `src/commands/`. All external constants are centralized in `src/lib/config.ts`.
78
+
79
+ The key cross-cutting pattern is the separation between lib modules (which integrate) and commands (which orchestrate). Violating this creates coupling that breaks the error handling model.
80
+
81
+ ## Core Responsibilities
82
+
83
+ - Lib modules: integrate with external systems, export async functions, throw on failure
84
+ - Commands: orchestrate lib modules, catch errors, route to UI via `showError()`
85
+ - Config: centralize all external constants, expose env var overrides
86
+
87
+ ## Standard Structure
88
+
89
+ Every integration follows the same file organization. This example shows the pattern that every existing integration (Claude CLI, GitHub, AI editors) follows:
90
+
91
+ ```
92
+ src/lib/
93
+ claude.ts # Claude Code CLI (spawn + stream JSON)
94
+ skill-installer.ts # GitHub (git clone, sparse checkout)
95
+ deploy.ts # AI editors (.claude/, .cursor/ dirs)
96
+ config.ts # All constants for the above
97
+ ```
98
+
99
+ A new integration means a new file here. The module exports async functions, imports from `config.ts`, and never imports from `src/ui/` or `src/commands/`.
100
+
101
+ ### Config Centralization
102
+
103
+ URLs, subpaths, install directories — these change together. One file to update when an upstream moves:
104
+
105
+ All constants use `SCREAMING_SNAKE_CASE` with a descriptive prefix. If a value can be overridden by the user, expose an env var with a sensible default.
106
+
107
+ ## Anti-Patterns
108
+
109
+ - **KB-AP-1, putting fetch logic in a command file** — breaks the lib/command separation and makes the integration untestable in isolation.
110
+ - **KB-AP-2, hardcoding URLs in lib modules** — always use `config.ts`. Scattered strings become stale and hard to find.
111
+ - **KB-AP-3, calling `showError()` from a lib module** — lib modules throw; commands catch and display.
112
+
113
+ ## Gotchas
114
+
115
+ - **KB-AP-4**: `spawn` requires the binary on PATH. If integrating a tool that may not be globally installed, detect `ENOENT` and provide an install URL.
116
+ - Temp files use `Date.now()`. If two processes run simultaneously, add a random suffix to avoid collisions.
117
+
118
+ ## Key Files
119
+
120
+ - `src/lib/config.ts` — add constants here before writing integration code
121
+ - `src/lib/claude.ts` — reference implementation for spawn-and-stream pattern
122
+ - `src/lib/skill-installer.ts` — reference implementation for fetch-from-remote pattern
123
+
124
+ ## Related
125
+
126
+ - `.devflow/features/cli-commands/KNOWLEDGE.md` — the command side of the lib/command split: catching errors and routing them to `showError()`
127
+ - `src/commands/` — where each integration is wired into a command
128
+ ````
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: gap-analysis
3
- description: This skill should be used when analyzing specs or plans for completeness gaps.
3
+ description: Use when analyzing specs or plans for completeness gaps.
4
4
  user-invocable: false
5
5
  allowed-tools: Read, Grep, Glob
6
6
  ---
@@ -17,14 +17,10 @@ Domain expertise for detecting gaps in design documents, specifications, and pla
17
17
  > waiting to be written. Catch gaps in the plan so the implementation reflects reality,
18
18
  > not assumption. Evidence-required: every gap must cite specific text from the artifact.
19
19
 
20
- ---
21
-
22
20
  ## Focus Areas
23
21
 
24
22
  ### 1. Completeness
25
23
 
26
- Detect missing pieces that will block or break implementation.
27
-
28
24
  **Detection patterns:**
29
25
  - Missing acceptance criteria — requirements without testable success conditions
30
26
  - Undefined error states — happy path described, failure paths absent
@@ -37,8 +33,6 @@ Detect missing pieces that will block or break implementation.
37
33
 
38
34
  ### 2. Architecture
39
35
 
40
- Detect design decisions that conflict with existing patterns or create structural problems.
41
-
42
36
  **Detection patterns:**
43
37
  - Implied patterns violating existing conventions — new module structure that contradicts codebase layout
44
38
  - Missing integration points — feature touches shared state but integration method unspecified
@@ -51,8 +45,6 @@ Detect design decisions that conflict with existing patterns or create structura
51
45
 
52
46
  ### 3. Security
53
47
 
54
- Detect authentication, authorization, and data protection gaps.
55
-
56
48
  **Detection patterns:**
57
49
  - Auth gaps — feature creates new endpoints or data access without specifying auth requirements
58
50
  - Input validation missing — user-provided data consumed without specifying sanitization
@@ -65,8 +57,6 @@ Detect authentication, authorization, and data protection gaps.
65
57
 
66
58
  ### 4. Performance
67
59
 
68
- Detect design decisions that will cause performance problems at scale.
69
-
70
60
  **Detection patterns:**
71
61
  - N+1 patterns implied — loop-based data fetching without batch operation specified
72
62
  - Missing caching strategy — repeated expensive operations (DB queries, API calls) without cache layer
@@ -79,8 +69,6 @@ Detect design decisions that will cause performance problems at scale.
79
69
 
80
70
  ### 5. Consistency (multi-issue only)
81
71
 
82
- Detect contradictions and duplications across multiple issue specifications.
83
-
84
72
  **Detection patterns:**
85
73
  - Cross-issue contradictions — Issue A says feature X works one way, Issue B implies another
86
74
  - Duplicate requirements — same functionality specified in multiple issues without coordination
@@ -92,8 +80,6 @@ Detect contradictions and duplications across multiple issue specifications.
92
80
 
93
81
  ### 6. Dependencies (multi-issue only)
94
82
 
95
- Detect ordering constraints and shared resource conflicts across issues.
96
-
97
83
  **Detection patterns:**
98
84
  - Inter-issue ordering — Issue B depends on data/schema/interface created by Issue A
99
85
  - Shared resources — multiple issues modify the same file, table, or API without coordination
@@ -103,8 +89,6 @@ Detect ordering constraints and shared resource conflicts across issues.
103
89
 
104
90
  **Evidence trigger:** Any issue that references state, contracts, or resources that may be in flux due to another issue in the batch.
105
91
 
106
- ---
107
-
108
92
  ## Extended References
109
93
 
110
94
  | Reference | Content |
@@ -119,17 +103,3 @@ Detect ordering constraints and shared resource conflicts across issues.
119
103
  | **HIGH** | Gap that will cause incorrect behavior or significant technical debt | Missing pagination on unbounded list, undefined race condition in concurrent update |
120
104
  | **MEDIUM** | Gap that will require rework if unaddressed | Vague acceptance criteria, missing caching strategy for frequently-read data |
121
105
  | **LOW** | Gap that is an improvement opportunity | Naming inconsistency, minor UX ambiguity with obvious resolution |
122
-
123
- ## Confidence Calibration
124
-
125
- - **Report at 80%+**: Gap is clearly present, evidence directly cited
126
- - **Suggest at 60-79%**: Plausible gap, depends on context not visible in artifact
127
- - **Drop below 60%**: Speculation without textual evidence
128
-
129
- Output format per gap:
130
- ```
131
- **[FOCUS] Gap: {title}** — Severity: {CRITICAL/HIGH/MEDIUM/LOW} | Confidence: {n}%
132
- Evidence: "{quoted text from artifact}"
133
- Issue: {what is missing or contradictory}
134
- Resolution: {concrete action to address the gap}
135
- ```
@@ -7,24 +7,16 @@ allowed-tools: Bash, Read, Grep, Glob
7
7
 
8
8
  # Git & GitHub Patterns
9
9
 
10
- Unified skill for safe git operations, atomic commits, honest PR descriptions, and GitHub API interactions. Used by the Code agent and Git agent.
10
+ Safe git operations, atomic commits, honest PR descriptions, and GitHub API calls.
11
11
 
12
12
  ## Iron Law
13
13
 
14
- > **EVERY COMMIT TELLS AN HONEST, ATOMIC STORY** [1][3]
14
+ > **Every commit tells an honest, atomic story.**
15
15
  >
16
16
  > Each commit captures one logical change with a message that explains *what* changed
17
17
  > and *why*, not just *how*. Atomic commits make history reviewable, bisectable, and
18
18
  > revertable. Never bundle unrelated changes. Never write vague messages.
19
19
 
20
- ---
21
-
22
- ## When This Skill Activates
23
-
24
- Any `git` or `gh` operation: staging, commits, branches, pull requests, rebases, issues, releases.
25
-
26
- ---
27
-
28
20
  ## Safety
29
21
 
30
22
  ### Lock File Handling
@@ -79,12 +71,8 @@ git reset HEAD~1 # Undo commit, keep unstaged
79
71
 
80
72
  See `references/patterns.md` for extended recovery and stash workflows.
81
73
 
82
- ---
83
-
84
74
  ## Commits
85
75
 
86
- > **ONE LOGICAL CHANGE PER COMMIT, HONESTLY DESCRIBED**
87
-
88
76
  ### Message Format
89
77
 
90
78
  ```
@@ -131,8 +119,6 @@ EOF
131
119
  2. **By Type**: Source code, tests, docs, config separately
132
120
  3. **By Relationship**: Files that change together for single logical purpose
133
121
 
134
- ---
135
-
136
122
  ## Pull Requests
137
123
 
138
124
  ### Title Format
@@ -158,8 +144,6 @@ EOF
158
144
  | Large | 500-1000 | Recommend splitting |
159
145
  | Very Large | > 1000 | **WARN**: Split into smaller PRs |
160
146
 
161
- ---
162
-
163
147
  ## Sensitive File Detection
164
148
 
165
149
  ### Never Commit These Patterns
@@ -181,16 +165,12 @@ Block commits containing:
181
165
 
182
166
  See `references/detection.md` for full `check_for_secrets()` function.
183
167
 
184
- ---
185
-
186
168
  ## GitHub API
187
169
 
188
170
  > **RESPECT RATE LIMITS OR FAIL GRACEFULLY** — at `X-RateLimit-Remaining` < 10 STOP the fan-out and report `THROTTLED` (D4); 1-2s between calls. Throttling and releases: `references/github-api.md`; posting steps, where installed: `references/github-posting.md`.
189
171
 
190
172
  Naming conventions: `learn-conventions` writes `.devflow/conventions.md` from a bounded scan (≤50 branches, ≤20 tags, ≤30 PR titles) and is its single authority; delete that file to re-learn.
191
173
 
192
- ---
193
-
194
174
  ## Extended References
195
175
 
196
176
  | Reference | Contents |