takt 0.2.1 → 0.2.3

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 (121) hide show
  1. package/README.md +67 -38
  2. package/dist/cli.d.ts +4 -2
  3. package/dist/cli.d.ts.map +1 -1
  4. package/dist/cli.js +27 -17
  5. package/dist/cli.js.map +1 -1
  6. package/dist/commands/addTask.d.ts.map +1 -1
  7. package/dist/commands/addTask.js +6 -5
  8. package/dist/commands/addTask.js.map +1 -1
  9. package/dist/commands/help.js +3 -3
  10. package/dist/commands/index.d.ts +1 -1
  11. package/dist/commands/index.d.ts.map +1 -1
  12. package/dist/commands/index.js +1 -1
  13. package/dist/commands/index.js.map +1 -1
  14. package/dist/commands/listTasks.d.ts +45 -0
  15. package/dist/commands/listTasks.d.ts.map +1 -0
  16. package/dist/commands/listTasks.js +353 -0
  17. package/dist/commands/listTasks.js.map +1 -0
  18. package/dist/commands/taskExecution.d.ts +7 -5
  19. package/dist/commands/taskExecution.d.ts.map +1 -1
  20. package/dist/commands/taskExecution.js +26 -17
  21. package/dist/commands/taskExecution.js.map +1 -1
  22. package/dist/commands/workflowExecution.d.ts.map +1 -1
  23. package/dist/commands/workflowExecution.js +11 -10
  24. package/dist/commands/workflowExecution.js.map +1 -1
  25. package/dist/config/globalConfig.d.ts.map +1 -1
  26. package/dist/config/globalConfig.js +4 -0
  27. package/dist/config/globalConfig.js.map +1 -1
  28. package/dist/config/paths.d.ts +1 -1
  29. package/dist/config/paths.d.ts.map +1 -1
  30. package/dist/config/paths.js +3 -1
  31. package/dist/config/paths.js.map +1 -1
  32. package/dist/config/sessionStore.d.ts +10 -0
  33. package/dist/config/sessionStore.d.ts.map +1 -1
  34. package/dist/config/sessionStore.js +54 -0
  35. package/dist/config/sessionStore.js.map +1 -1
  36. package/dist/models/schemas.d.ts +1 -0
  37. package/dist/models/schemas.d.ts.map +1 -1
  38. package/dist/models/schemas.js +2 -0
  39. package/dist/models/schemas.js.map +1 -1
  40. package/dist/models/types.d.ts +2 -0
  41. package/dist/models/types.d.ts.map +1 -1
  42. package/dist/resources/index.d.ts.map +1 -1
  43. package/dist/resources/index.js +6 -3
  44. package/dist/resources/index.js.map +1 -1
  45. package/dist/task/autoCommit.d.ts +9 -6
  46. package/dist/task/autoCommit.d.ts.map +1 -1
  47. package/dist/task/autoCommit.js +21 -12
  48. package/dist/task/autoCommit.js.map +1 -1
  49. package/dist/task/branchList.d.ts +55 -0
  50. package/dist/task/branchList.d.ts.map +1 -0
  51. package/dist/task/branchList.js +131 -0
  52. package/dist/task/branchList.js.map +1 -0
  53. package/dist/task/clone.d.ts +53 -0
  54. package/dist/task/clone.d.ts.map +1 -0
  55. package/dist/task/clone.js +181 -0
  56. package/dist/task/clone.js.map +1 -0
  57. package/dist/task/index.d.ts +3 -2
  58. package/dist/task/index.d.ts.map +1 -1
  59. package/dist/task/index.js +3 -2
  60. package/dist/task/index.js.map +1 -1
  61. package/dist/task/runner.d.ts +14 -0
  62. package/dist/task/runner.d.ts.map +1 -1
  63. package/dist/task/runner.js +30 -7
  64. package/dist/task/runner.js.map +1 -1
  65. package/dist/task/schema.d.ts +4 -4
  66. package/dist/task/schema.js +4 -4
  67. package/dist/task/summarize.d.ts +22 -0
  68. package/dist/task/summarize.d.ts.map +1 -0
  69. package/dist/task/summarize.js +83 -0
  70. package/dist/task/summarize.js.map +1 -0
  71. package/dist/utils/updateNotifier.d.ts +6 -0
  72. package/dist/utils/updateNotifier.d.ts.map +1 -0
  73. package/dist/utils/updateNotifier.js +17 -0
  74. package/dist/utils/updateNotifier.js.map +1 -0
  75. package/dist/workflow/engine.d.ts +1 -1
  76. package/dist/workflow/engine.d.ts.map +1 -1
  77. package/dist/workflow/engine.js +10 -2
  78. package/dist/workflow/engine.js.map +1 -1
  79. package/dist/workflow/instruction-builder.d.ts +8 -7
  80. package/dist/workflow/instruction-builder.d.ts.map +1 -1
  81. package/dist/workflow/instruction-builder.js +39 -24
  82. package/dist/workflow/instruction-builder.js.map +1 -1
  83. package/package.json +4 -1
  84. package/resources/global/en/agents/default/{ai-reviewer.md → ai-antipattern-reviewer.md} +22 -1
  85. package/resources/global/en/agents/default/coder.md +3 -3
  86. package/resources/global/en/agents/default/planner.md +14 -1
  87. package/resources/global/en/workflows/default.yaml +6 -51
  88. package/resources/global/en/workflows/{expert-review.yaml → expert-cqrs.yaml} +14 -49
  89. package/resources/global/en/workflows/expert.yaml +1106 -0
  90. package/resources/global/en/workflows/magi.yaml +0 -9
  91. package/resources/global/en/workflows/research.yaml +0 -9
  92. package/resources/global/en/workflows/simple.yaml +5 -26
  93. package/resources/global/ja/agents/default/{ai-reviewer.md → ai-antipattern-reviewer.md} +22 -1
  94. package/resources/global/ja/agents/default/coder.md +3 -3
  95. package/resources/global/ja/agents/default/planner.md +14 -1
  96. package/resources/global/ja/workflows/default.yaml +6 -51
  97. package/resources/global/ja/workflows/{expert-review.yaml → expert-cqrs.yaml} +15 -55
  98. package/resources/global/ja/workflows/expert.yaml +1106 -0
  99. package/resources/global/ja/workflows/magi.yaml +0 -9
  100. package/resources/global/ja/workflows/research.yaml +0 -9
  101. package/resources/global/ja/workflows/simple.yaml +5 -26
  102. package/resources/project/dotgitignore +10 -0
  103. package/resources/project/tasks/TASK-FORMAT +37 -0
  104. package/dist/commands/reviewTasks.d.ts +0 -32
  105. package/dist/commands/reviewTasks.d.ts.map +0 -1
  106. package/dist/commands/reviewTasks.js +0 -198
  107. package/dist/commands/reviewTasks.js.map +0 -1
  108. package/dist/task/worktree.d.ts +0 -70
  109. package/dist/task/worktree.d.ts.map +0 -1
  110. package/dist/task/worktree.js +0 -221
  111. package/dist/task/worktree.js.map +0 -1
  112. /package/resources/global/en/agents/{expert-review → expert}/frontend-reviewer.md +0 -0
  113. /package/resources/global/en/agents/{expert-review → expert}/qa-reviewer.md +0 -0
  114. /package/resources/global/en/agents/{expert-review → expert}/security-reviewer.md +0 -0
  115. /package/resources/global/en/agents/{expert-review → expert}/supervisor.md +0 -0
  116. /package/resources/global/en/agents/{expert-review → expert-cqrs}/cqrs-es-reviewer.md +0 -0
  117. /package/resources/global/ja/agents/{expert-review → expert}/frontend-reviewer.md +0 -0
  118. /package/resources/global/ja/agents/{expert-review → expert}/qa-reviewer.md +0 -0
  119. /package/resources/global/ja/agents/{expert-review → expert}/security-reviewer.md +0 -0
  120. /package/resources/global/ja/agents/{expert-review → expert}/supervisor.md +0 -0
  121. /package/resources/global/ja/agents/{expert-review → expert-cqrs}/cqrs-es-reviewer.md +0 -0
@@ -0,0 +1,1106 @@
1
+ # Expert Review Workflow
2
+ # Review workflow with Architecture, Frontend, Security, and QA experts
3
+ #
4
+ # Flow:
5
+ # plan -> implement -> architect_review -> frontend_review -> ai_review -> security_review -> qa_review -> supervise -> COMPLETE
6
+ # ↓ ↓ ↓ ↓ ↓ ↓
7
+ # fix_architect fix_frontend ai_fix fix_security fix_qa fix_supervisor
8
+ #
9
+ # Fix destination is determined by Coder based on change impact:
10
+ # - fix_security: MINOR→security_review, MAJOR→architect_review
11
+ # - fix_qa: MINOR→qa_review, SECURITY→security_review, MAJOR→architect_review
12
+ #
13
+ # Template Variables:
14
+ # {iteration} - Workflow-wide turn count (total steps executed across all agents)
15
+ # {max_iterations} - Maximum iterations allowed for the workflow
16
+ # {step_iteration} - Per-step iteration count (how many times THIS step has been executed)
17
+ # {task} - Original user request
18
+ # {previous_response} - Output from the previous step
19
+ # {git_diff} - Current uncommitted changes (git diff)
20
+ # {user_inputs} - Accumulated user inputs during workflow
21
+ # {report_dir} - Report directory name (e.g., "20250126-143052-task-summary")
22
+
23
+ name: expert
24
+ description: Architecture, Frontend, Security, QA Expert Review
25
+
26
+ max_iterations: 20
27
+
28
+ initial_step: plan
29
+
30
+ steps:
31
+ # ===========================================
32
+ # Phase 0: Planning
33
+ # ===========================================
34
+ - name: plan
35
+ agent: ~/.takt/agents/default/planner.md
36
+ allowed_tools:
37
+ - Read
38
+ - Glob
39
+ - Grep
40
+ - Write
41
+ - Bash
42
+ - WebSearch
43
+ - WebFetch
44
+ status_rules_prompt: |
45
+
46
+
47
+ ## Output Format
48
+
49
+ | Situation | Tag |
50
+ |-----------|-----|
51
+ | Analysis complete | `[PLANNER:DONE]` |
52
+ | Requirements unclear | `[PLANNER:BLOCKED]` |
53
+ instruction_template: |
54
+ ## Workflow Context
55
+ - Iteration: {iteration}/{max_iterations} (workflow-wide)
56
+ - Step Iteration: {step_iteration} (times this step has run)
57
+ - Step: plan (Task Analysis)
58
+ - Report Directory: .takt/reports/{report_dir}/
59
+ - Report File: .takt/reports/{report_dir}/00-plan.md
60
+
61
+ ## User Request
62
+ {task}
63
+
64
+ ## Previous Response (when returned from implement)
65
+ {previous_response}
66
+
67
+ ## Instructions
68
+ Analyze the task and create an implementation plan.
69
+
70
+ **Note:** If returned from implement step (Previous Response exists),
71
+ review and revise the plan based on that feedback (replan).
72
+
73
+ **Tasks:**
74
+ 1. Understand the requirements
75
+ 2. Identify impact scope
76
+ 3. Decide implementation approach
77
+
78
+ **Report output:** Output to the `Report File` specified above.
79
+ - If file does not exist: Create new file
80
+ - If file exists: Append with `## Iteration {step_iteration}` section
81
+
82
+ **Report format:**
83
+ ```markdown
84
+ # Task Plan
85
+
86
+ ## Original Request
87
+ {User's request as-is}
88
+
89
+ ## Analysis Results
90
+
91
+ ### Objective
92
+ {What needs to be achieved}
93
+
94
+ ### Scope
95
+ {Impact scope}
96
+
97
+ ### Implementation Approach
98
+ {How to proceed}
99
+
100
+ ## Clarifications Needed (if any)
101
+ - {Unclear points or items requiring confirmation}
102
+ ```
103
+
104
+ Output [PLANNER:DONE] when complete.
105
+ Output [PLANNER:BLOCKED] if requirements are unclear.
106
+ pass_previous_response: true
107
+ transitions:
108
+ - condition: done
109
+ next_step: implement
110
+ - condition: blocked
111
+ next_step: ABORT
112
+
113
+ # ===========================================
114
+ # Phase 1: Implementation
115
+ # ===========================================
116
+ - name: implement
117
+ agent: ~/.takt/agents/default/coder.md
118
+ allowed_tools:
119
+ - Read
120
+ - Glob
121
+ - Grep
122
+ - Edit
123
+ - Write
124
+ - Bash
125
+ - WebSearch
126
+ - WebFetch
127
+ status_rules_prompt: |
128
+
129
+
130
+ ## Output Format
131
+
132
+ | Situation | Tag |
133
+ |-----------|-----|
134
+ | Implementation complete | `[CODER:DONE]` |
135
+ | Cannot proceed | `[CODER:BLOCKED]` |
136
+ instruction_template: |
137
+ ## Workflow Context
138
+ - Iteration: {iteration}/{max_iterations} (workflow-wide)
139
+ - Step Iteration: {step_iteration} (times this step has run)
140
+ - Step: implement
141
+ - Report Directory: .takt/reports/{report_dir}/
142
+ - Report Files:
143
+ - Scope: .takt/reports/{report_dir}/01-coder-scope.md
144
+ - Decisions: .takt/reports/{report_dir}/02-coder-decisions.md
145
+
146
+ ## User Request
147
+ {task}
148
+
149
+ ## Additional User Inputs
150
+ {user_inputs}
151
+
152
+ ## Instructions
153
+ Follow the plan from the plan step and implement.
154
+ Refer to the plan report (00-plan.md) and proceed with implementation.
155
+
156
+ **Report output:** Output to the `Report Files` specified above.
157
+ - If file does not exist: Create new file
158
+ - If file exists: Append with `## Iteration {step_iteration}` section
159
+
160
+ **Scope report format (create at implementation start):**
161
+ ```markdown
162
+ # Change Scope Declaration
163
+
164
+ ## Task
165
+ {One-line task summary}
166
+
167
+ ## Planned Changes
168
+ | Type | File |
169
+ |------|------|
170
+ | Create | `src/example.ts` |
171
+ | Modify | `src/routes.ts` |
172
+
173
+ ## Estimated Size
174
+ Small / Medium / Large
175
+
176
+ ## Impact Scope
177
+ - {Affected modules or features}
178
+ ```
179
+
180
+ **Decisions report format (on completion, only if decisions were made):**
181
+ ```markdown
182
+ # Decision Log
183
+
184
+ ## 1. {Decision Content}
185
+ - **Background**: {Why the decision was needed}
186
+ - **Options Considered**: {List of options}
187
+ - **Reason**: {Why this option was chosen}
188
+ ```
189
+
190
+ Include [CODER:DONE] when complete.
191
+ Include [CODER:BLOCKED] if you cannot proceed (returns to plan).
192
+ transitions:
193
+ - condition: done
194
+ next_step: architect_review
195
+ - condition: blocked
196
+ next_step: plan
197
+
198
+ # ===========================================
199
+ # Phase 2: Architecture Review
200
+ # ===========================================
201
+ - name: architect_review
202
+ agent: ~/.takt/agents/default/architect.md
203
+ allowed_tools:
204
+ - Read
205
+ - Glob
206
+ - Grep
207
+ - Write
208
+ - WebSearch
209
+ - WebFetch
210
+ status_rules_prompt: |
211
+
212
+
213
+ ## Judgment Criteria
214
+
215
+ | Situation | Judgment |
216
+ |-----------|----------|
217
+ | Structural issues | REJECT |
218
+ | Design principle violations | REJECT |
219
+ | Missing call chain wiring | REJECT |
220
+ | Insufficient tests | REJECT |
221
+ | Minor improvements needed | IMPROVE |
222
+ | No issues | APPROVE |
223
+
224
+ ## Output Format
225
+
226
+ | Situation | Tag |
227
+ |-----------|-----|
228
+ | No issues | `[ARCHITECT:APPROVE]` |
229
+ | Minor improvements needed | `[ARCHITECT:IMPROVE]` |
230
+ | Structural fixes required | `[ARCHITECT:REJECT]` |
231
+ instruction_template: |
232
+ ## Workflow Context
233
+ - Iteration: {iteration}/{max_iterations} (workflow-wide)
234
+ - Step Iteration: {step_iteration} (times this step has run)
235
+ - Step: architect_review (Architecture Review)
236
+ - Report Directory: .takt/reports/{report_dir}/
237
+ - Report File: .takt/reports/{report_dir}/03-architect-review.md
238
+
239
+ ## Original User Request
240
+ {task}
241
+
242
+ ## Git Diff
243
+ ```diff
244
+ {git_diff}
245
+ ```
246
+
247
+ ## Instructions
248
+ Focus on **architecture and design** review.
249
+
250
+ **Review Criteria:**
251
+ - Structure/design validity
252
+ - Code quality
253
+ - Change scope appropriateness
254
+ - Test coverage
255
+ - Dead code
256
+ - Call chain verification
257
+
258
+ **Report output:** Output to the `Report File` specified above.
259
+ - If file does not exist: Create new file
260
+ - If file exists: Append with `## Iteration {step_iteration}` section
261
+
262
+ **Report format:**
263
+ ```markdown
264
+ # Architecture Review
265
+
266
+ ## Result: APPROVE / IMPROVE / REJECT
267
+
268
+ ## Summary
269
+ {1-2 sentences summarizing result}
270
+
271
+ ## Reviewed Aspects
272
+ - [x] Structure/Design
273
+ - [x] Code Quality
274
+ - [x] Change Scope
275
+ - [x] Test Coverage
276
+ - [x] Dead Code
277
+ - [x] Call Chain Verification
278
+
279
+ ## Issues (if REJECT)
280
+ | # | Location | Issue | Fix |
281
+ |---|----------|-------|-----|
282
+ | 1 | `src/file.ts:42` | Issue description | Fix method |
283
+
284
+ ## Improvement Suggestions (optional - non-blocking)
285
+ - {Future improvement suggestions}
286
+ ```
287
+
288
+ **Cognitive load reduction rules:**
289
+ - APPROVE + no issues → Summary only (5 lines or less)
290
+ - APPROVE + minor suggestions → Summary + suggestions (15 lines or less)
291
+ - REJECT → Issues in table format (30 lines or less)
292
+ transitions:
293
+ - condition: approved
294
+ next_step: frontend_review
295
+ - condition: improve
296
+ next_step: fix_architect
297
+ - condition: rejected
298
+ next_step: fix_architect
299
+
300
+ - name: fix_architect
301
+ agent: ~/.takt/agents/default/coder.md
302
+ allowed_tools:
303
+ - Read
304
+ - Glob
305
+ - Grep
306
+ - Edit
307
+ - Write
308
+ - Bash
309
+ - WebSearch
310
+ - WebFetch
311
+ permission_mode: acceptEdits
312
+ status_rules_prompt: |
313
+
314
+
315
+ ## Output Format
316
+
317
+ | Situation | Tag |
318
+ |-----------|-----|
319
+ | Fix complete | `[CODER:DONE]` |
320
+ | Cannot proceed | `[CODER:BLOCKED]` |
321
+ instruction_template: |
322
+ ## Workflow Context
323
+ - Iteration: {iteration}/{max_iterations} (workflow-wide)
324
+ - Step Iteration: {step_iteration} (times this step has run)
325
+ - Step: fix_architect
326
+
327
+ ## Architect Feedback (This is the latest instruction - prioritize this)
328
+ {previous_response}
329
+
330
+ ## Original User Request (Initial request - for reference)
331
+ {task}
332
+
333
+ ## Additional User Inputs
334
+ {user_inputs}
335
+
336
+ ## Instructions
337
+ **Important**: Address the Architect's feedback.
338
+ "Original User Request" is for reference; it's not the latest instruction.
339
+ Review the session conversation history and fix the Architect's issues.
340
+
341
+ Include [CODER:DONE] when complete.
342
+ Include [CODER:BLOCKED] if unable to proceed.
343
+ pass_previous_response: true
344
+ transitions:
345
+ - condition: done
346
+ next_step: architect_review
347
+ - condition: blocked
348
+ next_step: plan
349
+
350
+ # ===========================================
351
+ # Phase 3: Frontend Review
352
+ # ===========================================
353
+ - name: frontend_review
354
+ agent: ~/.takt/agents/expert/frontend-reviewer.md
355
+ allowed_tools:
356
+ - Read
357
+ - Glob
358
+ - Grep
359
+ - Write
360
+ - WebSearch
361
+ - WebFetch
362
+ status_rules_prompt: |
363
+
364
+
365
+ ## Output Format
366
+
367
+ | Situation | Tag |
368
+ |-----------|-----|
369
+ | Frontend design is sound | `[FRONTEND:APPROVE]` |
370
+ | Design issues found | `[FRONTEND:REJECT]` |
371
+ instruction_template: |
372
+ ## Workflow Context
373
+ - Iteration: {iteration}/{max_iterations} (workflow-wide)
374
+ - Step Iteration: {step_iteration} (times this step has run)
375
+ - Step: frontend_review (Frontend Expert Review)
376
+ - Report Directory: .takt/reports/{report_dir}/
377
+ - Report File: .takt/reports/{report_dir}/04-frontend-review.md
378
+
379
+ ## Original User Request
380
+ {task}
381
+
382
+ ## Git Diff
383
+ ```diff
384
+ {git_diff}
385
+ ```
386
+
387
+ ## Instructions
388
+ Review the changes above from the frontend development perspective.
389
+
390
+ **Review Criteria:**
391
+ - Component design (separation of concerns, granularity)
392
+ - State management (local/global decisions)
393
+ - Performance (re-rendering, memoization)
394
+ - Accessibility (keyboard support, ARIA)
395
+ - Data fetching patterns
396
+ - TypeScript type safety
397
+
398
+ **Note**: If this project does not include frontend code,
399
+ output [FRONTEND:APPROVE] and proceed.
400
+
401
+ **Report output:** Output to the `Report File` specified above.
402
+ - If file does not exist: Create new file
403
+ - If file exists: Append with `## Iteration {step_iteration}` section
404
+
405
+ **Report format:**
406
+ ```markdown
407
+ # Frontend Review
408
+
409
+ ## Result: APPROVE / REJECT
410
+
411
+ ## Summary
412
+ {1-2 sentences summarizing result}
413
+
414
+ ## Reviewed Perspectives
415
+ | Perspective | Result | Notes |
416
+ |-------------|--------|-------|
417
+ | Component Design | ✅ | - |
418
+ | State Management | ✅ | - |
419
+ | Performance | ✅ | - |
420
+ | Accessibility | ✅ | - |
421
+ | Type Safety | ✅ | - |
422
+
423
+ ## Issues (if REJECT)
424
+ | # | Location | Issue | Fix |
425
+ |---|----------|-------|-----|
426
+ | 1 | `src/file.tsx:42` | Issue description | Fix method |
427
+ ```
428
+
429
+ Include:
430
+ - [FRONTEND:APPROVE] if frontend design is sound
431
+ - [FRONTEND:REJECT] if design issues found (list specific issues)
432
+ transitions:
433
+ - condition: approved
434
+ next_step: ai_review
435
+ - condition: rejected
436
+ next_step: fix_frontend
437
+
438
+ - name: fix_frontend
439
+ agent: ~/.takt/agents/default/coder.md
440
+ allowed_tools:
441
+ - Read
442
+ - Glob
443
+ - Grep
444
+ - Edit
445
+ - Write
446
+ - Bash
447
+ - WebSearch
448
+ - WebFetch
449
+ status_rules_prompt: |
450
+
451
+
452
+ ## Output Format
453
+
454
+ | Situation | Tag |
455
+ |-----------|-----|
456
+ | Fix complete | `[CODER:DONE]` |
457
+ | Cannot proceed | `[CODER:BLOCKED]` |
458
+ instruction_template: |
459
+ ## Workflow Context
460
+ - Iteration: {iteration}/{max_iterations} (workflow-wide)
461
+ - Step Iteration: {step_iteration} (times this step has run)
462
+ - Step: fix_frontend
463
+
464
+ ## Frontend Review Feedback (This is the latest instruction - prioritize this)
465
+ {previous_response}
466
+
467
+ ## Original User Request (Initial request - for reference)
468
+ {task}
469
+
470
+ ## Additional User Inputs
471
+ {user_inputs}
472
+
473
+ ## Instructions
474
+ **Important**: Fix the issues pointed out by the frontend expert.
475
+
476
+ Areas of concern:
477
+ - Component design
478
+ - State management
479
+ - Performance
480
+ - Accessibility
481
+ - Type safety
482
+
483
+ Include [CODER:DONE] when complete.
484
+ Include [CODER:BLOCKED] if unable to proceed.
485
+ pass_previous_response: true
486
+ transitions:
487
+ - condition: done
488
+ next_step: frontend_review
489
+ - condition: blocked
490
+ next_step: plan
491
+
492
+ # ===========================================
493
+ # Phase 4: AI Review
494
+ # ===========================================
495
+ - name: ai_review
496
+ agent: ~/.takt/agents/default/ai-antipattern-reviewer.md
497
+ allowed_tools:
498
+ - Read
499
+ - Glob
500
+ - Grep
501
+ - Write
502
+ - WebSearch
503
+ - WebFetch
504
+ status_rules_prompt: |
505
+
506
+
507
+ ## Output Format
508
+
509
+ | Situation | Tag |
510
+ |-----------|-----|
511
+ | No AI-specific issues | `[AI_REVIEW:APPROVE]` |
512
+ | Issues found | `[AI_REVIEW:REJECT]` |
513
+ instruction_template: |
514
+ ## Workflow Context
515
+ - Iteration: {iteration}/{max_iterations} (workflow-wide)
516
+ - Step Iteration: {step_iteration} (times this step has run)
517
+ - Step: ai_review (AI-Generated Code Review)
518
+ - Report Directory: .takt/reports/{report_dir}/
519
+ - Report File: .takt/reports/{report_dir}/05-ai-review.md
520
+
521
+ ## Original User Request (Initial request from workflow start)
522
+ {task}
523
+
524
+ ## Git Diff
525
+ ```diff
526
+ {git_diff}
527
+ ```
528
+
529
+ ## Instructions
530
+ Review the code for AI-specific issues:
531
+ - Assumption validation
532
+ - Plausible but wrong patterns
533
+ - Context fit with existing codebase
534
+ - Scope creep detection
535
+
536
+ **Report output:** Output to the `Report File` specified above.
537
+ - If file does not exist: Create new file
538
+ - If file exists: Append with `## Iteration {step_iteration}` section
539
+
540
+ **Report format:**
541
+ ```markdown
542
+ # AI-Generated Code Review
543
+
544
+ ## Result: APPROVE / REJECT
545
+
546
+ ## Summary
547
+ {One sentence summarizing result}
548
+
549
+ ## Verified Items
550
+ | Aspect | Result | Notes |
551
+ |--------|--------|-------|
552
+ | Assumption validity | ✅ | - |
553
+ | API/Library existence | ✅ | - |
554
+ | Context fit | ✅ | - |
555
+ | Scope | ✅ | - |
556
+
557
+ ## Issues (if REJECT)
558
+ | # | Category | Location | Issue |
559
+ |---|----------|----------|-------|
560
+ | 1 | Hallucinated API | `src/file.ts:23` | Non-existent method |
561
+ ```
562
+
563
+ **Cognitive load reduction rules:**
564
+ - No issues → Summary 1 line + check table only (10 lines or less)
565
+ - Issues found → + Issues in table format (25 lines or less)
566
+
567
+ Include:
568
+ - [AI_REVIEW:APPROVE] if no AI-specific issues found
569
+ - [AI_REVIEW:REJECT] if issues detected (list specific problems)
570
+ transitions:
571
+ - condition: approved
572
+ next_step: security_review
573
+ - condition: rejected
574
+ next_step: ai_fix
575
+
576
+ - name: ai_fix
577
+ agent: ~/.takt/agents/default/coder.md
578
+ allowed_tools:
579
+ - Read
580
+ - Glob
581
+ - Grep
582
+ - Edit
583
+ - Write
584
+ - Bash
585
+ - WebSearch
586
+ - WebFetch
587
+ status_rules_prompt: |
588
+
589
+
590
+ ## Output Format
591
+
592
+ | Situation | Tag |
593
+ |-----------|-----|
594
+ | Fix complete | `[CODER:DONE]` |
595
+ | Cannot proceed | `[CODER:BLOCKED]` |
596
+ instruction_template: |
597
+ ## Workflow Context
598
+ - Iteration: {iteration}/{max_iterations} (workflow-wide)
599
+ - Step Iteration: {step_iteration} (times this step has run)
600
+ - Step: ai_fix
601
+
602
+ ## AI Review Feedback (This is the latest instruction - prioritize this)
603
+ {previous_response}
604
+
605
+ ## Original User Request (Initial request from workflow start - for reference)
606
+ {task}
607
+
608
+ ## Additional User Inputs
609
+ {user_inputs}
610
+
611
+ ## Instructions
612
+ **Important**: Address the AI Reviewer's feedback.
613
+ Focus on:
614
+ - Correcting incorrect assumptions
615
+ - Fixing plausible-but-wrong implementations
616
+ - Aligning with existing codebase patterns
617
+ - Removing scope creep
618
+
619
+ Include [CODER:DONE] when complete.
620
+ Include [CODER:BLOCKED] if unable to proceed.
621
+ pass_previous_response: true
622
+ transitions:
623
+ - condition: done
624
+ next_step: ai_review
625
+ - condition: blocked
626
+ next_step: plan
627
+
628
+ # ===========================================
629
+ # Phase 5: Security Review
630
+ # ===========================================
631
+ - name: security_review
632
+ agent: ~/.takt/agents/expert/security-reviewer.md
633
+ allowed_tools:
634
+ - Read
635
+ - Glob
636
+ - Grep
637
+ - Write
638
+ - WebSearch
639
+ - WebFetch
640
+ status_rules_prompt: |
641
+
642
+
643
+ ## Output Format
644
+
645
+ | Situation | Tag |
646
+ |-----------|-----|
647
+ | No security issues | `[SECURITY:APPROVE]` |
648
+ | Vulnerabilities found | `[SECURITY:REJECT]` |
649
+ instruction_template: |
650
+ ## Workflow Context
651
+ - Iteration: {iteration}/{max_iterations} (workflow-wide)
652
+ - Step Iteration: {step_iteration} (times this step has run)
653
+ - Step: security_review (Security Expert Review)
654
+ - Report Directory: .takt/reports/{report_dir}/
655
+ - Report File: .takt/reports/{report_dir}/06-security-review.md
656
+
657
+ ## Original User Request
658
+ {task}
659
+
660
+ ## Git Diff
661
+ ```diff
662
+ {git_diff}
663
+ ```
664
+
665
+ ## Instructions
666
+ Review the changes above from the security perspective.
667
+
668
+ **Review Criteria:**
669
+ - Injection attacks (SQL, command, XSS)
670
+ - Authentication/authorization flaws
671
+ - Sensitive information handling
672
+ - Encryption appropriateness
673
+ - OWASP Top 10
674
+
675
+ **Report output:** Output to the `Report File` specified above.
676
+ - If file does not exist: Create new file
677
+ - If file exists: Append with `## Iteration {step_iteration}` section
678
+
679
+ **Report format:**
680
+ ```markdown
681
+ # Security Review
682
+
683
+ ## Result: APPROVE / REJECT
684
+
685
+ ## Severity: None / Low / Medium / High / Critical
686
+
687
+ ## Check Results
688
+ | Category | Result | Notes |
689
+ |----------|--------|-------|
690
+ | Injection | ✅ | - |
691
+ | Auth/Authz | ✅ | - |
692
+ | Data Protection | ✅ | - |
693
+ | Dependencies | ✅ | - |
694
+
695
+ ## Vulnerabilities (if REJECT)
696
+ | # | Severity | Type | Location | Fix |
697
+ |---|----------|------|----------|-----|
698
+ | 1 | High | SQLi | `src/db.ts:42` | Use parameterized query |
699
+
700
+ ## Warnings (non-blocking)
701
+ - {Security recommendations}
702
+ ```
703
+
704
+ Include:
705
+ - [SECURITY:APPROVE] if no security issues found
706
+ - [SECURITY:REJECT] if vulnerabilities found (list specific issues with severity)
707
+ transitions:
708
+ - condition: approved
709
+ next_step: qa_review
710
+ - condition: rejected
711
+ next_step: fix_security
712
+
713
+ - name: fix_security
714
+ agent: ~/.takt/agents/default/coder.md
715
+ allowed_tools:
716
+ - Read
717
+ - Glob
718
+ - Grep
719
+ - Edit
720
+ - Write
721
+ - Bash
722
+ - WebSearch
723
+ - WebFetch
724
+ status_rules_prompt: |
725
+
726
+
727
+ ## Output Format
728
+
729
+ | Situation | Tag |
730
+ |-----------|-----|
731
+ | Minor fix complete | `[CODER:DONE]` |
732
+ | Major fix (restart from Architecture) | `[CODER:REJECT]` |
733
+ | Cannot proceed | `[CODER:BLOCKED]` |
734
+ instruction_template: |
735
+ ## Workflow Context
736
+ - Iteration: {iteration}/{max_iterations} (workflow-wide)
737
+ - Step Iteration: {step_iteration} (times this step has run)
738
+ - Step: fix_security
739
+
740
+ ## Security Review Feedback (This is the latest instruction - prioritize this)
741
+ {previous_response}
742
+
743
+ ## Original User Request (Initial request - for reference)
744
+ {task}
745
+
746
+ ## Additional User Inputs
747
+ {user_inputs}
748
+
749
+ ## Instructions
750
+ **Important**: Fix the issues pointed out by the security expert.
751
+ Security issues should be addressed with highest priority.
752
+
753
+ Areas of concern:
754
+ - Injection vulnerabilities
755
+ - Authentication/authorization flaws
756
+ - Sensitive information exposure
757
+ - Encryption issues
758
+
759
+ ## Completion: Determine Change Impact
760
+ When fix is complete, judge the **impact scope of changes** and output the appropriate tag:
761
+
762
+ - `[CODER:DONE]` - Minor fix (re-run security review only)
763
+ - Examples: Add validation, add escaping, configuration changes
764
+ - `[CODER:REJECT]` - Major fix (restart from Architecture review)
765
+ - Examples: Data flow changes, API design changes, auth method changes, domain model changes
766
+
767
+ Include [CODER:BLOCKED] if unable to proceed.
768
+ pass_previous_response: true
769
+ transitions:
770
+ - condition: done
771
+ next_step: security_review
772
+ - condition: rejected
773
+ next_step: architect_review
774
+ - condition: blocked
775
+ next_step: plan
776
+
777
+ # ===========================================
778
+ # Phase 6: QA Review
779
+ # ===========================================
780
+ - name: qa_review
781
+ agent: ~/.takt/agents/expert/qa-reviewer.md
782
+ allowed_tools:
783
+ - Read
784
+ - Glob
785
+ - Grep
786
+ - Write
787
+ - WebSearch
788
+ - WebFetch
789
+ status_rules_prompt: |
790
+
791
+
792
+ ## Output Format
793
+
794
+ | Situation | Tag |
795
+ |-----------|-----|
796
+ | Quality standards met | `[QA:APPROVE]` |
797
+ | Quality issues found | `[QA:REJECT]` |
798
+ instruction_template: |
799
+ ## Workflow Context
800
+ - Iteration: {iteration}/{max_iterations} (workflow-wide)
801
+ - Step Iteration: {step_iteration} (times this step has run)
802
+ - Step: qa_review (QA Expert Review)
803
+ - Report Directory: .takt/reports/{report_dir}/
804
+ - Report File: .takt/reports/{report_dir}/07-qa-review.md
805
+
806
+ ## Original User Request
807
+ {task}
808
+
809
+ ## Git Diff
810
+ ```diff
811
+ {git_diff}
812
+ ```
813
+
814
+ ## Instructions
815
+ Review the changes above from the quality assurance perspective.
816
+
817
+ **Review Criteria:**
818
+ - Test coverage and quality
819
+ - Test strategy (unit/integration/E2E)
820
+ - Documentation (in-code and external)
821
+ - Error handling
822
+ - Logging and monitoring
823
+ - Maintainability
824
+
825
+ **Report output:** Output to the `Report File` specified above.
826
+ - If file does not exist: Create new file
827
+ - If file exists: Append with `## Iteration {step_iteration}` section
828
+
829
+ **Report format:**
830
+ ```markdown
831
+ # QA Review
832
+
833
+ ## Result: APPROVE / REJECT
834
+
835
+ ## Summary
836
+ {1-2 sentences summarizing result}
837
+
838
+ ## Reviewed Perspectives
839
+ | Perspective | Result | Notes |
840
+ |-------------|--------|-------|
841
+ | Test Coverage | ✅ | - |
842
+ | Test Quality | ✅ | - |
843
+ | Error Handling | ✅ | - |
844
+ | Documentation | ✅ | - |
845
+ | Maintainability | ✅ | - |
846
+
847
+ ## Issues (if REJECT)
848
+ | # | Category | Issue | Fix |
849
+ |---|----------|-------|-----|
850
+ | 1 | Testing | Issue description | Fix method |
851
+ ```
852
+
853
+ Include:
854
+ - [QA:APPROVE] if quality standards are met
855
+ - [QA:REJECT] if quality issues found (list specific issues)
856
+ transitions:
857
+ - condition: approved
858
+ next_step: supervise
859
+ - condition: rejected
860
+ next_step: fix_qa
861
+
862
+ - name: fix_qa
863
+ agent: ~/.takt/agents/default/coder.md
864
+ allowed_tools:
865
+ - Read
866
+ - Glob
867
+ - Grep
868
+ - Edit
869
+ - Write
870
+ - Bash
871
+ - WebSearch
872
+ - WebFetch
873
+ status_rules_prompt: |
874
+
875
+
876
+ ## Output Format
877
+
878
+ | Situation | Tag |
879
+ |-----------|-----|
880
+ | Minor fix complete | `[CODER:DONE]` |
881
+ | Security-impacting fix | `[CODER:IMPROVE]` |
882
+ | Major fix (restart from Architecture) | `[CODER:REJECT]` |
883
+ | Cannot proceed | `[CODER:BLOCKED]` |
884
+ instruction_template: |
885
+ ## Workflow Context
886
+ - Iteration: {iteration}/{max_iterations} (workflow-wide)
887
+ - Step Iteration: {step_iteration} (times this step has run)
888
+ - Step: fix_qa
889
+
890
+ ## QA Review Feedback (This is the latest instruction - prioritize this)
891
+ {previous_response}
892
+
893
+ ## Original User Request (Initial request - for reference)
894
+ {task}
895
+
896
+ ## Additional User Inputs
897
+ {user_inputs}
898
+
899
+ ## Instructions
900
+ **Important**: Fix the issues pointed out by the QA expert.
901
+
902
+ Areas of concern:
903
+ - Adding/improving tests
904
+ - Adding/fixing documentation
905
+ - Error handling
906
+ - Log output
907
+ - Code quality
908
+
909
+ ## Completion: Determine Change Impact
910
+ When fix is complete, judge the **impact scope of changes** and output the appropriate tag:
911
+
912
+ - `[CODER:DONE]` - Minor fix (re-run QA review only)
913
+ - Examples: Add tests, add documentation, add logs, add comments
914
+ - `[CODER:IMPROVE]` - Security-impacting fix (restart from security review)
915
+ - Examples: Error handling changes (error message content changes), input validation changes
916
+ - `[CODER:REJECT]` - Major fix (restart from Architecture review)
917
+ - Examples: Business logic changes, data model changes, API changes
918
+
919
+ Include [CODER:BLOCKED] if unable to proceed.
920
+ pass_previous_response: true
921
+ transitions:
922
+ - condition: done
923
+ next_step: qa_review
924
+ - condition: improve
925
+ next_step: security_review
926
+ - condition: rejected
927
+ next_step: architect_review
928
+ - condition: blocked
929
+ next_step: plan
930
+
931
+ # ===========================================
932
+ # Phase 7: Supervision
933
+ # ===========================================
934
+ - name: supervise
935
+ agent: ~/.takt/agents/expert/supervisor.md
936
+ allowed_tools:
937
+ - Read
938
+ - Glob
939
+ - Grep
940
+ - Write
941
+ - WebSearch
942
+ - WebFetch
943
+ status_rules_prompt: |
944
+
945
+
946
+ ## Output Format
947
+
948
+ | Situation | Tag |
949
+ |-----------|-----|
950
+ | Ready to merge | `[SUPERVISOR:APPROVE]` |
951
+ | Issues found | `[SUPERVISOR:REJECT]` |
952
+ instruction_template: |
953
+ ## Workflow Context
954
+ - Iteration: {iteration}/{max_iterations} (workflow-wide)
955
+ - Step Iteration: {step_iteration} (times this step has run)
956
+ - Step: supervise (Final Review)
957
+ - Report Directory: .takt/reports/{report_dir}/
958
+ - Report Files:
959
+ - Validation: .takt/reports/{report_dir}/08-supervisor-validation.md
960
+ - Summary: .takt/reports/{report_dir}/summary.md
961
+
962
+ ## Original User Request
963
+ {task}
964
+
965
+ ## Git Diff
966
+ ```diff
967
+ {git_diff}
968
+ ```
969
+
970
+ ## Previous Reviews Summary
971
+ Reaching this step means all the following reviews have been APPROVED:
972
+ - Architecture Review: APPROVED
973
+ - Frontend Review: APPROVED
974
+ - AI Review: APPROVED
975
+ - Security Review: APPROVED
976
+ - QA Review: APPROVED
977
+
978
+ ## Instructions
979
+ Run tests, verify the build, and perform final approval.
980
+
981
+ **Workflow Overall Review:**
982
+ 1. Does the implementation match the plan (00-plan.md)?
983
+ 2. Were all review step issues addressed?
984
+ 3. Was the original task objective achieved?
985
+
986
+ **Review Reports:** Read all reports in Report Directory and
987
+ check for any unaddressed improvement suggestions.
988
+
989
+ **Report output:** Output to the `Report Files` specified above.
990
+ - If file does not exist: Create new file
991
+ - If file exists: Append with `## Iteration {step_iteration}` section
992
+
993
+ **Validation report format:**
994
+ ```markdown
995
+ # Final Validation Results
996
+
997
+ ## Result: APPROVE / REJECT
998
+
999
+ ## Validation Summary
1000
+ | Item | Status | Verification Method |
1001
+ |------|--------|---------------------|
1002
+ | Requirements met | ✅ | Matched against requirements list |
1003
+ | Tests | ✅ | `npm test` (N passed) |
1004
+ | Build | ✅ | `npm run build` succeeded |
1005
+ | Functional check | ✅ | Main flows verified |
1006
+
1007
+ ## Deliverables
1008
+ - Created: {Created files}
1009
+ - Modified: {Modified files}
1010
+
1011
+ ## Incomplete Items (if REJECT)
1012
+ | # | Item | Reason |
1013
+ |---|------|--------|
1014
+ | 1 | {Item} | {Reason} |
1015
+ ```
1016
+
1017
+ **Summary report format (only if APPROVE):**
1018
+ ```markdown
1019
+ # Task Completion Summary
1020
+
1021
+ ## Task
1022
+ {Original request in 1-2 sentences}
1023
+
1024
+ ## Result
1025
+ ✅ Complete
1026
+
1027
+ ## Changes
1028
+ | Type | File | Summary |
1029
+ |------|------|---------|
1030
+ | Create | `src/file.ts` | Summary description |
1031
+
1032
+ ## Review Results
1033
+ | Review | Result |
1034
+ |--------|--------|
1035
+ | Architecture | ✅ APPROVE |
1036
+ | Frontend | ✅ APPROVE |
1037
+ | AI Review | ✅ APPROVE |
1038
+ | Security | ✅ APPROVE |
1039
+ | QA | ✅ APPROVE |
1040
+ | Supervisor | ✅ APPROVE |
1041
+
1042
+ ## Verification Commands
1043
+ ```bash
1044
+ npm test
1045
+ npm run build
1046
+ ```
1047
+ ```
1048
+
1049
+ Output:
1050
+ - [SUPERVISOR:APPROVE] if ready to merge
1051
+ - [SUPERVISOR:REJECT] if issues found (specify the issues)
1052
+ transitions:
1053
+ - condition: approved
1054
+ next_step: COMPLETE
1055
+ - condition: rejected
1056
+ next_step: fix_supervisor
1057
+
1058
+ - name: fix_supervisor
1059
+ agent: ~/.takt/agents/default/coder.md
1060
+ allowed_tools:
1061
+ - Read
1062
+ - Glob
1063
+ - Grep
1064
+ - Edit
1065
+ - Write
1066
+ - Bash
1067
+ - WebSearch
1068
+ - WebFetch
1069
+ status_rules_prompt: |
1070
+
1071
+
1072
+ ## Output Format
1073
+
1074
+ | Situation | Tag |
1075
+ |-----------|-----|
1076
+ | Fix complete | `[CODER:DONE]` |
1077
+ | Cannot proceed | `[CODER:BLOCKED]` |
1078
+ instruction_template: |
1079
+ ## Workflow Context
1080
+ - Iteration: {iteration}/{max_iterations} (workflow-wide)
1081
+ - Step Iteration: {step_iteration} (times this step has run)
1082
+ - Step: fix_supervisor
1083
+
1084
+ ## Supervisor Feedback (This is the latest instruction - prioritize this)
1085
+ {previous_response}
1086
+
1087
+ ## Original User Request (Initial request - for reference)
1088
+ {task}
1089
+
1090
+ ## Additional User Inputs
1091
+ {user_inputs}
1092
+
1093
+ ## Instructions
1094
+ **Important**: Fix the issues pointed out by the supervisor.
1095
+
1096
+ The supervisor has identified issues from a big-picture perspective.
1097
+ Address items in priority order.
1098
+
1099
+ Include [CODER:DONE] when complete.
1100
+ Include [CODER:BLOCKED] if unable to proceed.
1101
+ pass_previous_response: true
1102
+ transitions:
1103
+ - condition: done
1104
+ next_step: supervise
1105
+ - condition: blocked
1106
+ next_step: plan