takt 0.31.0 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/README.md +16 -11
  2. package/builtins/en/facets/instructions/write-tests-first.md +1 -4
  3. package/builtins/en/facets/knowledge/cqrs-es.md +50 -0
  4. package/builtins/en/facets/knowledge/security.md +50 -0
  5. package/builtins/en/facets/knowledge/task-decomposition.md +12 -18
  6. package/builtins/en/facets/policies/task-decomposition.md +53 -0
  7. package/builtins/en/piece-categories.yaml +16 -13
  8. package/builtins/en/pieces/backend-cqrs-mini.yaml +1 -1
  9. package/builtins/en/pieces/backend-cqrs.yaml +90 -9
  10. package/builtins/en/pieces/backend-mini.yaml +1 -1
  11. package/builtins/en/pieces/backend.yaml +89 -9
  12. package/builtins/en/pieces/compound-eye.yaml +1 -1
  13. package/builtins/en/pieces/default.yaml +2 -2
  14. package/builtins/en/pieces/dual-cqrs-mini.yaml +1 -1
  15. package/builtins/en/pieces/dual-cqrs.yaml +2 -2
  16. package/builtins/en/pieces/dual-mini.yaml +1 -1
  17. package/builtins/en/pieces/dual.yaml +2 -2
  18. package/builtins/en/pieces/e2e-test.yaml +1 -1
  19. package/builtins/en/pieces/frontend-mini.yaml +1 -1
  20. package/builtins/en/pieces/frontend.yaml +89 -9
  21. package/builtins/en/pieces/magi.yaml +3 -3
  22. package/builtins/en/pieces/{backend-cqrs-review.yaml → review-backend-cqrs.yaml} +1 -1
  23. package/builtins/en/pieces/{backend-review.yaml → review-backend.yaml} +1 -1
  24. package/builtins/en/pieces/{review.yaml → review-default.yaml} +2 -2
  25. package/builtins/en/pieces/{dual-cqrs-review.yaml → review-dual-cqrs.yaml} +1 -1
  26. package/builtins/en/pieces/{dual-review.yaml → review-dual.yaml} +1 -1
  27. package/builtins/en/pieces/{backend-cqrs-review-fix.yaml → review-fix-backend-cqrs.yaml} +2 -2
  28. package/builtins/en/pieces/{backend-review-fix.yaml → review-fix-backend.yaml} +2 -2
  29. package/builtins/en/pieces/{review-fix.yaml → review-fix-default.yaml} +2 -2
  30. package/builtins/en/pieces/{dual-cqrs-review-fix.yaml → review-fix-dual-cqrs.yaml} +2 -2
  31. package/builtins/en/pieces/{dual-review-fix.yaml → review-fix-dual.yaml} +2 -2
  32. package/builtins/en/pieces/{frontend-review-fix.yaml → review-fix-frontend.yaml} +2 -2
  33. package/builtins/en/pieces/{takt-default-review-fix.yaml → review-fix-takt-default.yaml} +114 -8
  34. package/builtins/en/pieces/{frontend-review.yaml → review-frontend.yaml} +1 -1
  35. package/builtins/en/pieces/review-takt-default.yaml +295 -0
  36. package/builtins/en/pieces/takt-default.yaml +2 -2
  37. package/builtins/en/pieces/terraform.yaml +3 -3
  38. package/builtins/en/pieces/unit-test.yaml +1 -1
  39. package/builtins/ja/facets/instructions/write-tests-first.md +1 -4
  40. package/builtins/ja/facets/knowledge/cqrs-es.md +50 -0
  41. package/builtins/ja/facets/knowledge/security.md +50 -0
  42. package/builtins/ja/facets/knowledge/task-decomposition.md +12 -18
  43. package/builtins/ja/facets/policies/task-decomposition.md +53 -0
  44. package/builtins/ja/piece-categories.yaml +16 -13
  45. package/builtins/ja/pieces/backend-cqrs-mini.yaml +1 -1
  46. package/builtins/ja/pieces/backend-cqrs.yaml +90 -9
  47. package/builtins/ja/pieces/backend-mini.yaml +1 -1
  48. package/builtins/ja/pieces/backend.yaml +89 -9
  49. package/builtins/ja/pieces/compound-eye.yaml +1 -1
  50. package/builtins/ja/pieces/default.yaml +2 -2
  51. package/builtins/ja/pieces/dual-cqrs-mini.yaml +1 -1
  52. package/builtins/ja/pieces/dual-cqrs.yaml +2 -2
  53. package/builtins/ja/pieces/dual-mini.yaml +1 -1
  54. package/builtins/ja/pieces/dual.yaml +2 -2
  55. package/builtins/ja/pieces/e2e-test.yaml +1 -1
  56. package/builtins/ja/pieces/frontend-mini.yaml +1 -1
  57. package/builtins/ja/pieces/frontend.yaml +89 -9
  58. package/builtins/ja/pieces/magi.yaml +3 -3
  59. package/builtins/ja/pieces/{backend-cqrs-review.yaml → review-backend-cqrs.yaml} +1 -1
  60. package/builtins/ja/pieces/{backend-review.yaml → review-backend.yaml} +1 -1
  61. package/builtins/ja/pieces/{review.yaml → review-default.yaml} +2 -2
  62. package/builtins/ja/pieces/{dual-cqrs-review.yaml → review-dual-cqrs.yaml} +1 -1
  63. package/builtins/ja/pieces/{dual-review.yaml → review-dual.yaml} +1 -1
  64. package/builtins/ja/pieces/{backend-cqrs-review-fix.yaml → review-fix-backend-cqrs.yaml} +2 -2
  65. package/builtins/ja/pieces/{backend-review-fix.yaml → review-fix-backend.yaml} +2 -2
  66. package/builtins/ja/pieces/{review-fix.yaml → review-fix-default.yaml} +2 -2
  67. package/builtins/ja/pieces/{dual-cqrs-review-fix.yaml → review-fix-dual-cqrs.yaml} +2 -2
  68. package/builtins/ja/pieces/{dual-review-fix.yaml → review-fix-dual.yaml} +2 -2
  69. package/builtins/ja/pieces/{frontend-review-fix.yaml → review-fix-frontend.yaml} +2 -2
  70. package/builtins/ja/pieces/{takt-default-review-fix.yaml → review-fix-takt-default.yaml} +114 -8
  71. package/builtins/ja/pieces/{frontend-review.yaml → review-frontend.yaml} +1 -1
  72. package/builtins/ja/pieces/review-takt-default.yaml +267 -0
  73. package/builtins/ja/pieces/takt-default.yaml +2 -2
  74. package/builtins/ja/pieces/terraform.yaml +3 -3
  75. package/builtins/ja/pieces/unit-test.yaml +1 -1
  76. package/builtins/skill/references/yaml-schema.md +26 -7
  77. package/builtins/skill-codex/SKILL.md +203 -0
  78. package/builtins/skill-codex/agents/openai.yaml +6 -0
  79. package/builtins/skill-codex/references/engine.md +228 -0
  80. package/builtins/skill-codex/references/yaml-schema.md +243 -0
  81. package/dist/app/cli/commands.js +7 -1
  82. package/dist/app/cli/commands.js.map +1 -1
  83. package/dist/core/models/piece-types.d.ts +4 -4
  84. package/dist/core/models/piece-types.d.ts.map +1 -1
  85. package/dist/core/models/schemas.d.ts +39 -0
  86. package/dist/core/models/schemas.d.ts.map +1 -1
  87. package/dist/core/models/schemas.js +6 -3
  88. package/dist/core/models/schemas.js.map +1 -1
  89. package/dist/core/piece/engine/PieceEngine.d.ts +3 -3
  90. package/dist/core/piece/engine/PieceEngine.d.ts.map +1 -1
  91. package/dist/core/piece/engine/PieceEngine.js +10 -10
  92. package/dist/core/piece/engine/PieceEngine.js.map +1 -1
  93. package/dist/core/piece/engine/team-leader-common.js +1 -1
  94. package/dist/core/piece/engine/team-leader-common.js.map +1 -1
  95. package/dist/core/piece/instruction/InstructionBuilder.js +4 -4
  96. package/dist/core/piece/instruction/InstructionBuilder.js.map +1 -1
  97. package/dist/core/piece/instruction/escape.d.ts +1 -1
  98. package/dist/core/piece/instruction/escape.d.ts.map +1 -1
  99. package/dist/core/piece/instruction/escape.js +2 -2
  100. package/dist/core/piece/instruction/escape.js.map +1 -1
  101. package/dist/features/config/deploySkill.d.ts +0 -17
  102. package/dist/features/config/deploySkill.d.ts.map +1 -1
  103. package/dist/features/config/deploySkill.js +12 -167
  104. package/dist/features/config/deploySkill.js.map +1 -1
  105. package/dist/features/config/deploySkillCodex.d.ts +5 -0
  106. package/dist/features/config/deploySkillCodex.d.ts.map +1 -0
  107. package/dist/features/config/deploySkillCodex.js +18 -0
  108. package/dist/features/config/deploySkillCodex.js.map +1 -0
  109. package/dist/features/config/deploySkillInternal.d.ts +13 -0
  110. package/dist/features/config/deploySkillInternal.d.ts.map +1 -0
  111. package/dist/features/config/deploySkillInternal.js +144 -0
  112. package/dist/features/config/deploySkillInternal.js.map +1 -0
  113. package/dist/features/config/index.d.ts +1 -0
  114. package/dist/features/config/index.d.ts.map +1 -1
  115. package/dist/features/config/index.js +1 -0
  116. package/dist/features/config/index.js.map +1 -1
  117. package/dist/features/tasks/execute/parallelExecution.d.ts +1 -0
  118. package/dist/features/tasks/execute/parallelExecution.d.ts.map +1 -1
  119. package/dist/features/tasks/execute/parallelExecution.js +3 -1
  120. package/dist/features/tasks/execute/parallelExecution.js.map +1 -1
  121. package/dist/features/tasks/execute/resolveTask.d.ts.map +1 -1
  122. package/dist/features/tasks/execute/resolveTask.js +7 -2
  123. package/dist/features/tasks/execute/resolveTask.js.map +1 -1
  124. package/dist/features/tasks/execute/taskExecution.d.ts.map +1 -1
  125. package/dist/features/tasks/execute/taskExecution.js +8 -5
  126. package/dist/features/tasks/execute/taskExecution.js.map +1 -1
  127. package/dist/infra/config/loaders/pieceParser.d.ts.map +1 -1
  128. package/dist/infra/config/loaders/pieceParser.js +16 -6
  129. package/dist/infra/config/loaders/pieceParser.js.map +1 -1
  130. package/dist/infra/config/loaders/pieceResolver.js +2 -2
  131. package/dist/infra/config/loaders/pieceResolver.js.map +1 -1
  132. package/dist/infra/config/loaders/resource-resolver.d.ts +4 -4
  133. package/dist/infra/config/loaders/resource-resolver.d.ts.map +1 -1
  134. package/dist/infra/config/loaders/resource-resolver.js +3 -3
  135. package/dist/infra/config/loaders/resource-resolver.js.map +1 -1
  136. package/dist/infra/config/paths.d.ts +2 -2
  137. package/dist/infra/config/paths.d.ts.map +1 -1
  138. package/dist/infra/opencode/client.d.ts.map +1 -1
  139. package/dist/infra/opencode/client.js +12 -0
  140. package/dist/infra/opencode/client.js.map +1 -1
  141. package/dist/infra/task/clone-base-branch.d.ts +2 -0
  142. package/dist/infra/task/clone-base-branch.d.ts.map +1 -1
  143. package/dist/infra/task/clone-base-branch.js +12 -4
  144. package/dist/infra/task/clone-base-branch.js.map +1 -1
  145. package/dist/infra/task/clone.d.ts +1 -0
  146. package/dist/infra/task/clone.d.ts.map +1 -1
  147. package/dist/infra/task/clone.js +29 -5
  148. package/dist/infra/task/clone.js.map +1 -1
  149. package/dist/shared/prompts/en/score_interactive_policy.md +17 -0
  150. package/dist/shared/prompts/index.d.ts +1 -1
  151. package/dist/shared/prompts/index.d.ts.map +1 -1
  152. package/dist/shared/prompts/index.js +2 -2
  153. package/dist/shared/prompts/index.js.map +1 -1
  154. package/dist/shared/prompts/ja/score_interactive_policy.md +17 -0
  155. package/package.json +7 -6
  156. package/dist/faceted-prompting/compose.d.ts +0 -18
  157. package/dist/faceted-prompting/compose.d.ts.map +0 -1
  158. package/dist/faceted-prompting/compose.js +0 -45
  159. package/dist/faceted-prompting/compose.js.map +0 -1
  160. package/dist/faceted-prompting/data-engine.d.ts +0 -49
  161. package/dist/faceted-prompting/data-engine.d.ts.map +0 -1
  162. package/dist/faceted-prompting/data-engine.js +0 -85
  163. package/dist/faceted-prompting/data-engine.js.map +0 -1
  164. package/dist/faceted-prompting/escape.d.ts +0 -14
  165. package/dist/faceted-prompting/escape.d.ts.map +0 -1
  166. package/dist/faceted-prompting/escape.js +0 -16
  167. package/dist/faceted-prompting/escape.js.map +0 -1
  168. package/dist/faceted-prompting/index.d.ts +0 -18
  169. package/dist/faceted-prompting/index.d.ts.map +0 -1
  170. package/dist/faceted-prompting/index.js +0 -18
  171. package/dist/faceted-prompting/index.js.map +0 -1
  172. package/dist/faceted-prompting/resolve.d.ts +0 -73
  173. package/dist/faceted-prompting/resolve.d.ts.map +0 -1
  174. package/dist/faceted-prompting/resolve.js +0 -160
  175. package/dist/faceted-prompting/resolve.js.map +0 -1
  176. package/dist/faceted-prompting/scope.d.ts +0 -47
  177. package/dist/faceted-prompting/scope.d.ts.map +0 -1
  178. package/dist/faceted-prompting/scope.js +0 -69
  179. package/dist/faceted-prompting/scope.js.map +0 -1
  180. package/dist/faceted-prompting/template.d.ts +0 -27
  181. package/dist/faceted-prompting/template.d.ts.map +0 -1
  182. package/dist/faceted-prompting/template.js +0 -49
  183. package/dist/faceted-prompting/template.js.map +0 -1
  184. package/dist/faceted-prompting/truncation.d.ts +0 -36
  185. package/dist/faceted-prompting/truncation.d.ts.map +0 -1
  186. package/dist/faceted-prompting/truncation.js +0 -63
  187. package/dist/faceted-prompting/truncation.js.map +0 -1
  188. package/dist/faceted-prompting/types.d.ts +0 -44
  189. package/dist/faceted-prompting/types.d.ts.map +0 -1
  190. package/dist/faceted-prompting/types.js +0 -10
  191. package/dist/faceted-prompting/types.js.map +0 -1
package/README.md CHANGED
@@ -12,7 +12,7 @@ TAKT is built with TAKT itself (dogfooding).
12
12
 
13
13
  **Batteries included** — Architecture, security, and AI antipattern review criteria are built in. Ship code that meets a quality bar from day one.
14
14
 
15
- **Practical** — A tool for daily development, not demos. Talk to AI to refine requirements, queue tasks, and run them. Automatic worktree isolation, PR creation, and retry on failure.
15
+ **Practical** — A tool for daily development, not demos. Talk to AI to refine requirements, queue tasks, and run them. Worktree isolation on task execution, PR creation, and retry on failure.
16
16
 
17
17
  **Reproducible** — Execution paths are declared in YAML, keeping results consistent. Pieces are shareable — a workflow built by one team member can be used by anyone else to run the same quality process. Every step is logged in NDJSON for full traceability from task to PR.
18
18
 
@@ -39,7 +39,7 @@ Optional:
39
39
  npm install -g takt
40
40
  ```
41
41
 
42
- ### Talk to AI, then execute
42
+ ### Talk to AI and queue tasks
43
43
 
44
44
  ```
45
45
  $ takt
@@ -55,21 +55,24 @@ Select piece:
55
55
  [AI clarifies requirements and organizes the task]
56
56
 
57
57
  > /go
58
- ```
59
58
 
60
- TAKT creates an isolated worktree, runs the piece (plan → implement → review → fix loop), and offers to create a PR when done.
59
+ Proposed task:
60
+ ...
61
61
 
62
- ### Queue tasks, then batch execute
62
+ What would you like to do?
63
+ Execute now
64
+ Create GitHub Issue
65
+ ❯ Queue as task # ← normal flow
66
+ Continue conversation
67
+ ```
63
68
 
64
- Use `takt` to queue multiple tasks, then execute them all at once:
69
+ Choosing "Queue as task" saves the task to `.takt/tasks/`. Run `takt run` to execute TAKT creates an isolated worktree, runs the piece (plan implement → review → fix loop), and offers to create a PR when done.
65
70
 
66
71
  ```bash
67
- # Queue tasks through conversation
68
- takt
69
- > Refactor the auth module
70
- > /go # queues the task
72
+ # Execute queued tasks
73
+ takt run
71
74
 
72
- # Or queue from GitHub Issues
75
+ # You can also queue from GitHub Issues
73
76
  takt add #6
74
77
  takt add #12
75
78
 
@@ -77,6 +80,8 @@ takt add #12
77
80
  takt run
78
81
  ```
79
82
 
83
+ > **"Execute now"** runs the piece directly in your current directory without worktree isolation. Useful for quick experiments, but note that changes go straight into your working tree.
84
+
80
85
  ### Manage results
81
86
 
82
87
  ```bash
@@ -12,14 +12,13 @@ Refer only to files within the Report Directory shown in the Piece Context. Do n
12
12
  - Does a new status/state merge into an existing workflow?
13
13
  - Does a new option propagate through a call chain to the endpoint?
14
14
  - If any apply, create integration tests
15
- 5. Run the build (type check) to verify test code has no syntax errors
16
15
 
17
16
  **Test writing guidelines:**
18
17
  - Follow the project's existing test patterns (naming conventions, directory structure, helpers)
19
18
  - Write tests in Given-When-Then structure
20
19
  - One concept per test. Do not mix multiple concerns in a single test
21
20
  - Cover happy path, error cases, boundary values, and edge cases
22
- - Write tests that are expected to pass after implementation is complete
21
+ - Write tests that are expected to pass after implementation is complete (build errors and test failures are expected at this stage)
23
22
 
24
23
  **Scope output contract (create at the start):**
25
24
  ```markdown
@@ -55,5 +54,3 @@ Small / Medium / Large
55
54
  - {Summary of actions taken}
56
55
  ## Changes made
57
56
  - {List of test files created}
58
- ## Build results
59
- - {Build execution results}
@@ -408,6 +408,56 @@ Checklist:
408
408
  | Query side tests don't create data via Command | Recommended |
409
409
  | Integration tests consider Axon async processing | Required |
410
410
 
411
+ ## Master Data and CRUD
412
+
413
+ Not everything in a CQRS+ES system needs event sourcing. Master data (reference data) with simple characteristics is better implemented as plain CRUD — it's simpler and easier to maintain.
414
+
415
+ However, don't mechanically decide "it's master data, so CRUD". The more criteria below that apply, the more CRUD is suitable. Conversely, if even one requirement calls for CQRS+ES, consider adopting it.
416
+
417
+ **Criteria for determining CRUD is sufficient:**
418
+
419
+ | Aspect | Leans CRUD | Leans CQRS+ES |
420
+ |--------|-----------|---------------|
421
+ | Business requirements | Just "manage X" with no special mentions | Specific business rules or constraints |
422
+ | Logic evolution | Simple reference/update, no foreseeable complexity | State transitions or lifecycle may grow complex |
423
+ | Change history / audit | No need to track "who changed what when" | Change history or audit trail required |
424
+ | Domain events | Changes don't affect other aggregates or processes | Changes trigger downstream processes |
425
+ | Consistency scope | Self-contained, no cross-aggregate consistency needed | Must maintain consistency with other aggregates |
426
+ | Point-in-time queries | No "what was the state at time T" queries | Point-in-time queries required |
427
+
428
+ **Typical CRUD candidates:**
429
+ - Code masters such as prefecture/country codes
430
+ - Classification masters such as categories and tags
431
+ - Configuration values, constant tables
432
+
433
+ **Cases where CQRS+ES is justified:**
434
+ - Product master, but price change history tracking is needed
435
+ - Organization master, but changes trigger permission recalculation
436
+ - Business partner master, but has credit assessment state transitions
437
+
438
+ ```kotlin
439
+ // CRUD is sufficient: Simple category master
440
+ @Entity
441
+ data class Category(
442
+ @Id val categoryId: String,
443
+ val name: String,
444
+ val displayOrder: Int
445
+ )
446
+
447
+ // CQRS+ES is appropriate: Product with price change history tracking
448
+ data class Product(
449
+ val productId: String,
450
+ val currentPrice: Money
451
+ ) {
452
+ fun changePrice(newPrice: Money, reason: String): PriceChangedEvent {
453
+ require(newPrice.amount > BigDecimal.ZERO) { "Price must be positive" }
454
+ return PriceChangedEvent(productId, currentPrice, newPrice, reason)
455
+ }
456
+ }
457
+ ```
458
+
459
+ Even when implementing with CRUD, other aggregates in the CQRS+ES system reference CRUD entities by ID. The principle that CRUD entities don't directly access aggregate internal state still applies.
460
+
411
461
  ## Infrastructure Layer
412
462
 
413
463
  Check:
@@ -98,6 +98,56 @@ app.get('/user/:id', authorize('read:user'), (req, res) => {
98
98
  - Missing type checks → REJECT
99
99
  - No size limits set → REJECT
100
100
 
101
+ ## Logging & Masking
102
+
103
+ Prevent sensitive information from leaking into logs and responses.
104
+
105
+ **Never log:**
106
+ - Passwords, tokens, API keys
107
+ - Credit card numbers, personal identification numbers
108
+ - Session IDs, authentication header values
109
+ - Personal information (email, phone) unless necessary for debugging
110
+
111
+ **Masking patterns:**
112
+
113
+ ```typescript
114
+ // NG - Password exposed in logs
115
+ logger.info('User login attempt', { email, password })
116
+
117
+ // OK - Exclude sensitive fields
118
+ logger.info('User login attempt', { email })
119
+ ```
120
+
121
+ ```kotlin
122
+ // NG - Logging entire request object
123
+ logger.info("Request: {}", request)
124
+
125
+ // OK - Log only safe fields
126
+ logger.info("Request: userId={}, action={}", request.userId, request.action)
127
+ ```
128
+
129
+ **Structured logging field filtering:**
130
+
131
+ When passing objects to log output, ensure `toString()` or JSON serialization does not include sensitive fields.
132
+
133
+ ```kotlin
134
+ // NG - data class toString() includes password
135
+ data class UserCredentials(val email: String, val password: String)
136
+
137
+ // OK - Override toString() to mask sensitive fields
138
+ data class UserCredentials(val email: String, val password: String) {
139
+ override fun toString(): String = "UserCredentials(email=$email, password=***)"
140
+ }
141
+ ```
142
+
143
+ | Criteria | Verdict |
144
+ |----------|---------|
145
+ | Log output contains passwords, tokens, or API keys | REJECT |
146
+ | Error responses contain stack traces or internal paths | REJECT |
147
+ | data class toString() exposes sensitive fields | REJECT |
148
+ | Sensitive info can be output regardless of log level | REJECT |
149
+ | Debug logs contain PII but disabled in production | Warning. Risk of misconfiguration |
150
+
101
151
  ## Cryptography
102
152
 
103
153
  - Use of weak crypto algorithms → REJECT
@@ -2,15 +2,17 @@
2
2
 
3
3
  ## Decomposition Feasibility
4
4
 
5
- Before splitting a task into multiple parts, assess whether decomposition is appropriate. When decomposition is unsuitable, implementing in a single part is more efficient.
5
+ Before splitting a task into multiple parts, assess whether decomposition is appropriate. Conditions that prohibit decomposition and REJECT criteria are defined in the Task Decomposition Policy. This section explains the underlying reasoning.
6
6
 
7
- | Criteria | Judgment |
8
- |----------|----------|
9
- | Changed files clearly separate into layers | Decompose |
10
- | Shared types/IDs span multiple parts | Single part |
11
- | Broad rename/refactoring | Single part |
12
- | Fewer than 5 files to change | Single part |
13
- | Same file needs editing by multiple parts | Single part |
7
+ ### Decision Criteria Table (Rationale)
8
+
9
+ | Perspective | Detection Pattern | Recommended Judgment | Rationale (Why) |
10
+ |-------------|-------------------|----------------------|-----------------|
11
+ | Shared contracts (ID/type) | A new ID/type is defined in one part and referenced by another | Do not decompose (single part) | Producer/consumer mismatches in type, naming, and handoff are common |
12
+ | Event chains | Both emitter and receiver must be changed together | Do not decompose (single part) | Bidirectional assumptions drift and cause runtime inconsistencies |
13
+ | Interface changes | Existing signature change + multiple call-site updates required | Do not decompose (single part) | Missed call-site updates easily lead to build/runtime failures |
14
+ | File ownership overlap | Same file assigned to multiple parts | Do not decompose (restructure plan) | Overwrites/conflicts create repeated REJECT in review cycles |
15
+ | Layer independence | API/Domain/Infra boundaries are clear and dependencies are one-way | Decomposition allowed | Clear boundaries reduce coupling across parts |
14
16
 
15
17
  ### Detecting Cross-Cutting Concerns
16
18
 
@@ -20,17 +22,9 @@ When any of the following apply, independent parts cannot maintain consistency.
20
22
  - Both the event emitter and event receiver need changes
21
23
  - An existing interface signature changes, requiring updates to all call sites
22
24
 
23
- ## File Exclusivity Principle
24
-
25
- When decomposing into multiple parts, each part's file ownership must be completely exclusive.
26
-
27
- | Criteria | Judgment |
28
- |----------|----------|
29
- | Same file edited by multiple parts | REJECT (causes conflicts) |
30
- | Type definition and consumer in different parts | Consolidate into the type definition part |
31
- | Test file and implementation file in different parts | Consolidate into the same part |
25
+ ## Grouping Priority
32
26
 
33
- ### Grouping Priority
27
+ When decomposition is appropriate, use the following criteria to group files.
34
28
 
35
29
  1. **By dependency direction** — keep dependency source and target in the same part
36
30
  2. **By layer** — domain layer / infrastructure layer / API layer
@@ -0,0 +1,53 @@
1
+ # Task Decomposition Policy
2
+
3
+ Ensure decomposition quality for parallel parts.
4
+
5
+ ## Principles
6
+
7
+ | Principle | Criteria |
8
+ |-----------|----------|
9
+ | Explicit decomposition judgment | Evaluate the knowledge base criteria table before decomposing; state the judgment explicitly |
10
+ | File exclusivity | Each file is owned by exactly one part. No exceptions |
11
+ | Dependency direction | If parts have dependencies, merge them into a single part |
12
+ | Tests with implementation | Test files and corresponding implementation files belong to the same part |
13
+ | Quality gates aggregate | Build/test execution belongs in a part that aggregates all other parts' results |
14
+
15
+ ## File Exclusivity
16
+
17
+ When multiple parts edit the same file, sub-agents overwrite each other's changes.
18
+
19
+ | Criteria | Judgment |
20
+ |----------|----------|
21
+ | Same file appears in multiple parts' assignments | REJECT |
22
+ | Type definition file and consumer file in different parts | REJECT (merge into the type definition part) |
23
+ | Assigned files described as "touch as needed on failure" or similar vague expressions | REJECT (determine files upfront) |
24
+ | Test file and implementation file in different parts | REJECT |
25
+ | Wildcard assignments (`src/**/*`) overlapping with another part's scope | REJECT |
26
+
27
+ ## Conditions That Prohibit Decomposition
28
+
29
+ When any of the following apply, implement in a single part. Do not decompose.
30
+
31
+ | Criteria | Judgment |
32
+ |----------|----------|
33
+ | Broad rename or refactor | Single part |
34
+ | Shared types or IDs cross multiple parts | Single part |
35
+ | Fewer than 5 files to change | Single part |
36
+ | Existing interface signature change + updating all call sites | Single part |
37
+
38
+ ## Quality Gate Parts
39
+
40
+ Parts responsible for build/test execution follow different rules from implementation parts.
41
+
42
+ | Criteria | Judgment |
43
+ |----------|----------|
44
+ | Quality gate part includes implementation part files in its assignment | REJECT |
45
+ | Quality gate split into multiple parts | REJECT (merge into one) |
46
+ | Quality gate part's fix scope is "anything" | REJECT (specify target files upfront) |
47
+
48
+ ## Prohibited
49
+
50
+ - **Skipping decomposition judgment** - decomposing without evaluating the knowledge criteria table
51
+ - **Assigning the same file to multiple parts** - including via wildcard assignments
52
+ - **Separating dependent changes** - putting type definitions and consumers, or event emitters and receivers, in different parts
53
+ - **Parts with undefined file assignments** - vague assignments like "fix as needed" or "modify if required"
@@ -33,18 +33,20 @@ piece_categories:
33
33
  - terraform
34
34
  🔍 Review:
35
35
  pieces:
36
- - review
37
- - review-fix
38
- - frontend-review
39
- - frontend-review-fix
40
- - backend-review
41
- - backend-review-fix
42
- - dual-review
43
- - dual-review-fix
44
- - dual-cqrs-review
45
- - dual-cqrs-review-fix
46
- - backend-cqrs-review
47
- - backend-cqrs-review-fix
36
+ - review-default
37
+ - review-fix-default
38
+ - review-frontend
39
+ - review-fix-frontend
40
+ - review-backend
41
+ - review-fix-backend
42
+ - review-dual
43
+ - review-fix-dual
44
+ - review-dual-cqrs
45
+ - review-fix-dual-cqrs
46
+ - review-backend-cqrs
47
+ - review-fix-backend-cqrs
48
+ - review-takt-default
49
+ - review-fix-takt-default
48
50
  🧪 Testing:
49
51
  pieces:
50
52
  - unit-test
@@ -52,7 +54,8 @@ piece_categories:
52
54
  🎵 TAKT Development:
53
55
  pieces:
54
56
  - takt-default
55
- - takt-default-review-fix
57
+ - review-takt-default
58
+ - review-fix-takt-default
56
59
  Others:
57
60
  pieces:
58
61
  - research
@@ -15,7 +15,7 @@ loop_monitors:
15
15
  threshold: 3
16
16
  judge:
17
17
  persona: supervisor
18
- instruction_template: loop-monitor-reviewers-fix
18
+ instruction: loop-monitor-reviewers-fix
19
19
  rules:
20
20
  - condition: converging (findings decreasing, fixes applied)
21
21
  next: fix_both
@@ -1,5 +1,5 @@
1
1
  name: backend-cqrs
2
- description: CQRS+ES, Security, QA Expert Review
2
+ description: CQRS+ES development piece with test-first, AI review, 2-stage reviews, fix loops, and supervision
3
3
  piece_config:
4
4
  provider_options:
5
5
  codex:
@@ -10,15 +10,27 @@ max_movements: 30
10
10
  initial_movement: plan
11
11
  loop_monitors:
12
12
  - cycle:
13
- - reviewers
13
+ - ai_review
14
+ - ai_fix
15
+ threshold: 3
16
+ judge:
17
+ persona: supervisor
18
+ instruction: loop-monitor-ai-fix
19
+ rules:
20
+ - condition: Healthy (making progress)
21
+ next: ai_review
22
+ - condition: Unproductive (no improvement)
23
+ next: reviewers_1
24
+ - cycle:
25
+ - reviewers_1
14
26
  - fix
15
27
  threshold: 3
16
28
  judge:
17
29
  persona: supervisor
18
- instruction_template: loop-monitor-reviewers-fix
30
+ instruction: loop-monitor-reviewers-fix
19
31
  rules:
20
32
  - condition: converging (findings decreasing, fixes applied)
21
- next: reviewers
33
+ next: reviewers_1
22
34
  - condition: unproductive (same findings repeating)
23
35
  next: supervise
24
36
  movements:
@@ -41,13 +53,53 @@ movements:
41
53
  instruction: plan
42
54
  rules:
43
55
  - condition: Task analysis and planning is complete
44
- next: implement
56
+ next: write_tests
45
57
  - condition: Requirements are unclear and planning cannot proceed
46
58
  next: ABORT
47
59
  output_contracts:
48
60
  report:
49
61
  - name: plan.md
50
62
  format: plan
63
+ - name: write_tests
64
+ edit: true
65
+ persona: coder
66
+ policy:
67
+ - coding
68
+ - testing
69
+ knowledge:
70
+ - backend
71
+ - cqrs-es
72
+ - architecture
73
+ provider_options:
74
+ claude:
75
+ allowed_tools:
76
+ - Read
77
+ - Glob
78
+ - Grep
79
+ - Edit
80
+ - Write
81
+ - Bash
82
+ - WebSearch
83
+ - WebFetch
84
+ required_permission_mode: edit
85
+ instruction: write-tests-first
86
+ rules:
87
+ - condition: Test creation is complete
88
+ next: implement
89
+ - condition: Skipping test creation as target is not yet implemented
90
+ next: implement
91
+ - condition: Cannot proceed with test creation
92
+ next: plan
93
+ - condition: User input required for clarification
94
+ next: write_tests
95
+ requires_user_input: true
96
+ interactive_only: true
97
+ output_contracts:
98
+ report:
99
+ - name: test-scope.md
100
+ format: coder-scope
101
+ - name: test-decisions.md
102
+ format: coder-decisions
51
103
  - name: implement
52
104
  edit: true
53
105
  persona: coder
@@ -106,7 +158,7 @@ movements:
106
158
  instruction: ai-review
107
159
  rules:
108
160
  - condition: No AI-specific issues found
109
- next: reviewers
161
+ next: reviewers_1
110
162
  - condition: AI-specific issues detected
111
163
  next: ai_fix
112
164
  output_contracts:
@@ -159,9 +211,9 @@ movements:
159
211
  - condition: ai_review's findings are valid (fix required)
160
212
  next: ai_fix
161
213
  - condition: ai_fix's judgment is valid (no fix needed)
162
- next: reviewers
214
+ next: reviewers_1
163
215
  instruction: arbitrate
164
- - name: reviewers
216
+ - name: reviewers_1
165
217
  parallel:
166
218
  - name: cqrs-es-review
167
219
  edit: false
@@ -186,6 +238,35 @@ movements:
186
238
  report:
187
239
  - name: cqrs-es-review.md
188
240
  format: cqrs-es-review
241
+ - name: testing-review
242
+ edit: false
243
+ persona: testing-reviewer
244
+ policy:
245
+ - review
246
+ - testing
247
+ provider_options:
248
+ claude:
249
+ allowed_tools:
250
+ - Read
251
+ - Glob
252
+ - Grep
253
+ - WebSearch
254
+ - WebFetch
255
+ rules:
256
+ - condition: approved
257
+ - condition: needs_fix
258
+ instruction: review-test
259
+ output_contracts:
260
+ report:
261
+ - name: testing-review.md
262
+ format: testing-review
263
+ rules:
264
+ - condition: all("approved")
265
+ next: reviewers_2
266
+ - condition: any("needs_fix")
267
+ next: fix
268
+ - name: reviewers_2
269
+ parallel:
189
270
  - name: security-review
190
271
  edit: false
191
272
  persona: security-reviewer
@@ -260,7 +341,7 @@ movements:
260
341
  pass_previous_response: false
261
342
  rules:
262
343
  - condition: Fix complete
263
- next: reviewers
344
+ next: reviewers_1
264
345
  - condition: Cannot proceed, insufficient info
265
346
  next: plan
266
347
  instruction: fix
@@ -15,7 +15,7 @@ loop_monitors:
15
15
  threshold: 3
16
16
  judge:
17
17
  persona: supervisor
18
- instruction_template: loop-monitor-reviewers-fix
18
+ instruction: loop-monitor-reviewers-fix
19
19
  rules:
20
20
  - condition: converging (findings decreasing, fixes applied)
21
21
  next: fix_both
@@ -1,5 +1,5 @@
1
1
  name: backend
2
- description: Backend, Security, QA Expert Review
2
+ description: Backend development piece with test-first, AI review, 2-stage reviews, fix loops, and supervision
3
3
  piece_config:
4
4
  provider_options:
5
5
  codex:
@@ -10,15 +10,27 @@ max_movements: 30
10
10
  initial_movement: plan
11
11
  loop_monitors:
12
12
  - cycle:
13
- - reviewers
13
+ - ai_review
14
+ - ai_fix
15
+ threshold: 3
16
+ judge:
17
+ persona: supervisor
18
+ instruction: loop-monitor-ai-fix
19
+ rules:
20
+ - condition: Healthy (making progress)
21
+ next: ai_review
22
+ - condition: Unproductive (no improvement)
23
+ next: reviewers_1
24
+ - cycle:
25
+ - reviewers_1
14
26
  - fix
15
27
  threshold: 3
16
28
  judge:
17
29
  persona: supervisor
18
- instruction_template: loop-monitor-reviewers-fix
30
+ instruction: loop-monitor-reviewers-fix
19
31
  rules:
20
32
  - condition: converging (findings decreasing, fixes applied)
21
- next: reviewers
33
+ next: reviewers_1
22
34
  - condition: unproductive (same findings repeating)
23
35
  next: supervise
24
36
  movements:
@@ -40,13 +52,52 @@ movements:
40
52
  instruction: plan
41
53
  rules:
42
54
  - condition: Task analysis and planning is complete
43
- next: implement
55
+ next: write_tests
44
56
  - condition: Requirements are unclear and planning cannot proceed
45
57
  next: ABORT
46
58
  output_contracts:
47
59
  report:
48
60
  - name: plan.md
49
61
  format: plan
62
+ - name: write_tests
63
+ edit: true
64
+ persona: coder
65
+ policy:
66
+ - coding
67
+ - testing
68
+ knowledge:
69
+ - backend
70
+ - architecture
71
+ provider_options:
72
+ claude:
73
+ allowed_tools:
74
+ - Read
75
+ - Glob
76
+ - Grep
77
+ - Edit
78
+ - Write
79
+ - Bash
80
+ - WebSearch
81
+ - WebFetch
82
+ required_permission_mode: edit
83
+ instruction: write-tests-first
84
+ rules:
85
+ - condition: Test creation is complete
86
+ next: implement
87
+ - condition: Skipping test creation as target is not yet implemented
88
+ next: implement
89
+ - condition: Cannot proceed with test creation
90
+ next: plan
91
+ - condition: User input required for clarification
92
+ next: write_tests
93
+ requires_user_input: true
94
+ interactive_only: true
95
+ output_contracts:
96
+ report:
97
+ - name: test-scope.md
98
+ format: coder-scope
99
+ - name: test-decisions.md
100
+ format: coder-decisions
50
101
  - name: implement
51
102
  edit: true
52
103
  persona: coder
@@ -104,7 +155,7 @@ movements:
104
155
  instruction: ai-review
105
156
  rules:
106
157
  - condition: No AI-specific issues found
107
- next: reviewers
158
+ next: reviewers_1
108
159
  - condition: AI-specific issues detected
109
160
  next: ai_fix
110
161
  output_contracts:
@@ -156,9 +207,9 @@ movements:
156
207
  - condition: ai_review's findings are valid (fix required)
157
208
  next: ai_fix
158
209
  - condition: ai_fix's judgment is valid (no fix needed)
159
- next: reviewers
210
+ next: reviewers_1
160
211
  instruction: arbitrate
161
- - name: reviewers
212
+ - name: reviewers_1
162
213
  parallel:
163
214
  - name: arch-review
164
215
  edit: false
@@ -183,6 +234,35 @@ movements:
183
234
  report:
184
235
  - name: architect-review.md
185
236
  format: architecture-review
237
+ - name: testing-review
238
+ edit: false
239
+ persona: testing-reviewer
240
+ policy:
241
+ - review
242
+ - testing
243
+ provider_options:
244
+ claude:
245
+ allowed_tools:
246
+ - Read
247
+ - Glob
248
+ - Grep
249
+ - WebSearch
250
+ - WebFetch
251
+ rules:
252
+ - condition: approved
253
+ - condition: needs_fix
254
+ instruction: review-test
255
+ output_contracts:
256
+ report:
257
+ - name: testing-review.md
258
+ format: testing-review
259
+ rules:
260
+ - condition: all("approved")
261
+ next: reviewers_2
262
+ - condition: any("needs_fix")
263
+ next: fix
264
+ - name: reviewers_2
265
+ parallel:
186
266
  - name: security-review
187
267
  edit: false
188
268
  persona: security-reviewer
@@ -256,7 +336,7 @@ movements:
256
336
  pass_previous_response: false
257
337
  rules:
258
338
  - condition: Fix complete
259
- next: reviewers
339
+ next: reviewers_1
260
340
  - condition: Cannot proceed, insufficient info
261
341
  next: plan
262
342
  instruction: fix
@@ -108,7 +108,7 @@ movements:
108
108
  rules:
109
109
  - condition: synthesis complete
110
110
  next: COMPLETE
111
- instruction_template: |
111
+ instruction: |
112
112
  Two models (Claude / Codex) independently answered the same instruction.
113
113
  Synthesize their responses.
114
114