takt 0.32.0 → 0.32.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 (231) hide show
  1. package/builtins/en/facets/instructions/e2e-coverage-implement.md +26 -0
  2. package/builtins/en/facets/instructions/e2e-coverage-plan.md +38 -0
  3. package/builtins/en/facets/instructions/e2e-coverage-supervise.md +21 -0
  4. package/builtins/en/facets/instructions/fix.md +4 -0
  5. package/builtins/en/facets/instructions/loop-monitor-ai-fix.md +4 -3
  6. package/builtins/en/facets/instructions/loop-monitor-reviewers-fix.md +4 -2
  7. package/builtins/en/facets/instructions/plan.md +2 -0
  8. package/builtins/en/facets/instructions/review-frontend.md +9 -0
  9. package/builtins/en/facets/instructions/security-audit-plan.md +12 -0
  10. package/builtins/en/facets/instructions/security-audit-review.md +22 -0
  11. package/builtins/en/facets/instructions/security-audit-supervise.md +20 -0
  12. package/builtins/en/facets/instructions/security-audit-team-leader.md +27 -0
  13. package/builtins/en/facets/knowledge/e2e-testing.md +89 -0
  14. package/builtins/en/facets/knowledge/frontend.md +46 -0
  15. package/builtins/en/facets/knowledge/react.md +90 -0
  16. package/builtins/en/facets/knowledge/unit-testing.md +108 -0
  17. package/builtins/en/facets/output-contracts/e2e-coverage-plan.md +33 -0
  18. package/builtins/en/facets/output-contracts/plan-frontend.md +41 -0
  19. package/builtins/en/facets/output-contracts/plan.md +8 -0
  20. package/builtins/en/facets/output-contracts/security-audit.md +31 -0
  21. package/builtins/en/facets/personas/coder.md +1 -0
  22. package/builtins/en/facets/personas/frontend-reviewer.md +4 -0
  23. package/builtins/en/facets/policies/ai-antipattern.md +43 -0
  24. package/builtins/en/facets/policies/coding.md +90 -1
  25. package/builtins/en/facets/policies/design-fidelity.md +51 -0
  26. package/builtins/en/facets/policies/design-planning.md +52 -0
  27. package/builtins/en/facets/policies/qa.md +15 -0
  28. package/builtins/en/facets/policies/testing.md +54 -1
  29. package/builtins/en/piece-categories.yaml +3 -2
  30. package/builtins/en/pieces/backend-cqrs.yaml +5 -0
  31. package/builtins/en/pieces/backend.yaml +5 -0
  32. package/builtins/en/pieces/default.yaml +2 -0
  33. package/builtins/en/pieces/dual-cqrs-mini.yaml +8 -1
  34. package/builtins/en/pieces/dual-cqrs.yaml +10 -2
  35. package/builtins/en/pieces/dual-mini.yaml +8 -1
  36. package/builtins/en/pieces/dual.yaml +14 -2
  37. package/builtins/en/pieces/{e2e-test.yaml → fill-e2e.yaml} +41 -61
  38. package/builtins/en/pieces/{unit-test.yaml → fill-unit.yaml} +12 -2
  39. package/builtins/en/pieces/frontend-mini.yaml +8 -1
  40. package/builtins/en/pieces/frontend.yaml +25 -3
  41. package/builtins/en/pieces/review-default.yaml +3 -0
  42. package/builtins/en/pieces/review-dual-cqrs.yaml +3 -1
  43. package/builtins/en/pieces/review-dual.yaml +3 -1
  44. package/builtins/en/pieces/review-fix-default.yaml +3 -0
  45. package/builtins/en/pieces/review-fix-dual-cqrs.yaml +5 -1
  46. package/builtins/en/pieces/review-fix-dual.yaml +5 -1
  47. package/builtins/en/pieces/review-fix-frontend.yaml +5 -1
  48. package/builtins/en/pieces/review-fix-takt-default.yaml +5 -2
  49. package/builtins/en/pieces/review-frontend.yaml +3 -1
  50. package/builtins/en/pieces/review-takt-default.yaml +3 -0
  51. package/builtins/en/pieces/security-audit.yaml +68 -0
  52. package/builtins/en/pieces/takt-default.yaml +7 -2
  53. package/builtins/en/pieces/terraform.yaml +0 -5
  54. package/builtins/ja/INSTRUCTION_STYLE_GUIDE.md +9 -10
  55. package/builtins/ja/KNOWLEDGE_STYLE_GUIDE.md +4 -4
  56. package/builtins/ja/OUTPUT_CONTRACT_STYLE_GUIDE.md +4 -4
  57. package/builtins/ja/PERSONA_STYLE_GUIDE.md +8 -8
  58. package/builtins/ja/POLICY_STYLE_GUIDE.md +5 -5
  59. package/builtins/ja/STYLE_GUIDE.md +8 -26
  60. package/builtins/ja/facets/instructions/e2e-coverage-implement.md +26 -0
  61. package/builtins/ja/facets/instructions/e2e-coverage-plan.md +38 -0
  62. package/builtins/ja/facets/instructions/e2e-coverage-supervise.md +21 -0
  63. package/builtins/ja/facets/instructions/fix.md +4 -0
  64. package/builtins/ja/facets/instructions/loop-monitor-ai-fix.md +4 -3
  65. package/builtins/ja/facets/instructions/loop-monitor-reviewers-fix.md +4 -2
  66. package/builtins/ja/facets/instructions/plan.md +2 -0
  67. package/builtins/ja/facets/instructions/review-frontend.md +9 -0
  68. package/builtins/ja/facets/instructions/security-audit-plan.md +12 -0
  69. package/builtins/ja/facets/instructions/security-audit-review.md +22 -0
  70. package/builtins/ja/facets/instructions/security-audit-supervise.md +20 -0
  71. package/builtins/ja/facets/instructions/security-audit-team-leader.md +27 -0
  72. package/builtins/ja/facets/knowledge/e2e-testing.md +89 -0
  73. package/builtins/ja/facets/knowledge/frontend.md +46 -0
  74. package/builtins/ja/facets/knowledge/react.md +90 -0
  75. package/builtins/ja/facets/knowledge/unit-testing.md +108 -0
  76. package/builtins/ja/facets/output-contracts/e2e-coverage-plan.md +33 -0
  77. package/builtins/ja/facets/output-contracts/plan-frontend.md +41 -0
  78. package/builtins/ja/facets/output-contracts/plan.md +8 -0
  79. package/builtins/ja/facets/output-contracts/security-audit.md +31 -0
  80. package/builtins/ja/facets/personas/coder.md +1 -0
  81. package/builtins/ja/facets/personas/frontend-reviewer.md +2 -0
  82. package/builtins/ja/facets/policies/ai-antipattern.md +43 -0
  83. package/builtins/ja/facets/policies/coding.md +90 -1
  84. package/builtins/ja/facets/policies/design-fidelity.md +51 -0
  85. package/builtins/ja/facets/policies/design-planning.md +52 -0
  86. package/builtins/ja/facets/policies/qa.md +15 -0
  87. package/builtins/ja/facets/policies/testing.md +54 -1
  88. package/builtins/ja/piece-categories.yaml +3 -2
  89. package/builtins/ja/pieces/backend-cqrs.yaml +5 -0
  90. package/builtins/ja/pieces/backend.yaml +5 -0
  91. package/builtins/ja/pieces/default.yaml +2 -0
  92. package/builtins/ja/pieces/dual-cqrs-mini.yaml +8 -1
  93. package/builtins/ja/pieces/dual-cqrs.yaml +10 -2
  94. package/builtins/ja/pieces/dual-mini.yaml +8 -1
  95. package/builtins/ja/pieces/dual.yaml +14 -2
  96. package/builtins/ja/pieces/{e2e-test.yaml → fill-e2e.yaml} +40 -60
  97. package/builtins/ja/pieces/{unit-test.yaml → fill-unit.yaml} +12 -2
  98. package/builtins/ja/pieces/frontend-mini.yaml +8 -1
  99. package/builtins/ja/pieces/frontend.yaml +25 -3
  100. package/builtins/ja/pieces/review-default.yaml +3 -0
  101. package/builtins/ja/pieces/review-dual-cqrs.yaml +3 -1
  102. package/builtins/ja/pieces/review-dual.yaml +3 -1
  103. package/builtins/ja/pieces/review-fix-default.yaml +3 -0
  104. package/builtins/ja/pieces/review-fix-dual-cqrs.yaml +5 -1
  105. package/builtins/ja/pieces/review-fix-dual.yaml +5 -1
  106. package/builtins/ja/pieces/review-fix-frontend.yaml +5 -1
  107. package/builtins/ja/pieces/review-fix-takt-default.yaml +5 -2
  108. package/builtins/ja/pieces/review-frontend.yaml +3 -1
  109. package/builtins/ja/pieces/review-takt-default.yaml +3 -0
  110. package/builtins/ja/pieces/security-audit.yaml +68 -0
  111. package/builtins/ja/pieces/takt-default.yaml +7 -2
  112. package/builtins/ja/pieces/terraform.yaml +0 -5
  113. package/dist/app/cli/routing.js +1 -1
  114. package/dist/app/cli/routing.js.map +1 -1
  115. package/dist/core/models/config-types.d.ts +4 -0
  116. package/dist/core/models/config-types.d.ts.map +1 -1
  117. package/dist/core/models/schemas.d.ts +4 -0
  118. package/dist/core/models/schemas.d.ts.map +1 -1
  119. package/dist/core/models/schemas.js +4 -0
  120. package/dist/core/models/schemas.js.map +1 -1
  121. package/dist/core/piece/engine/MovementExecutor.d.ts +1 -0
  122. package/dist/core/piece/engine/MovementExecutor.d.ts.map +1 -1
  123. package/dist/core/piece/engine/MovementExecutor.js +8 -4
  124. package/dist/core/piece/engine/MovementExecutor.js.map +1 -1
  125. package/dist/core/piece/engine/OptionsBuilder.d.ts.map +1 -1
  126. package/dist/core/piece/engine/OptionsBuilder.js +4 -1
  127. package/dist/core/piece/engine/OptionsBuilder.js.map +1 -1
  128. package/dist/features/config/deploySkillInternal.d.ts.map +1 -1
  129. package/dist/features/config/deploySkillInternal.js +2 -6
  130. package/dist/features/config/deploySkillInternal.js.map +1 -1
  131. package/dist/features/interactive/conversationLoop.d.ts.map +1 -1
  132. package/dist/features/interactive/conversationLoop.js +4 -15
  133. package/dist/features/interactive/conversationLoop.js.map +1 -1
  134. package/dist/features/pipeline/steps.d.ts.map +1 -1
  135. package/dist/features/pipeline/steps.js +5 -1
  136. package/dist/features/pipeline/steps.js.map +1 -1
  137. package/dist/features/tasks/execute/resolveTask.d.ts.map +1 -1
  138. package/dist/features/tasks/execute/resolveTask.js +11 -3
  139. package/dist/features/tasks/execute/resolveTask.js.map +1 -1
  140. package/dist/infra/config/global/globalConfigCore.d.ts.map +1 -1
  141. package/dist/infra/config/global/globalConfigCore.js +11 -8
  142. package/dist/infra/config/global/globalConfigCore.js.map +1 -1
  143. package/dist/infra/config/global/globalConfigSerializer.d.ts.map +1 -1
  144. package/dist/infra/config/global/globalConfigSerializer.js +6 -0
  145. package/dist/infra/config/global/globalConfigSerializer.js.map +1 -1
  146. package/dist/infra/config/pathExpansion.d.ts +3 -0
  147. package/dist/infra/config/pathExpansion.d.ts.map +1 -0
  148. package/dist/infra/config/pathExpansion.js +15 -0
  149. package/dist/infra/config/pathExpansion.js.map +1 -0
  150. package/dist/infra/config/project/projectConfig.d.ts.map +1 -1
  151. package/dist/infra/config/project/projectConfig.js +15 -2
  152. package/dist/infra/config/project/projectConfig.js.map +1 -1
  153. package/dist/infra/config/resolveConfigValue.d.ts.map +1 -1
  154. package/dist/infra/config/resolveConfigValue.js +4 -1
  155. package/dist/infra/config/resolveConfigValue.js.map +1 -1
  156. package/dist/infra/cursor/client.js +1 -1
  157. package/dist/infra/cursor/client.js.map +1 -1
  158. package/dist/infra/github/pr.d.ts.map +1 -1
  159. package/dist/infra/github/pr.js +36 -8
  160. package/dist/infra/github/pr.js.map +1 -1
  161. package/dist/infra/resources/index.d.ts +5 -6
  162. package/dist/infra/resources/index.d.ts.map +1 -1
  163. package/dist/infra/resources/index.js +5 -6
  164. package/dist/infra/resources/index.js.map +1 -1
  165. package/dist/infra/task/autoCommit.d.ts.map +1 -1
  166. package/dist/infra/task/autoCommit.js +5 -1
  167. package/dist/infra/task/autoCommit.js.map +1 -1
  168. package/dist/infra/task/clone.d.ts +2 -1
  169. package/dist/infra/task/clone.d.ts.map +1 -1
  170. package/dist/infra/task/clone.js +5 -2
  171. package/dist/infra/task/clone.js.map +1 -1
  172. package/dist/infra/task/git.d.ts +5 -1
  173. package/dist/infra/task/git.d.ts.map +1 -1
  174. package/dist/infra/task/git.js +51 -3
  175. package/dist/infra/task/git.js.map +1 -1
  176. package/dist/infra/task/index.d.ts +1 -1
  177. package/dist/infra/task/index.d.ts.map +1 -1
  178. package/dist/infra/task/index.js +1 -1
  179. package/dist/infra/task/index.js.map +1 -1
  180. package/dist/shared/utils/index.d.ts +1 -0
  181. package/dist/shared/utils/index.d.ts.map +1 -1
  182. package/dist/shared/utils/index.js +1 -0
  183. package/dist/shared/utils/index.js.map +1 -1
  184. package/dist/shared/utils/pathBoundary.d.ts +2 -0
  185. package/dist/shared/utils/pathBoundary.d.ts.map +1 -0
  186. package/dist/shared/utils/pathBoundary.js +10 -0
  187. package/dist/shared/utils/pathBoundary.js.map +1 -0
  188. package/package.json +2 -2
  189. package/builtins/en/facets/instructions/implement-e2e-test.md +0 -51
  190. package/builtins/en/facets/instructions/plan-e2e-test.md +0 -11
  191. package/builtins/en/templates/instructions/ai-fix.md +0 -74
  192. package/builtins/en/templates/instructions/ai-review-standalone.md +0 -47
  193. package/builtins/en/templates/instructions/arbitrate.md +0 -45
  194. package/builtins/en/templates/instructions/architect.md +0 -48
  195. package/builtins/en/templates/instructions/fix.md +0 -86
  196. package/builtins/en/templates/instructions/implement.md +0 -102
  197. package/builtins/en/templates/instructions/plan.md +0 -55
  198. package/builtins/en/templates/instructions/review.md +0 -101
  199. package/builtins/en/templates/instructions/supervise.md +0 -106
  200. package/builtins/en/templates/personas/character.md +0 -45
  201. package/builtins/en/templates/personas/expert.md +0 -68
  202. package/builtins/en/templates/personas/simple.md +0 -22
  203. package/builtins/en/templates/policies/policy.md +0 -49
  204. package/builtins/en/templates/reports/architecture-design.md +0 -31
  205. package/builtins/en/templates/reports/plan.md +0 -70
  206. package/builtins/en/templates/reports/review.md +0 -143
  207. package/builtins/en/templates/reports/security-review.md +0 -43
  208. package/builtins/en/templates/reports/summary.md +0 -52
  209. package/builtins/en/templates/reports/validation.md +0 -31
  210. package/builtins/ja/facets/instructions/implement-e2e-test.md +0 -51
  211. package/builtins/ja/facets/instructions/plan-e2e-test.md +0 -11
  212. package/builtins/ja/templates/instructions/ai-fix.md +0 -74
  213. package/builtins/ja/templates/instructions/ai-review-standalone.md +0 -47
  214. package/builtins/ja/templates/instructions/arbitrate.md +0 -45
  215. package/builtins/ja/templates/instructions/architect.md +0 -48
  216. package/builtins/ja/templates/instructions/fix.md +0 -86
  217. package/builtins/ja/templates/instructions/implement.md +0 -102
  218. package/builtins/ja/templates/instructions/plan.md +0 -55
  219. package/builtins/ja/templates/instructions/review.md +0 -101
  220. package/builtins/ja/templates/instructions/supervise.md +0 -106
  221. package/builtins/ja/templates/knowledge/knowledge.md +0 -39
  222. package/builtins/ja/templates/output-contracts/architecture-design.md +0 -31
  223. package/builtins/ja/templates/output-contracts/plan.md +0 -70
  224. package/builtins/ja/templates/output-contracts/review.md +0 -143
  225. package/builtins/ja/templates/output-contracts/security-review.md +0 -43
  226. package/builtins/ja/templates/output-contracts/summary.md +0 -52
  227. package/builtins/ja/templates/output-contracts/validation.md +0 -31
  228. package/builtins/ja/templates/personas/character.md +0 -43
  229. package/builtins/ja/templates/personas/expert.md +0 -21
  230. package/builtins/ja/templates/personas/simple.md +0 -22
  231. package/builtins/ja/templates/policies/policy.md +0 -49
@@ -0,0 +1,41 @@
1
+ ```markdown
2
+ # Task Plan
3
+
4
+ ## Original Request
5
+ {User's request as-is}
6
+
7
+ ## Analysis
8
+
9
+ ### Objective
10
+ {What needs to be achieved}
11
+
12
+ ### Reference Material Findings (when reference material exists)
13
+ {Overview of reference implementation's approach and key differences from current implementation}
14
+
15
+ ### Design Element Decisions (when design references exist)
16
+ | Element | Keep/Change | Rationale |
17
+ |------|-------------|-----------|
18
+
19
+ ### Scope
20
+ {Impact area}
21
+
22
+ ### Approaches Considered (when design decisions exist)
23
+ | Approach | Adopted? | Rationale |
24
+ |----------|----------|-----------|
25
+
26
+ ### Implementation Approach
27
+ {How to proceed}
28
+
29
+ ## Implementation Guidelines (only when design is needed)
30
+ - {Guidelines the Coder should follow during implementation}
31
+
32
+ ## Out of Scope (only when items exist)
33
+ | Item | Reason for exclusion |
34
+ |------|---------------------|
35
+
36
+ When design references exist:
37
+ - {Excluded element name, why it is excluded, and why no substitute is taken now}
38
+
39
+ ## Open Questions (if any)
40
+ - {Unclear points or items that need confirmation}
41
+ ```
@@ -22,6 +22,14 @@
22
22
  ### Implementation Approach
23
23
  {How to proceed}
24
24
 
25
+ ### Reachability and Launch Conditions (when adding/changing user-facing features)
26
+ | Item | Content |
27
+ |------|---------|
28
+ | User entry point | {Menu/route/button/link/external caller, or explicitly say "none"} |
29
+ | Callers/wiring to update | {Files or layers that must be updated} |
30
+ | Launch conditions | {Auth, permission, URL condition, flags, etc.} |
31
+ | Remaining gaps | {Any unresolved wiring, or "none"} |
32
+
25
33
  ## Implementation Guidelines (only when design is needed)
26
34
  - {Guidelines the Coder should follow during implementation}
27
35
 
@@ -0,0 +1,31 @@
1
+ ```markdown
2
+ # Security Audit Report
3
+
4
+ ## Result: APPROVE / REJECT
5
+
6
+ ## Severity: None / Low / Medium / High / Critical
7
+
8
+ ## Audit Scope
9
+ | # | File | Audited | Risk Classification |
10
+ |---|------|---------|-------------------|
11
+ | 1 | `src/file.ts` | ✅ | High / Medium / Low |
12
+
13
+ ## Detected Issues
14
+ | # | Severity | Category | Location | Issue | Remediation |
15
+ |---|----------|----------|----------|-------|-------------|
16
+ | 1 | Critical | injection | `src/file.ts:42` | {issue description} | {remediation} |
17
+
18
+ ## Files with No Issues
19
+ - {list of files where no issues were detected}
20
+
21
+ ## Recommendations (non-blocking)
22
+ - {security improvement suggestions}
23
+
24
+ ## REJECT Criteria
25
+ - REJECT if one or more High or Critical issues exist
26
+ ```
27
+
28
+ **Cognitive load reduction rules:**
29
+ - No issues → Audit scope table only (15 lines max)
30
+ - Low/Medium only → + issues table (30 lines max)
31
+ - High/Critical present → Full output
@@ -19,6 +19,7 @@ You are the implementer. Focus on implementation, not design decisions.
19
19
  - Thoroughness over speed. Code correctness over implementation ease
20
20
  - Prioritize "works correctly" over "works for now"
21
21
  - Don't implement by guessing; report unclear points
22
+ - When a design reference is provided, match UI appearance, structure, and wording to the design. Do not add, omit, or change anything on your own judgment
22
23
  - Work only within the specified project directory (reading external files for reference is allowed)
23
24
 
24
25
  **Reviewer's feedback is absolute. Your understanding is wrong.**
@@ -12,6 +12,9 @@ The user interface is the only point of contact between the system and users. No
12
12
 
13
13
  ## Areas of Expertise
14
14
 
15
+ ### Design Fidelity
16
+ - When a design reference is provided, verify implementation matches the design element by element
17
+
15
18
  ### Component Design
16
19
  - Separation of concerns and component granularity
17
20
  - Props design and data flow
@@ -34,6 +37,7 @@ The user interface is the only point of contact between the system and users. No
34
37
 
35
38
  ## Important
36
39
 
40
+ - **Design fidelity first**: When a design reference exists, verify design match before evaluating UX quality
37
41
  - **Prioritize user experience**: UX over technical correctness
38
42
  - **Performance can't be fixed later**: Consider at design stage
39
43
  - **Accessibility is hard to retrofit**: Build in from the start
@@ -75,6 +75,49 @@ Verification approach:
75
75
  2. If the only difference is optional argument presence, unify with ternary or spread syntax
76
76
  3. If branches have different preprocessing, store results in a variable and make a single call
77
77
 
78
+ ## Callback + External Variable Capture Abuse
79
+
80
+ AI tends to implement data retrieval via callbacks and external variable capture when return values would suffice.
81
+
82
+ | Pattern | Example | Verdict |
83
+ |---------|---------|---------|
84
+ | Assign to external variable in callback | `let result; await f(x => { result = x })` | REJECT |
85
+ | Get value via event handler | `emitter.on('data', d => { captured = d })` to synchronously get value | REJECT |
86
+ | Build state across multiple callbacks | `forEach(item => { externalMap.set(...) })` to construct result | REJECT |
87
+
88
+ ```typescript
89
+ // REJECT - Capturing external variable via callback
90
+ let selectedMode: string | undefined;
91
+ await promptUser(choices, (choice) => {
92
+ selectedMode = choice;
93
+ });
94
+ return selectedMode;
95
+
96
+ // OK - Receive via return value
97
+ const selectedMode = await promptUser(choices);
98
+ return selectedMode;
99
+ ```
100
+
101
+ Verification approach:
102
+ 1. Find places where callback functions assign to variables in the outer scope
103
+ 2. Check if the value can be returned as a function return value
104
+ 3. If possible, flag for rewriting to the return-value pattern
105
+
106
+ ## Inappropriate Response to Review Findings
107
+
108
+ AI sometimes "addresses" review findings by adding tests or documentation that "verify the finding" instead of actually fixing the code.
109
+
110
+ | Pattern | Example | Verdict |
111
+ |---------|---------|---------|
112
+ | Adding tests instead of fixing | "Remove unnecessary comments" → adds tests verifying comment presence | REJECT |
113
+ | Adding docs instead of fixing | "DRY violation" → adds documentation explaining duplication is intentional | REJECT |
114
+ | Changing unrelated files | Security finding → performs unrelated refactoring | REJECT |
115
+
116
+ Verification approach:
117
+ 1. Check if the fix diff includes changes to the finding's target file and target lines
118
+ 2. If the fix consists only of new file additions, check whether those files "fix" the issue or merely "verify" it
119
+ 3. If tests are added as part of the fix, verify they test "correct behavior after the fix" (not "the finding itself")
120
+
78
121
  ## Context Fitness Assessment
79
122
 
80
123
  Does the code fit this specific project?
@@ -204,13 +204,35 @@ return storage.upload(file, options)
204
204
  - UI/logic exceeding 50 lines → Separate
205
205
  - Has multiple responsibilities → Separate
206
206
 
207
+ ### Reachability When Adding Features
208
+
209
+ When adding a new feature or screen, update the paths by which users reach it in the same change set. Framework-specific wiring belongs in domain knowledge.
210
+
211
+ | Criteria | Judgment |
212
+ |----------|----------|
213
+ | A new feature is implemented but callers, entry points, or navigation are not updated | REJECT |
214
+ | A user-facing feature is added without defining how users reach it | REJECT |
215
+ | Implementation and reachability updates are made in the same change set | OK |
216
+ | A temporary entry path is added and its purpose/removal condition is documented | OK |
217
+
207
218
  ### Dependency Direction
208
219
 
209
220
  - Upper layers → Lower layers (reverse direction prohibited)
210
221
  - Fetch data at the root (View/Controller) and pass it down
211
222
  - Children do not know about their parents
212
223
 
213
- ### State Management
224
+ ### Align execution triggers with actual intent
225
+
226
+ Dependencies and triggers must match the conditions under which the behavior should actually run again. Do not add triggers only to satisfy linting or implementation convenience if that changes runtime behavior.
227
+
228
+ | Criteria | Judgment |
229
+ |----------|----------|
230
+ | Dependencies or triggers are expanded only for linting/convenience and create rerun loops | REJECT |
231
+ | Initial processing reruns because of unrelated state changes or recreated callbacks | REJECT |
232
+ | Rerun conditions correspond to URL, filters, explicit refresh actions, or other intended behavior | OK |
233
+ | Initialization and later refetch triggers are designed separately | OK |
234
+
235
+ ## State Management
214
236
 
215
237
  - Confine state to where it is used
216
238
  - Children do not modify state directly (notify parents via events)
@@ -305,6 +327,73 @@ function formatDate(date: Date): string { ... }
305
327
  function formatPercentage(value: number): string { ... }
306
328
  ```
307
329
 
330
+ ## Same Implementation with Different Names (DRY Violation)
331
+
332
+ AI tends to define the same logic under multiple function names.
333
+
334
+ | Pattern | Example | Verdict |
335
+ |---------|---------|---------|
336
+ | Same implementation with different names | `copyFacets()` and `placeFacetFiles()` doing the same thing | REJECT |
337
+ | Same parameter signature and body | Two functions taking the same params and doing the same work | REJECT |
338
+
339
+ ```typescript
340
+ // REJECT - Same implementation exists under different names
341
+ function copyFiles(src: string, dest: string): void {
342
+ for (const f of readdirSync(src)) {
343
+ copyFileSync(join(src, f), join(dest, f));
344
+ }
345
+ }
346
+ function placeFiles(src: string, dest: string): void {
347
+ for (const f of readdirSync(src)) {
348
+ copyFileSync(join(src, f), join(dest, f));
349
+ }
350
+ }
351
+
352
+ // OK - Consolidate into a single function
353
+ function copyFiles(src: string, dest: string): void {
354
+ for (const f of readdirSync(src)) {
355
+ copyFileSync(join(src, f), join(dest, f));
356
+ }
357
+ }
358
+ ```
359
+
360
+ Verification approach:
361
+ 1. Check if newly added functions have bodies identical or nearly identical to existing functions
362
+ 2. Compare functions within the same file and within the same module
363
+ 3. If duplication is found, consolidate into one and unify call sites
364
+
365
+ ## Dangerous Stateful Regex Patterns
366
+
367
+ Regular expressions with the `/g` flag are stateful (they retain `lastIndex`). Defining them at module scope and mixing `test()` and `replace()` causes unexpected results.
368
+
369
+ | Pattern | Example | Verdict |
370
+ |---------|---------|---------|
371
+ | Module-scope `/g` regex used with `test()` | `const RE = /x/g; if (RE.test(s)) ...` | REJECT |
372
+ | `/g` regex shared between `test()` and `replace()` | `RE.test(s)` followed by `s.replace(RE, ...)` | REJECT |
373
+
374
+ ```typescript
375
+ // REJECT - Module-scope /g regex used with test()
376
+ const PATTERN = /\{\{facet:(\w+)\}\}/g;
377
+ function hasFacetRef(text: string): boolean {
378
+ return PATTERN.test(text); // lastIndex advances, next call returns different result
379
+ }
380
+
381
+ // OK - Don't use /g for test(), or create new RegExp inside function
382
+ const PATTERN_CHECK = /\{\{facet:(\w+)\}\}/; // no /g
383
+ const PATTERN_REPLACE = /\{\{facet:(\w+)\}\}/g; // /g for replace
384
+ function hasFacetRef(text: string): boolean {
385
+ return PATTERN_CHECK.test(text);
386
+ }
387
+ function replaceFacetRefs(text: string): string {
388
+ return text.replace(PATTERN_REPLACE, ...);
389
+ }
390
+ ```
391
+
392
+ Verification approach:
393
+ 1. Check if module-scope regexes have the `/g` flag
394
+ 2. Check if `/g` regexes are used with `test()`
395
+ 3. Check if the same regex is used with both `test()` and `replace()`
396
+
308
397
  ## Prohibited
309
398
 
310
399
  - **Fallbacks are prohibited by default** - Do not write fallbacks using `?? 'unknown'`, `|| 'default'`, or swallowing via `try-catch`. Propagate errors upward. If absolutely necessary, add a comment explaining why
@@ -0,0 +1,51 @@
1
+ # Design Fidelity Policy
2
+
3
+ When a design reference is provided, match UI appearance, structure, and wording to the design.
4
+
5
+ ## Principles
6
+
7
+ | Principle | Criteria |
8
+ |-----------|----------|
9
+ | Design is truth | When a design reference is provided, it is the single source of truth for UI |
10
+ | Element coverage | Implement all elements present in the design. Do not omit any |
11
+ | No unauthorized additions | Do not add elements not present in the design |
12
+ | Wording match | Use labels, button text, and placeholders exactly as specified in the design |
13
+ | Layout match | Match element placement order, direction, and hierarchy to the design |
14
+ | Color and spacing match | Follow color values, margins, border-radius, and font sizes specified in the design |
15
+
16
+ ## Applicability
17
+
18
+ This policy applies when the task order or its referenced materials include a design reference (UI samples, mockups, design files, etc.). When no design reference is provided, this policy does not apply.
19
+
20
+ ## Judgment Criteria
21
+
22
+ | Criteria | Verdict |
23
+ |----------|---------|
24
+ | Element present in design is missing from implementation | REJECT |
25
+ | Element not in design is independently added | REJECT |
26
+ | Wording differs from design | REJECT |
27
+ | Element placement order differs from design | REJECT |
28
+ | Color values differ from design | REJECT |
29
+ | Margins/spacing clearly differ from design | REJECT |
30
+ | Adding edge-case UI not in design (loading, error, empty states) | OK |
31
+ | Interpreting ambiguous parts of design (record rationale in decisions log) | OK |
32
+
33
+ ## Implementation Procedure
34
+
35
+ 1. Enumerate elements in the design reference (per screen/section)
36
+ 2. Verify layout, wording, colors, and spacing for each element
37
+ 3. Cross-check implementation against design element by element
38
+ 4. Record rationale in the decisions log for ambiguous parts of the design
39
+
40
+ ## Review Procedure
41
+
42
+ 1. Compare design reference and implementation element by element
43
+ 2. For each discrepancy, describe both "design specification" and "implementation state" concretely
44
+ 3. Check the decisions log to determine if the discrepancy is intentional
45
+ 4. Report unintentional discrepancies as blocking issues
46
+
47
+ ## Acceptable Cases
48
+
49
+ - Edge-case UI not covered in the design (loading states, error displays, empty state displays)
50
+ - Alternative implementations due to platform-specific constraints (record rationale)
51
+ - Reasonable interpretation of insufficiently detailed parts of the design (record rationale)
@@ -0,0 +1,52 @@
1
+ # Design Planning Policy
2
+
3
+ When a task includes design references, planning must make element inventory and scope decisions explicit.
4
+
5
+ ## Principles
6
+
7
+ | Principle | Standard |
8
+ |------|------|
9
+ | Reference-first planning | When design references exist, planning treats them as primary input |
10
+ | Element-level inventory | Differences are checked at the element level, not only at the screen level |
11
+ | Explicit change decision | Each element includes a keep/change decision with rationale |
12
+ | Scope exclusion accountability | If a design element is excluded, the reason must be stated |
13
+ | Clear implementation boundary | The boundary between in-scope and out-of-scope elements is fixed during planning |
14
+
15
+ ## Applicability
16
+
17
+ This policy applies to planning tasks whose task instructions or reference materials include design references. It does not apply when no design reference exists.
18
+
19
+ ## Decision Criteria
20
+
21
+ | Criteria | Decision |
22
+ |------|------|
23
+ | Planning proceeds without listing the main design elements | REJECT |
24
+ | There is no keep/change decision for each element | REJECT |
25
+ | Scope is narrowed with vague statements such as "list only this time" without naming elements | REJECT |
26
+ | Out-of-scope elements do not include an exclusion rationale | REJECT |
27
+ | Design interpretation is ambiguous but the rationale is recorded | OK |
28
+
29
+ ## Planning Judgment
30
+
31
+ Planning inventories the design reference without dropping elements that materially affect the UI or flow.
32
+
33
+ Inventory viewpoints:
34
+ - Check not only major sections, but also detailed flows, modals, action controls, and state displays
35
+ - Record the current implementation difference and keep/change decision for each element
36
+ - When keeping the existing implementation, cite the target file and rationale
37
+
38
+ ## Scope Decisions
39
+
40
+ If a design-referenced element is placed out of scope, planning records at least:
41
+
42
+ - the excluded element name
43
+ - the reason for exclusion
44
+ - the reason no substitute implementation is taken now
45
+
46
+ Do not split out design-referenced elements as "another task" without explicit rationale.
47
+
48
+ ## Prohibited
49
+
50
+ - **Planning with only coarse screen-level summaries** - causes missing element coverage
51
+ - **Narrowing the intent of the reference without rationale** - misaligns implementation and review
52
+ - **Omitting the explanation for out-of-scope elements** - makes later movements ambiguous
@@ -26,3 +26,18 @@
26
26
  | @ts-ignore, @ts-expect-error without reason | Warning |
27
27
  | eslint-disable without reason | Warning |
28
28
  | Usage of deprecated APIs | Warning |
29
+
30
+ ## Post-Write Side Effect Check
31
+
32
+ When code writes files or directories and then scans/reads them, verify that the written files are not unintentionally included in the scan target.
33
+
34
+ | Pattern | Example | Verdict |
35
+ |---------|---------|---------|
36
+ | Scanning the output directory | Scanning for syntax after copying facets to the same directory | REJECT |
37
+ | Reading back temp files | Writing to a temp directory then processing all files in it | REJECT |
38
+ | Self-referential processing | Generated files becoming input for the next processing pipeline | Warning |
39
+
40
+ Verification approach:
41
+ 1. Identify places where directory scans (readdir, glob, etc.) happen after file writes
42
+ 2. Check if the scan target includes the write destination
43
+ 3. If included, check whether an exclusion filter exists
@@ -29,7 +29,9 @@ Every behavior change requires a corresponding test, and every bug fix requires
29
29
  |----------|--------|
30
30
  | High | Business logic, state transitions |
31
31
  | Medium | Edge cases, error handling |
32
- | Low | Simple CRUD, UI appearance |
32
+ | Low | Simple CRUD |
33
+
34
+ **Note:** When a design reference is provided, UI appearance verification is elevated to medium priority. Refer to the Design Fidelity Policy.
33
35
 
34
36
  ## Test Structure: Given-When-Then
35
37
 
@@ -64,6 +66,37 @@ Test names describe expected behavior. Use the `should {expected behavior} when
64
66
  - Arrange-Act-Assert pattern (equivalent to Given-When-Then)
65
67
  - Avoid magic numbers and magic strings
66
68
 
69
+ ## Refetch loop regressions
70
+
71
+ When a page performs initial loading, tests must prove that the load does not rerun because of unrelated re-renders, loading toggles, or Context callback identity changes.
72
+
73
+ | Criteria | Verdict |
74
+ |----------|---------|
75
+ | Initial load bug fix has no regression test for duplicate API calls | REJECT |
76
+ | Tests only verify that loading happened once, not that it stayed stable after rerender | Warning |
77
+ | Page tests assert call count stability across rerender or state updates | OK |
78
+
79
+ ## Reachability regressions
80
+
81
+ When adding or changing user-facing features or screens, tests or equivalent verification must prove that users can still reach the feature.
82
+
83
+ | Criteria | Verdict |
84
+ |----------|---------|
85
+ | A new screen or feature is added with no verification of entry path or launch conditions | REJECT |
86
+ | Only isolated component rendering is tested, without verifying reachability from an entry point | Warning |
87
+ | The feature is verified reachable from an actual entry point such as a route, menu, button, link, or external caller | OK |
88
+
89
+ ## UI library integration regressions
90
+
91
+ When introducing or changing major third-party UI components such as data grids, date pickers, virtualized lists, or charts, tests must prove that the real component mounts without crashing.
92
+
93
+ | Criteria | Verdict |
94
+ |----------|---------|
95
+ | A major third-party UI component is added or changed without a regression test that mounts the real component | REJECT |
96
+ | Prop compatibility is checked only through shallow mocks or existence checks | Warning |
97
+ | The screen is rendered from its real entry path and the primary UI mounts without exceptions | OK |
98
+ | The primary UI component is also rendered directly with representative props | OK |
99
+
67
100
  ## Test Strategy
68
101
 
69
102
  - Prefer unit tests for logic, integration tests for boundaries
@@ -81,6 +114,26 @@ Verify data flow coupling that unit tests alone cannot cover.
81
114
  | New option propagating through a call chain to the endpoint | End-to-end chain coupling test required |
82
115
  | All module-level unit tests pass | Unit tests alone are sufficient (when none of the above apply) |
83
116
 
117
+ ## Unit Test Criteria
118
+
119
+ | Criteria | Verdict |
120
+ |----------|---------|
121
+ | Mocking the internal implementation of the test target (testing implementation, not behavior) | REJECT |
122
+ | Sharing and mutating fixtures between tests | REJECT. Loss of test independence |
123
+ | Mock return values diverging from actual types | Warning. Use type-safe mocks |
124
+ | Only testing happy paths without boundary values | Warning |
125
+
126
+ ## E2E Test Criteria
127
+
128
+ | Criteria | Verdict |
129
+ |----------|---------|
130
+ | Hitting production APIs without mocking external calls | REJECT. Test reproducibility is lost |
131
+ | Mocking the core logic under test | REJECT. Defeats the purpose of E2E |
132
+ | Using fixed sleep for timing synchronization | REJECT. Use state-based waits |
133
+ | Sharing state between tests | Warning. Test independence is compromised |
134
+ | Only testing happy paths without error flows | Warning |
135
+ | Writing E2E tests for logic that unit tests can cover | Warning |
136
+
84
137
  ## Test Environment Isolation
85
138
 
86
139
  Tie test infrastructure configuration to test scenario parameters. Hardcoded assumptions break under different scenarios.
@@ -47,10 +47,11 @@ piece_categories:
47
47
  - review-fix-backend-cqrs
48
48
  - review-takt-default
49
49
  - review-fix-takt-default
50
+ - security-audit
50
51
  🧪 Testing:
51
52
  pieces:
52
- - unit-test
53
- - e2e-test
53
+ - fill-unit
54
+ - fill-e2e
54
55
  🎵 TAKT Development:
55
56
  pieces:
56
57
  - takt-default
@@ -70,6 +70,8 @@ movements:
70
70
  - backend
71
71
  - cqrs-es
72
72
  - architecture
73
+ - unit-testing
74
+ - e2e-testing
73
75
  provider_options:
74
76
  claude:
75
77
  allowed_tools:
@@ -244,6 +246,9 @@ movements:
244
246
  policy:
245
247
  - review
246
248
  - testing
249
+ knowledge:
250
+ - unit-testing
251
+ - e2e-testing
247
252
  provider_options:
248
253
  claude:
249
254
  allowed_tools:
@@ -68,6 +68,8 @@ movements:
68
68
  knowledge:
69
69
  - backend
70
70
  - architecture
71
+ - unit-testing
72
+ - e2e-testing
71
73
  provider_options:
72
74
  claude:
73
75
  allowed_tools:
@@ -240,6 +242,9 @@ movements:
240
242
  policy:
241
243
  - review
242
244
  - testing
245
+ knowledge:
246
+ - unit-testing
247
+ - e2e-testing
243
248
  provider_options:
244
249
  claude:
245
250
  allowed_tools:
@@ -83,6 +83,8 @@ movements:
83
83
  - testing
84
84
  knowledge:
85
85
  - architecture
86
+ - unit-testing
87
+ - e2e-testing
86
88
  provider_options:
87
89
  claude:
88
90
  allowed_tools:
@@ -25,6 +25,8 @@ movements:
25
25
  - name: plan
26
26
  edit: false
27
27
  persona: planner
28
+ policy:
29
+ - design-planning
28
30
  knowledge:
29
31
  - frontend
30
32
  - backend
@@ -51,13 +53,14 @@ movements:
51
53
  output_contracts:
52
54
  report:
53
55
  - name: plan.md
54
- format: plan
56
+ format: plan-frontend
55
57
  - name: implement
56
58
  edit: true
57
59
  persona: coder
58
60
  policy:
59
61
  - coding
60
62
  - testing
63
+ - design-fidelity
61
64
  knowledge:
62
65
  - frontend
63
66
  - backend
@@ -163,6 +166,7 @@ movements:
163
166
  policy:
164
167
  - coding
165
168
  - testing
169
+ - design-fidelity
166
170
  knowledge:
167
171
  - frontend
168
172
  - backend
@@ -191,6 +195,7 @@ movements:
191
195
  policy:
192
196
  - coding
193
197
  - testing
198
+ - design-fidelity
194
199
  knowledge:
195
200
  - frontend
196
201
  - backend
@@ -223,6 +228,7 @@ movements:
223
228
  policy:
224
229
  - coding
225
230
  - testing
231
+ - design-fidelity
226
232
  knowledge:
227
233
  - frontend
228
234
  - backend
@@ -256,6 +262,7 @@ movements:
256
262
  policy:
257
263
  - coding
258
264
  - testing
265
+ - design-fidelity
259
266
  knowledge:
260
267
  - frontend
261
268
  - backend
@@ -37,6 +37,8 @@ movements:
37
37
  - name: plan
38
38
  edit: false
39
39
  persona: planner
40
+ policy:
41
+ - design-planning
40
42
  knowledge:
41
43
  - frontend
42
44
  - backend
@@ -60,13 +62,14 @@ movements:
60
62
  output_contracts:
61
63
  report:
62
64
  - name: plan.md
63
- format: plan
65
+ format: plan-frontend
64
66
  - name: implement
65
67
  edit: true
66
68
  persona: coder
67
69
  policy:
68
70
  - coding
69
71
  - testing
72
+ - design-fidelity
70
73
  session: refresh
71
74
  knowledge:
72
75
  - frontend
@@ -133,6 +136,7 @@ movements:
133
136
  policy:
134
137
  - coding
135
138
  - testing
139
+ - design-fidelity
136
140
  session: refresh
137
141
  knowledge:
138
142
  - frontend
@@ -204,7 +208,9 @@ movements:
204
208
  - name: frontend-review
205
209
  edit: false
206
210
  persona: frontend-reviewer
207
- policy: review
211
+ policy:
212
+ - review
213
+ - design-fidelity
208
214
  knowledge: frontend
209
215
  provider_options:
210
216
  claude:
@@ -276,6 +282,7 @@ movements:
276
282
  policy:
277
283
  - coding
278
284
  - testing
285
+ - design-fidelity
279
286
  knowledge:
280
287
  - frontend
281
288
  - backend
@@ -333,6 +340,7 @@ movements:
333
340
  policy:
334
341
  - coding
335
342
  - testing
343
+ - design-fidelity
336
344
  knowledge:
337
345
  - frontend
338
346
  - backend