devflow-kit 0.3.3 β†’ 0.4.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.
@@ -0,0 +1,507 @@
1
+ ---
2
+ allowed-tools: TodoWrite, Read, Write, Edit, AskUserQuestion, Bash, Grep, Glob
3
+ description: Smart implementation orchestrator - triages todos, seeks clarification, and implements tasks iteratively with continuous user interaction
4
+ ---
5
+
6
+ ## Your task
7
+
8
+ Orchestrate intelligent implementation of planned tasks from the todo list. This command provides interactive guidance through the implementation process, asking for clarification when needed and ensuring quality through existing skills.
9
+
10
+ **Philosophy**: Pair programming with AI - you decide priorities and provide clarification, I implement with your guidance.
11
+
12
+ ---
13
+
14
+ ## Step 1: Load and Display Current Todos
15
+
16
+ Get the current todo list and show it to the user:
17
+
18
+ ```
19
+ Fetch current todos using TodoWrite to get state.
20
+ ```
21
+
22
+ Display todos grouped by status:
23
+
24
+ ```markdown
25
+ πŸ“‹ **Current Todo List**
26
+
27
+ ### πŸ”„ In Progress ({count})
28
+ - {todo 1}
29
+ - {todo 2}
30
+
31
+ ### ⏳ Pending ({count})
32
+ - {todo 1}
33
+ - {todo 2}
34
+ - {todo 3}
35
+
36
+ ### βœ… Completed ({count})
37
+ - {todo 1}
38
+ - {todo 2}
39
+ ```
40
+
41
+ If no pending or in-progress todos:
42
+ ```
43
+ No todos found. Run /plan-next-steps to create actionable tasks, or use TodoWrite to add tasks manually.
44
+ ```
45
+
46
+ ---
47
+
48
+ ## Step 2: Todo Triage
49
+
50
+ Use AskUserQuestion to let the user manage their todo list:
51
+
52
+ **Question 1: Remove unnecessary todos?**
53
+ ```
54
+ header: "Remove todos"
55
+ question: "Are there any todos you want to remove from the list?"
56
+ multiSelect: true
57
+ options: [List all pending/in-progress todos]
58
+ ```
59
+
60
+ Update TodoWrite to remove selected todos.
61
+
62
+ **Question 2: Defer todos for later?**
63
+ ```
64
+ header: "Defer todos"
65
+ question: "Any todos you want to discuss/plan later instead of implementing now?"
66
+ multiSelect: true
67
+ options: [List remaining pending/in-progress todos]
68
+ ```
69
+
70
+ For deferred todos, add note to todo content: "(Deferred - discuss later)" and mark as pending.
71
+
72
+ **Question 3: Prioritize implementation order**
73
+ ```
74
+ header: "Priority order"
75
+ question: "Which todo should we implement FIRST?"
76
+ multiSelect: false
77
+ options: [List remaining pending/in-progress todos with complexity indicators]
78
+ ```
79
+
80
+ Reorder todos based on selection. Present final implementation queue:
81
+
82
+ ```markdown
83
+ 🎯 **Implementation Queue**
84
+
85
+ 1. {todo 1} - {complexity: Simple/Medium/Complex}
86
+ 2. {todo 2} - {complexity}
87
+ 3. {todo 3} - {complexity}
88
+
89
+ Total: {count} todos to implement
90
+ ```
91
+
92
+ ---
93
+
94
+ ## Step 3: Iterative Implementation
95
+
96
+ For each todo in priority order:
97
+
98
+ ### 3.1 Analyze Todo
99
+
100
+ **Check clarity**:
101
+ - Is the task clear and specific?
102
+ - Are there multiple possible approaches?
103
+ - Is there missing context (file paths, specific requirements)?
104
+
105
+ **Assess complexity**:
106
+ - **Simple**: Single file change, clear approach (< 50 lines)
107
+ - **Medium**: Multiple files, standard patterns (50-150 lines)
108
+ - **Complex**: Architectural changes, new patterns (> 150 lines)
109
+
110
+ ### 3.2 Seek Clarification (if needed)
111
+
112
+ **Only if genuinely unclear**, ask ONE question using AskUserQuestion:
113
+
114
+ ```
115
+ header: "Clarification"
116
+ question: "For '{todo}': {specific question about the unclear aspect}?"
117
+ multiSelect: false
118
+ options: [
119
+ {option 1 with explanation},
120
+ {option 2 with explanation},
121
+ {option 3 with explanation}
122
+ ]
123
+ ```
124
+
125
+ **Examples of when to ask**:
126
+ - Multiple valid approaches (REST vs GraphQL, Redux vs Context)
127
+ - Missing specifics (which file? which component?)
128
+ - Architectural decision needed (new pattern vs existing)
129
+ - Security/performance trade-off
130
+
131
+ **Examples of when NOT to ask**:
132
+ - Standard implementation (follow existing patterns)
133
+ - Clear from context
134
+ - Developer best judgment applies
135
+
136
+ **If user provides clarification**, update todo content with the decision and proceed.
137
+
138
+ ### 3.3 Pre-Implementation Analysis
139
+
140
+ Before coding, quickly check:
141
+
142
+ ```bash
143
+ # Find relevant existing code
144
+ grep -r "similar_pattern" --include="*.ts" --include="*.js" src/ | head -5
145
+
146
+ # Check for related files
147
+ find . -name "*related*" -type f | head -10
148
+ ```
149
+
150
+ Identify:
151
+ - **Files to modify**: List specific files
152
+ - **Existing patterns**: Reference similar code
153
+ - **Dependencies**: Any new imports needed
154
+
155
+ **Share plan** with user:
156
+
157
+ ```markdown
158
+ πŸ“ **Implementation Plan for**: {todo}
159
+
160
+ **Approach**: {chosen approach}
161
+ **Files to modify**:
162
+ - {file1} - {what changes}
163
+ - {file2} - {what changes}
164
+
165
+ **Pattern**: Following {existing pattern from file:line}
166
+ **Estimated complexity**: {Simple/Medium/Complex}
167
+
168
+ Proceeding with implementation...
169
+ ```
170
+
171
+ ### 3.4 Implement
172
+
173
+ Implement the todo step-by-step:
174
+
175
+ 1. **Read relevant files** using Read tool
176
+ 2. **Make changes** using Edit or Write tool
177
+ 3. **Follow existing patterns** (skills will auto-validate)
178
+ 4. **Update imports/dependencies** if needed
179
+ 5. **Verify changes** with quick grep/read
180
+
181
+ **During implementation**:
182
+ - Pattern-check skill auto-validates architecture
183
+ - Test-design skill auto-validates test quality
184
+ - Error-handling skill auto-validates Result types
185
+ - Code-smell skill detects anti-patterns
186
+
187
+ ### 3.5 Pause for Unexpected Issues
188
+
189
+ If issues arise during implementation:
190
+
191
+ **Question: How to proceed?**
192
+ ```
193
+ header: "Issue found"
194
+ question: "Found {issue description}. How should we proceed?"
195
+ multiSelect: false
196
+ options: [
197
+ {Approach 1 with trade-offs},
198
+ {Approach 2 with trade-offs},
199
+ {Defer this todo for later discussion}
200
+ ]
201
+ ```
202
+
203
+ If deferred, mark todo status and move to next.
204
+
205
+ ### 3.6 Mark Complete
206
+
207
+ Once implemented successfully:
208
+
209
+ ```bash
210
+ # Update todo status
211
+ TodoWrite: Mark current todo as "completed"
212
+ ```
213
+
214
+ **Brief confirmation**:
215
+ ```
216
+ βœ… Completed: {todo}
217
+ Files modified: {list}
218
+ Pattern used: {pattern}
219
+ ```
220
+
221
+ Move to next todo.
222
+
223
+ ---
224
+
225
+ ## Step 4: Implementation Summary
226
+
227
+ After all todos processed, provide comprehensive summary:
228
+
229
+ ```markdown
230
+ ## πŸŽ‰ Implementation Session Complete
231
+
232
+ ### βœ… Completed ({count})
233
+ - {todo 1} - {files modified}
234
+ - {todo 2} - {files modified}
235
+ - {todo 3} - {files modified}
236
+
237
+ ### ⏸️ Deferred ({count})
238
+ - {todo 1} - {reason deferred}
239
+ - {todo 2} - {reason deferred}
240
+
241
+ ### πŸ“Š Session Stats
242
+ - **Files modified**: {count}
243
+ - **Files created**: {count}
244
+ - **Pattern compliance**: {skills flagged X issues, addressed inline}
245
+ - **Time estimate**: {based on complexity}
246
+
247
+ ### πŸ” Code Changes
248
+
249
+ {Brief summary of what was implemented}
250
+
251
+ ### πŸ“ Next Steps
252
+
253
+ **Immediate**:
254
+ - [ ] Run tests to verify implementations
255
+ - [ ] Review changed files: {list}
256
+ - [ ] Consider committing: `git add {files}` && `/commit`
257
+
258
+ **Deferred Todos**:
259
+ {If any todos were deferred, list them with notes}
260
+
261
+ **Recommended**:
262
+ - Run `/code-review` before committing for comprehensive quality check
263
+ - Use `/devlog` to document this implementation session
264
+ ```
265
+
266
+ ---
267
+
268
+ ## Step 5: Recommend Next Action
269
+
270
+ Based on what was implemented:
271
+
272
+ ```
273
+ πŸ’‘ **Recommended Next Action**:
274
+
275
+ {Smart recommendation based on context:}
276
+
277
+ - If major changes: "Run `/code-review` to ensure quality across all changes"
278
+ - If tests written: "Run test suite: `npm test` (or relevant command)"
279
+ - If ready to commit: "Review changes and use `/commit` to create atomic commit"
280
+ - If complex changes: "Use `/devlog` to document implementation decisions"
281
+ - If deferred todos: "Use `/plan-next-steps` to refine deferred todos"
282
+ ```
283
+
284
+ ---
285
+
286
+ ## Best Practices
287
+
288
+ ### When to Ask Questions
289
+
290
+ **DO ask when**:
291
+ - Multiple valid approaches with different trade-offs
292
+ - Missing critical context (which file, which approach)
293
+ - Architectural decision impacts future code
294
+ - Security or performance implications
295
+ - User preference matters
296
+
297
+ **DON'T ask when**:
298
+ - Following obvious existing pattern
299
+ - Developer best judgment applies
300
+ - Standard implementation approach
301
+ - Clear from todo description
302
+ - Existing codebase shows the way
303
+
304
+ ### Smart Implementation
305
+
306
+ **Simple todos** (< 50 lines):
307
+ - Quick grep for patterns
308
+ - Implement directly
309
+ - Mark complete
310
+
311
+ **Medium todos** (50-150 lines):
312
+ - Analyze existing patterns
313
+ - Share plan with user
314
+ - Implement with pattern compliance
315
+ - Mark complete
316
+
317
+ **Complex todos** (> 150 lines):
318
+ - Break into smaller steps
319
+ - Check for clarification
320
+ - Implement incrementally
321
+ - Validate along the way
322
+ - Mark complete
323
+
324
+ ### Quality Enforcement
325
+
326
+ **Let skills do their job**:
327
+ - pattern-check enforces Result types, DI, immutability
328
+ - test-design validates test quality
329
+ - error-handling ensures consistency
330
+ - code-smell detects anti-patterns
331
+
332
+ **Don't re-validate** what skills already check.
333
+
334
+ ### User Interaction Style
335
+
336
+ **Be efficient**:
337
+ - Ask ONE question at a time (not multiple)
338
+ - Only ask when genuinely needed
339
+ - Provide clear options with trade-offs
340
+ - Recommend the best option
341
+
342
+ **Be transparent**:
343
+ - Share implementation plan before coding
344
+ - Explain pattern choices
345
+ - Report issues as they arise
346
+ - Keep user informed of progress
347
+
348
+ ---
349
+
350
+ ## Example Session
351
+
352
+ ```
353
+ User: /implement
354
+ AI: Loading current todo list...
355
+
356
+ πŸ“‹ **Current Todo List**
357
+
358
+ ### ⏳ Pending (5)
359
+ - Add authentication middleware to API routes
360
+ - Write unit tests for user registration
361
+ - Update README with auth setup instructions
362
+ - Refactor error handling to use Result types
363
+ - Add rate limiting to public endpoints
364
+
365
+ [Shows AskUserQuestion: "Remove todos?"]
366
+ User: None
367
+
368
+ [Shows AskUserQuestion: "Defer todos?"]
369
+ User: "Update README" and "Add rate limiting"
370
+
371
+ [Shows AskUserQuestion: "Which todo first?"]
372
+ User: "Add authentication middleware"
373
+
374
+ AI: 🎯 **Implementation Queue**
375
+
376
+ 1. Add authentication middleware to API routes - Medium
377
+ 2. Write unit tests for user registration - Simple
378
+ 3. Refactor error handling to use Result types - Complex
379
+
380
+ Deferred for later:
381
+ - Update README with auth setup instructions
382
+ - Add rate limiting to public endpoints
383
+
384
+ ---
385
+
386
+ AI: πŸ“ **Implementation Plan for**: Add authentication middleware
387
+
388
+ Checking existing patterns...
389
+ Found similar auth pattern in src/middleware/cors.ts:12
390
+
391
+ **Approach**: Create JWT middleware following existing pattern
392
+ **Files to modify**:
393
+ - src/middleware/auth.ts (create new)
394
+ - src/routes/api.ts (add middleware)
395
+
396
+ **Pattern**: Following middleware pattern from cors.ts
397
+ **Estimated complexity**: Medium
398
+
399
+ Proceeding with implementation...
400
+
401
+ [AI implements the changes using Edit/Write tools]
402
+ [pattern-check skill auto-validates Result types]
403
+ [error-handling skill validates error handling]
404
+
405
+ βœ… Completed: Add authentication middleware to API routes
406
+ Files modified: src/middleware/auth.ts, src/routes/api.ts
407
+ Pattern used: Middleware pattern from cors.ts:12
408
+
409
+ ---
410
+
411
+ AI: πŸ“ **Implementation Plan for**: Write unit tests for user registration
412
+
413
+ [Question appears: "Testing library preference?"]
414
+ User: Select "Use existing Jest setup"
415
+
416
+ [AI implements tests following existing patterns]
417
+ [test-design skill auto-validates test quality]
418
+
419
+ βœ… Completed: Write unit tests for user registration
420
+ Files modified: tests/auth/register.test.ts
421
+ Pattern used: Test pattern from existing auth tests
422
+
423
+ ---
424
+
425
+ AI: πŸ“ **Implementation Plan for**: Refactor error handling to use Result types
426
+
427
+ This is complex - will require changes across multiple files.
428
+ Analyzing impact...
429
+
430
+ [Question: "Approach?"]
431
+ Options:
432
+ 1. Incremental refactor (start with one module, expand)
433
+ 2. Full refactor now (all error handling at once)
434
+ 3. Defer for deeper planning
435
+
436
+ User: Option 1
437
+
438
+ [AI implements incrementally for one module]
439
+ [error-handling skill validates Result type usage]
440
+
441
+ βœ… Completed: Refactor error handling to use Result types
442
+ Files modified: src/services/user.ts, src/types/result.ts
443
+ Pattern used: Result<T, E> type, incremental refactor
444
+
445
+ ---
446
+
447
+ ## πŸŽ‰ Implementation Session Complete
448
+
449
+ ### βœ… Completed (3)
450
+ - Add authentication middleware - src/middleware/auth.ts, src/routes/api.ts
451
+ - Write unit tests - tests/auth/register.test.ts
452
+ - Refactor error handling (user module) - src/services/user.ts
453
+
454
+ ### ⏸️ Deferred (2)
455
+ - Update README - deferred for documentation session
456
+ - Add rate limiting - deferred for later discussion
457
+
458
+ ### πŸ“Š Session Stats
459
+ - **Files modified**: 5
460
+ - **Files created**: 2
461
+ - **Skills auto-validated**: pattern-check, test-design, error-handling
462
+ - **Complexity**: 1 Simple, 1 Medium, 1 Complex
463
+
464
+ ### πŸ“ Next Steps
465
+
466
+ **Immediate**:
467
+ - [ ] Run test suite: `npm test`
468
+ - [ ] Review changes: src/middleware/auth.ts, src/routes/api.ts, src/services/user.ts
469
+ - [ ] Consider committing changes
470
+
471
+ **Remaining error refactor**:
472
+ - Continue incremental refactor to other modules
473
+
474
+ πŸ’‘ **Recommended Next Action**:
475
+ Run `/code-review` to validate all changes before committing.
476
+ ```
477
+
478
+ ---
479
+
480
+ ## Key Features
481
+
482
+ **Smart Triage**:
483
+ - Remove unnecessary todos
484
+ - Defer todos for later discussion
485
+ - Prioritize implementation order
486
+
487
+ **Continuous Clarification**:
488
+ - Asks ONE question at a time
489
+ - Only when genuinely needed
490
+ - Provides clear options with trade-offs
491
+
492
+ **Pattern-Driven Implementation**:
493
+ - Finds and follows existing patterns
494
+ - Shares implementation plan
495
+ - Validates through skills
496
+
497
+ **Quality by Default**:
498
+ - Skills auto-enforce patterns
499
+ - Result types checked automatically
500
+ - Test quality validated inline
501
+
502
+ **Transparent Progress**:
503
+ - Updates todos as work completes
504
+ - Shows what's done vs deferred
505
+ - Recommends next actions
506
+
507
+ This creates a smooth implementation flow where the user stays in control while the AI handles the implementation details with quality enforced through existing skills.