devflow-kit 1.1.0 → 1.3.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 (152) hide show
  1. package/CHANGELOG.md +69 -1
  2. package/README.md +23 -6
  3. package/dist/cli.js +2 -0
  4. package/dist/commands/ambient.js +5 -4
  5. package/dist/commands/init.js +4 -2
  6. package/dist/commands/memory.js +4 -4
  7. package/dist/commands/skills.d.ts +11 -0
  8. package/dist/commands/skills.js +116 -0
  9. package/dist/commands/uninstall.js +11 -1
  10. package/dist/plugins.js +67 -3
  11. package/dist/utils/installer.js +20 -2
  12. package/package.json +4 -2
  13. package/plugins/devflow-accessibility/.claude-plugin/plugin.json +22 -0
  14. package/plugins/devflow-ambient/.claude-plugin/plugin.json +4 -2
  15. package/plugins/devflow-ambient/README.md +8 -8
  16. package/plugins/devflow-ambient/commands/ambient.md +14 -14
  17. package/plugins/devflow-ambient/skills/ambient-router/SKILL.md +16 -9
  18. package/plugins/devflow-ambient/skills/ambient-router/references/skill-catalog.md +6 -2
  19. package/plugins/devflow-audit-claude/.claude-plugin/plugin.json +1 -1
  20. package/plugins/devflow-code-review/.claude-plugin/plugin.json +13 -6
  21. package/plugins/devflow-code-review/agents/reviewer.md +8 -0
  22. package/plugins/devflow-code-review/commands/code-review-teams.md +11 -1
  23. package/plugins/devflow-code-review/commands/code-review.md +12 -2
  24. package/plugins/devflow-code-review/skills/architecture-patterns/SKILL.md +1 -1
  25. package/plugins/devflow-code-review/skills/complexity-patterns/SKILL.md +1 -1
  26. package/plugins/devflow-code-review/skills/consistency-patterns/SKILL.md +1 -1
  27. package/plugins/devflow-code-review/skills/database-patterns/SKILL.md +1 -1
  28. package/plugins/devflow-code-review/skills/dependencies-patterns/SKILL.md +1 -1
  29. package/plugins/devflow-code-review/skills/documentation-patterns/SKILL.md +1 -1
  30. package/plugins/devflow-code-review/skills/performance-patterns/SKILL.md +1 -1
  31. package/plugins/devflow-code-review/skills/regression-patterns/SKILL.md +1 -1
  32. package/plugins/devflow-code-review/skills/review-methodology/SKILL.md +1 -1
  33. package/plugins/devflow-code-review/skills/security-patterns/SKILL.md +1 -1
  34. package/plugins/devflow-core-skills/.claude-plugin/plugin.json +10 -7
  35. package/plugins/devflow-core-skills/skills/test-driven-development/SKILL.md +5 -8
  36. package/plugins/devflow-debug/.claude-plugin/plugin.json +10 -3
  37. package/plugins/devflow-frontend-design/.claude-plugin/plugin.json +22 -0
  38. package/plugins/devflow-go/.claude-plugin/plugin.json +22 -0
  39. package/plugins/devflow-go/skills/go/SKILL.md +187 -0
  40. package/plugins/devflow-go/skills/go/references/concurrency.md +312 -0
  41. package/plugins/devflow-go/skills/go/references/detection.md +129 -0
  42. package/plugins/devflow-go/skills/go/references/patterns.md +232 -0
  43. package/plugins/devflow-go/skills/go/references/violations.md +205 -0
  44. package/plugins/devflow-implement/.claude-plugin/plugin.json +19 -5
  45. package/plugins/devflow-implement/agents/coder.md +11 -6
  46. package/plugins/devflow-implement/skills/self-review/SKILL.md +1 -1
  47. package/plugins/devflow-java/.claude-plugin/plugin.json +22 -0
  48. package/plugins/devflow-java/skills/java/SKILL.md +183 -0
  49. package/plugins/devflow-java/skills/java/references/detection.md +120 -0
  50. package/plugins/devflow-java/skills/java/references/modern-java.md +270 -0
  51. package/plugins/devflow-java/skills/java/references/patterns.md +235 -0
  52. package/plugins/devflow-java/skills/java/references/violations.md +213 -0
  53. package/plugins/devflow-python/.claude-plugin/plugin.json +22 -0
  54. package/plugins/devflow-python/skills/python/SKILL.md +188 -0
  55. package/plugins/devflow-python/skills/python/references/async.md +220 -0
  56. package/plugins/devflow-python/skills/python/references/detection.md +128 -0
  57. package/plugins/devflow-python/skills/python/references/patterns.md +226 -0
  58. package/plugins/devflow-python/skills/python/references/violations.md +204 -0
  59. package/plugins/devflow-react/.claude-plugin/plugin.json +22 -0
  60. package/plugins/{devflow-core-skills → devflow-react}/skills/react/SKILL.md +1 -1
  61. package/plugins/{devflow-core-skills → devflow-react}/skills/react/references/patterns.md +3 -3
  62. package/plugins/devflow-resolve/.claude-plugin/plugin.json +13 -3
  63. package/plugins/devflow-resolve/skills/security-patterns/SKILL.md +1 -1
  64. package/plugins/devflow-rust/.claude-plugin/plugin.json +22 -0
  65. package/plugins/devflow-rust/skills/rust/SKILL.md +193 -0
  66. package/plugins/devflow-rust/skills/rust/references/detection.md +131 -0
  67. package/plugins/devflow-rust/skills/rust/references/ownership.md +242 -0
  68. package/plugins/devflow-rust/skills/rust/references/patterns.md +210 -0
  69. package/plugins/devflow-rust/skills/rust/references/violations.md +191 -0
  70. package/plugins/devflow-self-review/.claude-plugin/plugin.json +10 -3
  71. package/plugins/devflow-self-review/skills/self-review/SKILL.md +1 -1
  72. package/plugins/devflow-specify/.claude-plugin/plugin.json +15 -4
  73. package/plugins/devflow-typescript/.claude-plugin/plugin.json +22 -0
  74. package/plugins/{devflow-core-skills → devflow-typescript}/skills/typescript/references/patterns.md +3 -3
  75. package/scripts/hooks/{ambient-prompt.sh → ambient-prompt} +4 -4
  76. package/scripts/hooks/{background-memory-update.sh → background-memory-update} +3 -3
  77. package/scripts/hooks/{ensure-memory-gitignore.sh → ensure-memory-gitignore} +1 -1
  78. package/scripts/hooks/{pre-compact-memory.sh → pre-compact-memory} +2 -2
  79. package/scripts/hooks/run-hook +23 -0
  80. package/scripts/hooks/session-start-memory +151 -0
  81. package/scripts/hooks/{stop-update-memory.sh → stop-update-memory} +4 -4
  82. package/shared/agents/coder.md +11 -6
  83. package/shared/agents/reviewer.md +8 -0
  84. package/shared/skills/ambient-router/SKILL.md +16 -9
  85. package/shared/skills/ambient-router/references/skill-catalog.md +6 -2
  86. package/shared/skills/architecture-patterns/SKILL.md +1 -1
  87. package/shared/skills/complexity-patterns/SKILL.md +1 -1
  88. package/shared/skills/consistency-patterns/SKILL.md +1 -1
  89. package/shared/skills/database-patterns/SKILL.md +1 -1
  90. package/shared/skills/dependencies-patterns/SKILL.md +1 -1
  91. package/shared/skills/documentation-patterns/SKILL.md +1 -1
  92. package/shared/skills/go/SKILL.md +187 -0
  93. package/shared/skills/go/references/concurrency.md +312 -0
  94. package/shared/skills/go/references/detection.md +129 -0
  95. package/shared/skills/go/references/patterns.md +232 -0
  96. package/shared/skills/go/references/violations.md +205 -0
  97. package/shared/skills/java/SKILL.md +183 -0
  98. package/shared/skills/java/references/detection.md +120 -0
  99. package/shared/skills/java/references/modern-java.md +270 -0
  100. package/shared/skills/java/references/patterns.md +235 -0
  101. package/shared/skills/java/references/violations.md +213 -0
  102. package/shared/skills/performance-patterns/SKILL.md +1 -1
  103. package/shared/skills/python/SKILL.md +188 -0
  104. package/shared/skills/python/references/async.md +220 -0
  105. package/shared/skills/python/references/detection.md +128 -0
  106. package/shared/skills/python/references/patterns.md +226 -0
  107. package/shared/skills/python/references/violations.md +204 -0
  108. package/shared/skills/react/SKILL.md +1 -1
  109. package/shared/skills/react/references/patterns.md +3 -3
  110. package/shared/skills/regression-patterns/SKILL.md +1 -1
  111. package/shared/skills/review-methodology/SKILL.md +1 -1
  112. package/shared/skills/rust/SKILL.md +193 -0
  113. package/shared/skills/rust/references/detection.md +131 -0
  114. package/shared/skills/rust/references/ownership.md +242 -0
  115. package/shared/skills/rust/references/patterns.md +210 -0
  116. package/shared/skills/rust/references/violations.md +191 -0
  117. package/shared/skills/security-patterns/SKILL.md +1 -1
  118. package/shared/skills/self-review/SKILL.md +1 -1
  119. package/shared/skills/test-driven-development/SKILL.md +5 -8
  120. package/shared/skills/typescript/references/patterns.md +3 -3
  121. package/src/templates/settings.json +3 -3
  122. package/plugins/devflow-code-review/skills/react/SKILL.md +0 -276
  123. package/plugins/devflow-code-review/skills/react/references/patterns.md +0 -1331
  124. package/plugins/devflow-core-skills/skills/accessibility/SKILL.md +0 -229
  125. package/plugins/devflow-core-skills/skills/accessibility/references/detection.md +0 -171
  126. package/plugins/devflow-core-skills/skills/accessibility/references/patterns.md +0 -670
  127. package/plugins/devflow-core-skills/skills/accessibility/references/violations.md +0 -419
  128. package/plugins/devflow-core-skills/skills/frontend-design/SKILL.md +0 -254
  129. package/plugins/devflow-core-skills/skills/frontend-design/references/detection.md +0 -184
  130. package/plugins/devflow-core-skills/skills/frontend-design/references/patterns.md +0 -511
  131. package/plugins/devflow-core-skills/skills/frontend-design/references/violations.md +0 -453
  132. package/plugins/devflow-core-skills/skills/react/references/violations.md +0 -565
  133. package/plugins/devflow-implement/skills/accessibility/SKILL.md +0 -229
  134. package/plugins/devflow-implement/skills/accessibility/references/detection.md +0 -171
  135. package/plugins/devflow-implement/skills/accessibility/references/patterns.md +0 -670
  136. package/plugins/devflow-implement/skills/accessibility/references/violations.md +0 -419
  137. package/plugins/devflow-implement/skills/frontend-design/SKILL.md +0 -254
  138. package/plugins/devflow-implement/skills/frontend-design/references/detection.md +0 -184
  139. package/plugins/devflow-implement/skills/frontend-design/references/patterns.md +0 -511
  140. package/plugins/devflow-implement/skills/frontend-design/references/violations.md +0 -453
  141. package/scripts/hooks/session-start-memory.sh +0 -126
  142. /package/plugins/{devflow-code-review → devflow-accessibility}/skills/accessibility/SKILL.md +0 -0
  143. /package/plugins/{devflow-code-review → devflow-accessibility}/skills/accessibility/references/detection.md +0 -0
  144. /package/plugins/{devflow-code-review → devflow-accessibility}/skills/accessibility/references/patterns.md +0 -0
  145. /package/plugins/{devflow-code-review → devflow-accessibility}/skills/accessibility/references/violations.md +0 -0
  146. /package/plugins/{devflow-code-review → devflow-frontend-design}/skills/frontend-design/SKILL.md +0 -0
  147. /package/plugins/{devflow-code-review → devflow-frontend-design}/skills/frontend-design/references/detection.md +0 -0
  148. /package/plugins/{devflow-code-review → devflow-frontend-design}/skills/frontend-design/references/patterns.md +0 -0
  149. /package/plugins/{devflow-code-review → devflow-frontend-design}/skills/frontend-design/references/violations.md +0 -0
  150. /package/plugins/{devflow-code-review → devflow-react}/skills/react/references/violations.md +0 -0
  151. /package/plugins/{devflow-core-skills → devflow-typescript}/skills/typescript/SKILL.md +0 -0
  152. /package/plugins/{devflow-core-skills → devflow-typescript}/skills/typescript/references/violations.md +0 -0
@@ -1,276 +0,0 @@
1
- ---
2
- name: react
3
- description: This skill should be used when the user works with React components (.tsx/.jsx), asks about "hooks", "state management", "context providers", "memo optimization", "useEffect", or discusses component composition and rendering performance. Provides patterns for hooks, state, effects, memoization, and React-specific architecture.
4
- user-invocable: false
5
- allowed-tools: Read, Grep, Glob
6
- activation:
7
- file-patterns:
8
- - "**/*.tsx"
9
- - "**/*.jsx"
10
- exclude:
11
- - "node_modules/**"
12
- - "**/*.test.*"
13
- - "**/*.spec.*"
14
- ---
15
-
16
- # React Patterns
17
-
18
- Reference for React-specific patterns, component design, hooks, and performance optimization.
19
-
20
- ## Iron Law
21
-
22
- > **COMPOSITION OVER PROPS**
23
- >
24
- > Use children and compound components, not prop drilling. If a component has >5 props,
25
- > it's doing too much. Split it. If you're passing data through 3+ levels, use context
26
- > or composition. Props are for configuration, not data plumbing.
27
-
28
- ## When This Skill Activates
29
-
30
- - Working with React codebases
31
- - Creating components and hooks
32
- - Managing state and side effects
33
- - Optimizing render performance
34
-
35
- ---
36
-
37
- ## Component Patterns
38
-
39
- ### Functional Component Structure
40
-
41
- ```tsx
42
- export function UserCard({ user, className }: UserCardProps) {
43
- const [isExpanded, setIsExpanded] = useState(false); // 1. Hooks first
44
- const displayName = user.firstName + ' ' + user.lastName; // 2. Derived state
45
- const handleToggle = () => setIsExpanded((prev) => !prev); // 3. Handlers
46
- return ( // 4. Render
47
- <div className={cn('user-card', className)}>
48
- <h3>{displayName}</h3>
49
- {isExpanded && <UserDetails user={user} />}
50
- <button onClick={handleToggle}>{isExpanded ? 'Collapse' : 'Expand'}</button>
51
- </div>
52
- );
53
- }
54
- ```
55
-
56
- ### Composition Over Props
57
-
58
- ```tsx
59
- function Card({ children }: { children: React.ReactNode }) {
60
- return <div className="card">{children}</div>;
61
- }
62
- Card.Header = ({ children }) => <div className="card-header">{children}</div>;
63
- Card.Body = ({ children }) => <div className="card-body">{children}</div>;
64
-
65
- // Usage - flexible, not rigid props
66
- <Card>
67
- <Card.Header><h2>Title</h2></Card.Header>
68
- <Card.Body><p>Content</p></Card.Body>
69
- </Card>
70
- ```
71
-
72
- ---
73
-
74
- ## Hook Patterns
75
-
76
- ```tsx
77
- function useLocalStorage<T>(key: string, initialValue: T) {
78
- const [value, setValue] = useState<T>(() => {
79
- const stored = localStorage.getItem(key);
80
- return stored ? JSON.parse(stored) : initialValue;
81
- });
82
- useEffect(() => localStorage.setItem(key, JSON.stringify(value)), [key, value]);
83
- return [value, setValue] as const;
84
- }
85
- ```
86
-
87
- ---
88
-
89
- ## State Management
90
-
91
- ```tsx
92
- const AuthContext = createContext<AuthContextValue | null>(null);
93
-
94
- export function AuthProvider({ children }: { children: React.ReactNode }) {
95
- const [user, setUser] = useState<User | null>(null);
96
- const login = async (creds: Credentials) => setUser(await authApi.login(creds));
97
- const logout = () => { authApi.logout(); setUser(null); };
98
- return <AuthContext.Provider value={{ user, login, logout }}>{children}</AuthContext.Provider>;
99
- }
100
-
101
- export function useAuth() {
102
- const ctx = useContext(AuthContext);
103
- if (!ctx) throw new Error('useAuth must be used within AuthProvider');
104
- return ctx;
105
- }
106
- ```
107
-
108
- ---
109
-
110
- ## Performance
111
-
112
- ```tsx
113
- function UserList({ users, filter }: { users: User[]; filter: string }) {
114
- const filtered = useMemo(() => users.filter((u) => u.name.includes(filter)), [users, filter]);
115
- const onClick = useCallback(() => console.log('Clicked'), []);
116
- return <ul>{filtered.map((u) => <MemoItem key={u.id} user={u} onClick={onClick} />)}</ul>;
117
- }
118
- const MemoItem = memo(({ user }: { user: User }) => <li>{user.name}</li>);
119
- ```
120
-
121
- ---
122
-
123
- ## Async Parallelization
124
-
125
- ```tsx
126
- // CORRECT: Independent fetches run in parallel
127
- async function loadDashboard(userId: string) {
128
- const [user, orders, preferences] = await Promise.all([
129
- fetchUser(userId),
130
- fetchOrders(userId),
131
- fetchPreferences(userId),
132
- ]);
133
- return { user, orders, preferences };
134
- }
135
-
136
- // VIOLATION: Sequential fetches (3x slower)
137
- async function loadDashboardSlow(userId: string) {
138
- const user = await fetchUser(userId);
139
- const orders = await fetchOrders(userId);
140
- const preferences = await fetchPreferences(userId);
141
- return { user, orders, preferences };
142
- }
143
- ```
144
-
145
- ---
146
-
147
- ## Bundle Size
148
-
149
- ```tsx
150
- // CORRECT: Direct imports (tree-shakable)
151
- import { Button } from '@/components/Button';
152
- import { Card } from '@/components/Card';
153
-
154
- // VIOLATION: Barrel imports (imports entire library)
155
- import { Button, Card } from '@/components';
156
-
157
- // CORRECT: Dynamic import for heavy components
158
- const Chart = lazy(() => import('./Chart'));
159
- const Editor = lazy(() => import('./Editor'));
160
-
161
- function Dashboard() {
162
- return (
163
- <Suspense fallback={<Skeleton />}>
164
- {showChart && <Chart data={data} />}
165
- </Suspense>
166
- );
167
- }
168
- ```
169
-
170
- ---
171
-
172
- ## Re-render Optimization
173
-
174
- ```tsx
175
- // CORRECT: Primitive deps (stable references)
176
- useEffect(() => {
177
- fetchData(userId, isActive);
178
- }, [userId, isActive]); // primitives don't cause unnecessary runs
179
-
180
- // VIOLATION: Object/array deps (new reference every render)
181
- useEffect(() => {
182
- fetchData(options);
183
- }, [options]); // { page: 1 } !== { page: 1 }
184
-
185
- // CORRECT: Stable callback with useCallback
186
- const handleClick = useCallback((id: string) => {
187
- setSelected(id);
188
- }, []); // no deps = stable reference
189
-
190
- // VIOLATION: Inline function (new reference every render)
191
- <List onItemClick={(id) => setSelected(id)} />
192
- ```
193
-
194
- ---
195
-
196
- ## Image Optimization
197
-
198
- ```tsx
199
- // CORRECT: Optimized image with all attributes
200
- <img
201
- src={url}
202
- alt={description}
203
- width={400}
204
- height={300}
205
- loading="lazy"
206
- decoding="async"
207
- style={{ aspectRatio: '4/3' }}
208
- />
209
-
210
- // VIOLATION: Unoptimized image
211
- <img src={url} /> // No dimensions, no lazy loading, layout shift
212
- ```
213
-
214
- ---
215
-
216
- ## Data Structure Performance
217
-
218
- ```tsx
219
- // CORRECT: Set for O(1) membership checks
220
- const selectedIds = new Set(selected);
221
- const isSelected = (id: string) => selectedIds.has(id);
222
-
223
- // VIOLATION: Array.includes is O(n)
224
- const isSelected = (id: string) => selected.includes(id);
225
-
226
- // CORRECT: Map for key-value lookups
227
- const usersById = new Map(users.map(u => [u.id, u]));
228
- const getUser = (id: string) => usersById.get(id);
229
-
230
- // VIOLATION: Array.find is O(n)
231
- const getUser = (id: string) => users.find(u => u.id === id);
232
- ```
233
-
234
- ---
235
-
236
- ## Anti-Patterns
237
-
238
- ```tsx
239
- // BAD: Derived state in useState | GOOD: useMemo
240
- const filtered = useMemo(() => items.filter(i => i.active), [items]);
241
-
242
- // BAD: Missing dependency | GOOD: Include all deps
243
- useEffect(() => { fetchData(userId); }, [userId]);
244
-
245
- // BAD: State update in render | GOOD: Use effect
246
- useEffect(() => { setState(value); }, [value]);
247
- ```
248
-
249
- ---
250
-
251
- ## Extended References
252
-
253
- - `references/patterns.md` - Render props, reducers, virtualization, lazy loading
254
- - `references/hooks.md` - useQuery, useDebouncedValue, usePrevious, useClickOutside
255
- - `references/forms.md` - Controlled forms, validation hooks, multi-step forms
256
- - `references/error-handling.md` - Error boundaries, async error handling
257
-
258
- ---
259
-
260
- ## Checklist
261
-
262
- - [ ] Hooks at top level only
263
- - [ ] All useEffect deps included
264
- - [ ] useCallback for handlers passed to children
265
- - [ ] useMemo for expensive computations
266
- - [ ] Context at appropriate level
267
- - [ ] Error boundaries around risky components
268
- - [ ] Keys on list items (not index)
269
- - [ ] Loading/error states handled
270
- - [ ] Accessibility (aria-*, role)
271
- - [ ] Independent fetches parallelized with Promise.all
272
- - [ ] No barrel imports (direct imports for tree-shaking)
273
- - [ ] Large components lazy-loaded
274
- - [ ] Object/array deps avoided in useEffect (use primitives)
275
- - [ ] Set/Map used for lookups instead of Array.includes/find
276
- - [ ] Images have dimensions, lazy loading, and aspect-ratio