@whatasoda/agent-tools 0.1.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 (51) hide show
  1. package/dist/agents/codex-review/body.md +98 -0
  2. package/dist/agents/team-reviewer/body.md +78 -0
  3. package/dist/agents/team-worker/body.md +46 -0
  4. package/dist/scripts/codex-review.js +237 -0
  5. package/dist/scripts/detect-base-branch.js +185 -0
  6. package/dist/scripts/resolve-session.js +76 -0
  7. package/dist/skills/soda-brief/body.md +73 -0
  8. package/dist/skills/soda-discuss/README.md +25 -0
  9. package/dist/skills/soda-discuss/body.md +216 -0
  10. package/dist/skills/soda-fix/body.md +137 -0
  11. package/dist/skills/soda-plan/body.md +333 -0
  12. package/dist/skills/soda-research/body.md +127 -0
  13. package/dist/skills/soda-review/body.md +165 -0
  14. package/dist/skills/soda-review-todos/body.md +19 -0
  15. package/dist/skills/soda-team-init/body.md +313 -0
  16. package/dist/skills/soda-team-init/references/coordination-files.md +188 -0
  17. package/dist/skills/soda-team-run/body.md +329 -0
  18. package/dist/skills/soda-todo/body.md +86 -0
  19. package/dist/src/cli/commands/agent.js +29 -0
  20. package/dist/src/cli/commands/codex-review.js +14 -0
  21. package/dist/src/cli/commands/decision.js +103 -0
  22. package/dist/src/cli/commands/import.js +174 -0
  23. package/dist/src/cli/commands/link.js +52 -0
  24. package/dist/src/cli/commands/list.js +12 -0
  25. package/dist/src/cli/commands/node.js +118 -0
  26. package/dist/src/cli/commands/review.js +23 -0
  27. package/dist/src/cli/commands/session.js +23 -0
  28. package/dist/src/cli/commands/skill.js +29 -0
  29. package/dist/src/cli/commands/tag.js +31 -0
  30. package/dist/src/cli/helpers.js +51 -0
  31. package/dist/src/cli/index.js +48 -0
  32. package/dist/src/cli.js +59 -0
  33. package/dist/src/core/database.js +209 -0
  34. package/dist/src/core/ensure-dirs.js +8 -0
  35. package/dist/src/core/index.js +1 -0
  36. package/dist/src/core/kinds.js +46 -0
  37. package/dist/src/core/schema.sql +36 -0
  38. package/dist/src/core/schemas.js +41 -0
  39. package/dist/src/core/search.js +80 -0
  40. package/dist/src/core/types.js +0 -0
  41. package/dist/src/tui/App.js +130 -0
  42. package/dist/src/tui/actions.js +9 -0
  43. package/dist/src/tui/components/FilterBar.js +46 -0
  44. package/dist/src/tui/components/LinkList.js +53 -0
  45. package/dist/src/tui/components/NodeDetail.js +111 -0
  46. package/dist/src/tui/components/NodeList.js +62 -0
  47. package/dist/src/tui/components/StatusBar.js +90 -0
  48. package/dist/src/tui/hooks/useNavigation.js +57 -0
  49. package/dist/src/tui/hooks/useNodes.js +44 -0
  50. package/dist/src/tui/index.js +4 -0
  51. package/package.json +29 -0
@@ -0,0 +1,313 @@
1
+
2
+ **CRITICAL**: Do NOT use EnterPlanMode or enter plan mode at any point during this skill. This is an interactive dialogue skill — not an implementation task.
3
+
4
+ Initialize an agent team project by classifying requirements into groups, decomposing them into tasks, and generating the coordination files that soda-team-run consumes.
5
+
6
+ Use English for all generated file content. User interaction (AskUserQuestion options, presentations, summaries) must be in Japanese.
7
+
8
+ **Prerequisite**: A soda-discuss session should have been completed beforehand to establish design direction. Design decisions persisted in the DB provide the Architect's initial context, including design constraints and rejected alternatives. Query them via `sd decision list --repo <owner/repo>`.
9
+
10
+ If `$ARGUMENTS` is empty, ask the user to describe the requirements source before proceeding.
11
+
12
+ ## Step 1: Project Setup
13
+
14
+ **Repo root detection**:
15
+ ```bash
16
+ git rev-parse --show-toplevel
17
+ ```
18
+
19
+ **Check for existing `.agent-team/` projects**:
20
+
21
+ 1. **Legacy flat layout detection**: If `.agent-team/CONFIG.md` exists directly (not inside a subdirectory), warn the user that the old flat format is detected and suggest manual cleanup before re-initializing. Stop.
22
+ 2. **Scan for namespaced projects**: Check for existing projects by scanning `.agent-team/*/TASKS.md`.
23
+ 3. If existing namespaced projects found, present the list and use AskUserQuestion:
24
+ - "既存プロジェクトを上書きする (対象を選択)" — present project list for selection. Set `{{NAMESPACE}}` to the selected project's directory name, delete its contents (`rm -rf .agent-team/{{NAMESPACE}}/tasks .agent-team/{{NAMESPACE}}/reviews`), and skip the "Derive namespace directory name" step below. Proceed to Branch Strategy.
25
+ - "新規プロジェクトとして作成" — proceed to branch strategy, create a new namespace
26
+ - "キャンセル"
27
+ 4. If no existing projects found, proceed to branch strategy.
28
+
29
+ **Branch Strategy**:
30
+
31
+ Determine the integration branch where all Worker results will be merged. This branch is NOT main — it serves as a staging area for the entire team project.
32
+
33
+ Use AskUserQuestion:
34
+ - "新しい統合ブランチを作成" — create a new branch from current HEAD
35
+ - "現在のブランチを統合ブランチとして使用 (`{{CURRENT_BRANCH}}`)"
36
+
37
+ If creating a new branch:
38
+ - Derive branch name as `team/{{project-name}}` (slugified from the project description)
39
+ - Present the suggested name for confirmation
40
+ - Create from current HEAD:
41
+ ```bash
42
+ git checkout -b {{BRANCH_NAME}}
43
+ ```
44
+
45
+ Record the integration branch name — CONFIG.md will be written together with other coordination files in Step 6.
46
+
47
+ This branch name is used by soda-team-run for all merge operations.
48
+
49
+ **Derive namespace directory name**:
50
+ ```
51
+ NAMESPACE = "<YYYYMMDD>-<project-name>" # e.g., 20260320-auth-refactor
52
+ # Collision check
53
+ if .agent-team/NAMESPACE already exists:
54
+ append -2, -3, etc. until unique
55
+ ```
56
+ The `NAMESPACE` variable is used in Step 6 for all file generation paths.
57
+
58
+ ## Step 2: Requirements Ingestion
59
+
60
+ Accept requirements from the user. Requirements can come from:
61
+
62
+ - **Inline text**: User provides a list directly in `$ARGUMENTS` or as a follow-up message
63
+ - **File reference**: User points to a file containing requirements (e.g., a gap analysis document, issue list)
64
+ - **Design decisions from DB**: Query `sd decision list --repo <owner/repo>` for design constraints from a preceding soda-discuss session
65
+
66
+ Parse the input into a normalized list of individual requirements. Each requirement should be a single, actionable item.
67
+
68
+ Present the parsed list to the user:
69
+
70
+ > **要件一覧** ({{COUNT}}件)
71
+ > 1. {{requirement 1}}
72
+ > 2. {{requirement 2}}
73
+ > ...
74
+
75
+ Use AskUserQuestion:
76
+ - "この一覧で進める"
77
+ - "要件を追加・修正"
78
+ - "要件を再分割(粒度が粗い)"
79
+
80
+ Do NOT proceed until the user confirms the requirements list.
81
+
82
+ ## Step 3: Investigation & Classification
83
+
84
+ Launch 1-2 sub-agents (Task, subagent_type: Explore) to investigate the codebase and classify requirements.
85
+
86
+ **Sub-agent prompt constraints**: Every sub-agent prompt MUST begin with:
87
+ > You are a research-only agent. Do NOT use AskUserQuestion, EnterPlanMode, or any interactive/planning tools. Return your findings in the output format specified below.
88
+
89
+ **Investigation goals**:
90
+ - Identify which files and areas each requirement affects
91
+ - Find existing patterns and conventions relevant to the requirements
92
+ - Detect natural groupings based on shared affected areas, dependencies, or functional domains
93
+
94
+ **Sub-agent output contract**: Every sub-agent prompt MUST end with:
95
+ > Return findings in this exact format:
96
+ > ### Affected Areas
97
+ > - requirement N — `path/to/affected/area`, `path/to/other/area`
98
+ > ### Proposed Groups
99
+ > - Group name — [requirement numbers] — rationale for grouping
100
+ > ### Dependencies
101
+ > - requirement N depends on requirement M — reason
102
+ > ### Patterns
103
+ > - pattern name — description of existing convention relevant to these requirements
104
+ > ### Open Questions
105
+ > - question — what remains unclear
106
+
107
+ After investigation, classify requirements into groups. Each group should:
108
+ - Share affected code areas or functional domain
109
+ - Be implementable as a coherent unit
110
+ - Contain 3-10 requirements (split or merge if outside this range)
111
+
112
+ **Identify design-critical groups**: A group is design-critical if:
113
+ - It involves architectural decisions not covered by existing design decisions in the DB
114
+ - It affects multiple functional domains or cross-cutting concerns
115
+ - Investigation revealed conflicting patterns or ambiguity in the existing codebase
116
+
117
+ Present the classification result:
118
+
119
+ > **グループ分類結果**
120
+ >
121
+ > **GROUP-A**: {{name}} ({{N}}件) {{🔶 設計判断が必要 if design-critical}}
122
+ > - {{requirement 1}}
123
+ > - {{requirement 2}}
124
+ > - 影響範囲: `src/foo/`, `src/bar/`
125
+ >
126
+ > **GROUP-B**: {{name}} ({{N}}件)
127
+ > - {{requirement 3}}
128
+ > - {{requirement 4}}
129
+ > - 影響範囲: `src/baz/`
130
+ >
131
+ > **グループ間依存**: GROUP-A → GROUP-B (AのAPI変更がBに影響)
132
+
133
+ Use AskUserQuestion:
134
+ - "この分類で進める"
135
+ - "グループを調整"
136
+ - "さらに調査を深める"(available at most once)
137
+
138
+ Do NOT proceed until the user confirms the classification.
139
+
140
+ ## Step 4: Design-Critical Group Discussion
141
+
142
+ For each group marked as design-critical, conduct a focused discussion with the user. Process groups in dependency order.
143
+
144
+ For each design-critical group:
145
+
146
+ 1. Present the group's requirements, affected areas, and the specific design question
147
+ 2. Present options with evidence and recommendation (following soda-discuss Interaction Principles)
148
+ 3. Use AskUserQuestion for the user's decision
149
+ 4. Record the decision as an ADR draft (to be written to ARCHITECTURE.md in Step 6)
150
+
151
+ For groups that are NOT design-critical, briefly present the planned approach:
152
+
153
+ > **GROUP-B**: {{name}} — 自動分解方針
154
+ > - {{approach summary}}
155
+ > - 設計判断なし(既存パターン `src/existing/pattern.ts` に従う)
156
+
157
+ Use AskUserQuestion after presenting all non-critical groups:
158
+ - "この方針で自動分解に進む"
159
+ - "特定のグループについて議論したい"
160
+
161
+ ## Step 5: Task Decomposition
162
+
163
+ Decompose each group into individual tasks. For each group, launch a sub-agent (Task, subagent_type: Explore) to investigate at task-level granularity.
164
+
165
+ **Sub-agent prompt** must include:
166
+ - The constraint block
167
+ - The group's requirements and affected areas
168
+ - Design decisions from Step 4 (if any)
169
+ - Existing patterns discovered in Step 3
170
+
171
+ **Sub-agent output contract**:
172
+ > Return findings in this exact format:
173
+ > ### Tasks
174
+ > - task title — description, affected files, acceptance criteria, validation command
175
+ > ### Task Dependencies
176
+ > - task A depends on task B — reason
177
+ > ### Risks
178
+ > - risk — mitigation
179
+
180
+ **Task granularity guideline**: Each task should be completable by a single Worker in one session. Signs a task is too large:
181
+ - Affects more than 5 files
182
+ - Has more than 3 acceptance criteria
183
+ - Requires changes in multiple functional domains
184
+
185
+ Signs a task is too small:
186
+ - Is a single-line change
187
+ - Cannot be validated independently
188
+
189
+ Present the decomposed tasks per group:
190
+
191
+ > **GROUP-A タスク分解** ({{N}}タスク)
192
+ >
193
+ > | # | タスク | 受入条件 | 依存 | 並列可 |
194
+ > |---|--------|----------|------|--------|
195
+ > | 1 | {{title}} | {{acceptance}} | なし | ✓ |
196
+ > | 2 | {{title}} | {{acceptance}} | #1 | - |
197
+ > | 3 | {{title}} | {{acceptance}} | なし | ✓ |
198
+ >
199
+ > **並列実行プラン**: #1 と #3 を並列 → #2
200
+
201
+ Present groups one at a time (following soda-discuss "one topic at a time" principle).
202
+
203
+ Use AskUserQuestion for each group:
204
+ - "このタスク分解で進める"
205
+ - "タスクを調整"
206
+
207
+ After all groups are confirmed, present a final overview:
208
+
209
+ > **全体サマリー**
210
+ > - グループ数: {{N}}
211
+ > - タスク総数: {{M}}
212
+ > - 並列実行可能: 最大{{P}}タスク同時
213
+ > - 設計判断: {{D}}件 (ARCHITECTURE.md に記録)
214
+ > - 推定実行順序: GROUP-A (#1,#3 並列) → GROUP-A #2 → GROUP-B (#1,#2 並列) → ...
215
+
216
+ Use AskUserQuestion:
217
+ - "ファイル生成に進む"
218
+ - "全体を調整"
219
+
220
+ ## Step 6: Generate Coordination Files
221
+
222
+ ### Codex Review (pre-generation)
223
+
224
+ Before writing files, compose the full content of TASKS.md and ARCHITECTURE.md, then delegate review:
225
+
226
+ 1. Launch a codex review subagent:
227
+ - Tool: `Task(subagent_type: soda:codex-review)`
228
+ - Prompt:
229
+ ```
230
+ ## Codex Review Request
231
+ - **Mode**: init
232
+ - **Instruction**: "Review this agent team initialization. Focus on task completeness, dependency correctness, ADR quality, and TASK file self-containedness — only flag critical problems"
233
+
234
+ ### Content
235
+ [composed TASKS.md + ARCHITECTURE.md + sample TASK-NNN.md]
236
+ ```
237
+ 2. If **Revision Applied: Yes**: use `Revised Content`.
238
+ 3. If **Status: Skipped** or failure: continue without review.
239
+
240
+ ### File Generation
241
+
242
+ Initialize the namespaced directory:
243
+ ```bash
244
+ mkdir -p .agent-team/{{NAMESPACE}}/tasks .agent-team/{{NAMESPACE}}/reviews
245
+ ```
246
+
247
+ Write the following files (refer to `references/coordination-files.md` for format specification):
248
+
249
+ 1. **`.agent-team/{{NAMESPACE}}/CONFIG.md`** — Integration branch name, base branch/commit, creation date (as determined in Step 1)
250
+ 2. **`.agent-team/{{NAMESPACE}}/TASKS.md`** — Task list with group overview and all tasks in pending state
251
+ 3. **`.agent-team/{{NAMESPACE}}/ARCHITECTURE.md`** — Initial ADRs from:
252
+ - Design decisions from DB (transcribed as ADRs with decision name as Source reference)
253
+ - Design decisions from Step 4 (design-critical group discussions)
254
+ 4. **`.agent-team/{{NAMESPACE}}/tasks/TASK-NNN.md`** — One file per task, with:
255
+ - Definition from Step 5 decomposition
256
+ - Design Constraints summarized from relevant ADRs (not just references)
257
+ - Context from investigation findings
258
+ - Validation criteria
259
+
260
+ Task numbering: `TASK-001`, `TASK-002`, ... zero-padded to 3 digits. Order follows dependency topology within each group, groups ordered by inter-group dependencies.
261
+
262
+ ### Gitignore Check
263
+
264
+ ```bash
265
+ git check-ignore .agent-team/
266
+ ```
267
+
268
+ If `.agent-team/` is NOT gitignored, warn the user and suggest adding it to their global gitignore.
269
+
270
+ ## Step 7: Summary & Next Steps
271
+
272
+ Present the generated files:
273
+
274
+ > **Agent Team 初期化完了**
275
+ >
276
+ > ```
277
+ > .agent-team/
278
+ > └── {{NAMESPACE}}/
279
+ > ├── CONFIG.md — integration branch: {{BRANCH_NAME}}
280
+ > ├── TASKS.md — {{GROUP_COUNT}} groups, {{TASK_COUNT}} tasks
281
+ > ├── ARCHITECTURE.md — {{ADR_COUNT}} decisions
282
+ > └── tasks/
283
+ > ├── TASK-001.md
284
+ > ├── TASK-002.md
285
+ > └── ... ({{TASK_COUNT}} files)
286
+ > ```
287
+ >
288
+ > **実行順序**:
289
+ > {{GROUP-A}}: TASK-001, TASK-003 (並列) → TASK-002
290
+ > {{GROUP-B}}: TASK-004, TASK-005 (並列)
291
+ > GROUP-A → GROUP-B (依存)
292
+
293
+ Then print next steps:
294
+
295
+ ```
296
+ Next:
297
+ /soda-team-run — Execute tasks with agent team
298
+ ```
299
+
300
+ ## Constraints
301
+
302
+ - This skill only initializes the coordination files. Do NOT execute any tasks.
303
+ - Do NOT create Worker agents or start implementation.
304
+ - The `.agent-team/` directory structure and file formats must conform to `references/coordination-files.md`.
305
+ - Every TASK-NNN.md must be self-contained — a Worker should need only that file to begin implementation.
306
+ - Design Constraints in TASK-NNN.md must include summarized ADR content, not just references to ARCHITECTURE.md.
307
+
308
+ ## Sub-agent Usage
309
+
310
+ Every sub-agent prompt MUST begin with the constraint block:
311
+ > You are a research-only agent. Do NOT use AskUserQuestion, EnterPlanMode, or any interactive/planning tools. Return your findings in the output format specified below.
312
+
313
+ Every sub-agent prompt MUST end with the relevant output contract defined in the step where it is used.
@@ -0,0 +1,188 @@
1
+ # Coordination Files Specification
2
+
3
+ This document defines the file-based coordination protocol shared by soda-team-init and soda-team-run.
4
+
5
+ All coordination files live under `.agent-team/<YYYYMMDD>-<project-name>/` in the repository root. Each namespaced subdirectory represents an independent project, allowing multiple soda-team-init sessions to coexist in the same repository.
6
+
7
+ ## Directory Structure
8
+
9
+ ```
10
+ .agent-team/
11
+ └── <YYYYMMDD>-<project-name>/ — Namespaced project directory (e.g., 20260320-auth-refactor)
12
+ ├── CONFIG.md — Project configuration (integration branch, creation metadata)
13
+ ├── TASKS.md — Task list and status (managed by Orchestrator)
14
+ ├── ARCHITECTURE.md — Architecture decision records (managed by Architect)
15
+ ├── tasks/
16
+ │ ├── TASK-001.md — Individual task instruction (managed by Orchestrator + Architect)
17
+ │ ├── TASK-002.md
18
+ │ └── ...
19
+ └── reviews/
20
+ ├── REVIEW-001-1.md — Review result for TASK-001, attempt 1 (managed by Reviewer)
21
+ └── ...
22
+ ```
23
+
24
+ ### Namespace Convention
25
+
26
+ - **Format**: `<YYYYMMDD>-<project-name>` (e.g., `20260320-auth-refactor`)
27
+ - **Date prefix**: Creation date in `YYYYMMDD` format for chronological sorting
28
+ - **Project name**: Slugified from the project description (same as the `team/<project-name>` integration branch)
29
+ - **Collision handling**: If the directory already exists, append `-2`, `-3`, etc. until unique
30
+
31
+ ## CONFIG.md
32
+
33
+ Project-level configuration set during soda-team-init. Read by soda-team-run to determine merge targets and project metadata.
34
+
35
+ ```markdown
36
+ # Team Config
37
+ - **Integration Branch**: {{branch name}}
38
+ - **Created From**: {{base branch or commit SHA}}
39
+ - **Created At**: {{ISO date}}
40
+ ```
41
+
42
+ **Managed by**: soda-team-init (created), soda-team-run (read-only)
43
+ **Updated when**: Initial creation only. If the integration branch needs to change, re-run soda-team-init.
44
+
45
+ ## TASKS.md
46
+
47
+ Task list with group overview and per-task status.
48
+
49
+ **State legend**: `[ ]` pending, `[~]` in-progress, `[x]` done, `[!]` blocked
50
+
51
+ ```markdown
52
+ # Tasks
53
+
54
+ ## Groups
55
+ - **GROUP-A**: {{description}} ({{N}} tasks, {{done}} done, {{in-progress}} in-progress, {{pending}} pending)
56
+ - **GROUP-B**: {{description}} ({{N}} tasks, {{done}} done, {{in-progress}} in-progress, {{pending}} pending)
57
+
58
+ ## Task List
59
+ - [x] TASK-001: {{title}} (group: A, merged: {{commit-sha}})
60
+ - [~] TASK-002: {{title}} (group: A, worker: worktree-002)
61
+ - [ ] TASK-003: {{title}} (group: A, deps: TASK-001)
62
+ - [!] TASK-004: {{title}} (group: B, blocked: "{{reason}}")
63
+ ```
64
+
65
+ **Managed by**: Orchestrator
66
+ **Updated when**: Task assignment, completion, merge, or block
67
+
68
+ ## TASK-NNN.md
69
+
70
+ Self-contained instruction for a Worker. The Worker should be able to implement the task by reading only this file.
71
+
72
+ ```markdown
73
+ # TASK-NNN: {{title}}
74
+
75
+ ## Definition
76
+ - **Group**: {{GROUP-X}}
77
+ - **Goal**: {{what to achieve — 1-2 sentences}}
78
+ - **Acceptance**: {{pass/fail condition}}
79
+ - **Deps**: {{TASK-NNN | "none"}}
80
+
81
+ ## Design Constraints
82
+ - ADR-NNN: {{summary of the relevant decision — not just a reference, include enough context for the Worker}}
83
+ - {{additional constraints from Architect if any}}
84
+
85
+ ## Context
86
+ - `{{path/to/file}}` — {{what about this file is relevant}}
87
+ - `{{path/to/file}}` — {{same}}
88
+ - {{relevant information transcribed from Investigator findings}}
89
+
90
+ ## Validation
91
+ - `{{runnable command}}` — {{expected outcome}}
92
+ - {{additional verification methods}}
93
+
94
+ ## History
95
+ {{Only present for re-implementation. Contains previous Reviewer findings.}}
96
+ - Attempt N: FAIL — "{{specific issue}}" (REVIEW-NNN-N)
97
+ ```
98
+
99
+ **Managed by**: Orchestrator (Definition, Context, Validation) + Architect (Design Constraints)
100
+ **Created when**: Task assignment
101
+ **Updated when**: Re-implementation (History appended from REVIEW-NNN)
102
+
103
+ ### Design Principles
104
+
105
+ - **Self-contained**: Worker reads only this file. Design Constraints include summarized ADR content, not just references.
106
+ - **History for learning**: Re-implementation attempts carry forward Reviewer findings to prevent repeating the same mistakes.
107
+ - **Concrete context**: File paths and relevant details from Investigator findings are transcribed here, not left as references to other files.
108
+
109
+ ## ARCHITECTURE.md
110
+
111
+ Architecture Decision Records maintained by Architect. The primary mechanism for preventing Architectural Drift across Workers.
112
+
113
+ ```markdown
114
+ # Architecture Decisions
115
+
116
+ ## ADR-NNN: {{topic}}
117
+ - **Decision**: {{what was decided}}
118
+ - **Context**: {{why this decision was needed}}
119
+ - **Options**:
120
+ - A: {{description}} — {{pros / cons}}
121
+ - B: {{description}} — {{pros / cons}}
122
+ - **Rationale**: {{why the chosen option was selected}}
123
+ - **Affected Areas**: `{{path/}}`, `{{path/}}`
124
+ - **Status**: {{Active | Superseded (by ADR-NNN) | Deprecated}}
125
+ - **Source**: {{soda-discuss | Architect decision | User instruction}}
126
+ ```
127
+
128
+ **Managed by**: Architect
129
+ **Updated when**: New design decision, decision revision, or deprecation
130
+
131
+ ### Quality Safeguards
132
+
133
+ - **Source field**: Traces the origin of each decision. soda-discuss decisions are transcribed from Living Discussion Document DD-N entries; Architect decisions include the reasoning; User instructions preserve original wording.
134
+ - **Status field**: Active / Superseded (with pointer to replacement ADR) / Deprecated. Prevents stale decisions from misleading Workers.
135
+ - **Affected Areas specificity**: Must be directory or file-path level. Vague entries like "entire codebase" are prohibited. Reviewer uses these for compliance checking.
136
+
137
+ ### Initial State
138
+
139
+ On soda-team-init execution, Design Decisions (DD-N) from the preceding soda-discuss Living Discussion Document are transcribed as the initial set of ADRs. Each ADR's Source field references the originating DD-N.
140
+
141
+ ## REVIEW-NNN-A.md
142
+
143
+ Review result for a completed task. File naming: `REVIEW-{task number}-{attempt number}.md` (e.g., `REVIEW-001-1.md` for TASK-001's first review, `REVIEW-001-2.md` for the second). This preserves both the task correspondence and the full review history across retries.
144
+
145
+ Written by Reviewer, consumed by Orchestrator (for status updates) and by future Workers (via TASK-NNN.md History).
146
+
147
+ ```markdown
148
+ # REVIEW-NNN-A: TASK-NNN (Attempt A)
149
+
150
+ ## Verdict: {{PASS | PASS_WITH_FIX | FAIL | ESCALATE}}
151
+
152
+ ## Summary
153
+ {{1-2 sentence overview of the review result}}
154
+
155
+ ## Findings
156
+ - **[PASS]** {{criterion met}} — {{evidence}}
157
+ - **[FAIL]** {{issue found}} — {{specific details}}
158
+ - **[WARN]** {{minor concern}} — {{impact assessment}}
159
+
160
+ ## ADR Compliance
161
+ - ADR-NNN: {{OK | VIOLATION — description of what diverges}}
162
+
163
+ ## Trivial Fixes Applied
164
+ {{PASS_WITH_FIX or ESCALATE with trivial fixes. Each fix must be 1-2 lines and unambiguous.}}
165
+ - `{{path/to/file}}:{{line}}` — {{what was fixed}}
166
+
167
+ ## For Next Worker
168
+ {{FAIL only. Concrete instructions for re-implementation.}}
169
+ - {{what to fix, with file paths and line references to existing patterns}}
170
+
171
+ ## Escalation
172
+ {{ESCALATE only. Problem description for Architect.}}
173
+ - {{what assumption or decision needs revisiting and why}}
174
+
175
+ ## Implicit Decisions Detected
176
+ {{Present when implicit design decisions are found (criterion 6). Listed regardless of verdict.}}
177
+ - **[file:line]** {{decision description}} — not covered by task definition or Design Constraints
178
+ ```
179
+
180
+ **Managed by**: Reviewer
181
+ **Created when**: Review completion
182
+
183
+ ### Verdict Semantics
184
+
185
+ - **PASS**: Task meets acceptance criteria and ADR compliance. Orchestrator proceeds to merge.
186
+ - **PASS_WITH_FIX**: Task meets criteria after Reviewer applied trivial fixes (1-2 lines, unambiguous). Fixes are committed by Reviewer and recorded. Orchestrator proceeds to merge.
187
+ - **FAIL**: Worker-level issue. Orchestrator creates a new Worker with the findings transcribed to TASK-NNN.md History.
188
+ - **ESCALATE**: Design-level issue. Orchestrator routes to Architect for decision revision before re-assignment.