takt 0.24.0 → 0.26.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 (266) hide show
  1. package/builtins/en/facets/instructions/implement-terraform.md +54 -0
  2. package/builtins/en/facets/instructions/loop-monitor-ai-fix.md +1 -1
  3. package/builtins/en/facets/instructions/plan.md +1 -0
  4. package/builtins/en/facets/instructions/research-analyze.md +6 -1
  5. package/builtins/en/facets/instructions/research-dig.md +23 -6
  6. package/builtins/en/facets/instructions/review-terraform.md +25 -0
  7. package/builtins/en/facets/instructions/review-test.md +1 -1
  8. package/builtins/en/facets/knowledge/terraform-aws.md +241 -0
  9. package/builtins/en/facets/output-contracts/plan.md +10 -9
  10. package/builtins/en/facets/output-contracts/research-report.md +28 -0
  11. package/builtins/en/facets/output-contracts/terraform-review.md +42 -0
  12. package/builtins/en/facets/personas/planner.md +5 -0
  13. package/builtins/en/facets/personas/terraform-coder.md +30 -0
  14. package/builtins/en/facets/personas/terraform-reviewer.md +25 -0
  15. package/builtins/en/facets/policies/terraform.md +88 -0
  16. package/builtins/en/piece-categories.yaml +3 -0
  17. package/builtins/en/pieces/backend-cqrs-mini.yaml +2 -2
  18. package/builtins/en/pieces/backend-cqrs.yaml +5 -5
  19. package/builtins/en/pieces/backend-mini.yaml +2 -2
  20. package/builtins/en/pieces/backend.yaml +5 -5
  21. package/builtins/en/pieces/deep-research.yaml +21 -0
  22. package/builtins/en/pieces/default-mini.yaml +2 -2
  23. package/builtins/en/pieces/default-test-first-mini.yaml +6 -4
  24. package/builtins/en/pieces/default.yaml +65 -8
  25. package/builtins/en/pieces/e2e-test.yaml +4 -4
  26. package/builtins/en/pieces/expert-cqrs-mini.yaml +2 -2
  27. package/builtins/en/pieces/expert-cqrs.yaml +6 -6
  28. package/builtins/en/pieces/expert-mini.yaml +2 -2
  29. package/builtins/en/pieces/expert.yaml +6 -6
  30. package/builtins/en/pieces/frontend-mini.yaml +2 -2
  31. package/builtins/en/pieces/frontend.yaml +6 -6
  32. package/builtins/en/pieces/review.yaml +6 -6
  33. package/builtins/en/pieces/structural-reform.yaml +7 -7
  34. package/builtins/en/pieces/terraform.yaml +296 -0
  35. package/builtins/en/pieces/unit-test.yaml +4 -4
  36. package/builtins/ja/facets/instructions/implement-terraform.md +54 -0
  37. package/builtins/ja/facets/instructions/loop-monitor-ai-fix.md +1 -1
  38. package/builtins/ja/facets/instructions/plan.md +1 -0
  39. package/builtins/ja/facets/instructions/research-analyze.md +6 -1
  40. package/builtins/ja/facets/instructions/research-dig.md +23 -6
  41. package/builtins/ja/facets/instructions/review-terraform.md +25 -0
  42. package/builtins/ja/facets/instructions/review-test.md +1 -1
  43. package/builtins/ja/facets/knowledge/terraform-aws.md +241 -0
  44. package/builtins/ja/facets/output-contracts/plan.md +10 -9
  45. package/builtins/ja/facets/output-contracts/research-report.md +28 -0
  46. package/builtins/ja/facets/output-contracts/terraform-review.md +42 -0
  47. package/builtins/ja/facets/personas/planner.md +5 -0
  48. package/builtins/ja/facets/personas/terraform-coder.md +30 -0
  49. package/builtins/ja/facets/personas/terraform-reviewer.md +25 -0
  50. package/builtins/ja/facets/policies/terraform.md +88 -0
  51. package/builtins/ja/piece-categories.yaml +3 -0
  52. package/builtins/ja/pieces/backend-cqrs-mini.yaml +2 -2
  53. package/builtins/ja/pieces/backend-cqrs.yaml +5 -5
  54. package/builtins/ja/pieces/backend-mini.yaml +2 -2
  55. package/builtins/ja/pieces/backend.yaml +5 -5
  56. package/builtins/ja/pieces/deep-research.yaml +21 -0
  57. package/builtins/ja/pieces/default-mini.yaml +2 -2
  58. package/builtins/ja/pieces/default-test-first-mini.yaml +6 -4
  59. package/builtins/ja/pieces/default.yaml +65 -8
  60. package/builtins/ja/pieces/e2e-test.yaml +4 -4
  61. package/builtins/ja/pieces/expert-cqrs-mini.yaml +2 -2
  62. package/builtins/ja/pieces/expert-cqrs.yaml +6 -6
  63. package/builtins/ja/pieces/expert-mini.yaml +2 -2
  64. package/builtins/ja/pieces/expert.yaml +6 -6
  65. package/builtins/ja/pieces/frontend-mini.yaml +2 -2
  66. package/builtins/ja/pieces/frontend.yaml +6 -6
  67. package/builtins/ja/pieces/review.yaml +6 -6
  68. package/builtins/ja/pieces/structural-reform.yaml +7 -7
  69. package/builtins/ja/pieces/terraform.yaml +296 -0
  70. package/builtins/ja/pieces/unit-test.yaml +4 -4
  71. package/builtins/schemas/more-parts.json +41 -0
  72. package/builtins/skill/references/engine.md +1 -1
  73. package/dist/agents/runner.d.ts.map +1 -1
  74. package/dist/agents/runner.js +24 -22
  75. package/dist/agents/runner.js.map +1 -1
  76. package/dist/app/cli/routing.d.ts.map +1 -1
  77. package/dist/app/cli/routing.js +13 -13
  78. package/dist/app/cli/routing.js.map +1 -1
  79. package/dist/commands/repertoire/add.d.ts.map +1 -1
  80. package/dist/commands/repertoire/add.js +16 -4
  81. package/dist/commands/repertoire/add.js.map +1 -1
  82. package/dist/core/models/part.d.ts +2 -0
  83. package/dist/core/models/part.d.ts.map +1 -1
  84. package/dist/core/models/persisted-global-config.d.ts +6 -2
  85. package/dist/core/models/persisted-global-config.d.ts.map +1 -1
  86. package/dist/core/models/schemas.d.ts +5 -7
  87. package/dist/core/models/schemas.d.ts.map +1 -1
  88. package/dist/core/models/schemas.js +16 -2
  89. package/dist/core/models/schemas.js.map +1 -1
  90. package/dist/core/piece/agent-usecases.d.ts +12 -0
  91. package/dist/core/piece/agent-usecases.d.ts.map +1 -1
  92. package/dist/core/piece/agent-usecases.js +120 -3
  93. package/dist/core/piece/agent-usecases.js.map +1 -1
  94. package/dist/core/piece/engine/MovementExecutor.d.ts +7 -0
  95. package/dist/core/piece/engine/MovementExecutor.d.ts.map +1 -1
  96. package/dist/core/piece/engine/MovementExecutor.js +53 -35
  97. package/dist/core/piece/engine/MovementExecutor.js.map +1 -1
  98. package/dist/core/piece/engine/OptionsBuilder.d.ts +3 -1
  99. package/dist/core/piece/engine/OptionsBuilder.d.ts.map +1 -1
  100. package/dist/core/piece/engine/OptionsBuilder.js +13 -7
  101. package/dist/core/piece/engine/OptionsBuilder.js.map +1 -1
  102. package/dist/core/piece/engine/PieceEngine.d.ts +1 -1
  103. package/dist/core/piece/engine/PieceEngine.d.ts.map +1 -1
  104. package/dist/core/piece/engine/PieceEngine.js +2 -2
  105. package/dist/core/piece/engine/PieceEngine.js.map +1 -1
  106. package/dist/core/piece/engine/TeamLeaderRunner.d.ts +1 -1
  107. package/dist/core/piece/engine/TeamLeaderRunner.d.ts.map +1 -1
  108. package/dist/core/piece/engine/TeamLeaderRunner.js +91 -88
  109. package/dist/core/piece/engine/TeamLeaderRunner.js.map +1 -1
  110. package/dist/core/piece/engine/parallel-logger.d.ts +14 -3
  111. package/dist/core/piece/engine/parallel-logger.d.ts.map +1 -1
  112. package/dist/core/piece/engine/parallel-logger.js +37 -22
  113. package/dist/core/piece/engine/parallel-logger.js.map +1 -1
  114. package/dist/core/piece/engine/stream-buffer.d.ts +31 -0
  115. package/dist/core/piece/engine/stream-buffer.d.ts.map +1 -0
  116. package/dist/core/piece/engine/stream-buffer.js +145 -0
  117. package/dist/core/piece/engine/stream-buffer.js.map +1 -0
  118. package/dist/core/piece/engine/team-leader-aggregation.d.ts +3 -0
  119. package/dist/core/piece/engine/team-leader-aggregation.d.ts.map +1 -0
  120. package/dist/core/piece/engine/team-leader-aggregation.js +14 -0
  121. package/dist/core/piece/engine/team-leader-aggregation.js.map +1 -0
  122. package/dist/core/piece/engine/team-leader-common.d.ts +8 -0
  123. package/dist/core/piece/engine/team-leader-common.d.ts.map +1 -0
  124. package/dist/core/piece/engine/team-leader-common.js +32 -0
  125. package/dist/core/piece/engine/team-leader-common.js.map +1 -0
  126. package/dist/core/piece/engine/team-leader-execution.d.ts +38 -0
  127. package/dist/core/piece/engine/team-leader-execution.d.ts.map +1 -0
  128. package/dist/core/piece/engine/team-leader-execution.js +94 -0
  129. package/dist/core/piece/engine/team-leader-execution.js.map +1 -0
  130. package/dist/core/piece/engine/team-leader-streaming.d.ts +5 -0
  131. package/dist/core/piece/engine/team-leader-streaming.d.ts.map +1 -0
  132. package/dist/core/piece/engine/team-leader-streaming.js +30 -0
  133. package/dist/core/piece/engine/team-leader-streaming.js.map +1 -0
  134. package/dist/core/piece/index.d.ts +1 -1
  135. package/dist/core/piece/index.d.ts.map +1 -1
  136. package/dist/core/piece/index.js.map +1 -1
  137. package/dist/core/piece/part-definition-validator.d.ts.map +1 -1
  138. package/dist/core/piece/part-definition-validator.js +4 -3
  139. package/dist/core/piece/part-definition-validator.js.map +1 -1
  140. package/dist/core/piece/permission-profile-resolution.d.ts.map +1 -1
  141. package/dist/core/piece/permission-profile-resolution.js +1 -4
  142. package/dist/core/piece/permission-profile-resolution.js.map +1 -1
  143. package/dist/core/piece/provider-resolution.d.ts +17 -0
  144. package/dist/core/piece/provider-resolution.d.ts.map +1 -1
  145. package/dist/core/piece/provider-resolution.js +31 -0
  146. package/dist/core/piece/provider-resolution.js.map +1 -1
  147. package/dist/core/piece/schema-loader.d.ts +1 -0
  148. package/dist/core/piece/schema-loader.d.ts.map +1 -1
  149. package/dist/core/piece/schema-loader.js +16 -0
  150. package/dist/core/piece/schema-loader.js.map +1 -1
  151. package/dist/core/piece/types.d.ts +6 -1
  152. package/dist/core/piece/types.d.ts.map +1 -1
  153. package/dist/features/interactive/conversationLoop.d.ts.map +1 -1
  154. package/dist/features/interactive/conversationLoop.js +2 -1
  155. package/dist/features/interactive/conversationLoop.js.map +1 -1
  156. package/dist/features/interactive/lineEditor.d.ts.map +1 -1
  157. package/dist/features/interactive/lineEditor.js +38 -7
  158. package/dist/features/interactive/lineEditor.js.map +1 -1
  159. package/dist/features/interactive/quietMode.d.ts.map +1 -1
  160. package/dist/features/interactive/quietMode.js +1 -1
  161. package/dist/features/interactive/quietMode.js.map +1 -1
  162. package/dist/features/pipeline/steps.d.ts +3 -3
  163. package/dist/features/pipeline/steps.d.ts.map +1 -1
  164. package/dist/features/pipeline/steps.js +9 -7
  165. package/dist/features/pipeline/steps.js.map +1 -1
  166. package/dist/features/tasks/add/index.d.ts +26 -4
  167. package/dist/features/tasks/add/index.d.ts.map +1 -1
  168. package/dist/features/tasks/add/index.js +63 -12
  169. package/dist/features/tasks/add/index.js.map +1 -1
  170. package/dist/features/tasks/execute/pieceExecution.d.ts.map +1 -1
  171. package/dist/features/tasks/execute/pieceExecution.js +6 -11
  172. package/dist/features/tasks/execute/pieceExecution.js.map +1 -1
  173. package/dist/features/tasks/execute/postExecution.d.ts +2 -2
  174. package/dist/features/tasks/execute/postExecution.d.ts.map +1 -1
  175. package/dist/features/tasks/execute/postExecution.js +8 -6
  176. package/dist/features/tasks/execute/postExecution.js.map +1 -1
  177. package/dist/features/tasks/execute/resolveTask.d.ts +2 -2
  178. package/dist/features/tasks/execute/resolveTask.d.ts.map +1 -1
  179. package/dist/features/tasks/execute/resolveTask.js +5 -4
  180. package/dist/features/tasks/execute/resolveTask.js.map +1 -1
  181. package/dist/features/tasks/execute/selectAndExecute.js +1 -1
  182. package/dist/features/tasks/execute/selectAndExecute.js.map +1 -1
  183. package/dist/features/tasks/execute/taskExecution.d.ts.map +1 -1
  184. package/dist/features/tasks/execute/taskExecution.js +3 -9
  185. package/dist/features/tasks/execute/taskExecution.js.map +1 -1
  186. package/dist/features/tasks/execute/types.d.ts +2 -2
  187. package/dist/features/tasks/execute/types.d.ts.map +1 -1
  188. package/dist/features/tasks/index.d.ts +1 -1
  189. package/dist/features/tasks/index.d.ts.map +1 -1
  190. package/dist/features/tasks/index.js +1 -1
  191. package/dist/features/tasks/index.js.map +1 -1
  192. package/dist/features/tasks/list/index.js +1 -1
  193. package/dist/features/tasks/list/index.js.map +1 -1
  194. package/dist/features/tasks/list/taskDiffActions.js +1 -1
  195. package/dist/features/tasks/list/taskDiffActions.js.map +1 -1
  196. package/dist/features/tasks/list/taskSyncAction.d.ts +1 -2
  197. package/dist/features/tasks/list/taskSyncAction.d.ts.map +1 -1
  198. package/dist/features/tasks/list/taskSyncAction.js +50 -35
  199. package/dist/features/tasks/list/taskSyncAction.js.map +1 -1
  200. package/dist/infra/config/loaders/pieceParser.d.ts.map +1 -1
  201. package/dist/infra/config/loaders/pieceParser.js +1 -0
  202. package/dist/infra/config/loaders/pieceParser.js.map +1 -1
  203. package/dist/infra/config/project/projectConfig.d.ts.map +1 -1
  204. package/dist/infra/config/project/projectConfig.js +60 -1
  205. package/dist/infra/config/project/projectConfig.js.map +1 -1
  206. package/dist/infra/config/resolveConfigValue.d.ts.map +1 -1
  207. package/dist/infra/config/resolveConfigValue.js +0 -1
  208. package/dist/infra/config/resolveConfigValue.js.map +1 -1
  209. package/dist/infra/config/resolvedConfig.d.ts +1 -2
  210. package/dist/infra/config/resolvedConfig.d.ts.map +1 -1
  211. package/dist/infra/config/types.d.ts +7 -1
  212. package/dist/infra/config/types.d.ts.map +1 -1
  213. package/dist/infra/git/index.d.ts +9 -0
  214. package/dist/infra/git/index.d.ts.map +1 -0
  215. package/dist/infra/git/index.js +14 -0
  216. package/dist/infra/git/index.js.map +1 -0
  217. package/dist/infra/git/types.d.ts +76 -0
  218. package/dist/infra/git/types.d.ts.map +1 -0
  219. package/dist/infra/git/types.js +8 -0
  220. package/dist/infra/git/types.js.map +1 -0
  221. package/dist/infra/github/GitHubProvider.d.ts +17 -0
  222. package/dist/infra/github/GitHubProvider.d.ts.map +1 -0
  223. package/dist/infra/github/GitHubProvider.js +30 -0
  224. package/dist/infra/github/GitHubProvider.js.map +1 -0
  225. package/dist/infra/github/index.d.ts +2 -4
  226. package/dist/infra/github/index.d.ts.map +1 -1
  227. package/dist/infra/github/index.js +2 -2
  228. package/dist/infra/github/index.js.map +1 -1
  229. package/dist/infra/github/issue.d.ts.map +1 -1
  230. package/dist/infra/github/issue.js +23 -1
  231. package/dist/infra/github/issue.js.map +1 -1
  232. package/dist/infra/github/pr.d.ts +3 -19
  233. package/dist/infra/github/pr.d.ts.map +1 -1
  234. package/dist/infra/github/pr.js +2 -19
  235. package/dist/infra/github/pr.js.map +1 -1
  236. package/dist/infra/github/types.d.ts +1 -50
  237. package/dist/infra/github/types.d.ts.map +1 -1
  238. package/dist/infra/mock/client.js +1 -1
  239. package/dist/infra/mock/client.js.map +1 -1
  240. package/dist/infra/mock/scenario.js +5 -0
  241. package/dist/infra/mock/scenario.js.map +1 -1
  242. package/dist/infra/mock/types.d.ts +2 -0
  243. package/dist/infra/mock/types.d.ts.map +1 -1
  244. package/dist/infra/task/clone.d.ts.map +1 -1
  245. package/dist/infra/task/clone.js +28 -2
  246. package/dist/infra/task/clone.js.map +1 -1
  247. package/dist/infra/task/git.d.ts +4 -4
  248. package/dist/infra/task/git.d.ts.map +1 -1
  249. package/dist/infra/task/git.js +12 -4
  250. package/dist/infra/task/git.js.map +1 -1
  251. package/dist/infra/task/index.d.ts +1 -1
  252. package/dist/infra/task/index.d.ts.map +1 -1
  253. package/dist/infra/task/index.js +1 -1
  254. package/dist/infra/task/index.js.map +1 -1
  255. package/dist/infra/task/summarize.d.ts.map +1 -1
  256. package/dist/infra/task/summarize.js +4 -1
  257. package/dist/infra/task/summarize.js.map +1 -1
  258. package/dist/shared/i18n/labels_en.yaml +11 -0
  259. package/dist/shared/i18n/labels_ja.yaml +11 -0
  260. package/dist/shared/prompts/en/score_interactive_policy.md +15 -8
  261. package/dist/shared/prompts/en/sync_conflict_resolver_message.md +51 -0
  262. package/dist/shared/prompts/en/sync_conflict_resolver_system_prompt.md +23 -0
  263. package/dist/shared/prompts/ja/score_interactive_policy.md +15 -8
  264. package/dist/shared/prompts/ja/sync_conflict_resolver_message.md +51 -0
  265. package/dist/shared/prompts/ja/sync_conflict_resolver_system_prompt.md +24 -0
  266. package/package.json +1 -1
@@ -0,0 +1,54 @@
1
+ Implement Terraform code according to the plan.
2
+ Refer only to files within the Report Directory shown in the Piece Context. Do not search or reference other report directories.
3
+
4
+ **Important**: After implementation, run the following validations in order:
5
+ 1. `terraform fmt -check` — fix formatting violations with `terraform fmt` if any
6
+ 2. `terraform validate` — check for syntax and type errors
7
+ 3. `terraform plan` — verify changes (no unintended modifications)
8
+
9
+ **Constraints:**
10
+ - Never execute `terraform apply`
11
+ - Never write secrets (passwords, tokens) in code
12
+ - Do not remove existing `lifecycle { prevent_destroy = true }` without approval
13
+ - All new variables must have `type` and `description`
14
+
15
+ **Scope output contract (create at the start of implementation):**
16
+ ```markdown
17
+ # Change Scope Declaration
18
+
19
+ ## Task
20
+ {One-line task summary}
21
+
22
+ ## Planned changes
23
+ | Type | File |
24
+ |------|------|
25
+ | Create | `modules/example/main.tf` |
26
+ | Modify | `environments/sandbox/main.tf` |
27
+
28
+ ## Estimated size
29
+ Small / Medium / Large
30
+
31
+ ## Impact area
32
+ - {Affected modules or resources}
33
+ ```
34
+
35
+ **Decisions output contract (at implementation completion, only if decisions were made):**
36
+ ```markdown
37
+ # Decision Log
38
+
39
+ ## 1. {Decision}
40
+ - **Context**: {Why the decision was needed}
41
+ - **Options considered**: {List of options}
42
+ - **Rationale**: {Reason for the choice}
43
+ - **Cost impact**: {If applicable}
44
+ ```
45
+
46
+ **Required output (include headings)**
47
+ ## Work results
48
+ - {Summary of actions taken}
49
+ ## Changes made
50
+ - {Summary of changes}
51
+ ## Validation results
52
+ - {terraform fmt -check result}
53
+ - {terraform validate result}
54
+ - {terraform plan summary (resources to add/change/destroy)}
@@ -4,7 +4,7 @@ Review the reports from each cycle and determine whether this loop
4
4
  is healthy (making progress) or unproductive (repeating the same issues).
5
5
 
6
6
  **Reports to reference:**
7
- - AI Review results: {report:03-ai-review.md}
7
+ - AI Review results: {report:ai-review.md}
8
8
 
9
9
  **Judgment criteria:**
10
10
  - Are new issues being found/fixed in each cycle?
@@ -12,6 +12,7 @@ For small tasks, skip the design sections in the report.
12
12
 
13
13
  **Actions:**
14
14
  1. Understand the task requirements
15
+ - **When reference material points to an external implementation, determine whether it is a "bug fix clue" or a "design approach to adopt". If narrowing scope beyond the reference material's intent, include the rationale in the plan report**
15
16
  - **For each requirement, determine "change needed / not needed". If "not needed", cite the relevant code (file:line) as evidence. Claiming "already correct" without evidence is prohibited**
16
17
  2. Investigate code to resolve unknowns
17
18
  3. Identify the impact area
@@ -3,10 +3,15 @@ Analyze the research results and determine whether additional investigation is n
3
3
  **What to do:**
4
4
  1. Organize the major findings from the research results
5
5
  2. Identify unexplained phenomena, unverified hypotheses, and missing data
6
- 3. Make one of the following judgments:
6
+ 3. Save analysis results to `{report_dir}/analysis-{N}.md` as files
7
+ 4. Make one of the following judgments:
7
8
  - **New questions exist** → Create additional research instructions for the Digger
8
9
  - **Sufficiently investigated** → Create an overall summary
9
10
 
11
+ **Data saving rules:**
12
+ - Write to `{report_dir}/analysis-{N}.md` (N is sequential number) for each analysis
13
+ - Include analysis perspective, synthesized findings, and identified gaps
14
+
10
15
  **Additional research instruction format:**
11
16
  - What to investigate (specific data or information)
12
17
  - Why it's needed (which gap it fills)
@@ -1,12 +1,29 @@
1
- Execute the research according to the plan (or additional research instructions).
1
+ Decompose the research plan (or additional research instructions) into independent subtasks and execute the investigation in parallel.
2
2
 
3
3
  **What to do:**
4
- 1. Execute planned research items in order
5
- 2. Actually investigate each item (web search, codebase search, etc.)
6
- 3. Report items that could not be researched as "Unable to research"
7
- 4. Organize results and create a report
4
+ 1. Analyze research items from the plan and decompose them into independently executable subtasks
5
+ 2. Include clear research scope and expected deliverables in each subtask's instruction
6
+ 3. Include the following data saving rules and report structure in each subtask's instruction
8
7
 
9
- **Report structure:**
8
+ **Subtask decomposition guidelines:**
9
+ - Prioritize topic independence (group interdependent items into the same subtask)
10
+ - Avoid spreading high-priority items (P1) across too many subtasks
11
+ - Balance workload evenly across subtasks
12
+
13
+ **Rules to include in each subtask's instruction:**
14
+
15
+ Data saving rules:
16
+ - Write data per research item to `{report_dir}/data-{topic-name}.md`
17
+ - Topic names in lowercase English with hyphens (e.g., `data-market-size.md`)
18
+ - Include source URLs, retrieval dates, and raw data
19
+
20
+ External data downloads:
21
+ - Actively download and utilize CSV, Excel, JSON, and other data files from public institutions and trusted sources
22
+ - Always verify source reliability before downloading
23
+ - Save downloaded files to `{report_dir}/`
24
+ - Never download from suspicious domains or download executable files
25
+
26
+ Report structure (per subtask):
10
27
  - Results and details per research item
11
28
  - Summary of key findings
12
29
  - Caveats and risks
@@ -0,0 +1,25 @@
1
+ Focus on reviewing **Terraform convention compliance**.
2
+ Do not review AI-specific issues (already covered by the ai_review movement).
3
+
4
+ **Review criteria:**
5
+ - Variable declaration compliance (type, description, sensitive)
6
+ - Resource naming consistency (name_prefix pattern)
7
+ - File organization compliance (one file per concern)
8
+ - Security configurations (IMDSv2, encryption, access control, IAM least privilege)
9
+ - Tag management (default_tags, no duplication)
10
+ - Lifecycle rule appropriateness
11
+ - Cost trade-off documentation
12
+ - Unused variables / outputs / data sources
13
+
14
+ **Previous finding tracking (required):**
15
+ - First, extract open findings from "Previous Response"
16
+ - Assign `finding_id` to each finding and classify current status as `new / persists / resolved`
17
+ - If status is `persists`, provide concrete unresolved evidence (file/line)
18
+
19
+ ## Judgment Procedure
20
+
21
+ 1. First, extract previous open findings and preliminarily classify as `new / persists / resolved`
22
+ 2. Review the change diff and detect issues based on Terraform convention criteria
23
+ - Cross-check changes against REJECT criteria tables defined in knowledge
24
+ 3. For each detected issue, classify as blocking/non-blocking based on Policy's scope determination table and judgment rules
25
+ 4. If there is even one blocking issue (`new` or `persists`), judge as REJECT
@@ -9,6 +9,6 @@ Review the changes from a test quality perspective.
9
9
 
10
10
  ## Judgment Procedure
11
11
 
12
- 1. Cross-reference the test plan report ({report:00-test-plan.md}) with the implemented tests
12
+ 1. Cross-reference the test plan/test scope reports in the Report Directory with the implemented tests
13
13
  2. For each detected issue, classify as blocking/non-blocking based on Policy's scope determination table and judgment rules
14
14
  3. If there is even one blocking issue, judge as REJECT
@@ -0,0 +1,241 @@
1
+ # Terraform AWS Knowledge
2
+
3
+ ## Module Design
4
+
5
+ Split modules by domain (network, database, application layer). Do not create generic utility modules.
6
+
7
+ | Criteria | Judgment |
8
+ |----------|----------|
9
+ | Domain-based module splitting | OK |
10
+ | Generic "utils" module | REJECT |
11
+ | Unrelated resources mixed in one module | REJECT |
12
+ | Implicit inter-module dependencies | REJECT (connect explicitly via outputs→inputs) |
13
+
14
+ ### Inter-Module Dependencies
15
+
16
+ Pass dependencies explicitly via outputs→inputs. Avoid implicit references (using `data` sources to look up other module resources).
17
+
18
+ ```hcl
19
+ # OK - Explicit dependency
20
+ module "database" {
21
+ source = "../../modules/database"
22
+ vpc_id = module.network.vpc_id
23
+ subnet_ids = module.network.private_subnet_ids
24
+ }
25
+
26
+ # NG - Implicit dependency
27
+ module "database" {
28
+ source = "../../modules/database"
29
+ # vpc_id not passed; module uses data "aws_vpc" internally
30
+ }
31
+ ```
32
+
33
+ ### Identification Variable Passthrough
34
+
35
+ Pass identification variables (environment, service name) explicitly from root to child modules. Do not rely on globals or hardcoding.
36
+
37
+ ```hcl
38
+ # OK - Explicit passthrough
39
+ module "database" {
40
+ environment = var.environment
41
+ service = var.service
42
+ application_name = var.application_name
43
+ }
44
+ ```
45
+
46
+ ## Resource Naming Convention
47
+
48
+ Compute `name_prefix` in `locals` and apply consistently to all resources. Append resource-specific suffixes.
49
+
50
+ | Criteria | Judgment |
51
+ |----------|----------|
52
+ | Unified naming with `name_prefix` pattern | OK |
53
+ | Inconsistent naming across resources | REJECT |
54
+ | Name exceeds AWS character limits | REJECT |
55
+ | Tag names not in PascalCase | Warning |
56
+
57
+ ```hcl
58
+ # OK - Unified with name_prefix
59
+ locals {
60
+ name_prefix = "${var.environment}-${var.service}-${var.application_name}"
61
+ }
62
+
63
+ resource "aws_ecs_cluster" "main" {
64
+ name = "${local.name_prefix}-cluster"
65
+ }
66
+
67
+ # NG - Inconsistent naming
68
+ resource "aws_ecs_cluster" "main" {
69
+ name = "${var.environment}-app-cluster"
70
+ }
71
+ ```
72
+
73
+ ### Character Limit Handling
74
+
75
+ AWS services have name character limits. Use shortened forms when approaching limits.
76
+
77
+ | Service | Limit | Example |
78
+ |---------|-------|---------|
79
+ | Target Group | 32 chars | `${var.environment}-${var.service}-backend-tg` |
80
+ | Lambda Function | 64 chars | Full prefix OK |
81
+ | S3 Bucket | 63 chars | Full prefix OK |
82
+
83
+ ## Tagging Strategy
84
+
85
+ Use provider `default_tags` for common tags. No duplicate tagging on individual resources.
86
+
87
+ | Criteria | Judgment |
88
+ |----------|----------|
89
+ | Centralized via provider `default_tags` | OK |
90
+ | Duplicate tags matching `default_tags` on individual resources | Warning |
91
+ | Only `Name` tag added on individual resources | OK |
92
+
93
+ ```hcl
94
+ # OK - Centralized, individual gets Name only
95
+ provider "aws" {
96
+ default_tags {
97
+ tags = {
98
+ Environment = var.environment
99
+ ManagedBy = "Terraform"
100
+ }
101
+ }
102
+ }
103
+
104
+ resource "aws_instance" "main" {
105
+ tags = {
106
+ Name = "${local.name_prefix}-instance"
107
+ }
108
+ }
109
+
110
+ # NG - Duplicates default_tags
111
+ resource "aws_instance" "main" {
112
+ tags = {
113
+ Environment = var.environment
114
+ ManagedBy = "Terraform"
115
+ Name = "${local.name_prefix}-instance"
116
+ }
117
+ }
118
+ ```
119
+
120
+ ## File Organization Patterns
121
+
122
+ ### Environment Directory Structure
123
+
124
+ Separate environments into directories, each with independent state management.
125
+
126
+ ```
127
+ environments/
128
+ ├── production/
129
+ │ ├── terraform.tf # Version constraints
130
+ │ ├── providers.tf # Provider config (default_tags)
131
+ │ ├── backend.tf # S3 backend
132
+ │ ├── variables.tf # Environment variables
133
+ │ ├── main.tf # Module invocations
134
+ │ └── outputs.tf # Outputs
135
+ └── staging/
136
+ └── ...
137
+ ```
138
+
139
+ ### Module File Structure
140
+
141
+ | File | Contents |
142
+ |------|----------|
143
+ | `main.tf` | `locals` and `data` sources only |
144
+ | `variables.tf` | Input variable definitions only (no resources) |
145
+ | `outputs.tf` | Output definitions only (no resources) |
146
+ | `{resource_type}.tf` | One file per resource category |
147
+ | `templates/` | user_data scripts and other templates |
148
+
149
+ ## Security Best Practices
150
+
151
+ ### EC2 Instance Security
152
+
153
+ | Setting | Recommended | Reason |
154
+ |---------|-------------|--------|
155
+ | `http_tokens` | `"required"` | Enforce IMDSv2 (SSRF prevention) |
156
+ | `http_put_response_hop_limit` | `1` | Prevent container escapes |
157
+ | `root_block_device.encrypted` | `true` | Data-at-rest encryption |
158
+
159
+ ### S3 Bucket Security
160
+
161
+ Block all public access with all four settings. Use OAC (Origin Access Control) for CloudFront distributions.
162
+
163
+ ```hcl
164
+ # OK - Complete block
165
+ resource "aws_s3_bucket_public_access_block" "this" {
166
+ block_public_acls = true
167
+ block_public_policy = true
168
+ ignore_public_acls = true
169
+ restrict_public_buckets = true
170
+ }
171
+ ```
172
+
173
+ ### IAM Design
174
+
175
+ | Pattern | Recommendation |
176
+ |---------|---------------|
177
+ | Per-service role separation | Separate execution role (for ECS Agent) and task role (for app) |
178
+ | CI/CD authentication | OIDC federation (avoid long-lived credentials) |
179
+ | Policy scope | Specify resource ARNs explicitly (avoid `"*"`) |
180
+
181
+ ### Secret Management
182
+
183
+ | Method | Recommendation |
184
+ |--------|---------------|
185
+ | SSM Parameter Store (SecureString) | Recommended |
186
+ | Secrets Manager | Recommended (when rotation needed) |
187
+ | Direct in `.tfvars` | Conditional OK (gitignore required) |
188
+ | Hardcoded in `.tf` files | REJECT |
189
+
190
+ Set SSM Parameter initial values to placeholders and use `lifecycle { ignore_changes = [value] }` to manage outside Terraform.
191
+
192
+ ## Cost Optimization Patterns
193
+
194
+ Document trade-offs with inline comments for cost-impacting choices.
195
+
196
+ | Choice | Cost Effect | Trade-off |
197
+ |--------|------------|-----------|
198
+ | NAT Instance vs NAT Gateway | Instance ~$3-4/mo vs Gateway ~$32/mo | Lower availability and throughput |
199
+ | Public subnet placement | No VPC Endpoints needed | Weaker network isolation |
200
+ | EC2 + EBS vs RDS | EC2 ~$15-20/mo vs RDS ~$50+/mo | Higher operational burden |
201
+
202
+ ```hcl
203
+ # OK - Trade-off documented
204
+ # Using t3.nano instead of NAT Gateway (~$3-4/mo vs ~$32/mo)
205
+ # Trade-off: single-AZ availability, throughput limits
206
+ resource "aws_instance" "nat" {
207
+ instance_type = "t3.nano"
208
+ }
209
+ ```
210
+
211
+ ## Lifecycle Rule Usage
212
+
213
+ | Rule | Purpose | Target |
214
+ |------|---------|--------|
215
+ | `prevent_destroy` | Prevent accidental deletion | Databases, EBS volumes |
216
+ | `ignore_changes` | Allow external changes | `desired_count` (Auto Scaling), SSM `value` |
217
+ | `create_before_destroy` | Prevent downtime | Load balancers, security groups |
218
+
219
+ ```hcl
220
+ # OK - Prevent accidental database deletion
221
+ resource "aws_instance" "database" {
222
+ lifecycle {
223
+ prevent_destroy = true
224
+ }
225
+ }
226
+
227
+ # OK - Let Auto Scaling manage desired_count
228
+ resource "aws_ecs_service" "main" {
229
+ lifecycle {
230
+ ignore_changes = [desired_count]
231
+ }
232
+ }
233
+ ```
234
+
235
+ ## Version Management
236
+
237
+ | Setting | Recommendation |
238
+ |---------|---------------|
239
+ | `required_version` | `">= 1.5.0"` or higher (`default_tags` support) |
240
+ | Provider version | Pin minor version with `~>` (e.g., `~> 5.80`) |
241
+ | State locking | `use_lockfile = true` required |
@@ -9,18 +9,15 @@
9
9
  ### Objective
10
10
  {What needs to be achieved}
11
11
 
12
+ ### Reference Material Findings (when reference material exists)
13
+ {Overview of reference implementation's approach and key differences from current implementation}
14
+
12
15
  ### Scope
13
16
  {Impact area}
14
17
 
15
- ### Design Decisions (only when design is needed)
16
-
17
- #### File Structure
18
- | File | Role |
19
- |------|------|
20
- | `src/example.ts` | Overview |
21
-
22
- #### Design Patterns
23
- - {Adopted patterns and where they apply}
18
+ ### Approaches Considered (when design decisions exist)
19
+ | Approach | Adopted? | Rationale |
20
+ |----------|----------|-----------|
24
21
 
25
22
  ### Implementation Approach
26
23
  {How to proceed}
@@ -28,6 +25,10 @@
28
25
  ## Implementation Guidelines (only when design is needed)
29
26
  - {Guidelines the Coder should follow during implementation}
30
27
 
28
+ ## Out of Scope (only when items exist)
29
+ | Item | Reason for exclusion |
30
+ |------|---------------------|
31
+
31
32
  ## Open Questions (if any)
32
33
  - {Unclear points or items that need confirmation}
33
34
  ```
@@ -0,0 +1,28 @@
1
+ ```markdown
2
+ # Research Report
3
+
4
+ ## Research Overview
5
+ {Summarize the original request in 1-2 sentences}
6
+
7
+ ## Key Findings
8
+ {Major insights discovered during research, as bullet points}
9
+
10
+ ## Research Results
11
+
12
+ ### {Topic 1}
13
+ {Data and analysis results}
14
+
15
+ ### {Topic 2}
16
+ {Data and analysis results}
17
+
18
+ ## Data Sources
19
+ | # | Source | Type | Reliability |
20
+ |---|--------|------|-------------|
21
+ | 1 | {Source name/URL} | {Web/Codebase/Literature} | {High/Medium/Low} |
22
+
23
+ ## Conclusions and Recommendations
24
+ {Conclusions and recommendations based on research results}
25
+
26
+ ## Remaining Gaps (if any)
27
+ - {Items that could not be researched or unverified hypotheses}
28
+ ```
@@ -0,0 +1,42 @@
1
+ ```markdown
2
+ # Terraform Convention Review
3
+
4
+ ## Result: APPROVE / REJECT
5
+
6
+ ## Summary
7
+ {1-2 sentences summarizing the result}
8
+
9
+ ## Reviewed Aspects
10
+ - [x] Variable declarations (type, description, sensitive)
11
+ - [x] Resource naming (name_prefix pattern)
12
+ - [x] File organization (one file per concern)
13
+ - [x] Security configurations
14
+ - [x] Tag management
15
+ - [x] Lifecycle rules
16
+ - [x] Cost trade-off documentation
17
+
18
+ ## New Findings (new)
19
+ | # | finding_id | Scope | Location | Issue | Fix Suggestion |
20
+ |---|------------|-------|----------|-------|---------------|
21
+ | 1 | TF-NEW-file-L42 | In scope | `modules/example/main.tf:42` | Issue description | How to fix |
22
+
23
+ Scope: "In scope" (fixable now) / "Out of scope" (existing issue, non-blocking)
24
+
25
+ ## Persisting Findings (persists)
26
+ | # | finding_id | Previous Evidence | Current Evidence | Issue | Fix Suggestion |
27
+ |---|------------|-------------------|------------------|-------|---------------|
28
+ | 1 | TF-PERSIST-file-L77 | `file.tf:77` | `file.tf:77` | Unresolved | Apply existing fix plan |
29
+
30
+ ## Resolved
31
+ | finding_id | Resolution Evidence |
32
+ |------------|-------------------|
33
+ | TF-RESOLVED-file-L10 | `file.tf:10` meets conventions |
34
+
35
+ ## REJECT Criteria
36
+ - REJECT only if 1+ `new` or `persists` findings exist
37
+ - Findings without `finding_id` are invalid
38
+ ```
39
+
40
+ **Cognitive load reduction rules:**
41
+ - APPROVE → Summary only (5 lines or less)
42
+ - REJECT → Only relevant findings in table (30 lines or less)
@@ -97,6 +97,11 @@ Only plan work that is explicitly stated in the task order. Do not include impli
97
97
  "Change statuses to 5 values" means "rewrite enum values," NOT "delete flows that seem unnecessary."
98
98
  Do not over-interpret the task order. Plan only what is written.
99
99
 
100
+ **Reference material intent:**
101
+ - When the task order specifies external implementations as reference material, determine WHY that reference was specified
102
+ - "Fix/improve by referencing X" includes evaluating whether to adopt the reference's design approach
103
+ - When narrowing scope beyond the reference material's implied intent, explicitly document the rationale in the plan report
104
+
100
105
  **Bug fix propagation check:**
101
106
  - After identifying the root cause pattern, grep for the same pattern in related files
102
107
  - If the same bug exists in other files, include them in scope
@@ -0,0 +1,30 @@
1
+ # Terraform Coder
2
+
3
+ You are a Terraform/AWS infrastructure implementation specialist. You write safe, maintainable infrastructure code following IaC principles.
4
+
5
+ ## Role Boundaries
6
+
7
+ **Do:**
8
+ - Create and modify Terraform code (.tf files)
9
+ - Design modules and define variables
10
+ - Implement security configurations (IAM, security groups, encryption)
11
+ - Make cost optimization decisions and document trade-offs
12
+
13
+ **Don't:**
14
+ - Implement application code (implementation agent's responsibility)
15
+ - Make final infrastructure design decisions (planning/design agent's responsibility)
16
+ - Apply changes to production (`terraform apply` is never executed)
17
+
18
+ ## Behavioral Principles
19
+
20
+ - Safety over speed. Infrastructure misconfigurations have greater impact than application bugs
21
+ - Don't guess configurations; verify with official documentation
22
+ - Never write secrets (passwords, tokens) in code
23
+ - Document trade-offs with inline comments for cost-impacting choices
24
+ - Security is strict by default. Only relax explicitly with justification
25
+
26
+ **Be aware of AI's bad habits:**
27
+ - Writing nonexistent resource attributes or provider arguments → Prohibited (verify with official docs)
28
+ - Casually opening security groups to `0.0.0.0/0` → Prohibited
29
+ - Writing unused variables or outputs "just in case" → Prohibited
30
+ - Adding `depends_on` where implicit dependencies suffice → Prohibited
@@ -0,0 +1,25 @@
1
+ # Terraform Reviewer
2
+
3
+ You are an IaC (Infrastructure as Code) convention specialist reviewer. You verify that Terraform code complies with project conventions and security standards.
4
+
5
+ ## Role Boundaries
6
+
7
+ **Do:**
8
+ - Verify Terraform convention compliance (naming, file organization, variable declarations)
9
+ - Validate security configurations (IAM least privilege, encryption, access control)
10
+ - Detect cost impacts and verify trade-off documentation
11
+ - Validate `lifecycle` rule appropriateness
12
+
13
+ **Don't:**
14
+ - Write code yourself (only provide findings and fix suggestions)
15
+ - Review AI-specific issues (separate review agent's responsibility)
16
+ - Review application code (design review agent's responsibility)
17
+ - Execute `terraform plan` (validation agent's responsibility)
18
+
19
+ ## Behavioral Principles
20
+
21
+ - No compromises on security issues. Missing encryption or public access exposure is an immediate REJECT
22
+ - Enforce naming consistency. Even one off-convention name gets flagged
23
+ - Flag cost-impacting choices that lack trade-off documentation
24
+ - No "conditional approvals". If there are issues, reject
25
+ - Never miss unused variables/outputs/data sources
@@ -0,0 +1,88 @@
1
+ # Terraform Policy
2
+
3
+ Prioritize safety and maintainability. Write infrastructure code following consistent conventions.
4
+
5
+ ## Principles
6
+
7
+ | Principle | Criteria |
8
+ |-----------|----------|
9
+ | Security by Default | Security is strict by default. Relaxation requires explicit justification |
10
+ | Fail Fast | No defaults for required values. Missing values must error immediately |
11
+ | Naming Consistency | Unified resource naming via `name_prefix` pattern |
12
+ | Least Privilege | IAM scoped to minimum necessary actions and resources |
13
+ | Cost Awareness | Document trade-offs with inline comments |
14
+ | DRY | Compute common values in `locals`. Eliminate duplication |
15
+ | One File One Concern | Split files by resource category |
16
+
17
+ ## Variable Declarations
18
+
19
+ | Criteria | Judgment |
20
+ |----------|----------|
21
+ | Missing `type` | REJECT |
22
+ | Missing `description` | REJECT |
23
+ | Sensitive value without `sensitive = true` | REJECT |
24
+ | Default on environment-dependent value | REJECT |
25
+ | Default on constant value (port numbers, etc.) | OK |
26
+
27
+ ```hcl
28
+ # REJECT - no type/description
29
+ variable "region" {}
30
+
31
+ # REJECT - sensitive value without sensitive flag
32
+ variable "db_password" {
33
+ type = string
34
+ }
35
+
36
+ # OK - constant value with default
37
+ variable "container_port" {
38
+ type = number
39
+ description = "Container port for the application"
40
+ default = 8080
41
+ }
42
+ ```
43
+
44
+ ## Security
45
+
46
+ | Criteria | Judgment |
47
+ |----------|----------|
48
+ | EC2 without IMDSv2 (`http_tokens != "required"`) | REJECT |
49
+ | Unencrypted EBS/RDS | REJECT |
50
+ | S3 without public access block | REJECT |
51
+ | Security group with unnecessary `0.0.0.0/0` | REJECT |
52
+ | IAM policy with `*` resource (no valid reason) | REJECT |
53
+ | Direct SSH access (when SSM is viable) | REJECT |
54
+ | Hardcoded secrets | REJECT |
55
+ | Missing `lifecycle { prevent_destroy = true }` on critical data | Warning |
56
+
57
+ ## Naming Convention
58
+
59
+ | Criteria | Judgment |
60
+ |----------|----------|
61
+ | `name_prefix` pattern not used | REJECT |
62
+ | Resource name missing environment identifier | REJECT |
63
+ | Tag names not in PascalCase | Warning |
64
+ | Name exceeds AWS character limits | REJECT |
65
+
66
+ ## File Organization
67
+
68
+ | Criteria | Judgment |
69
+ |----------|----------|
70
+ | Resource definitions mixed in `main.tf` | REJECT |
71
+ | Resources defined in `variables.tf` | REJECT |
72
+ | Multiple resource categories in one file | Warning |
73
+ | Unused variable / output / data source | REJECT |
74
+
75
+ ## Tag Management
76
+
77
+ | Criteria | Judgment |
78
+ |----------|----------|
79
+ | Provider `default_tags` not configured | REJECT |
80
+ | Tags duplicated between `default_tags` and individual resources | Warning |
81
+ | Missing `ManagedBy = "Terraform"` tag | Warning |
82
+
83
+ ## Cost Management
84
+
85
+ | Criteria | Judgment |
86
+ |----------|----------|
87
+ | Cost-impacting choice without documentation | Warning |
88
+ | High-cost resource without alternative consideration | Warning |
@@ -31,6 +31,9 @@ piece_categories:
31
31
  - expert-mini
32
32
  - expert-cqrs
33
33
  - expert-cqrs-mini
34
+ 🏗️ Infrastructure:
35
+ pieces:
36
+ - terraform
34
37
  🛠️ Refactoring:
35
38
  pieces:
36
39
  - structural-reform