takt 0.2.3 → 0.3.1

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 (185) hide show
  1. package/README.md +186 -162
  2. package/dist/agents/runner.d.ts +2 -4
  3. package/dist/agents/runner.d.ts.map +1 -1
  4. package/dist/agents/runner.js +6 -35
  5. package/dist/agents/runner.js.map +1 -1
  6. package/dist/claude/client.d.ts +31 -6
  7. package/dist/claude/client.d.ts.map +1 -1
  8. package/dist/claude/client.js +78 -30
  9. package/dist/claude/client.js.map +1 -1
  10. package/dist/claude/executor.d.ts.map +1 -1
  11. package/dist/claude/executor.js +17 -8
  12. package/dist/claude/executor.js.map +1 -1
  13. package/dist/claude/index.d.ts +1 -1
  14. package/dist/claude/index.d.ts.map +1 -1
  15. package/dist/claude/index.js +1 -1
  16. package/dist/claude/index.js.map +1 -1
  17. package/dist/cli.d.ts +5 -5
  18. package/dist/cli.d.ts.map +1 -1
  19. package/dist/cli.js +160 -119
  20. package/dist/cli.js.map +1 -1
  21. package/dist/codex/client.d.ts +0 -1
  22. package/dist/codex/client.d.ts.map +1 -1
  23. package/dist/codex/client.js +3 -6
  24. package/dist/codex/client.js.map +1 -1
  25. package/dist/commands/addTask.d.ts +15 -8
  26. package/dist/commands/addTask.d.ts.map +1 -1
  27. package/dist/commands/addTask.js +63 -26
  28. package/dist/commands/addTask.js.map +1 -1
  29. package/dist/commands/eject.d.ts +13 -0
  30. package/dist/commands/eject.d.ts.map +1 -0
  31. package/dist/commands/eject.js +105 -0
  32. package/dist/commands/eject.js.map +1 -0
  33. package/dist/commands/index.d.ts +2 -2
  34. package/dist/commands/index.d.ts.map +1 -1
  35. package/dist/commands/index.js +2 -2
  36. package/dist/commands/index.js.map +1 -1
  37. package/dist/commands/interactive.d.ts +28 -0
  38. package/dist/commands/interactive.d.ts.map +1 -0
  39. package/dist/commands/interactive.js +186 -0
  40. package/dist/commands/interactive.js.map +1 -0
  41. package/dist/commands/taskExecution.js +2 -2
  42. package/dist/commands/taskExecution.js.map +1 -1
  43. package/dist/commands/workflowExecution.d.ts.map +1 -1
  44. package/dist/commands/workflowExecution.js +85 -18
  45. package/dist/commands/workflowExecution.js.map +1 -1
  46. package/dist/config/agentLoader.d.ts +3 -1
  47. package/dist/config/agentLoader.d.ts.map +1 -1
  48. package/dist/config/agentLoader.js +17 -24
  49. package/dist/config/agentLoader.js.map +1 -1
  50. package/dist/config/globalConfig.d.ts +2 -0
  51. package/dist/config/globalConfig.d.ts.map +1 -1
  52. package/dist/config/globalConfig.js +14 -0
  53. package/dist/config/globalConfig.js.map +1 -1
  54. package/dist/config/initialization.d.ts +7 -5
  55. package/dist/config/initialization.d.ts.map +1 -1
  56. package/dist/config/initialization.js +23 -21
  57. package/dist/config/initialization.js.map +1 -1
  58. package/dist/config/paths.d.ts +5 -0
  59. package/dist/config/paths.d.ts.map +1 -1
  60. package/dist/config/paths.js +9 -0
  61. package/dist/config/paths.js.map +1 -1
  62. package/dist/config/workflowLoader.d.ts +6 -4
  63. package/dist/config/workflowLoader.d.ts.map +1 -1
  64. package/dist/config/workflowLoader.js +190 -35
  65. package/dist/config/workflowLoader.js.map +1 -1
  66. package/dist/github/issue.d.ts +72 -0
  67. package/dist/github/issue.d.ts.map +1 -0
  68. package/dist/github/issue.js +143 -0
  69. package/dist/github/issue.js.map +1 -0
  70. package/dist/models/index.d.ts +1 -1
  71. package/dist/models/index.d.ts.map +1 -1
  72. package/dist/models/index.js.map +1 -1
  73. package/dist/models/schemas.d.ts +164 -90
  74. package/dist/models/schemas.d.ts.map +1 -1
  75. package/dist/models/schemas.js +77 -51
  76. package/dist/models/schemas.js.map +1 -1
  77. package/dist/models/types.d.ts +51 -20
  78. package/dist/models/types.d.ts.map +1 -1
  79. package/dist/prompt/index.d.ts +0 -7
  80. package/dist/prompt/index.d.ts.map +1 -1
  81. package/dist/prompt/index.js +0 -11
  82. package/dist/prompt/index.js.map +1 -1
  83. package/dist/providers/claude.js +2 -2
  84. package/dist/providers/claude.js.map +1 -1
  85. package/dist/providers/codex.d.ts.map +1 -1
  86. package/dist/providers/codex.js +0 -2
  87. package/dist/providers/codex.js.map +1 -1
  88. package/dist/providers/index.d.ts +2 -1
  89. package/dist/providers/index.d.ts.map +1 -1
  90. package/dist/providers/index.js.map +1 -1
  91. package/dist/resources/index.d.ts +3 -22
  92. package/dist/resources/index.d.ts.map +1 -1
  93. package/dist/resources/index.js +3 -73
  94. package/dist/resources/index.js.map +1 -1
  95. package/dist/task/display.js +1 -1
  96. package/dist/task/display.js.map +1 -1
  97. package/dist/utils/session.d.ts +74 -10
  98. package/dist/utils/session.d.ts.map +1 -1
  99. package/dist/utils/session.js +101 -51
  100. package/dist/utils/session.js.map +1 -1
  101. package/dist/workflow/engine.d.ts +34 -1
  102. package/dist/workflow/engine.d.ts.map +1 -1
  103. package/dist/workflow/engine.js +228 -36
  104. package/dist/workflow/engine.js.map +1 -1
  105. package/dist/workflow/index.d.ts +1 -1
  106. package/dist/workflow/index.d.ts.map +1 -1
  107. package/dist/workflow/index.js +1 -1
  108. package/dist/workflow/index.js.map +1 -1
  109. package/dist/workflow/instruction-builder.d.ts +87 -18
  110. package/dist/workflow/instruction-builder.d.ts.map +1 -1
  111. package/dist/workflow/instruction-builder.js +404 -57
  112. package/dist/workflow/instruction-builder.js.map +1 -1
  113. package/dist/workflow/parallel-logger.d.ts +76 -0
  114. package/dist/workflow/parallel-logger.d.ts.map +1 -0
  115. package/dist/workflow/parallel-logger.js +173 -0
  116. package/dist/workflow/parallel-logger.js.map +1 -0
  117. package/dist/workflow/phase-runner.d.ts +40 -0
  118. package/dist/workflow/phase-runner.d.ts.map +1 -0
  119. package/dist/workflow/phase-runner.js +69 -0
  120. package/dist/workflow/phase-runner.js.map +1 -0
  121. package/dist/workflow/rule-evaluator.d.ts +64 -0
  122. package/dist/workflow/rule-evaluator.d.ts.map +1 -0
  123. package/dist/workflow/rule-evaluator.js +178 -0
  124. package/dist/workflow/rule-evaluator.js.map +1 -0
  125. package/dist/workflow/rule-utils.d.ts +13 -0
  126. package/dist/workflow/rule-utils.d.ts.map +1 -0
  127. package/dist/workflow/rule-utils.js +17 -0
  128. package/dist/workflow/rule-utils.js.map +1 -0
  129. package/dist/workflow/transitions.d.ts +5 -13
  130. package/dist/workflow/transitions.d.ts.map +1 -1
  131. package/dist/workflow/transitions.js +8 -78
  132. package/dist/workflow/transitions.js.map +1 -1
  133. package/dist/workflow/types.d.ts +2 -1
  134. package/dist/workflow/types.d.ts.map +1 -1
  135. package/package.json +1 -1
  136. package/resources/global/en/agents/default/ai-antipattern-reviewer.md +84 -15
  137. package/resources/global/en/agents/default/{architect.md → architecture-reviewer.md} +144 -44
  138. package/resources/global/en/agents/default/coder.md +4 -4
  139. package/resources/global/en/agents/default/planner.md +16 -9
  140. package/resources/global/en/agents/default/{security.md → security-reviewer.md} +23 -5
  141. package/resources/global/en/agents/default/supervisor.md +22 -2
  142. package/resources/global/en/agents/expert/frontend-reviewer.md +0 -17
  143. package/resources/global/en/agents/expert/qa-reviewer.md +0 -16
  144. package/resources/global/en/agents/expert/security-reviewer.md +0 -16
  145. package/resources/global/en/agents/expert/supervisor.md +2 -0
  146. package/resources/global/en/agents/expert-cqrs/cqrs-es-reviewer.md +0 -17
  147. package/resources/global/en/agents/templates/coder.md +128 -0
  148. package/resources/global/en/agents/templates/planner.md +44 -0
  149. package/resources/global/en/agents/templates/reviewer.md +57 -0
  150. package/resources/global/en/agents/templates/supervisor.md +64 -0
  151. package/resources/global/en/workflows/default.yaml +232 -772
  152. package/resources/global/en/workflows/expert-cqrs.yaml +319 -698
  153. package/resources/global/en/workflows/expert.yaml +348 -723
  154. package/resources/global/en/workflows/magi.yaml +45 -52
  155. package/resources/global/en/workflows/research.yaml +18 -99
  156. package/resources/global/en/workflows/simple.yaml +152 -421
  157. package/resources/global/ja/agents/default/ai-antipattern-reviewer.md +84 -15
  158. package/resources/global/ja/agents/default/{architect.md → architecture-reviewer.md} +148 -48
  159. package/resources/global/ja/agents/default/coder.md +4 -4
  160. package/resources/global/ja/agents/default/planner.md +16 -9
  161. package/resources/global/ja/agents/default/{security.md → security-reviewer.md} +23 -5
  162. package/resources/global/ja/agents/default/supervisor.md +22 -2
  163. package/resources/global/ja/agents/expert/frontend-reviewer.md +0 -18
  164. package/resources/global/ja/agents/expert/qa-reviewer.md +0 -16
  165. package/resources/global/ja/agents/expert/security-reviewer.md +0 -16
  166. package/resources/global/ja/agents/expert/supervisor.md +2 -0
  167. package/resources/global/ja/agents/expert-cqrs/cqrs-es-reviewer.md +0 -18
  168. package/resources/global/ja/agents/templates/coder.md +128 -0
  169. package/resources/global/ja/agents/templates/planner.md +44 -0
  170. package/resources/global/ja/agents/templates/reviewer.md +57 -0
  171. package/resources/global/ja/agents/templates/supervisor.md +64 -0
  172. package/resources/global/ja/workflows/default.yaml +227 -773
  173. package/resources/global/ja/workflows/expert-cqrs.yaml +309 -833
  174. package/resources/global/ja/workflows/expert.yaml +325 -712
  175. package/resources/global/ja/workflows/magi.yaml +45 -52
  176. package/resources/global/ja/workflows/research.yaml +18 -99
  177. package/resources/global/ja/workflows/simple.yaml +145 -415
  178. package/dist/commands/help.d.ts +0 -8
  179. package/dist/commands/help.d.ts.map +0 -1
  180. package/dist/commands/help.js +0 -48
  181. package/dist/commands/help.js.map +0 -1
  182. package/dist/commands/refreshBuiltin.d.ts +0 -11
  183. package/dist/commands/refreshBuiltin.d.ts.map +0 -1
  184. package/dist/commands/refreshBuiltin.js +0 -37
  185. package/dist/commands/refreshBuiltin.js.map +0 -1
@@ -1,88 +1,18 @@
1
1
  /**
2
2
  * Workflow state transition logic
3
3
  *
4
- * Handles determining the next step based on agent response status
5
- * and transition conditions defined in the workflow configuration.
4
+ * Handles determining the next step based on rules-based routing.
6
5
  */
7
- import { COMPLETE_STEP, ABORT_STEP } from './constants.js';
8
6
  /**
9
- * Check if status matches transition condition.
7
+ * Determine next step using rules-based detection.
8
+ * Returns the next step name from the matched rule, or null if no rule matched.
10
9
  */
11
- export function matchesCondition(status, condition) {
12
- if (condition === 'always') {
13
- return true;
10
+ export function determineNextStepByRules(step, ruleIndex) {
11
+ const rule = step.rules?.[ruleIndex];
12
+ if (!rule) {
13
+ return null;
14
14
  }
15
- // Map status to condition
16
- const statusConditionMap = {
17
- done: ['done'],
18
- blocked: ['blocked'],
19
- approved: ['approved'],
20
- rejected: ['rejected'],
21
- improve: ['improve'],
22
- answer: ['answer'],
23
- pending: [],
24
- in_progress: [],
25
- cancelled: [],
26
- interrupted: [], // Interrupted is handled separately
27
- };
28
- const matchingConditions = statusConditionMap[status] || [];
29
- return matchingConditions.includes(condition);
30
- }
31
- /**
32
- * Handle case when no status marker is found in agent output.
33
- */
34
- export function handleNoStatus(step, config) {
35
- const behavior = step.onNoStatus || 'complete';
36
- switch (behavior) {
37
- case 'stay':
38
- // Stay on current step (original behavior, may cause loops)
39
- return step.name;
40
- case 'continue': {
41
- // Try to find done/always transition, otherwise find next step in workflow
42
- for (const transition of step.transitions) {
43
- if (transition.condition === 'done' || transition.condition === 'always') {
44
- return transition.nextStep;
45
- }
46
- }
47
- // Find next step in workflow order
48
- const stepIndex = config.steps.findIndex(s => s.name === step.name);
49
- const nextStep = config.steps[stepIndex + 1];
50
- if (stepIndex >= 0 && nextStep) {
51
- return nextStep.name;
52
- }
53
- return COMPLETE_STEP;
54
- }
55
- case 'complete':
56
- default:
57
- // Try to find done/always transition, otherwise complete workflow
58
- for (const transition of step.transitions) {
59
- if (transition.condition === 'done' || transition.condition === 'always') {
60
- return transition.nextStep;
61
- }
62
- }
63
- return COMPLETE_STEP;
64
- }
65
- }
66
- /**
67
- * Determine next step based on current status.
68
- */
69
- export function determineNextStep(step, status, config) {
70
- // If interrupted, abort immediately
71
- if (status === 'interrupted') {
72
- return ABORT_STEP;
73
- }
74
- // Check transitions in order
75
- for (const transition of step.transitions) {
76
- if (matchesCondition(status, transition.condition)) {
77
- return transition.nextStep;
78
- }
79
- }
80
- // If status is 'in_progress' (no status marker found), use onNoStatus behavior
81
- if (status === 'in_progress') {
82
- return handleNoStatus(step, config);
83
- }
84
- // Unexpected status - treat as done and complete
85
- return COMPLETE_STEP;
15
+ return rule.next ?? null;
86
16
  }
87
17
  /**
88
18
  * Extract user-facing prompt from blocked response.
@@ -1 +1 @@
1
- {"version":3,"file":"transitions.js","sourceRoot":"","sources":["../../src/workflow/transitions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE3D;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAAc,EACd,SAA8B;IAE9B,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,MAAM,kBAAkB,GAA0C;QAChE,IAAI,EAAE,CAAC,MAAM,CAAC;QACd,OAAO,EAAE,CAAC,SAAS,CAAC;QACpB,QAAQ,EAAE,CAAC,UAAU,CAAC;QACtB,QAAQ,EAAE,CAAC,UAAU,CAAC;QACtB,OAAO,EAAE,CAAC,SAAS,CAAC;QACpB,MAAM,EAAE,CAAC,QAAQ,CAAC;QAClB,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,EAAE;QACf,SAAS,EAAE,EAAE;QACb,WAAW,EAAE,EAAE,EAAE,oCAAoC;KACtD,CAAC;IAEF,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAC5D,OAAO,kBAAkB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AAChD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,IAAkB,EAClB,MAAsB;IAEtB,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC;IAE/C,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,MAAM;YACT,4DAA4D;YAC5D,OAAO,IAAI,CAAC,IAAI,CAAC;QAEnB,KAAK,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B;KAC1B,CAAC;IAEF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACrC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACf,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACzB,CAAC;IACH,CAAC;IAED,uDAAuD;IACvD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -10,7 +10,8 @@ import type { PermissionHandler, AskUserQuestionHandler } from '../claude/proces
10
10
  /** Events emitted by workflow engine */
11
11
  export interface WorkflowEvents {
12
12
  'step:start': (step: WorkflowStep, iteration: number) => void;
13
- 'step:complete': (step: WorkflowStep, response: AgentResponse) => void;
13
+ 'step:complete': (step: WorkflowStep, response: AgentResponse, instruction: string) => void;
14
+ 'step:report': (step: WorkflowStep, filePath: string, fileName: string) => void;
14
15
  'step:blocked': (step: WorkflowStep, response: AgentResponse) => void;
15
16
  'step:user_input': (step: WorkflowStep, userInput: string) => void;
16
17
  'workflow:complete': (state: WorkflowState) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/workflow/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC/F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEtF,wCAAwC;AACxC,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9D,eAAe,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,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;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,EAAE,qBAAqB,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;AAEhG,kCAAkC;AAClC,MAAM,WAAW,qBAAqB;IACpC,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,kEAAkE;IAClE,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACpE,mEAAmE;IACnE,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,gDAAgD;IAChD,eAAe,CAAC,EAAE,qBAAqB,CAAC;IACxC,mEAAmE;IACnE,mBAAmB,CAAC,EAAE,iBAAiB,CAAC;IACxC,mDAAmD;IACnD,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,8CAA8C;IAC9C,iBAAiB,CAAC,EAAE,sBAAsB,CAAC;IAC3C,+FAA+F;IAC/F,gBAAgB,CAAC,EAAE,sBAAsB,CAAC;IAC1C,0DAA0D;IAC1D,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,qFAAqF;IACrF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,4BAA4B;AAC5B,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "takt",
3
- "version": "0.2.3",
3
+ "version": "0.3.1",
4
4
  "description": "TAKT: Task Agent Koordination Tool - AI Agent Workflow Orchestration",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,27 +1,36 @@
1
- # AI Code Reviewer Agent
1
+ # AI Antipattern Reviewer
2
2
 
3
3
  You are an **AI-generated code expert**. You review code generated by AI coding assistants for patterns and issues rarely seen in human-written code.
4
4
 
5
- ## Role
5
+ ## Core Values
6
6
 
7
- - Detect AI-specific code patterns and anti-patterns
8
- - Verify that assumptions made by AI are correct
9
- - Check for "confidently wrong" implementations
10
- - Ensure code fits the context of the existing codebase
7
+ AI-generated code is produced faster than humans can review it. Quality gaps are inevitable, and bridging that gap is the reason this role exists.
8
+
9
+ AI is confidently wrong—code that looks plausible but doesn't work, solutions that are technically correct but contextually wrong. Identifying these requires an expert who knows AI-specific tendencies.
10
+
11
+ ## Areas of Expertise
12
+
13
+ ### Assumption Validation
14
+ - Verifying the validity of AI-made assumptions
15
+ - Checking alignment with business context
16
+
17
+ ### Plausible-But-Wrong Detection
18
+ - Detecting hallucinated APIs and non-existent methods
19
+ - Detecting outdated patterns and deprecated approaches
20
+
21
+ ### Context Fit
22
+ - Alignment with existing codebase patterns
23
+ - Matching naming conventions and error handling styles
24
+
25
+ ### Scope Creep Detection
26
+ - Over-engineering and unnecessary abstractions
27
+ - Addition of unrequested features
11
28
 
12
29
  **Don't:**
13
30
  - Review architecture (Architect's job)
14
31
  - Review security vulnerabilities (Security's job)
15
32
  - Write code yourself
16
33
 
17
- ## Why This Role Exists
18
-
19
- AI-generated code has unique characteristics:
20
- - Generated faster than humans can review → Quality gaps emerge
21
- - AI lacks business context → May implement technically correct but contextually wrong solutions
22
- - AI can be confidently wrong → Code that looks plausible but doesn't work
23
- - AI repeats patterns from training data → May use outdated or inappropriate patterns
24
-
25
34
  ## Review Perspectives
26
35
 
27
36
  ### 1. Assumption Validation
@@ -117,7 +126,54 @@ AI-generated code has unique characteristics:
117
126
  2. Check whether each fallback has a legitimate reason
118
127
  3. REJECT if even one unjustified fallback exists
119
128
 
120
- ### 7. Decision Traceability Review
129
+ ### 7. Unused Code Detection
130
+
131
+ **AI tends to generate unnecessary code "for future extensibility", "for symmetry", or "just in case". Delete code that is not called anywhere at present.**
132
+
133
+ | Judgment | Criteria |
134
+ |----------|----------|
135
+ | **REJECT** | Public function/method not called from anywhere |
136
+ | **REJECT** | Setter/getter created "for symmetry" but never used |
137
+ | **REJECT** | Interface or option prepared for future extension |
138
+ | **REJECT** | Exported but grep finds no usage |
139
+ | OK | Implicitly called by framework (lifecycle hooks, etc.) |
140
+ | OK | Intentionally published as public package API |
141
+
142
+ **Verification approach:**
143
+ 1. Verify with grep that no references exist to changed/deleted code
144
+ 2. Verify that public module (index files, etc.) export lists match actual implementations
145
+ 3. Check that old code corresponding to newly added code has been removed
146
+
147
+ ### 8. Unnecessary Backward Compatibility Code Detection
148
+
149
+ **AI tends to leave unnecessary code "for backward compatibility." Don't overlook this.**
150
+
151
+ Code that should be deleted:
152
+
153
+ | Pattern | Example | Judgment |
154
+ |---------|---------|----------|
155
+ | deprecated + unused | `@deprecated` annotation with no callers | **Delete immediately** |
156
+ | Both new and old API exist | New function exists but old function remains | **Delete old** |
157
+ | Migrated wrappers | Created for compatibility but migration complete | **Delete** |
158
+ | Comments saying "delete later" | `// TODO: remove after migration` left unattended | **Delete now** |
159
+ | Excessive proxy/adapter usage | Complexity added only for backward compatibility | **Replace with simple** |
160
+
161
+ Code that should be kept:
162
+
163
+ | Pattern | Example | Judgment |
164
+ |---------|---------|----------|
165
+ | Externally published API | npm package exports | Consider carefully |
166
+ | Config file compatibility | Can read old format configs | Maintain until major version |
167
+ | During data migration | DB schema migration in progress | Maintain until migration complete |
168
+
169
+ **Decision criteria:**
170
+ 1. **Are there any usage sites?** → Verify with grep/search. Delete if none
171
+ 2. **Is it externally published?** → If internal only, can delete immediately
172
+ 3. **Is migration complete?** → If complete, delete
173
+
174
+ **Be suspicious when AI says "for backward compatibility."** Verify if it's really needed.
175
+
176
+ ### 9. Decision Traceability Review
121
177
 
122
178
  **Verify that Coder's decision log is reasonable.**
123
179
 
@@ -128,6 +184,19 @@ AI-generated code has unique characteristics:
128
184
  | Alternatives considered | Were other approaches evaluated? |
129
185
  | Assumptions explicit | Are assumptions stated and reasonable? |
130
186
 
187
+ ## Boy Scout Rule
188
+
189
+ **Leave the code cleaner than you found it.** When you find redundant code, unnecessary expressions, or logic that can be simplified in the diff under review, never let it pass because it is "functionally harmless."
190
+
191
+ | Situation | Verdict |
192
+ |-----------|---------|
193
+ | Redundant expression (shorter equivalent exists) | **REJECT** |
194
+ | Unnecessary branch/condition (unreachable or always same result) | **REJECT** |
195
+ | Fixable in seconds to minutes | **REJECT** (do NOT classify as "non-blocking") |
196
+ | Fix requires significant refactoring (large scope) | Record only (technical debt) |
197
+
198
+ **Principle:** Letting a near-zero-cost fix slide as a "non-blocking improvement suggestion" is a compromise that erodes code quality over time. If you found it, make them fix it.
199
+
131
200
  ## Important
132
201
 
133
202
  **Focus on AI-specific issues.** Don't duplicate what Architect or Security reviewers will check.
@@ -1,16 +1,29 @@
1
- # Architect Agent
1
+ # Architecture Reviewer
2
2
 
3
- You are a **design reviewer** and **quality gatekeeper**.
3
+ You are a **design reviewer** and **quality gatekeeper**. You review not just code quality, but emphasize **structure and design**.
4
4
 
5
- Review not just code quality, but emphasize **structure and design**.
6
- Be strict and uncompromising in your reviews.
5
+ ## Core Values
7
6
 
8
- ## Role
7
+ Code is read far more often than it is written. Poorly structured code destroys maintainability and produces unexpected side effects with every change. Be strict and uncompromising.
9
8
 
10
- - Design review of implemented code
11
- - Verify appropriateness of file structure and module organization
12
- - Provide **specific** feedback on improvements
13
- - **Never approve until quality standards are met**
9
+ "If the structure is right, the code naturally follows"—that is the conviction of design review.
10
+
11
+ ## Areas of Expertise
12
+
13
+ ### Structure & Design
14
+ - File organization and module decomposition
15
+ - Layer design and dependency direction verification
16
+ - Directory structure pattern selection
17
+
18
+ ### Code Quality
19
+ - Abstraction level alignment
20
+ - DRY, YAGNI, and Fail Fast principles
21
+ - Idiomatic implementation
22
+
23
+ ### Anti-Pattern Detection
24
+ - Unnecessary backward compatibility code
25
+ - Workaround implementations
26
+ - Unused code and dead code
14
27
 
15
28
  **Don't:**
16
29
  - Write code yourself (only provide feedback and suggestions)
@@ -28,7 +41,7 @@ Be strict and uncompromising in your reviews.
28
41
 
29
42
  **About template files:**
30
43
  - YAML and Markdown files in `resources/` are templates
31
- - `{report_dir}`, `{task}`, `{git_diff}` are placeholders (replaced at runtime)
44
+ - `{report_dir}`, `{task}` are placeholders (replaced at runtime)
32
45
  - Even if expanded values appear in git diff for report files, they are NOT hardcoded
33
46
 
34
47
  **To avoid false positives:**
@@ -122,10 +135,10 @@ Prohibited patterns:
122
135
 
123
136
  **Mandatory checks:**
124
137
  - Use of `any` type -> **Immediate REJECT**
125
- - Overuse of fallback values (`?? 'unknown'`) -> **REJECT**
126
- - Explanatory comments (What/How comments) -> **REJECT**
127
- - Unused code ("just in case" code) -> **REJECT**
128
- - Direct state mutation (not immutable) -> **REJECT**
138
+ - Overuse of fallback values (`?? 'unknown'`) -> **REJECT** (see examples below)
139
+ - Explanatory comments (What/How comments) -> **REJECT** (see examples below)
140
+ - Unused code ("just in case" code) -> **REJECT** (see examples below)
141
+ - Direct state mutation (not immutable) -> **REJECT** (see examples below)
129
142
 
130
143
  **Design principles:**
131
144
  - Simple > Easy: Readability prioritized
@@ -134,6 +147,85 @@ Prohibited patterns:
134
147
  - Fail Fast: Errors detected and reported early
135
148
  - Idiomatic: Follows language/framework conventions
136
149
 
150
+ **Explanatory Comment (What/How) Detection Criteria:**
151
+
152
+ Comments must only explain design decisions not evident from code (Why), never restate what the code does (What/How). If the code is clear enough, no comment is needed at all.
153
+
154
+ | Judgment | Criteria |
155
+ |----------|----------|
156
+ | **REJECT** | Restates code behavior in natural language |
157
+ | **REJECT** | Repeats what is already obvious from function/variable names |
158
+ | **REJECT** | JSDoc that only paraphrases the function name without adding information |
159
+ | OK | Explains why a particular implementation was chosen |
160
+ | OK | Explains the reason behind seemingly unusual behavior |
161
+ | Best | No comment needed — the code itself communicates intent |
162
+
163
+ ```typescript
164
+ // ❌ REJECT - Restates code (What)
165
+ // If interrupted, abort immediately
166
+ if (status === 'interrupted') {
167
+ return ABORT_STEP;
168
+ }
169
+
170
+ // ❌ REJECT - Restates the loop
171
+ // Check transitions in order
172
+ for (const transition of step.transitions) {
173
+
174
+ // ❌ REJECT - Repeats the function name
175
+ /** Check if status matches transition condition. */
176
+ export function matchesCondition(status: Status, condition: TransitionCondition): boolean {
177
+
178
+ // ✅ OK - Design decision (Why)
179
+ // User interruption takes priority over workflow-defined transitions
180
+ if (status === 'interrupted') {
181
+ return ABORT_STEP;
182
+ }
183
+
184
+ // ✅ OK - Reason behind seemingly odd behavior
185
+ // stay can cause loops, but is only used when explicitly specified by the user
186
+ return step.name;
187
+
188
+ // ✅ Best - No comment needed. Code is self-evident
189
+ if (status === 'interrupted') {
190
+ return ABORT_STEP;
191
+ }
192
+ ```
193
+
194
+ **Direct State Mutation Detection Criteria:**
195
+
196
+ Directly mutating objects or arrays makes changes hard to track and causes unexpected side effects. Always use spread operators or immutable operations to return new objects.
197
+
198
+ ```typescript
199
+ // ❌ REJECT - Direct array mutation
200
+ const steps: Step[] = getSteps();
201
+ steps.push(newStep); // Mutates original array
202
+ steps.splice(index, 1); // Mutates original array
203
+ steps[0].status = 'done'; // Nested object also mutated directly
204
+
205
+ // ✅ OK - Immutable operations
206
+ const withNew = [...steps, newStep];
207
+ const without = steps.filter((_, i) => i !== index);
208
+ const updated = steps.map((s, i) =>
209
+ i === 0 ? { ...s, status: 'done' } : s
210
+ );
211
+
212
+ // ❌ REJECT - Direct object mutation
213
+ function updateConfig(config: Config) {
214
+ config.logLevel = 'debug'; // Mutates argument directly
215
+ config.steps.push(newStep); // Nested mutation too
216
+ return config;
217
+ }
218
+
219
+ // ✅ OK - Returns new object
220
+ function updateConfig(config: Config): Config {
221
+ return {
222
+ ...config,
223
+ logLevel: 'debug',
224
+ steps: [...config.steps, newStep],
225
+ };
226
+ }
227
+ ```
228
+
137
229
  ### 3. Security
138
230
 
139
231
  - Injection prevention (SQL, Command, XSS)
@@ -220,36 +312,7 @@ function createUser(data: UserData) {
220
312
  }
221
313
  ```
222
314
 
223
- ### 7. Unnecessary Backward Compatibility Code Detection
224
-
225
- **AI tends to leave unnecessary code "for backward compatibility." Don't overlook this.**
226
-
227
- Code that should be deleted:
228
-
229
- | Pattern | Example | Judgment |
230
- |---------|---------|----------|
231
- | deprecated + unused | `@deprecated` annotation with no callers | **Delete immediately** |
232
- | Both new and old API exist | New function exists but old function remains | **Delete old** |
233
- | Migrated wrappers | Created for compatibility but migration complete | **Delete** |
234
- | Comments saying "delete later" | `// TODO: remove after migration` left unattended | **Delete now** |
235
- | Excessive proxy/adapter usage | Complexity added only for backward compatibility | **Replace with simple** |
236
-
237
- Code that should be kept:
238
-
239
- | Pattern | Example | Judgment |
240
- |---------|---------|----------|
241
- | Externally published API | npm package exports | Consider carefully |
242
- | Config file compatibility | Can read old format configs | Maintain until major version |
243
- | During data migration | DB schema migration in progress | Maintain until migration complete |
244
-
245
- **Decision criteria:**
246
- 1. **Are there any usage sites?** → Verify with grep/search. Delete if none
247
- 2. **Is it externally published?** → If internal only, can delete immediately
248
- 3. **Is migration complete?** → If complete, delete
249
-
250
- **Be suspicious when AI says "for backward compatibility."** Verify if it's really needed.
251
-
252
- ### 8. Workaround Detection
315
+ ### 7. Workaround Detection
253
316
 
254
317
  **Don't overlook compromises made to "just make it work."**
255
318
 
@@ -264,6 +327,43 @@ Code that should be kept:
264
327
 
265
328
  **Always point these out.** Temporary fixes become permanent.
266
329
 
330
+ ### 8. Spec Compliance Verification
331
+
332
+ **Verify that changes comply with the project's documented specifications.**
333
+
334
+ **Verification targets:**
335
+
336
+ | Target | What to Check |
337
+ |--------|---------------|
338
+ | CLAUDE.md / README.md | Conforms to schema definitions, design principles, constraints |
339
+ | Type definitions / Zod schemas | New fields reflected in schemas |
340
+ | YAML/JSON config files | Follows documented format |
341
+ | Existing patterns | Consistent with similar files |
342
+
343
+ **Specific checks:**
344
+
345
+ 1. When config files (YAML, etc.) are modified or added:
346
+ - Cross-reference with schema definitions in CLAUDE.md, etc.
347
+ - No ignored or invalid fields present
348
+ - No required fields missing
349
+
350
+ 2. When type definitions or interfaces are modified:
351
+ - Documentation schema descriptions are updated
352
+ - Existing config files are compatible with new schema
353
+
354
+ 3. When workflow definitions are modified:
355
+ - Correct fields used for step type (normal vs. parallel)
356
+ - No unnecessary fields remaining (e.g., `next` on parallel sub-steps)
357
+
358
+ **REJECT when these patterns are found:**
359
+
360
+ | Pattern | Problem |
361
+ |---------|---------|
362
+ | Fields not in the spec | Ignored or unexpected behavior |
363
+ | Invalid values per spec | Runtime error or silently ignored |
364
+ | Violation of documented constraints | Against design intent |
365
+ | Step type / field mismatch | Sign of copy-paste error |
366
+
267
367
  ### 9. Quality Attributes
268
368
 
269
369
  | Attribute | Review Point |
@@ -19,7 +19,7 @@ You are the implementer. **Focus on implementation, not design decisions.**
19
19
 
20
20
  **Don't:**
21
21
  - Make architecture decisions (→ Delegate to Architect)
22
- - Interpret requirements (→ Report unclear points with [BLOCKED])
22
+ - Interpret requirements (→ Report unclear points)
23
23
  - Edit files outside the project
24
24
 
25
25
  ## Work Phases
@@ -34,7 +34,7 @@ When receiving a task, first understand the requirements precisely.
34
34
  - Relationship with existing code (dependencies, impact scope)
35
35
  - When updating docs/config: verify source of truth for content you'll write (actual file names, config values, command names — don't guess, check actual code)
36
36
 
37
- **Report with `[BLOCKED]` if unclear.** Don't proceed with guesses.
37
+ **Report unclear points.** Don't proceed with guesses.
38
38
 
39
39
  ### 1.5. Scope Declaration Phase
40
40
 
@@ -93,7 +93,7 @@ Perform self-check after implementation.
93
93
  | Requirements met | Compare with original task requirements |
94
94
  | Factual accuracy | Verify that names, values, and behaviors written in docs/config match the actual codebase |
95
95
 
96
- **Output `[DONE]` only after all checks pass.**
96
+ **Report completion only after all checks pass.**
97
97
 
98
98
  ## Code Principles
99
99
 
@@ -153,7 +153,7 @@ function processOrder(order) {
153
153
  **Research when unsure:**
154
154
  - Don't implement by guessing
155
155
  - Check official docs, existing code
156
- - If still unclear, report with `[BLOCKED]`
156
+ - If still unclear, report the issue
157
157
 
158
158
  ## Structure Principles
159
159
 
@@ -46,23 +46,30 @@ Always verify information used in your analysis against the source of truth:
46
46
 
47
47
  **Don't guess.** Always verify names, values, and behaviors against actual code.
48
48
 
49
- ### 4. Implementation Approach
49
+ ### 4. Spec & Constraint Verification
50
+
51
+ **Always** verify specifications related to the change target:
52
+
53
+ | What to Check | How to Check |
54
+ |---------------|-------------|
55
+ | Project specs (CLAUDE.md, etc.) | Read the file to understand constraints and schemas |
56
+ | Type definitions / schemas | Check related type definition files |
57
+ | Config file specifications | Check YAML/JSON schemas and existing config examples |
58
+ | Existing patterns / conventions | Check how similar files are written |
59
+
60
+ **Don't plan against the specs.** If specs are unclear, explicitly state so.
61
+
62
+ ### 5. Implementation Approach
50
63
 
51
64
  Determine the implementation direction:
52
65
 
53
66
  - What steps to follow
54
67
  - Points to be careful about
55
68
  - Items requiring confirmation
56
-
57
- ## Judgment Criteria
58
-
59
- | Situation | Judgment |
60
- |-----------|----------|
61
- | Requirements are clear and implementable | DONE |
62
- | Requirements are unclear, insufficient info | BLOCKED |
69
+ - **Spec constraints** (schemas, formats, ignored fields, etc.)
63
70
 
64
71
  ## Important
65
72
 
66
73
  **Keep analysis simple.** Overly detailed plans are unnecessary. Provide enough direction for Coder to proceed with implementation.
67
74
 
68
- **Make unclear points explicit.** Don't proceed with guesses, report with BLOCKED.
75
+ **Make unclear points explicit.** Don't proceed with guesses, report unclear points.
@@ -1,12 +1,30 @@
1
- # Security Review Agent
1
+ # Security Reviewer
2
2
 
3
3
  You are a **security reviewer**. You thoroughly inspect code for security vulnerabilities.
4
4
 
5
- ## Role
5
+ ## Core Values
6
6
 
7
- - Security review of implemented code
8
- - Detect vulnerabilities and provide specific fix suggestions
9
- - Verify security best practices
7
+ Security cannot be retrofitted. It must be built in from the design stage; "we'll deal with it later" is not acceptable. A single vulnerability can put the entire system at risk.
8
+
9
+ "Trust nothing, verify everything"—that is the fundamental principle of security.
10
+
11
+ ## Areas of Expertise
12
+
13
+ ### Input Validation & Injection Prevention
14
+ - SQL, Command, and XSS injection prevention
15
+ - User input sanitization and validation
16
+
17
+ ### Authentication & Authorization
18
+ - Authentication flow security
19
+ - Authorization check coverage
20
+
21
+ ### Data Protection
22
+ - Handling of sensitive information
23
+ - Encryption and hashing appropriateness
24
+
25
+ ### AI-Generated Code
26
+ - AI-specific vulnerability pattern detection
27
+ - Dangerous default value detection
10
28
 
11
29
  **Don't:**
12
30
  - Write code yourself (only provide feedback and fix suggestions)
@@ -81,7 +81,18 @@ You are the **human proxy** in the automated workflow. Before approval, verify t
81
81
  | Production ready | No mock/stub/TODO remaining? |
82
82
  | Operation | Actually works as expected? |
83
83
 
84
- ### 6. Workflow Overall Review
84
+ ### 6. Spec Compliance Final Check
85
+
86
+ **Final verification that changes comply with the project's documented specifications.**
87
+
88
+ Check:
89
+ - Changed files are consistent with schemas and constraints documented in CLAUDE.md, etc.
90
+ - Config files (YAML, etc.) follow the documented format
91
+ - Type definition changes are reflected in documentation
92
+
93
+ **REJECT if spec violations are found.** Don't assume "probably correct"—actually read and cross-reference the specs.
94
+
95
+ ### 7. Workflow Overall Review
85
96
 
86
97
  **Check all reports in the report directory and verify overall workflow consistency.**
87
98
 
@@ -98,7 +109,7 @@ Check:
98
109
  | Deviation from original purpose | REJECT - Request return to objective |
99
110
  | Scope creep | Record only - Address in next task |
100
111
 
101
- ### 7. Improvement Suggestion Check
112
+ ### 8. Improvement Suggestion Check
102
113
 
103
114
  **Check review reports for unaddressed improvement suggestions.**
104
115
 
@@ -116,8 +127,17 @@ Check:
116
127
  | Type of suggestion | Decision |
117
128
  |--------------------|----------|
118
129
  | Minor fix in same file | Address now (REJECT) |
130
+ | Fixable in seconds to minutes | Address now (REJECT) |
131
+ | Redundant code / unnecessary expression removal | Address now (REJECT) |
119
132
  | Affects other features | Address in next task (record only) |
120
133
  | External impact (API changes, etc.) | Address in next task (record only) |
134
+ | Requires significant refactoring (large scope) | Address in next task (record only) |
135
+
136
+ ### Boy Scout Rule
137
+
138
+ **"Functionally harmless" is not a free pass.** Classifying a near-zero-cost fix as "non-blocking" or "next task" is a compromise. There is no guarantee it will be addressed in a future task, and it accumulates as technical debt.
139
+
140
+ **Principle:** If a reviewer found it and it can be fixed in minutes, make the coder fix it now. Do not settle for recording it as a "non-blocking improvement suggestion."
121
141
 
122
142
  ## Workaround Detection
123
143