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
@@ -22,129 +22,50 @@ activation:
22
22
  > entire value proposition — if you need flexibility, use generics; if you need to handle
23
23
  > arbitrary data, use `unknown` and validate. `any` is giving up. [1, Item 43]
24
24
 
25
- ## When This Skill Activates
25
+ ## Type Safety
26
26
 
27
- - Working with TypeScript codebases or designing type-safe APIs
28
- - Using generics, type guards, branded types, or conditional types
27
+ - Return `unknown` from untyped sources (`JSON.parse`), then narrow with a type guard (`if (isUser(data))`), not a cast (`data as User`).
28
+ - Handle null and undefined explicitly: `user?.name ?? fallback`, not `user!.name!`.
29
+ - End a switch over a union with an exhaustive check, `default: const _: never = status;`, not `default: 'unknown'`.
30
+ - Use type-only imports (`import type`).
31
+ - Use a strict tsconfig: `strict`, `noUncheckedIndexedAccess`.
29
32
 
30
- ---
31
-
32
- ## Type Safety Fundamentals
33
-
34
- ### Prefer Unknown Over Any [1, Item 43]
35
-
36
- Types are sets of values [1, Item 7]. `any` opts out entirely; `unknown` forces narrowing.
37
-
38
- ```typescript
39
- // BAD: disables all type checking [4][17]
40
- function parse(json: string): any { return JSON.parse(json); }
41
- // GOOD: unknown forces narrowing before use [1, Item 43]
42
- function parse(json: string): unknown { return JSON.parse(json); }
43
- if (isUser(data)) console.log(data.name); // type-safe after guard
44
- ```
45
-
46
- ### Exhaustive Checks [1, Item 33][13]
47
-
48
- ```typescript
49
- type Status = 'pending' | 'running' | 'completed' | 'failed';
50
- function handleStatus(status: Status): string {
51
- switch (status) {
52
- case 'pending': return 'Waiting...';
53
- case 'running': return 'In progress...';
54
- case 'completed': return 'Done!';
55
- case 'failed': return 'Error occurred';
56
- default: const _: never = status; throw new Error(`Unhandled: ${_}`);
57
- }
58
- }
59
- ```
60
-
61
- ---
62
-
63
- ## Generic Patterns [2][6]
33
+ ## Generic Patterns
64
34
 
65
- ```typescript
66
- function first<T>(items: T[]): T | undefined { return items[0]; }
67
- // Constrained key access [1, Item 54]
68
- function getProperty<T, K extends keyof T>(obj: T, key: K): T[K] { return obj[key]; }
69
- interface Repository<T, ID = string> { findById(id: ID): Promise<T | null>; save(entity: T): Promise<T>; }
70
- ```
71
-
72
- ---
35
+ - Use generics for flexibility: `first<T>(items: T[]): T | undefined`.
36
+ - Constrain key access: `getProperty<T, K extends keyof T>(obj: T, key: K): T[K]`.
37
+ - Give a generic interface a default parameter: `Repository<T, ID = string>`.
73
38
 
74
- ## Discriminated Unions [1, Item 28][24]
39
+ ## Discriminated Unions
75
40
 
76
- Make illegal states unrepresentable — encode variants in the type [24].
41
+ Make illegal states unrepresentable: encode each variant in the type, for results and request states.
77
42
 
78
43
  ```typescript
79
44
  type Result<T, E> = { ok: true; value: T } | { ok: false; error: E };
80
- type RequestState<T> =
81
- | { status: 'idle' } | { status: 'loading' }
82
- | { status: 'success'; data: T } | { status: 'error'; error: Error };
83
45
  ```
84
46
 
85
- ---
86
-
87
- ## Branded Types [1, Item 37][22]
47
+ ## Branded Types
88
48
 
89
49
  Structural typing treats `UserId` and `OrderId` (both `string`) as identical.
90
- Brands add nominal distinction with zero runtime cost.
50
+ Brand IDs and amounts for nominal distinction with zero runtime cost.
91
51
 
92
52
  ```typescript
93
53
  declare const brand: unique symbol;
94
54
  type Brand<T, B> = T & { [brand]: B };
95
- type UserId = Brand<string, 'UserId'>;
96
- type OrderId = Brand<string, 'OrderId'>;
97
-
98
- function getUser(id: UserId): User { ... }
99
- // getUser(orderId) → Error: OrderId not assignable to UserId
55
+ type UserId = Brand<string, 'UserId'>; // getUser(orderId) is a compile error
100
56
  ```
101
57
 
102
- ---
103
-
104
- ## Conditional & Mapped Types [2][19]
58
+ ## Conditional & Mapped Types
105
59
 
106
- ```typescript
107
- // Unwrap Promise return type via infer [19]
108
- type AsyncReturnType<T extends (...args: any[]) => Promise<any>> =
109
- T extends (...args: any[]) => Promise<infer R> ? R : never;
110
- // Pick by value type — key remapping with `as` [6][8]
111
- type PickByType<T, V> = { [K in keyof T as T[K] extends V ? K : never]: T[K] };
112
- // Recursive deep readonly [6]
113
- type DeepReadonly<T> = { readonly [P in keyof T]: T[P] extends object ? DeepReadonly<T[P]> : T[P] };
114
- ```
115
-
116
- ---
117
-
118
- ## Anti-Patterns
119
-
120
- | Bad | Good | Source |
121
- |-----|------|--------|
122
- | `data: any` | `data: unknown` + guard | [1, Item 43] |
123
- | `data as User` | `if (isUser(data))` | [1, Item 9] |
124
- | `user!.name!` | `user?.name ?? default` | [4] |
125
- | `default: 'unknown'` | `const _: never = x` | [1, Item 33] |
126
- | two IDs as `string` | branded types | [1, Item 37] |
127
-
128
- ---
60
+ - Unwrap with `infer`: `T extends (...args: any[]) => Promise<infer R> ? R : never`.
61
+ - Remap keys with `as`: `{ [K in keyof T as T[K] extends V ? K : never]: T[K] }`.
62
+ - Recurse for deep forms: `DeepReadonly<T> = { readonly [P in keyof T]: T[P] extends object ? DeepReadonly<T[P]> : T[P] }`.
129
63
 
130
64
  ## Extended References
131
65
 
132
- - `references/sources.md` — Full bibliography [25 sources]
66
+ - `references/sources.md` — Full bibliography
133
67
  - `references/patterns.md` — Extended patterns with citations
134
68
  - `references/violations.md` — Violation examples with citations
135
- - `references/utility-types.md` — Utility types, branded types, template literals [6][15]
136
- - `references/type-guards.md` — Advanced type guard patterns [2][6]
137
- - `references/async.md` — Async TypeScript patterns [1, Item 25]
138
-
139
- ---
140
-
141
- ## Checklist
142
-
143
- - [ ] No `any` types — `unknown` or generics [1, Item 43]
144
- - [ ] Null/undefined handled explicitly [4]
145
- - [ ] Discriminated unions for state variants [1, Item 28]
146
- - [ ] Type guards narrow at runtime [2]
147
- - [ ] Exhaustive switch with `never` [1, Item 33]
148
- - [ ] Branded types for IDs and amounts [1, Item 37]
149
- - [ ] Type-only imports (`import type`) [4]
150
- - [ ] Strict tsconfig: `strict`, `noUncheckedIndexedAccess` [16]
69
+ - `references/utility-types.md` — Utility types, branded types, template literals
70
+ - `references/type-guards.md` — Advanced type guard patterns
71
+ - `references/async.md` — Async TypeScript patterns
@@ -18,7 +18,7 @@ activation:
18
18
 
19
19
  # UI Design Patterns
20
20
 
21
- Reference for intentional visual design. Every choice must be justified. Sources in `references/sources.md`.
21
+ Reference for intentional visual design. Sources in `references/sources.md`.
22
22
 
23
23
  ## Iron Law
24
24
 
@@ -30,73 +30,43 @@ Reference for intentional visual design. Every choice must be justified. Sources
30
30
  > because it serves purpose — it satisfies mental models, not trends.
31
31
  > — Don Norman, *The Design of Everyday Things* [11]; Laws of UX [4]
32
32
 
33
- ## When This Skill Activates
33
+ ## 1. Typography
34
34
 
35
- - Creating/styling UI components; reviewing CSS, Tailwind, or styled-components
36
- - Discussing typography, color schemes, layouts, or design systems
35
+ Font choice must match product personality, with a documented rationale: developer tools → monospace (precision), documentation → serif (readability), marketing → distinctive display.
37
36
 
38
- ---
39
-
40
- ## 1. Typography [6][7][10][19]
41
-
42
- Font choice must match product personality: developer tools → monospace (precision), documentation → serif (readability), marketing → distinctive display. [6][7][27]
37
+ Use a mathematical type scale (1.25 major third ratio). Line length: 45–75 characters for body text; `line-height: 1.7` for prose, `1.2` for headings.
43
38
 
44
- Use a **mathematical type scale** (1.25 major third ratio). All sizes relate harmonically. [10] Line length: 45–75 characters for body text; `line-height: 1.7` for prose, `1.2` for headings. [6][7]
45
-
46
- Heading levels must differ in weight, tracking, and size — not size alone. [7][15] See `references/patterns.md` for scale values, font pairs, and heading styles.
47
-
48
- ---
39
+ Heading levels must differ in weight, tracking, and size — not size alone. See `references/patterns.md` for scale values, font pairs, and heading styles.
49
40
 
50
- ## 2. Color System [1][9][12][14]
41
+ ## 2. Color System
51
42
 
52
- **Three-layer token architecture** (Material Design 3 [1] + W3C Design Tokens spec [9]):
43
+ Three-layer tokens: primitive (`--blue-600: #2563eb`) → semantic (`--color-primary: var(--blue-600)`) → component (`--button-primary-bg: var(--color-primary)`).
53
44
 
54
- ```css
55
- :root {
56
- --blue-600: #2563eb; /* Layer 1: Primitive */
57
- --color-primary: var(--blue-600); /* Layer 2: Semantic */
58
- --button-primary-bg: var(--color-primary);/* Layer 3: Component */
59
- }
60
- ```
45
+ Dark mode: swap semantic tokens only — never invert or filter. Elevation in dark mode is expressed via lightness, not shadows.
61
46
 
62
- **Dark mode**: swap semantic tokens only — never invert or filter. [23]
63
- Elevation in dark mode is expressed via lightness, not shadows. [1][12]
64
-
65
- **Contrast**: 4.5:1 for normal text, 3:1 for large text and UI components. [14][26]
47
+ Contrast: 4.5:1 for normal text, 3:1 for large text and UI components.
66
48
 
67
49
  See `references/patterns.md` for dark surface hierarchy and accessible contrast examples.
68
50
 
69
- ---
70
-
71
- ## 3. Spacing [1][13][15]
51
+ ## 3. Spacing
72
52
 
73
- 4px/8px base grid — from Müller-Brockmann grid mathematics [13], adopted by Material Design [1].
74
- All padding/margin values must come from the scale: `--space-1` (4px) through `--space-24` (96px).
53
+ 4px/8px base grid. All padding/margin values must come from the scale: `--space-1` (4px) through `--space-24` (96px). `padding: 18px 22px` is a violation: a magic number, off-grid.
75
54
 
76
- Gestalt proximity: larger gaps between sections, smaller gaps within — whitespace creates grouping. [5]
77
-
78
- **Violation**: `padding: 18px 22px` — magic number, off-grid. [15]
55
+ Gestalt proximity: larger gaps between sections, smaller gaps within. Build visual hierarchy with whitespace and spacing, not lines or boxes.
79
56
 
80
57
  See `references/patterns.md` for full scale and component spacing hierarchy.
81
58
 
82
- ---
83
-
84
- ## 4. Motion [4][11][24]
85
-
86
- Animation must communicate state, not decorate. Fitts's Law: every interaction needs tactile feedback. [4][11]
87
-
88
- Define a timing system (`--duration-fast: 100ms`, `--duration-normal: 200ms`, `--duration-slow: 300ms`). [1]
89
- Never animate `all` — specify properties. Transitions over 500ms feel sluggish for UI. [4]
59
+ ## 4. Motion
90
60
 
91
- **Required**: `@media (prefers-reduced-motion: reduce)` — WCAG 2.2 and vestibular accessibility. [24][26]
61
+ Animation must communicate state, not decorate. Every interaction needs tactile feedback.
92
62
 
93
- ---
63
+ Define a timing system (`--duration-fast: 100ms`, `--duration-normal: 200ms`, `--duration-slow: 300ms`). Never animate `all` — specify properties. Transitions over 500ms feel sluggish for UI.
94
64
 
95
- ## 5. Component Hierarchy [1][3][5][15]
65
+ Required: `@media (prefers-reduced-motion: reduce)` — WCAG 2.2 and vestibular accessibility.
96
66
 
97
- Atomic Design [3]: atoms → molecules → organisms. Components reference tokens; organisms compose molecules.
67
+ ## 5. Component Hierarchy
98
68
 
99
- **Elevation table** — radius and shadow signal interactivity, not decoration: [1][11][15]
69
+ Atomic Design: atoms → molecules → organisms. Components reference tokens; organisms compose molecules. Radius and shadow signal interactivity, not decoration:
100
70
 
101
71
  | Element | Radius | Shadow |
102
72
  |---------|--------|--------|
@@ -106,21 +76,17 @@ Atomic Design [3]: atoms → molecules → organisms. Components reference token
106
76
  | Dropdown | 8px | `shadow-lg` |
107
77
  | Modal | 12px (`--radius-xl`) | `shadow-xl` |
108
78
 
109
- ---
110
-
111
- ## AI Slop Detection [4][11][15]
79
+ ## AI Slop Detection
112
80
 
113
81
  | Pattern | Problem |
114
82
  |---------|---------|
115
- | Purple-to-pink gradient | No brand justification; copied template [15] |
116
- | `font-family: Inter` without rationale | Default, not intentional [6] |
117
- | Everything centered | No reading flow; violates hierarchy [30] |
118
- | `rounded-xl` everywhere | Radius must vary by component scale [1][15] |
119
- | Shadows on everything | Elevation loses meaning when ubiquitous [11] |
120
- | `animate-pulse` on buttons | Hick's Law: noise slows decisions [4] |
121
- | Glassmorphism everywhere | Trend, not purpose [15] |
122
-
123
- ---
83
+ | Purple-to-pink gradient | No brand justification; copied template |
84
+ | `font-family: Inter` without rationale | Default, not intentional |
85
+ | Everything centered | No reading flow; violates hierarchy |
86
+ | `rounded-xl` everywhere | Radius must vary by component scale |
87
+ | Shadows on everything | Elevation loses meaning when ubiquitous |
88
+ | `animate-pulse` on buttons | Hick's Law: noise slows decisions |
89
+ | Glassmorphism everywhere | Trend, not purpose |
124
90
 
125
91
  ## Extended References
126
92
 
@@ -128,17 +94,3 @@ Atomic Design [3]: atoms → molecules → organisms. Components reference token
128
94
  - `references/patterns.md` — Extended correct patterns with citations
129
95
  - `references/violations.md` — Extended violation examples with citations
130
96
  - `references/detection.md` — Grep patterns for finding issues
131
-
132
- ---
133
-
134
- ## Checklist
135
-
136
- - [ ] Typography scale is mathematical; font choice has documented rationale [6][10]
137
- - [ ] Color system uses 3-layer tokens (primitives → semantic → component) [1][9]
138
- - [ ] All text meets WCAG contrast minimums (4.5:1 / 3:1) [14][26]
139
- - [ ] Dark mode designed intentionally — no invert filter [23]
140
- - [ ] Spacing follows 4px/8px base grid — no magic numbers [1][13]
141
- - [ ] Animations communicate state; `prefers-reduced-motion` respected [24]
142
- - [ ] Component elevation (shadow, radius) signals interactivity level [1][11]
143
- - [ ] No AI slop patterns present [4][15]
144
- - [ ] Visual hierarchy via whitespace and spacing — not lines or boxes [5][30]
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: worktree-support
3
- description: Canonical worktree path resolution and discovery algorithm for agents and commands
3
+ description: Use when resolving or discovering worktree paths.
4
4
  user-invocable: false
5
5
  allowed-tools: Bash, Read
6
6
  ---
@@ -11,28 +11,22 @@ allowed-tools: Bash, Read
11
11
 
12
12
  > **WORKTREE_PATH IS A PREFIX, NOT A FLAG**
13
13
  >
14
- > When WORKTREE_PATH is provided, it changes how you resolve ALL paths — git commands,
15
- > file reads, .devflow/docs/ paths. It's not a toggle; it's a coordinate system shift.
14
+ > When WORKTREE_PATH is provided, it replaces cwd as the root of ALL paths and commands.
16
15
 
17
16
  ## Agent Path Resolution
18
17
 
19
- When `WORKTREE_PATH` is provided to an agent:
20
-
21
18
  | Operation | Without WORKTREE_PATH | With WORKTREE_PATH |
22
19
  |-----------|----------------------|-------------------|
23
20
  | Git commands | `git ...` | `git -C {WORKTREE_PATH} ...` |
24
21
  | .devflow/docs/ paths | `.devflow/docs/...` | `{WORKTREE_PATH}/.devflow/docs/...` |
25
22
  | Source files | `{file}` | `{WORKTREE_PATH}/{file}` |
26
- | Default | Use cwd | Use WORKTREE_PATH as root |
27
-
28
- If `WORKTREE_PATH` is omitted, behavior is unchanged (use cwd). This is the common case.
29
23
 
30
24
  ## Protected Branches (Canonical List)
31
25
 
32
26
  `main`, `master`, `develop`, `integration`, `trunk`, `release/*`, `staging`, `production`
33
27
 
34
- All components (agents, commands, skills) must use this exact list when checking for protected branches.
35
- The HUD mirrors this list in `TRUNK_BRANCHES`/`TRUNK_BRANCH_PREFIXES`/`isTrunkBranch()` in `src/core/git.ts` — update both together.
28
+ Every protected-branch check uses this exact list.
29
+ The HUD mirrors it in `TRUNK_BRANCHES`/`TRUNK_BRANCH_PREFIXES`/`isTrunkBranch()` in `src/core/git.ts`: update both together.
36
30
 
37
31
  ## Extended References
38
32
 
@@ -1,214 +0,0 @@
1
- ---
2
- description: Decision-preference profile distiller — mine past session transcripts across all projects to write ~/.devflow/preference-profile.md
3
- argument-hint: "[--dry-run]"
4
- ---
5
- ## Your task: author a Claude Code dynamic Workflow and run it
6
-
7
- You (the main model) will construct a Claude Code dynamic Workflow script inline and execute it using the `Workflow` tool. You do NOT write a static file — you author the script body right here, then pass it to the Workflow tool.
8
-
9
- ### Workflow runtime contract
10
-
11
- A workflow script MUST begin with a pure-literal export:
12
-
13
- ```js
14
- export const meta = {
15
- name: "devflow-dynamic-...", // flat hyphenated namespace — always prefix devflow-dynamic-
16
- description: "...",
17
- phases: ["..."]
18
- };
19
- ```
20
-
21
- The script body uses ONLY these hooks — nothing else:
22
-
23
- ```js
24
- agent(prompt, opts) // spawn a sub-agent; opts.agentType resolves devflow installed agents
25
- parallel(thunks) // barrier — awaits all; concurrency capped ~min(16, cores-2)
26
- pipeline(items, ...fns) // stream items through stages (no barrier between stages)
27
- phase(name, fn) // named phase boundary for resume / progress
28
- log(msg) // structured log
29
- workflow(fn) // nest one level
30
- ```
31
-
32
- Globals available in the script body: `args`, `budget`, `workflow()`.
33
-
34
- **The script body has NO filesystem / Node.js / CLI access** — no tracker CLI of any kind, `gh` included. All file reading, issue fetching, git operations, and shell commands happen INSIDE the agents the script spawns — never in the script body itself. There is no `fs`, no `exec`, no `fetch` in scope.
35
-
36
- ### Agent reuse via agentType
37
-
38
- Spawn devflow agents with:
39
-
40
- ```js
41
- agent("your prompt here", { agentType: "Code" })
42
- ```
43
-
44
- Valid `agentType` values: Code, Fix, Validate, Polish, Harden, Evaluate, Test, Review, Git, Synthesize, Knowledge, Design.
45
-
46
- **OMIT `opts.model` whenever `agentType` is set.** The agent frontmatter carries its own model tier (Code→sonnet, Validate→haiku, Review→opus, etc.) and that tier is honored automatically. Passing `opts.model` overrides it — always a mistake.
47
-
48
- Do not write logic that depends on an agent enumerating its own skills. Skills are loaded (confirmed by spike F5) but agents do not reliably self-report them.
49
-
50
- ### Pre-flight self-check — MANDATORY before the first live `Workflow` call
51
-
52
- Two distinct LLM-authored-script bugs have crashed whole runs in the field: `TypeError: pipeline() expects an array as the first argument` and `undefined is not an object (evaluating 'SEAL.num')`. Before you invoke the `Workflow` tool, audit the script you just authored against this checklist — it targets exactly those crash classes:
53
-
54
- - **`meta` is a pure literal** — `name` and `description` present; NO variables, function calls, spreads, or template interpolation anywhere inside `meta`.
55
- - **Every `pipeline(x, …)` / `parallel(x)` first argument is a real array** — never a function, object, or possibly-undefined value. If it derives from a prior agent result, coerce it: `parallel((maybeList || []).map(...))`.
56
- - **No reference to a possibly-undefined field** — guard every cross-result field access with optional chaining (e.g. `result?.findings`, `seal?.num`). This is the `SEAL.num` crash class: an agent returned a shape without `num`, so `SEAL.num` threw.
57
- - **`.filter(Boolean)` before mapping over `agent()` / `parallel()` results** — an agent can return `null` (skipped, or died after retries); strip nulls before `.map` or field access. filter(Boolean) is crash-safety only; it must never convert missing required coverage into success.
58
- - **`phase()` titles match the phases declared in `meta`** — every `phase("…")` call has a matching declared phase, and vice-versa.
59
-
60
- Then run a cheap syntax gate: write the authored script to a fresh, run-unique scratch file `/tmp/df-wf-check-<meta.name>-<epoch-seconds>.js` (a NEW filename every run — never reuse a prior run's path, as rewriting an existing file trips write guards), run `node --check` on that file, and only then pass the script text to the `Workflow` tool as usual. `node --check` catches SYNTAX errors only — it does NOT catch the runtime type errors above, so the checklist is the real safeguard.
61
-
62
- ### Budget scaling
63
-
64
- The `budget` global governs depth. Scale Review agent roster and verification votes to `budget`. A low-budget run uses a leaner roster and fewer verification votes; a high-budget run expands both. Never hardcode a roster size — let budget guide it.
65
-
66
- ### Handoff convention for sequential Code agents within a ticket
67
-
68
- When a ticket requires multiple sequential Code agent phases, each Code agent appends its own `## Phase {N} Implementation Summary` section, at most 8,192 bytes, to `{toplevel}/.devflow/docs/handoff-{branch_slug}.md` (branch-scoped to prevent concurrent session clobber), `{branch_slug}` being the ticket's branch name with every `/` replaced by `-`, and `{toplevel}` being `git rev-parse --show-toplevel` in the checkout the ticket's branch is in — never a subdirectory. It never rewrites an earlier section. The next Code agent reads, via HANDOFF_FILE input, only the section of the phase immediately before its own, not the whole file. PRIOR_PHASE_SUMMARY is the compact in-context form; the handoff file is the durable form that survives context compaction. Code is authoritative, summaries are supplementary.
69
-
70
- ### IRON RULE (LLM-vs-plumbing)
71
-
72
- **Author ZERO deterministic feature code.** No parsers, no schedulers, no topological-sort, no dependency-graph helpers, no confidence formulas. ALL issue reading, dependency reasoning, and scheduling decisions are LLM judgment at runtime, performed by the workflow's agents. The recipe is instructions. The workflow script Claude authors IS the runtime logic — keep it free of hand-coded feature algorithms.
73
-
74
- ### SAFETY BANNER
75
-
76
- **NEVER merge to main or master** — the workflow merges to an integration branch only. The user merges to main themselves after reviewing. This rule is absolute and must appear as an `engine_invariants()` note in every workflow that touches git.
77
-
78
- ---
79
-
80
- ## dynamic-profile — distill a decision-preference profile from past sessions
81
-
82
- This command spawns an agent (or a small set of parallel readers + a Synthesize agent) that reads past session history across ALL projects on this machine, finds the `AskUserQuestion` moments and the user's chosen answers, and writes a plain-prose preference profile to `~/.devflow/preference-profile.md`.
83
-
84
- The profile is then consumed by `/devflow:dynamic-plan` to pre-resolve design decisions matching established taste, so only genuinely new decisions reach the user.
85
-
86
- **This is a plain Agent spawn — not a Workflow.** No `Workflow` tool required. The agent does the reading and writing directly.
87
-
88
- ---
89
-
90
- **Requires:** read access to `{claude_dir}/projects/*/` session transcripts and `{claude_dir}/rules/`
91
- **Produces:** `~/.devflow/preference-profile.md` — plain-prose decision-preference profile
92
-
93
- ---
94
-
95
- ### Claude Code's directory
96
-
97
- `{claude_dir}` is Claude Code's directory, resolved once, the way the installer resolves it (D-CLAUDE-DIR-PROMPTS): `CLAUDE_CONFIG_DIR` when that is set to an absolute path, else `$HOME/.claude`. Run
98
-
99
- ```bash
100
- d="${CLAUDE_CONFIG_DIR:-}"; case "$d" in /*) ;; *) d="$HOME/.claude" ;; esac; printf '%s\n' "$d"
101
- ```
102
-
103
- and use its one-line output. Pass it to the agent below as `CLAUDE_DIR`.
104
-
105
- ---
106
-
107
- ### Privacy note
108
-
109
- This command mines session transcripts across **all projects** on this machine — `{claude_dir}/projects/*/*.jsonl`, `{claude_dir}/history.jsonl`, and feedback memories. The resulting profile is then injected into planning prompts as context. This is a cross-project surface: patterns from one project's decisions may influence planning in another.
110
-
111
- Mitigation: the profile is plain prose that you review and edit before use. You can trim, redact, or rewrite any section. The profile is at `~/.devflow/preference-profile.md` — open it, read it, adjust it. It is never committed to any repo.
112
-
113
- ---
114
-
115
- ### Bounded reading — mandatory
116
-
117
- Session transcripts on a typical machine are gigabytes. **The agent MUST NOT full-read transcripts into context.** Instead:
118
-
119
- 1. Use `rg` (ripgrep) or `grep` to search for `AskUserQuestion` occurrences across transcript files — extracting just the question text and the surrounding user response (a few lines each).
120
- 2. Sample the results — take up to ~200 instances spread across projects and time; do not feed everything into context at once.
121
- 3. Read `{claude_dir}/rules/` files (these are small) to supplement with explicitly stated preferences.
122
- 4. Read existing feedback memory files (`{claude_dir}/projects/*/memory/*.md`) — these are small and already distilled.
123
-
124
- This grep-and-sample approach is both efficient and Iron-Rule-safe: the agent uses `rg`/`grep` as tools — no extractor or clustering logic is authored.
125
-
126
- ---
127
-
128
- ### When --dry-run is passed
129
-
130
- Print what the agent would do (a summary of which paths under the resolved `{claude_dir}` it would search, what it would write) and STOP — do not spawn the agent.
131
-
132
- ---
133
-
134
- ### Agent task
135
-
136
- Spawn a single Knowledge agent with this task:
137
-
138
- ```
139
- You are distilling a decision-preference profile from past session history.
140
-
141
- CLAUDE_DIR: {claude_dir} — Claude Code's directory, already resolved; every path below is under it.
142
-
143
- BOUNDED READING — MANDATORY: transcripts are gigabytes; never full-read them.
144
- 1. Run: rg -l "AskUserQuestion" "{claude_dir}/projects/" 2>/dev/null | head -50
145
- to find transcript files that contain AskUserQuestion moments.
146
- 2. For each found file, run: rg -A 5 "AskUserQuestion" <file> | head -200
147
- to extract the question + nearby user response context. Sample broadly —
148
- aim for ~150-200 instances spread across projects and time windows.
149
- 3. Read {claude_dir}/history.jsonl if it exists (rg "AskUserQuestion" ... similarly).
150
- 4. Read all files in {claude_dir}/rules/ (small — read fully).
151
- 5. Read all *.md files in {claude_dir}/projects/*/memory/ (small — read fully).
152
-
153
- From this evidence, identify the recurring patterns in how the user answers design
154
- questions. Look for preferences about:
155
- - Error handling style (Result types vs exceptions, etc.)
156
- - Fix-all-issues vs defer-and-tech-debt stance
157
- - Architectural tradeoffs (coupling vs performance, etc.)
158
- - Code review behavior (accept suggestions or push back)
159
- - Testing discipline
160
- - Security stance
161
- - Any other recurrent taste patterns with at least 3 examples
162
-
163
- Write ~/.devflow/preference-profile.md as plain prose:
164
- - ## Overview: 1 paragraph summary of the user's overall decision style
165
- - ## Preferences (one ## section per identified pattern):
166
- - Pattern name
167
- - Observed behavior (plain language, no quotes from transcripts)
168
- - Confidence: high / medium / low (based on number of examples seen)
169
- - Example context: describe a scenario where this preference applies
170
- - ## Uncertain / incomplete: patterns with only 1-2 examples, flagged for user review
171
-
172
- Keep the profile scannable and honest. Do not fabricate preferences with no evidence.
173
- If a section has low confidence, say so. The user will review and edit this file.
174
-
175
- After writing, return: { path: "~/.devflow/preference-profile.md", patternCount: N, lowConfidenceCount: N }.
176
- ```
177
-
178
- Invoke the agent directly (not via a Workflow):
179
-
180
- ```js
181
- // Spawn a single Knowledge agent — no Workflow tool needed
182
- const result = await agent(
183
- `<the task above>`,
184
- { agentType: "Knowledge" }
185
- );
186
- ```
187
-
188
- After the agent completes, tell the user:
189
- - The profile was written to `~/.devflow/preference-profile.md`
190
- - How many patterns were found (and how many are low-confidence)
191
- - Prompt them to review and edit the file before running `/devflow:dynamic-plan`
192
- - Note: re-run this command any time to refresh the profile as new sessions accumulate
193
-
194
- ---
195
-
196
- ### Output
197
-
198
- After the agent returns, report:
199
-
200
- ```
201
- Profile written to ~/.devflow/preference-profile.md
202
- Patterns found: {patternCount} ({lowConfidenceCount} low-confidence — review these)
203
-
204
- Next steps:
205
- 1. Open ~/.devflow/preference-profile.md and review/edit the profile.
206
- 2. Run /devflow:dynamic-plan — it will read the profile and auto-resolve decisions matching your taste.
207
- 3. Re-run /devflow:dynamic-profile periodically to keep the profile fresh.
208
- ```
209
-
210
- ---
211
-
212
- ### Maintenance note
213
-
214
- This command mines ALL projects' history on this machine. The bounded-reading discipline (grep/rg + sample — never full-read) is mandatory and must be preserved in every revision. The agent writes prose; no extraction or clustering algorithm is authored here. Per the LLM-vs-plumbing Iron Rule: the agent does the reading and summarizing — not a script we maintain.