devflow-kit 1.7.0 → 1.8.0

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 (195) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +31 -1
  3. package/dist/cli.js +3 -1
  4. package/dist/commands/hud.d.ts +22 -0
  5. package/dist/commands/hud.js +180 -0
  6. package/dist/commands/init.d.ts +1 -0
  7. package/dist/commands/init.js +112 -3
  8. package/dist/commands/list.js +1 -0
  9. package/dist/commands/uninstall.js +9 -16
  10. package/dist/hud/cache.d.ts +14 -0
  11. package/dist/hud/cache.js +54 -0
  12. package/dist/hud/colors.d.ts +23 -0
  13. package/dist/hud/colors.js +62 -0
  14. package/dist/hud/components/config-counts.d.ts +8 -0
  15. package/dist/hud/components/config-counts.js +91 -0
  16. package/dist/hud/components/context-usage.d.ts +8 -0
  17. package/dist/hud/components/context-usage.js +49 -0
  18. package/dist/hud/components/diff-stats.d.ts +3 -0
  19. package/dist/hud/components/diff-stats.js +36 -0
  20. package/dist/hud/components/directory.d.ts +3 -0
  21. package/dist/hud/components/directory.js +10 -0
  22. package/dist/hud/components/git-ahead-behind.d.ts +3 -0
  23. package/dist/hud/components/git-ahead-behind.js +16 -0
  24. package/dist/hud/components/git-branch.d.ts +3 -0
  25. package/dist/hud/components/git-branch.js +14 -0
  26. package/dist/hud/components/model.d.ts +3 -0
  27. package/dist/hud/components/model.js +21 -0
  28. package/dist/hud/components/release-info.d.ts +3 -0
  29. package/dist/hud/components/release-info.js +9 -0
  30. package/dist/hud/components/session-cost.d.ts +3 -0
  31. package/dist/hud/components/session-cost.js +9 -0
  32. package/dist/hud/components/session-duration.d.ts +3 -0
  33. package/dist/hud/components/session-duration.js +18 -0
  34. package/dist/hud/components/todo-progress.d.ts +3 -0
  35. package/dist/hud/components/todo-progress.js +11 -0
  36. package/dist/hud/components/usage-quota.d.ts +3 -0
  37. package/dist/hud/components/usage-quota.js +45 -0
  38. package/dist/hud/components/version-badge.d.ts +3 -0
  39. package/dist/hud/components/version-badge.js +80 -0
  40. package/dist/hud/components/worktree-count.d.ts +3 -0
  41. package/dist/hud/components/worktree-count.js +8 -0
  42. package/dist/hud/config.d.ts +10 -0
  43. package/dist/hud/config.js +55 -0
  44. package/dist/hud/credentials.d.ts +17 -0
  45. package/dist/hud/credentials.js +99 -0
  46. package/dist/hud/git.d.ts +7 -0
  47. package/dist/hud/git.js +153 -0
  48. package/dist/hud/index.d.ts +2 -0
  49. package/dist/hud/index.js +81 -0
  50. package/dist/hud/render.d.ts +7 -0
  51. package/dist/hud/render.js +111 -0
  52. package/dist/hud/stdin.d.ts +6 -0
  53. package/dist/hud/stdin.js +25 -0
  54. package/dist/hud/transcript.d.ts +7 -0
  55. package/dist/hud/transcript.js +130 -0
  56. package/dist/hud/types.d.ts +116 -0
  57. package/dist/hud/types.js +2 -0
  58. package/dist/hud/usage-api.d.ts +7 -0
  59. package/dist/hud/usage-api.js +84 -0
  60. package/dist/utils/manifest.d.ts +1 -0
  61. package/package.json +5 -2
  62. package/plugins/devflow-accessibility/.claude-plugin/plugin.json +1 -1
  63. package/plugins/devflow-ambient/.claude-plugin/plugin.json +1 -1
  64. package/plugins/devflow-ambient/agents/scrutinizer.md +6 -4
  65. package/plugins/devflow-ambient/agents/shepherd.md +26 -12
  66. package/plugins/devflow-ambient/agents/simplifier.md +24 -15
  67. package/plugins/devflow-audit-claude/.claude-plugin/plugin.json +1 -1
  68. package/plugins/devflow-code-review/.claude-plugin/plugin.json +1 -1
  69. package/plugins/devflow-core-skills/.claude-plugin/plugin.json +1 -1
  70. package/plugins/devflow-debug/.claude-plugin/plugin.json +1 -1
  71. package/plugins/devflow-frontend-design/.claude-plugin/plugin.json +1 -1
  72. package/plugins/devflow-go/.claude-plugin/plugin.json +1 -1
  73. package/plugins/devflow-implement/.claude-plugin/plugin.json +1 -1
  74. package/plugins/devflow-implement/agents/scrutinizer.md +6 -4
  75. package/plugins/devflow-implement/agents/shepherd.md +26 -12
  76. package/plugins/devflow-implement/agents/simplifier.md +24 -15
  77. package/plugins/devflow-implement/skills/self-review/references/stub-detection.md +135 -0
  78. package/plugins/devflow-java/.claude-plugin/plugin.json +1 -1
  79. package/plugins/devflow-python/.claude-plugin/plugin.json +1 -1
  80. package/plugins/devflow-react/.claude-plugin/plugin.json +1 -1
  81. package/plugins/devflow-resolve/.claude-plugin/plugin.json +1 -1
  82. package/plugins/devflow-resolve/agents/simplifier.md +24 -15
  83. package/plugins/devflow-rust/.claude-plugin/plugin.json +1 -1
  84. package/plugins/devflow-self-review/.claude-plugin/plugin.json +1 -1
  85. package/plugins/devflow-self-review/agents/scrutinizer.md +6 -4
  86. package/plugins/devflow-self-review/agents/simplifier.md +24 -15
  87. package/plugins/devflow-self-review/skills/self-review/references/stub-detection.md +135 -0
  88. package/plugins/devflow-specify/.claude-plugin/plugin.json +1 -1
  89. package/plugins/devflow-typescript/.claude-plugin/plugin.json +1 -1
  90. package/scripts/hud/cache.d.ts +14 -0
  91. package/scripts/hud/cache.d.ts.map +1 -0
  92. package/scripts/hud/cache.js +54 -0
  93. package/scripts/hud/cache.js.map +1 -0
  94. package/scripts/hud/colors.d.ts +23 -0
  95. package/scripts/hud/colors.d.ts.map +1 -0
  96. package/scripts/hud/colors.js +62 -0
  97. package/scripts/hud/colors.js.map +1 -0
  98. package/scripts/hud/components/config-counts.d.ts +8 -0
  99. package/scripts/hud/components/config-counts.d.ts.map +1 -0
  100. package/scripts/hud/components/config-counts.js +91 -0
  101. package/scripts/hud/components/config-counts.js.map +1 -0
  102. package/scripts/hud/components/context-usage.d.ts +8 -0
  103. package/scripts/hud/components/context-usage.d.ts.map +1 -0
  104. package/scripts/hud/components/context-usage.js +49 -0
  105. package/scripts/hud/components/context-usage.js.map +1 -0
  106. package/scripts/hud/components/diff-stats.d.ts +3 -0
  107. package/scripts/hud/components/diff-stats.d.ts.map +1 -0
  108. package/scripts/hud/components/diff-stats.js +36 -0
  109. package/scripts/hud/components/diff-stats.js.map +1 -0
  110. package/scripts/hud/components/directory.d.ts +3 -0
  111. package/scripts/hud/components/directory.d.ts.map +1 -0
  112. package/scripts/hud/components/directory.js +10 -0
  113. package/scripts/hud/components/directory.js.map +1 -0
  114. package/scripts/hud/components/git-ahead-behind.d.ts +3 -0
  115. package/scripts/hud/components/git-ahead-behind.d.ts.map +1 -0
  116. package/scripts/hud/components/git-ahead-behind.js +16 -0
  117. package/scripts/hud/components/git-ahead-behind.js.map +1 -0
  118. package/scripts/hud/components/git-branch.d.ts +3 -0
  119. package/scripts/hud/components/git-branch.d.ts.map +1 -0
  120. package/scripts/hud/components/git-branch.js +14 -0
  121. package/scripts/hud/components/git-branch.js.map +1 -0
  122. package/scripts/hud/components/model.d.ts +3 -0
  123. package/scripts/hud/components/model.d.ts.map +1 -0
  124. package/scripts/hud/components/model.js +21 -0
  125. package/scripts/hud/components/model.js.map +1 -0
  126. package/scripts/hud/components/release-info.d.ts +3 -0
  127. package/scripts/hud/components/release-info.d.ts.map +1 -0
  128. package/scripts/hud/components/release-info.js +9 -0
  129. package/scripts/hud/components/release-info.js.map +1 -0
  130. package/scripts/hud/components/session-cost.d.ts +3 -0
  131. package/scripts/hud/components/session-cost.d.ts.map +1 -0
  132. package/scripts/hud/components/session-cost.js +9 -0
  133. package/scripts/hud/components/session-cost.js.map +1 -0
  134. package/scripts/hud/components/session-duration.d.ts +3 -0
  135. package/scripts/hud/components/session-duration.d.ts.map +1 -0
  136. package/scripts/hud/components/session-duration.js +18 -0
  137. package/scripts/hud/components/session-duration.js.map +1 -0
  138. package/scripts/hud/components/todo-progress.d.ts +3 -0
  139. package/scripts/hud/components/todo-progress.d.ts.map +1 -0
  140. package/scripts/hud/components/todo-progress.js +11 -0
  141. package/scripts/hud/components/todo-progress.js.map +1 -0
  142. package/scripts/hud/components/usage-quota.d.ts +3 -0
  143. package/scripts/hud/components/usage-quota.d.ts.map +1 -0
  144. package/scripts/hud/components/usage-quota.js +45 -0
  145. package/scripts/hud/components/usage-quota.js.map +1 -0
  146. package/scripts/hud/components/version-badge.d.ts +3 -0
  147. package/scripts/hud/components/version-badge.d.ts.map +1 -0
  148. package/scripts/hud/components/version-badge.js +80 -0
  149. package/scripts/hud/components/version-badge.js.map +1 -0
  150. package/scripts/hud/components/worktree-count.d.ts +3 -0
  151. package/scripts/hud/components/worktree-count.d.ts.map +1 -0
  152. package/scripts/hud/components/worktree-count.js +8 -0
  153. package/scripts/hud/components/worktree-count.js.map +1 -0
  154. package/scripts/hud/config.d.ts +10 -0
  155. package/scripts/hud/config.d.ts.map +1 -0
  156. package/scripts/hud/config.js +55 -0
  157. package/scripts/hud/config.js.map +1 -0
  158. package/scripts/hud/credentials.d.ts +17 -0
  159. package/scripts/hud/credentials.d.ts.map +1 -0
  160. package/scripts/hud/credentials.js +99 -0
  161. package/scripts/hud/credentials.js.map +1 -0
  162. package/scripts/hud/git.d.ts +7 -0
  163. package/scripts/hud/git.d.ts.map +1 -0
  164. package/scripts/hud/git.js +153 -0
  165. package/scripts/hud/git.js.map +1 -0
  166. package/scripts/hud/index.d.ts +2 -0
  167. package/scripts/hud/index.d.ts.map +1 -0
  168. package/scripts/hud/index.js +81 -0
  169. package/scripts/hud/index.js.map +1 -0
  170. package/scripts/hud/render.d.ts +7 -0
  171. package/scripts/hud/render.d.ts.map +1 -0
  172. package/scripts/hud/render.js +111 -0
  173. package/scripts/hud/render.js.map +1 -0
  174. package/scripts/hud/stdin.d.ts +6 -0
  175. package/scripts/hud/stdin.d.ts.map +1 -0
  176. package/scripts/hud/stdin.js +25 -0
  177. package/scripts/hud/stdin.js.map +1 -0
  178. package/scripts/hud/transcript.d.ts +7 -0
  179. package/scripts/hud/transcript.d.ts.map +1 -0
  180. package/scripts/hud/transcript.js +130 -0
  181. package/scripts/hud/transcript.js.map +1 -0
  182. package/scripts/hud/types.d.ts +116 -0
  183. package/scripts/hud/types.d.ts.map +1 -0
  184. package/scripts/hud/types.js +2 -0
  185. package/scripts/hud/types.js.map +1 -0
  186. package/scripts/hud/usage-api.d.ts +7 -0
  187. package/scripts/hud/usage-api.d.ts.map +1 -0
  188. package/scripts/hud/usage-api.js +84 -0
  189. package/scripts/hud/usage-api.js.map +1 -0
  190. package/scripts/hud.sh +5 -0
  191. package/shared/agents/scrutinizer.md +6 -4
  192. package/shared/agents/shepherd.md +26 -12
  193. package/shared/agents/simplifier.md +24 -15
  194. package/shared/skills/self-review/references/stub-detection.md +135 -0
  195. package/src/templates/settings.json +1 -1
@@ -30,31 +30,39 @@ Analyze recently modified code and apply refinements that:
30
30
  - Use proper error handling patterns (avoid try/catch when possible)
31
31
  - Maintain consistent naming conventions
32
32
 
33
- 3. **Enhance Clarity**: Simplify code structure by:
34
-
35
- - Reducing unnecessary complexity and nesting
36
- - Eliminating redundant code and abstractions
37
- - Improving readability through clear variable and function names
33
+ 3. **Remove Slop**: Detect and remove these categories:
34
+
35
+ | Category | Pattern |
36
+ |----------|---------|
37
+ | Language-behavior tests | Tests verifying built-in language features work as documented |
38
+ | Redundant type checks | Runtime checks for types TypeScript already enforces |
39
+ | Over-defensive handling | try/catch around code that cannot throw |
40
+ | Debug remnants | console.log, debugger, alert() left behind |
41
+ | Commented-out code | Dead code preserved in comments |
42
+ | Unused imports | Imports not referenced anywhere in file |
43
+ | Verbose names | Unnecessarily long names (`currentUserDataObject` → `user`) |
44
+ | Unnecessary intermediates | Variables used once, immediately after assignment |
45
+
46
+ 4. **Enhance Clarity**: Simplify code structure by:
47
+
48
+ - Reducing unnecessary nesting (early returns, guard clauses)
38
49
  - Consolidating related logic
39
- - Removing unnecessary comments that describe obvious code
40
- - IMPORTANT: Avoid nested ternary operators - prefer switch statements or if/else chains for multiple conditions
41
- - Choose clarity over brevity - explicit code is often better than overly compact code
50
+ - Avoiding nested ternary operators — prefer switch or if/else
51
+ - Choosing clarity over brevity — explicit code beats compact code
42
52
 
43
- 4. **Maintain Balance**: Avoid over-simplification that could:
53
+ 5. **Maintain Balance**: Avoid over-simplification that could:
44
54
 
45
- - Reduce code clarity or maintainability
46
55
  - Create overly clever solutions that are hard to understand
47
56
  - Combine too many concerns into single functions or components
48
57
  - Remove helpful abstractions that improve code organization
49
- - Prioritize "fewer lines" over readability (e.g., nested ternaries, dense one-liners)
50
58
  - Make the code harder to debug or extend
51
59
 
52
- 5. **Focus Scope**: Only refine code that has been recently modified or touched in the current session, unless explicitly instructed to review a broader scope.
60
+ 6. **Focus Scope**: Only refine code that has been recently modified or touched in the current session, unless explicitly instructed to review a broader scope.
53
61
 
54
62
  Your refinement process:
55
63
 
56
64
  1. Identify the recently modified code sections
57
- 2. Analyze for opportunities to improve elegance and consistency
65
+ 2. Analyze for slop categories and clarity improvements
58
66
  3. Apply project-specific best practices and coding standards
59
67
  4. Ensure all functionality remains unchanged
60
68
  5. Verify the refined code is simpler and more maintainable
@@ -87,7 +95,8 @@ Return structured completion status:
87
95
  - Files outside the recently modified scope (unless instructed)
88
96
 
89
97
  **Handle autonomously:**
90
- - Naming improvements, dead code removal, nesting reduction
98
+ - Slop removal (all 8 categories)
99
+ - Naming improvements, nesting reduction
91
100
  - Import sorting and organization
92
101
  - Redundant abstraction elimination
93
- - Comment cleanup (remove obvious, keep non-obvious)
102
+ - Comment cleanup (remove obvious, keep non-obvious)
@@ -0,0 +1,135 @@
1
+ # Stub Detection Patterns
2
+
3
+ Placeholder implementations that compile but don't deliver real functionality. Flag as **P0-Functionality** issues.
4
+
5
+ Cross-reference: `core-patterns/references/code-smell-violations.md` covers hardcoded data and fake functionality labeling. This file focuses on structural stub patterns.
6
+
7
+ ---
8
+
9
+ ## 1. Component Stubs
10
+
11
+ Render nothing meaningful or return placeholder markup.
12
+
13
+ ```tsx
14
+ // STUB — returns static text, no real rendering
15
+ function UserProfile({ userId }: Props) {
16
+ return <div>Name</div>;
17
+ }
18
+
19
+ // REAL — fetches and renders actual data
20
+ function UserProfile({ userId }: Props) {
21
+ const user = useUser(userId);
22
+ if (!user) return <Skeleton />;
23
+ return <div><h2>{user.name}</h2><p>{user.email}</p></div>;
24
+ }
25
+ ```
26
+
27
+ **Patterns to flag:**
28
+ - `return null` / `return <></>` in components that should render content
29
+ - Empty function bodies (`{}`) for handlers or lifecycle methods
30
+ - Components returning only hardcoded strings with no data binding
31
+
32
+ ---
33
+
34
+ ## 2. API / Service Stubs
35
+
36
+ Functions that exist in signature but throw, return hardcoded values, or do nothing.
37
+
38
+ ```typescript
39
+ // STUB — throws instead of implementing
40
+ async function createOrder(items: CartItem[]): Promise<Order> {
41
+ throw new Error("TODO: implement");
42
+ }
43
+
44
+ // STUB — hardcoded return, no real logic
45
+ async function getUser(id: string): Promise<User> {
46
+ return { id, name: "Test User", email: "test@test.com" };
47
+ }
48
+
49
+ // REAL — actual implementation
50
+ async function createOrder(items: CartItem[]): Promise<Result<Order, OrderError>> {
51
+ const validated = validateItems(items);
52
+ if (!validated.ok) return validated;
53
+ const order = await db.orders.create({ items: validated.value });
54
+ await queue.publish("order.created", order);
55
+ return { ok: true, value: order };
56
+ }
57
+ ```
58
+
59
+ **Patterns to flag:**
60
+ - `throw new Error("TODO")` / `throw new Error("Not implemented")`
61
+ - Functions returning hardcoded objects (no DB/API/computation)
62
+ - `"Not implemented"` strings in response bodies
63
+ - Empty async functions (`async function foo() {}`)
64
+
65
+ ---
66
+
67
+ ## 3. Hook / Effect Stubs
68
+
69
+ State and effects declared but not wired to behavior.
70
+
71
+ ```typescript
72
+ // STUB — effect does nothing
73
+ useEffect(() => {}, [userId]);
74
+
75
+ // STUB — state declared, setter never called
76
+ const [items, setItems] = useState<Item[]>([]);
77
+ // ... setItems never appears in the component
78
+
79
+ // STUB — custom hook returns static value
80
+ function usePermissions(): Permissions {
81
+ return { canEdit: true, canDelete: false };
82
+ }
83
+
84
+ // REAL — custom hook with actual logic
85
+ function usePermissions(): Permissions {
86
+ const { user } = useAuth();
87
+ const { data } = useQuery(["permissions", user.role], fetchPermissions);
88
+ return data ?? DEFAULT_PERMISSIONS;
89
+ }
90
+ ```
91
+
92
+ **Patterns to flag:**
93
+ - `useEffect(() => {}, [...])` — empty effect body
94
+ - `useState` where the setter is never called in the component
95
+ - Custom hooks returning static/hardcoded values
96
+ - `useMemo`/`useCallback` wrapping static values
97
+
98
+ ---
99
+
100
+ ## 4. Wiring Gaps
101
+
102
+ Individual pieces exist but aren't connected to the running application. **Highest-value detection** — these pass compilation and individual tests but the feature doesn't work end-to-end.
103
+
104
+ ```typescript
105
+ // GAP — fetch without await (result discarded)
106
+ function loadDashboard() {
107
+ fetchMetrics(); // Promise floats, never awaited
108
+ return <Dashboard />;
109
+ }
110
+
111
+ // GAP — state declared but never rendered
112
+ const [error, setError] = useState<string | null>(null);
113
+ // ... error never appears in JSX
114
+
115
+ // GAP — handler defined but not bound
116
+ function handleSubmit(data: FormData) { /* real logic */ }
117
+ // ... <form onSubmit={handleSubmit}> never appears
118
+
119
+ // GAP — route defined with no-op handler
120
+ app.post("/api/orders", (_req, res) => {
121
+ res.status(200).json({ ok: true });
122
+ });
123
+
124
+ // GAP — env var read but unused
125
+ const API_KEY = process.env.STRIPE_API_KEY;
126
+ // ... API_KEY never passed to any client or fetch call
127
+ ```
128
+
129
+ **Patterns to flag:**
130
+ - `fetch`/`axios`/API call without `await` or `.then` (result discarded)
131
+ - State variable (`useState`, `useRef`) never rendered or read in output
132
+ - Event handler defined but not bound to any element/listener
133
+ - Route/endpoint registered with empty or no-op handler
134
+ - Environment variable or config read but never used downstream
135
+ - Import used only in type position but imported as value (in non-type-only import)
@@ -4,7 +4,7 @@
4
4
  "author": {
5
5
  "name": "Dean0x"
6
6
  },
7
- "version": "1.7.0",
7
+ "version": "1.8.0",
8
8
  "homepage": "https://github.com/dean0x/devflow",
9
9
  "repository": "https://github.com/dean0x/devflow",
10
10
  "license": "MIT",
@@ -4,7 +4,7 @@
4
4
  "author": {
5
5
  "name": "Dean0x"
6
6
  },
7
- "version": "1.7.0",
7
+ "version": "1.8.0",
8
8
  "homepage": "https://github.com/dean0x/devflow",
9
9
  "repository": "https://github.com/dean0x/devflow",
10
10
  "license": "MIT",
@@ -4,7 +4,7 @@
4
4
  "author": {
5
5
  "name": "Dean0x"
6
6
  },
7
- "version": "1.7.0",
7
+ "version": "1.8.0",
8
8
  "homepage": "https://github.com/dean0x/devflow",
9
9
  "repository": "https://github.com/dean0x/devflow",
10
10
  "license": "MIT",
@@ -4,7 +4,7 @@
4
4
  "author": {
5
5
  "name": "Dean0x"
6
6
  },
7
- "version": "1.7.0",
7
+ "version": "1.8.0",
8
8
  "homepage": "https://github.com/dean0x/devflow",
9
9
  "repository": "https://github.com/dean0x/devflow",
10
10
  "license": "MIT",
@@ -30,31 +30,39 @@ Analyze recently modified code and apply refinements that:
30
30
  - Use proper error handling patterns (avoid try/catch when possible)
31
31
  - Maintain consistent naming conventions
32
32
 
33
- 3. **Enhance Clarity**: Simplify code structure by:
34
-
35
- - Reducing unnecessary complexity and nesting
36
- - Eliminating redundant code and abstractions
37
- - Improving readability through clear variable and function names
33
+ 3. **Remove Slop**: Detect and remove these categories:
34
+
35
+ | Category | Pattern |
36
+ |----------|---------|
37
+ | Language-behavior tests | Tests verifying built-in language features work as documented |
38
+ | Redundant type checks | Runtime checks for types TypeScript already enforces |
39
+ | Over-defensive handling | try/catch around code that cannot throw |
40
+ | Debug remnants | console.log, debugger, alert() left behind |
41
+ | Commented-out code | Dead code preserved in comments |
42
+ | Unused imports | Imports not referenced anywhere in file |
43
+ | Verbose names | Unnecessarily long names (`currentUserDataObject` → `user`) |
44
+ | Unnecessary intermediates | Variables used once, immediately after assignment |
45
+
46
+ 4. **Enhance Clarity**: Simplify code structure by:
47
+
48
+ - Reducing unnecessary nesting (early returns, guard clauses)
38
49
  - Consolidating related logic
39
- - Removing unnecessary comments that describe obvious code
40
- - IMPORTANT: Avoid nested ternary operators - prefer switch statements or if/else chains for multiple conditions
41
- - Choose clarity over brevity - explicit code is often better than overly compact code
50
+ - Avoiding nested ternary operators — prefer switch or if/else
51
+ - Choosing clarity over brevity — explicit code beats compact code
42
52
 
43
- 4. **Maintain Balance**: Avoid over-simplification that could:
53
+ 5. **Maintain Balance**: Avoid over-simplification that could:
44
54
 
45
- - Reduce code clarity or maintainability
46
55
  - Create overly clever solutions that are hard to understand
47
56
  - Combine too many concerns into single functions or components
48
57
  - Remove helpful abstractions that improve code organization
49
- - Prioritize "fewer lines" over readability (e.g., nested ternaries, dense one-liners)
50
58
  - Make the code harder to debug or extend
51
59
 
52
- 5. **Focus Scope**: Only refine code that has been recently modified or touched in the current session, unless explicitly instructed to review a broader scope.
60
+ 6. **Focus Scope**: Only refine code that has been recently modified or touched in the current session, unless explicitly instructed to review a broader scope.
53
61
 
54
62
  Your refinement process:
55
63
 
56
64
  1. Identify the recently modified code sections
57
- 2. Analyze for opportunities to improve elegance and consistency
65
+ 2. Analyze for slop categories and clarity improvements
58
66
  3. Apply project-specific best practices and coding standards
59
67
  4. Ensure all functionality remains unchanged
60
68
  5. Verify the refined code is simpler and more maintainable
@@ -87,7 +95,8 @@ Return structured completion status:
87
95
  - Files outside the recently modified scope (unless instructed)
88
96
 
89
97
  **Handle autonomously:**
90
- - Naming improvements, dead code removal, nesting reduction
98
+ - Slop removal (all 8 categories)
99
+ - Naming improvements, nesting reduction
91
100
  - Import sorting and organization
92
101
  - Redundant abstraction elimination
93
- - Comment cleanup (remove obvious, keep non-obvious)
102
+ - Comment cleanup (remove obvious, keep non-obvious)
@@ -4,7 +4,7 @@
4
4
  "author": {
5
5
  "name": "Dean0x"
6
6
  },
7
- "version": "1.7.0",
7
+ "version": "1.8.0",
8
8
  "homepage": "https://github.com/dean0x/devflow",
9
9
  "repository": "https://github.com/dean0x/devflow",
10
10
  "license": "MIT",
@@ -4,7 +4,7 @@
4
4
  "author": {
5
5
  "name": "Dean0x"
6
6
  },
7
- "version": "1.7.0",
7
+ "version": "1.8.0",
8
8
  "homepage": "https://github.com/dean0x/devflow",
9
9
  "repository": "https://github.com/dean0x/devflow",
10
10
  "license": "MIT",
@@ -21,13 +21,15 @@ You receive from orchestrator:
21
21
 
22
22
  2. **Evaluate P0 pillars** (Design, Functionality, Security): These MUST pass. Fix all issues found.
23
23
 
24
- 3. **Evaluate P1 pillars** (Complexity, Error Handling, Tests): These SHOULD pass. Fix all issues found.
24
+ 3. **Detect stubs and wiring gaps**: Check for placeholder implementations that compile but don't deliver real functionality. See `references/stub-detection.md` for patterns. Flag as P0-Functionality issues.
25
25
 
26
- 4. **Evaluate P2 pillars** (Naming, Consistency, Documentation): Report as suggestions. Fix if straightforward.
26
+ 4. **Evaluate P1 pillars** (Complexity, Error Handling, Tests): These SHOULD pass. Fix all issues found.
27
27
 
28
- 5. **Commit fixes**: If any changes were made, create a commit with message "fix: address self-review issues".
28
+ 5. **Evaluate P2 pillars** (Naming, Consistency, Documentation): Report as suggestions. Fix if straightforward.
29
29
 
30
- 6. **Report status**: Return structured report with pillar evaluations and changes made.
30
+ 6. **Commit fixes**: If any changes were made, create a commit with message "fix: address self-review issues".
31
+
32
+ 7. **Report status**: Return structured report with pillar evaluations and changes made.
31
33
 
32
34
  ## Principles
33
35
 
@@ -30,31 +30,39 @@ Analyze recently modified code and apply refinements that:
30
30
  - Use proper error handling patterns (avoid try/catch when possible)
31
31
  - Maintain consistent naming conventions
32
32
 
33
- 3. **Enhance Clarity**: Simplify code structure by:
34
-
35
- - Reducing unnecessary complexity and nesting
36
- - Eliminating redundant code and abstractions
37
- - Improving readability through clear variable and function names
33
+ 3. **Remove Slop**: Detect and remove these categories:
34
+
35
+ | Category | Pattern |
36
+ |----------|---------|
37
+ | Language-behavior tests | Tests verifying built-in language features work as documented |
38
+ | Redundant type checks | Runtime checks for types TypeScript already enforces |
39
+ | Over-defensive handling | try/catch around code that cannot throw |
40
+ | Debug remnants | console.log, debugger, alert() left behind |
41
+ | Commented-out code | Dead code preserved in comments |
42
+ | Unused imports | Imports not referenced anywhere in file |
43
+ | Verbose names | Unnecessarily long names (`currentUserDataObject` → `user`) |
44
+ | Unnecessary intermediates | Variables used once, immediately after assignment |
45
+
46
+ 4. **Enhance Clarity**: Simplify code structure by:
47
+
48
+ - Reducing unnecessary nesting (early returns, guard clauses)
38
49
  - Consolidating related logic
39
- - Removing unnecessary comments that describe obvious code
40
- - IMPORTANT: Avoid nested ternary operators - prefer switch statements or if/else chains for multiple conditions
41
- - Choose clarity over brevity - explicit code is often better than overly compact code
50
+ - Avoiding nested ternary operators — prefer switch or if/else
51
+ - Choosing clarity over brevity — explicit code beats compact code
42
52
 
43
- 4. **Maintain Balance**: Avoid over-simplification that could:
53
+ 5. **Maintain Balance**: Avoid over-simplification that could:
44
54
 
45
- - Reduce code clarity or maintainability
46
55
  - Create overly clever solutions that are hard to understand
47
56
  - Combine too many concerns into single functions or components
48
57
  - Remove helpful abstractions that improve code organization
49
- - Prioritize "fewer lines" over readability (e.g., nested ternaries, dense one-liners)
50
58
  - Make the code harder to debug or extend
51
59
 
52
- 5. **Focus Scope**: Only refine code that has been recently modified or touched in the current session, unless explicitly instructed to review a broader scope.
60
+ 6. **Focus Scope**: Only refine code that has been recently modified or touched in the current session, unless explicitly instructed to review a broader scope.
53
61
 
54
62
  Your refinement process:
55
63
 
56
64
  1. Identify the recently modified code sections
57
- 2. Analyze for opportunities to improve elegance and consistency
65
+ 2. Analyze for slop categories and clarity improvements
58
66
  3. Apply project-specific best practices and coding standards
59
67
  4. Ensure all functionality remains unchanged
60
68
  5. Verify the refined code is simpler and more maintainable
@@ -87,7 +95,8 @@ Return structured completion status:
87
95
  - Files outside the recently modified scope (unless instructed)
88
96
 
89
97
  **Handle autonomously:**
90
- - Naming improvements, dead code removal, nesting reduction
98
+ - Slop removal (all 8 categories)
99
+ - Naming improvements, nesting reduction
91
100
  - Import sorting and organization
92
101
  - Redundant abstraction elimination
93
- - Comment cleanup (remove obvious, keep non-obvious)
102
+ - Comment cleanup (remove obvious, keep non-obvious)
@@ -0,0 +1,135 @@
1
+ # Stub Detection Patterns
2
+
3
+ Placeholder implementations that compile but don't deliver real functionality. Flag as **P0-Functionality** issues.
4
+
5
+ Cross-reference: `core-patterns/references/code-smell-violations.md` covers hardcoded data and fake functionality labeling. This file focuses on structural stub patterns.
6
+
7
+ ---
8
+
9
+ ## 1. Component Stubs
10
+
11
+ Render nothing meaningful or return placeholder markup.
12
+
13
+ ```tsx
14
+ // STUB — returns static text, no real rendering
15
+ function UserProfile({ userId }: Props) {
16
+ return <div>Name</div>;
17
+ }
18
+
19
+ // REAL — fetches and renders actual data
20
+ function UserProfile({ userId }: Props) {
21
+ const user = useUser(userId);
22
+ if (!user) return <Skeleton />;
23
+ return <div><h2>{user.name}</h2><p>{user.email}</p></div>;
24
+ }
25
+ ```
26
+
27
+ **Patterns to flag:**
28
+ - `return null` / `return <></>` in components that should render content
29
+ - Empty function bodies (`{}`) for handlers or lifecycle methods
30
+ - Components returning only hardcoded strings with no data binding
31
+
32
+ ---
33
+
34
+ ## 2. API / Service Stubs
35
+
36
+ Functions that exist in signature but throw, return hardcoded values, or do nothing.
37
+
38
+ ```typescript
39
+ // STUB — throws instead of implementing
40
+ async function createOrder(items: CartItem[]): Promise<Order> {
41
+ throw new Error("TODO: implement");
42
+ }
43
+
44
+ // STUB — hardcoded return, no real logic
45
+ async function getUser(id: string): Promise<User> {
46
+ return { id, name: "Test User", email: "test@test.com" };
47
+ }
48
+
49
+ // REAL — actual implementation
50
+ async function createOrder(items: CartItem[]): Promise<Result<Order, OrderError>> {
51
+ const validated = validateItems(items);
52
+ if (!validated.ok) return validated;
53
+ const order = await db.orders.create({ items: validated.value });
54
+ await queue.publish("order.created", order);
55
+ return { ok: true, value: order };
56
+ }
57
+ ```
58
+
59
+ **Patterns to flag:**
60
+ - `throw new Error("TODO")` / `throw new Error("Not implemented")`
61
+ - Functions returning hardcoded objects (no DB/API/computation)
62
+ - `"Not implemented"` strings in response bodies
63
+ - Empty async functions (`async function foo() {}`)
64
+
65
+ ---
66
+
67
+ ## 3. Hook / Effect Stubs
68
+
69
+ State and effects declared but not wired to behavior.
70
+
71
+ ```typescript
72
+ // STUB — effect does nothing
73
+ useEffect(() => {}, [userId]);
74
+
75
+ // STUB — state declared, setter never called
76
+ const [items, setItems] = useState<Item[]>([]);
77
+ // ... setItems never appears in the component
78
+
79
+ // STUB — custom hook returns static value
80
+ function usePermissions(): Permissions {
81
+ return { canEdit: true, canDelete: false };
82
+ }
83
+
84
+ // REAL — custom hook with actual logic
85
+ function usePermissions(): Permissions {
86
+ const { user } = useAuth();
87
+ const { data } = useQuery(["permissions", user.role], fetchPermissions);
88
+ return data ?? DEFAULT_PERMISSIONS;
89
+ }
90
+ ```
91
+
92
+ **Patterns to flag:**
93
+ - `useEffect(() => {}, [...])` — empty effect body
94
+ - `useState` where the setter is never called in the component
95
+ - Custom hooks returning static/hardcoded values
96
+ - `useMemo`/`useCallback` wrapping static values
97
+
98
+ ---
99
+
100
+ ## 4. Wiring Gaps
101
+
102
+ Individual pieces exist but aren't connected to the running application. **Highest-value detection** — these pass compilation and individual tests but the feature doesn't work end-to-end.
103
+
104
+ ```typescript
105
+ // GAP — fetch without await (result discarded)
106
+ function loadDashboard() {
107
+ fetchMetrics(); // Promise floats, never awaited
108
+ return <Dashboard />;
109
+ }
110
+
111
+ // GAP — state declared but never rendered
112
+ const [error, setError] = useState<string | null>(null);
113
+ // ... error never appears in JSX
114
+
115
+ // GAP — handler defined but not bound
116
+ function handleSubmit(data: FormData) { /* real logic */ }
117
+ // ... <form onSubmit={handleSubmit}> never appears
118
+
119
+ // GAP — route defined with no-op handler
120
+ app.post("/api/orders", (_req, res) => {
121
+ res.status(200).json({ ok: true });
122
+ });
123
+
124
+ // GAP — env var read but unused
125
+ const API_KEY = process.env.STRIPE_API_KEY;
126
+ // ... API_KEY never passed to any client or fetch call
127
+ ```
128
+
129
+ **Patterns to flag:**
130
+ - `fetch`/`axios`/API call without `await` or `.then` (result discarded)
131
+ - State variable (`useState`, `useRef`) never rendered or read in output
132
+ - Event handler defined but not bound to any element/listener
133
+ - Route/endpoint registered with empty or no-op handler
134
+ - Environment variable or config read but never used downstream
135
+ - Import used only in type position but imported as value (in non-type-only import)
@@ -4,7 +4,7 @@
4
4
  "author": {
5
5
  "name": "Dean0x"
6
6
  },
7
- "version": "1.7.0",
7
+ "version": "1.8.0",
8
8
  "homepage": "https://github.com/dean0x/devflow",
9
9
  "repository": "https://github.com/dean0x/devflow",
10
10
  "license": "MIT",
@@ -4,7 +4,7 @@
4
4
  "author": {
5
5
  "name": "Dean0x"
6
6
  },
7
- "version": "1.7.0",
7
+ "version": "1.8.0",
8
8
  "homepage": "https://github.com/dean0x/devflow",
9
9
  "repository": "https://github.com/dean0x/devflow",
10
10
  "license": "MIT",
@@ -0,0 +1,14 @@
1
+ export declare function getCacheDir(): string;
2
+ /**
3
+ * Read a cached value. Returns null if missing or expired.
4
+ */
5
+ export declare function readCache<T>(key: string): T | null;
6
+ /**
7
+ * Read a cached value regardless of TTL (stale data). Returns null if missing.
8
+ */
9
+ export declare function readCacheStale<T>(key: string): T | null;
10
+ /**
11
+ * Write a value to cache with a TTL in milliseconds.
12
+ */
13
+ export declare function writeCache<T>(key: string, data: T, ttlMs: number): void;
14
+ //# sourceMappingURL=cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/cli/hud/cache.ts"],"names":[],"mappings":"AAUA,wBAAgB,WAAW,IAAI,MAAM,CAIpC;AAoBD;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAElD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAEvD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAWvE"}
@@ -0,0 +1,54 @@
1
+ import * as fs from 'node:fs';
2
+ import * as path from 'node:path';
3
+ import { homedir } from 'node:os';
4
+ export function getCacheDir() {
5
+ const devflowDir = process.env.DEVFLOW_DIR || path.join(process.env.HOME || homedir(), '.devflow');
6
+ return path.join(devflowDir, 'cache');
7
+ }
8
+ /**
9
+ * Read a cached value. Returns null if missing or expired.
10
+ * When `ignoreExpiry` is true, returns data regardless of TTL (stale read).
11
+ */
12
+ function readCacheEntry(key, ignoreExpiry) {
13
+ try {
14
+ const filePath = path.join(getCacheDir(), `${key}.json`);
15
+ const raw = fs.readFileSync(filePath, 'utf-8');
16
+ const entry = JSON.parse(raw);
17
+ if (ignoreExpiry || Date.now() - entry.timestamp < entry.ttl) {
18
+ return entry.data;
19
+ }
20
+ return null;
21
+ }
22
+ catch {
23
+ return null;
24
+ }
25
+ }
26
+ /**
27
+ * Read a cached value. Returns null if missing or expired.
28
+ */
29
+ export function readCache(key) {
30
+ return readCacheEntry(key, false);
31
+ }
32
+ /**
33
+ * Read a cached value regardless of TTL (stale data). Returns null if missing.
34
+ */
35
+ export function readCacheStale(key) {
36
+ return readCacheEntry(key, true);
37
+ }
38
+ /**
39
+ * Write a value to cache with a TTL in milliseconds.
40
+ */
41
+ export function writeCache(key, data, ttlMs) {
42
+ try {
43
+ const dir = getCacheDir();
44
+ if (!fs.existsSync(dir)) {
45
+ fs.mkdirSync(dir, { recursive: true });
46
+ }
47
+ const entry = { data, timestamp: Date.now(), ttl: ttlMs };
48
+ fs.writeFileSync(path.join(dir, `${key}.json`), JSON.stringify(entry));
49
+ }
50
+ catch {
51
+ // Cache write failure is non-fatal
52
+ }
53
+ }
54
+ //# sourceMappingURL=cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.js","sourceRoot":"","sources":["../../src/cli/hud/cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAQlC,MAAM,UAAU,WAAW;IACzB,MAAM,UAAU,GACd,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,OAAO,EAAE,EAAE,UAAU,CAAC,CAAC;IAClF,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AACxC,CAAC;AAED;;;GAGG;AACH,SAAS,cAAc,CAAI,GAAW,EAAE,YAAqB;IAC3D,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,GAAG,GAAG,OAAO,CAAC,CAAC;QACzD,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC/C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAkB,CAAC;QAC/C,IAAI,YAAY,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;YAC7D,OAAO,KAAK,CAAC,IAAI,CAAC;QACpB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAI,GAAW;IACtC,OAAO,cAAc,CAAI,GAAG,EAAE,KAAK,CAAC,CAAC;AACvC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAI,GAAW;IAC3C,OAAO,cAAc,CAAI,GAAG,EAAE,IAAI,CAAC,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAI,GAAW,EAAE,IAAO,EAAE,KAAa;IAC/D,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,WAAW,EAAE,CAAC;QAC1B,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACxB,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACzC,CAAC;QACD,MAAM,KAAK,GAAkB,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;QACzE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IACzE,CAAC;IAAC,MAAM,CAAC;QACP,mCAAmC;IACrC,CAAC;AACH,CAAC"}