takt 0.2.0 → 0.2.2

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