codex-workflows 0.2.1 → 0.2.3

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 (31) hide show
  1. package/.agents/skills/recipe-add-integration-tests/SKILL.md +2 -2
  2. package/.agents/skills/recipe-build/SKILL.md +1 -1
  3. package/.agents/skills/recipe-diagnose/SKILL.md +20 -4
  4. package/.agents/skills/recipe-front-build/SKILL.md +2 -2
  5. package/.agents/skills/recipe-fullstack-build/SKILL.md +1 -1
  6. package/.agents/skills/recipe-fullstack-implement/SKILL.md +1 -1
  7. package/.agents/skills/recipe-implement/SKILL.md +1 -1
  8. package/.agents/skills/recipe-reverse-engineer/SKILL.md +56 -12
  9. package/.agents/skills/recipe-update-doc/SKILL.md +10 -5
  10. package/.agents/skills/subagents-orchestration-guide/SKILL.md +3 -3
  11. package/.agents/skills/subagents-orchestration-guide/references/monorepo-flow.md +2 -2
  12. package/.codex/agents/code-reviewer.toml +11 -1
  13. package/.codex/agents/code-verifier.toml +58 -21
  14. package/.codex/agents/document-reviewer.toml +4 -2
  15. package/.codex/agents/integration-test-reviewer.toml +4 -0
  16. package/.codex/agents/investigator.toml +20 -17
  17. package/.codex/agents/prd-creator.toml +39 -24
  18. package/.codex/agents/quality-fixer-frontend.toml +15 -7
  19. package/.codex/agents/quality-fixer.toml +15 -7
  20. package/.codex/agents/requirement-analyzer.toml +4 -0
  21. package/.codex/agents/rule-advisor.toml +9 -0
  22. package/.codex/agents/scope-discoverer.toml +67 -29
  23. package/.codex/agents/security-reviewer.toml +4 -0
  24. package/.codex/agents/solver.toml +6 -2
  25. package/.codex/agents/task-executor-frontend.toml +9 -0
  26. package/.codex/agents/task-executor.toml +9 -0
  27. package/.codex/agents/technical-designer-frontend.toml +68 -115
  28. package/.codex/agents/technical-designer.toml +70 -114
  29. package/.codex/agents/verifier.toml +11 -13
  30. package/README.md +2 -2
  31. package/package.json +1 -1
@@ -106,7 +106,7 @@ Output in the following structured format:
106
106
  ### For Final Version
107
107
  Storage location and naming convention follow the principles in documentation-criteria skill.
108
108
 
109
- **Handling Undetermined Items**: When information is insufficient, do not speculate. Instead, list questions in an "Undetermined Items" section.
109
+ **Handling Undetermined Items**: When a claim cannot be confirmed directly from code, tests, or configuration, list the unresolved question in an "Undetermined Items" section.
110
110
 
111
111
  ## Output Policy
112
112
  Execute file output immediately. Final approval is managed by the orchestrator recipe.
@@ -116,10 +116,9 @@ Execute file output immediately. Final approval is managed by the orchestrator r
116
116
  - Understand and describe intent of each section
117
117
  - Limit questions to 3-5 in interactive mode
118
118
 
119
- ## PRD Boundaries: Do Not Include Implementation Phases
119
+ ## PRD Boundaries
120
120
 
121
121
  **ENFORCEMENT**: PRDs MUST focus solely on "what to build" — implementation phases and task decomposition are out of scope.
122
- These are outside the scope of this document. PRDs MUST focus solely on "what to build."
123
122
 
124
123
  ## PRD Creation Best Practices
125
124
 
@@ -183,58 +182,74 @@ Mode for extracting specifications from existing implementation to create PRD. U
183
182
  ### External Scope Handling
184
183
 
185
184
  When `External Scope Provided: true` is specified:
186
- - Skip independent scope discovery (Step 1)
187
- - Use provided scope data: Feature, Description, Related Files, Entry Points
188
- - Focus investigation within the provided scope boundaries
185
+ - Use provided scope data as an investigation starting point: Feature, Description, Related Files, Entry Points
186
+ - If entry point tracing reveals directly connected files or routes outside the provided scope, include them and report that expansion
189
187
 
190
188
  When external scope is NOT provided:
191
189
  - Execute full scope discovery independently
192
190
 
193
191
  ### Reverse PRD Execution Policy
194
192
  **Create high-quality PRD through thorough investigation**
195
- - Investigate until code implementation is fully understood
196
- - Comprehensively confirm related files, tests, and configurations
197
- - Write specifications with confidence (minimize speculation and assumptions)
198
193
 
199
194
  **Language Standard**: Code is the single source of truth. Describe observable behavior in definitive form. When uncertain about a behavior, investigate the code further to confirm — move the claim to "Undetermined Items" only when the behavior genuinely cannot be determined from code alone (e.g., business intent behind a design choice).
200
195
 
196
+ **Literal Transcription Rule**: Identifiers, URLs, parameter names, field names, component names, and string literals MUST be copied exactly as written in code. If code contains a typo, document the actual identifier and note the typo separately when needed.
197
+
201
198
  ### Confidence Gating
202
199
 
203
200
  Before documenting any claim, assess confidence level:
204
201
 
205
202
  | Confidence | Evidence | Output Format |
206
203
  |------------|----------|---------------|
207
- | Verified | Direct code observation, test confirmation | State as fact |
204
+ | Verified | Direct code observation via Read/Grep, test confirmation | State as fact |
208
205
  | Inferred | Indirect evidence, pattern matching | Mark with context |
209
206
  | Unverified | No direct evidence, speculation | Add to "Undetermined Items" section |
210
207
 
211
208
  **Rules**:
212
- - Never document Unverified claims as facts
209
+ - Unverified claims go to "Undetermined Items" only
213
210
  - Inferred claims require explicit rationale
214
211
  - Prioritize Verified claims in core requirements
215
212
  - Before classifying as Inferred, attempt to verify by reading the relevant code — classify as Inferred only after confirming the code is inaccessible or ambiguous
216
213
 
217
- ### Reverse PRD Process
218
- 1. **Investigation Phase** (skip if External Scope Provided)
219
- - Analyze all files of target feature
220
- - Understand expected behavior from test cases
221
- - Collect related documentation and comments
222
- - Fully grasp data flow and processing logic
214
+ ### Reverse PRD Investigation Protocol
215
+ 1. **Route and Entry Point Enumeration**
216
+ - Enumerate routes, endpoints, commands, or other entry points in the feature area
217
+ - Record each with exact method/path/name and handler as written in code
218
+
219
+ 2. **Entry Point Tracing**
220
+ - Read each handler or entry point implementation
221
+ - Trace invoked services, helpers, and downstream calls by reading their implementations
222
+ - Record actual behavior, parameters, and key branching
223
+
224
+ 3. **Data Model Investigation**
225
+ - Read schemas, types, migrations, or constants referenced by the traced flow
226
+ - Record field names, types, nullability, validation rules, and enum values exactly as written
227
+
228
+ 4. **Test File Discovery**
229
+ - Enumerate test files matching the feature area
230
+ - Read each discovered test and record tested behaviors
231
+ - If no tests are found for a traced handler or service, record that explicitly
232
+
233
+ 5. **Role and Permission Discovery**
234
+ - Search for middleware, guards, and role checks tied to the feature
235
+ - Record all observed roles and permissions
223
236
 
224
- 2. **Specification Documentation**
225
- - Apply Confidence Gating to each claim
226
- - Accurately document specifications extracted from current implementation
227
- - Only describe specifications clearly readable from code
237
+ 6. **Specification Documentation**
238
+ - Apply Confidence Gating to every claim
239
+ - Describe only behavior readable from code and tests
240
+ - Base core sections on the entry point list, traced flow, data model, and discovered tests
228
241
 
229
- 3. **Minimal Confirmation Items**
230
- - Only ask about truly undecidable important matters (maximum 3)
231
- - Only parts related to business decisions, not implementation details
242
+ 7. **Minimal Confirmation Items**
243
+ - Ask only truly undecidable business questions
244
+ - Limit to 3 items maximum
232
245
 
233
246
  ### Quality Standards
234
247
  - Verified content: 80%+ of core requirements
235
248
  - Inferred content: 15% maximum with rationale
236
249
  - Unverified content: Listed in "Undetermined Items" only
237
250
  - Specification document with implementable specificity
251
+ - All discovered entry points are accounted for in the PRD
252
+ - Data model details match the code-level source of truth
238
253
 
239
254
  ## Completion Gate [BLOCKING]
240
255
 
@@ -69,8 +69,13 @@ Apply fixes following the principles in coding-rules skill and testing skill.
69
69
  **Step 4: Repeat Until Approved**
70
70
  - Address all errors in each phase before proceeding to next phase
71
71
  - Error found → Fix immediately → Re-run checks
72
- - All pass → Return `approved: true`
73
- - Cannot determine spec → Return `blocked`
72
+ - All pass → proceed to Step 5
73
+ - Cannot determine spec → proceed to Step 5 with `blocked` status
74
+
75
+ **Step 5: Return JSON Result**
76
+ Return one of the following as the final response (see Output Format for schemas):
77
+ - `status: "approved"` — all quality checks pass
78
+ - `status: "blocked"` — specification unclear, business judgment required
74
79
 
75
80
  ## Frontend-Specific Quality Criteria
76
81
 
@@ -174,7 +179,6 @@ Before setting status to blocked, confirm specifications in this order:
174
179
  "totalWarnings": 0,
175
180
  "executionTime": "3m 30s"
176
181
  },
177
- "approved": true,
178
182
  "nextActions": "Ready to commit"
179
183
  }
180
184
  ```
@@ -200,11 +204,9 @@ Before setting status to blocked, confirm specifications in this order:
200
204
  }
201
205
  ```
202
206
 
203
- ### User Report (Mandatory)
204
-
205
- Summarize quality check results in an understandable way for users
207
+ ## Intermediate Progress Report
206
208
 
207
- ### Phase-by-phase Report (Detailed Information)
209
+ During execution, report progress between tool calls using this format:
208
210
 
209
211
  ```markdown
210
212
  Phase [Number]: [Phase Name]
@@ -222,6 +224,12 @@ Issues requiring fixes:
222
224
  Phase [Number] Complete! Proceeding to next phase.
223
225
  ```
224
226
 
227
+ This is intermediate output only. The final response must be the JSON result (Step 5).
228
+
229
+ ## Completion Criteria
230
+
231
+ - [ ] Final response is a single JSON with status `approved` or `blocked`
232
+
225
233
  ## Important Principles
226
234
 
227
235
  MUST follow these principles to maintain high-quality React code:
@@ -66,8 +66,13 @@ Apply fixes following the principles in coding-rules skill and testing skill.
66
66
  **Step 4: Repeat Until Approved**
67
67
  - Address all errors in each phase before proceeding to next phase
68
68
  - Error found → Fix immediately → Re-run checks
69
- - All pass → Return `approved: true`
70
- - Cannot determine spec → Return `blocked`
69
+ - All pass → proceed to Step 5
70
+ - Cannot determine spec → proceed to Step 5 with `blocked` status
71
+
72
+ **Step 5: Return JSON Result**
73
+ Return one of the following as the final response (see Output Format for schemas):
74
+ - `status: "approved"` — all quality checks pass
75
+ - `status: "blocked"` — specification unclear, business judgment required
71
76
 
72
77
  ## Status Determination Criteria (Binary Determination)
73
78
 
@@ -144,7 +149,6 @@ Apply fixes following the principles in coding-rules skill and testing skill.
144
149
  "totalWarnings": 0,
145
150
  "executionTime": "2m 15s"
146
151
  },
147
- "approved": true,
148
152
  "nextActions": "Ready to commit"
149
153
  }
150
154
  ```
@@ -170,11 +174,9 @@ Apply fixes following the principles in coding-rules skill and testing skill.
170
174
  }
171
175
  ```
172
176
 
173
- ### User Report (Mandatory)
174
-
175
- Summarize quality check results in an understandable way for users
177
+ ## Intermediate Progress Report
176
178
 
177
- ### Phase-by-phase Report (Detailed Information)
179
+ During execution, report progress between tool calls using this format:
178
180
 
179
181
  ```markdown
180
182
  Phase [Number]: [Phase Name]
@@ -192,6 +194,12 @@ Issues requiring fixes:
192
194
  Phase [Number] Complete! Proceeding to next phase.
193
195
  ```
194
196
 
197
+ This is intermediate output only. The final response must be the JSON result (Step 5).
198
+
199
+ ## Completion Criteria
200
+
201
+ - [ ] Final response is a single JSON with status `approved` or `blocked`
202
+
195
203
  ## Important Principles
196
204
 
197
205
  MUST follow these principles to maintain high-quality code:
@@ -112,6 +112,9 @@ Identify constraints, risks, and dependencies. Use web search to verify current
112
112
  ### 6. Formulate Questions
113
113
  Identify any ambiguities that affect scale determination (scopeDependencies) or require user confirmation before proceeding.
114
114
 
115
+ ### 7. Return JSON Result
116
+ Return the JSON result as the final response. See Output Format for the schema.
117
+
115
118
  ## Output Format
116
119
 
117
120
  **JSON format is mandatory.**
@@ -161,6 +164,7 @@ Identify any ambiguities that affect scale determination (scopeDependencies) or
161
164
  - [ ] Have I correctly determined ADR necessity?
162
165
  - [ ] Have I not overlooked technical risks?
163
166
  - [ ] Have I listed scopeDependencies for uncertain scale?
167
+ - [ ] Final response is the JSON output
164
168
 
165
169
  ## Completion Gate [BLOCKING]
166
170
 
@@ -65,6 +65,9 @@ From each skill:
65
65
  - Prioritize concrete procedures over abstract principles
66
66
  - Include checklists and actionable items
67
67
 
68
+ ### 4. Return JSON Result
69
+ Return the JSON result as the final response. See Output Format for the schema.
70
+
68
71
  ## Output Format
69
72
 
70
73
  Return structured JSON:
@@ -172,6 +175,12 @@ Return structured JSON:
172
175
  - MUST include enough context for standalone understanding
173
176
  - Prioritize actionable guidance over theory
174
177
 
178
+ ## Completion Criteria
179
+
180
+ - [ ] Task analysis completed with type, scale, and tags
181
+ - [ ] Relevant skills loaded and sections extracted
182
+ - [ ] Final response is the JSON output
183
+
175
184
  ## Completion Gate [BLOCKING]
176
185
 
177
186
  ☐ All completion criteria met with evidence
@@ -49,36 +49,18 @@ Skill Status:
49
49
 
50
50
  ## Output Scope
51
51
 
52
- This agent outputs **scope discovery results and evidence only**.
53
- Document generation is out of scope for this agent.
54
-
55
- ## Core Responsibilities
56
-
57
- 1. **Multi-source Discovery** - Collect evidence from routing, tests, directory structure, docs, modules, interfaces
58
- 2. **Boundary Identification** - Identify logical boundaries between functional units
59
- 3. **Relationship Mapping** - Map dependencies and relationships between discovered units
60
- 4. **Confidence Assessment** - Assess confidence level with triangulation strength
61
-
62
- ## Discovery Approach
63
-
64
- ### When reference_architecture is provided (Top-Down)
65
-
66
- 1. Apply RA layer definitions as initial classification framework
67
- 2. Map code directories to RA layers
68
- 3. Discover units within each layer
69
- 4. Validate boundaries against RA expectations
70
-
71
- ### When reference_architecture is none (Bottom-Up)
72
-
73
- 1. Scan all discovery sources
74
- 2. Identify natural boundaries from code structure
75
- 3. Group related components into units
76
- 4. Validate through cross-source confirmation
52
+ This agent outputs **scope discovery results, evidence, and PRD unit grouping**.
53
+ Document generation (PRD content, Design Doc content) is out of scope for this agent.
77
54
 
78
55
  ## Unified Scope Discovery
79
56
 
80
57
  Explore the codebase from both user-value and technical perspectives simultaneously, then synthesize results into functional units.
81
58
 
59
+ When `reference_architecture` is provided:
60
+ - Use its layer definitions to classify discovered code into layers
61
+ - Validate unit boundaries against those expectations
62
+ - Record deviations in `uncertainAreas`
63
+
82
64
  ### Discovery Sources
83
65
 
84
66
  | Source | Priority | Perspective | What to Look For |
@@ -115,19 +97,39 @@ Explore the codebase from both user-value and technical perspectives simultaneou
115
97
  - Identify interface contracts
116
98
 
117
99
  4. **Synthesis into Functional Units**
118
- - Merge user-value groups and technical boundaries into functional units
100
+ - Combine user-value groups and technical boundaries into functional units
119
101
  - Each unit MUST represent a coherent feature with identifiable technical scope
102
+ - For each unit, identify its `valueProfile`: who uses it, what goal it serves, and what high-level capability it belongs to
103
+ - Also assign normalized grouping keys in `valueProfile.groupingKey` for persona, goal, and category; use short stable slugs (`kebab-case`) rather than free-form prose
120
104
  - Apply Granularity Criteria (see below)
121
105
 
122
- 5. **Boundary Validation**
106
+ 5. **Unit Inventory Enumeration**
107
+ - For each discovered unit, enumerate:
108
+ - Routes or entry points in the unit's related files
109
+ - Test files covering the unit
110
+ - Public exports or interfaces in primary modules
111
+ - Store the results as `unitInventory`
112
+ - Use actual enumeration, not inferred summaries
113
+
114
+ 6. **Boundary Validation**
123
115
  - Verify each unit delivers distinct user value
124
116
  - Check for minimal overlap between units
125
117
  - Identify shared dependencies and cross-cutting concerns
126
118
 
127
- 6. **Saturation Check**
119
+ 7. **Saturation Check**
128
120
  - Stop discovery when 3 consecutive new sources yield no new units
129
121
  - Mark discovery as saturated in output
130
122
 
123
+ 8. **PRD Unit Grouping** (execute only after steps 1-7 are fully complete)
124
+ - Using the finalized `discoveredUnits` and their `valueProfile` metadata, group units into PRD-appropriate units
125
+ - Grouping logic: units with the same `groupingKey.valueCategory` AND the same `groupingKey.userGoal` AND the same `groupingKey.targetPersona` belong to one PRD unit. If any of the three differs, the units become separate PRD units
126
+ - Free-text fields (`targetPersona`, `userGoal`, `valueCategory`) are explanatory only and MUST NOT be used as grouping keys
127
+ - Every discovered unit must appear in exactly one PRD unit's `sourceUnits`
128
+ - Output as `prdUnits` alongside `discoveredUnits` (see Output Format)
129
+
130
+ 9. **Return JSON Result**
131
+ - Return the JSON result as the final response. See Output Format for the schema.
132
+
131
133
  ## Granularity Criteria
132
134
 
133
135
  Each discovered unit MUST represent a Vertical Slice — a coherent functional unit that spans all relevant layers — and satisfy:
@@ -138,11 +140,13 @@ Each discovered unit MUST represent a Vertical Slice — a coherent functional u
138
140
  - Multiple independent user journeys within one unit
139
141
  - Multiple distinct data domains with no shared state
140
142
 
141
- **Merge signals** (units may be too granular):
143
+ **Cohesion signals** (units that may belong together):
142
144
  - Units share >50% of related files
143
145
  - One unit cannot function without the other
144
146
  - Combined scope is still under 10 files
145
147
 
148
+ Note: These signals are informational only during steps 1-6. Keep all discovered units separate and capture accurate value metadata (see `valueProfile` in Output Format). PRD-level grouping is performed in step 7 after discovery is complete, using normalized grouping keys rather than free-text descriptions.
149
+
146
150
  ## Confidence Assessment
147
151
 
148
152
  | Level | Triangulation Strength | Criteria |
@@ -174,11 +178,26 @@ Each discovered unit MUST represent a Vertical Slice — a coherent functional u
174
178
  "entryPoints": ["/path1", "/path2"],
175
179
  "relatedFiles": ["src/feature/*"],
176
180
  "dependencies": ["UNIT-002"],
181
+ "valueProfile": {
182
+ "targetPersona": "Who this feature serves (e.g., 'end user', 'admin', 'developer')",
183
+ "userGoal": "What the user is trying to accomplish with this feature",
184
+ "valueCategory": "High-level capability this belongs to (e.g., 'Authentication', 'Content Management', 'Reporting')",
185
+ "groupingKey": {
186
+ "targetPersona": "end-user",
187
+ "userGoal": "sign-in",
188
+ "valueCategory": "authentication"
189
+ }
190
+ },
177
191
  "technicalProfile": {
178
192
  "primaryModules": ["src/auth/service.ts", "src/auth/controller.ts"],
179
193
  "publicInterfaces": ["AuthService.login()", "AuthController.handleLogin()"],
180
194
  "dataFlowSummary": "Request → Controller → Service → Repository → DB",
181
195
  "infrastructureDeps": ["database", "redis-cache"]
196
+ },
197
+ "unitInventory": {
198
+ "routes": ["POST /login -> AuthController.handleLogin (src/auth/controller.ts:24)"],
199
+ "testFiles": ["src/auth/service.test.ts"],
200
+ "publicExports": ["AuthService (src/auth/service.ts:10)"]
182
201
  }
183
202
  }
184
203
  ],
@@ -196,6 +215,21 @@ Each discovered unit MUST represent a Vertical Slice — a coherent functional u
196
215
  "suggestedAction": "What to do"
197
216
  }
198
217
  ],
218
+ "prdUnits": [
219
+ {
220
+ "id": "PRD-001",
221
+ "name": "PRD unit name (user-value level)",
222
+ "description": "What this capability delivers to the user",
223
+ "groupingKey": {
224
+ "targetPersona": "end-user",
225
+ "userGoal": "sign-in",
226
+ "valueCategory": "authentication"
227
+ },
228
+ "sourceUnits": ["UNIT-001", "UNIT-003"],
229
+ "combinedRelatedFiles": ["src/feature-a/*", "src/feature-b/*"],
230
+ "combinedEntryPoints": ["/path1", "/path2", "/path3"]
231
+ }
232
+ ],
199
233
  "limitations": ["What could not be discovered and why"]
200
234
  }
201
235
  ```
@@ -207,13 +241,17 @@ Each discovered unit MUST represent a Vertical Slice — a coherent functional u
207
241
  - [ ] Reviewed test structure for feature organization
208
242
  - [ ] Detected module/service boundaries
209
243
  - [ ] Mapped public interfaces
244
+ - [ ] Enumerated per-unit inventory for routes, test files, and public exports
210
245
  - [ ] Analyzed dependency graph
211
246
  - [ ] Applied granularity criteria (split/merge as needed)
247
+ - [ ] Identified value profile (persona, goal, category) for each unit
212
248
  - [ ] Mapped discovered units to evidence sources
213
249
  - [ ] Assessed triangulation strength for each unit
214
250
  - [ ] Documented relationships between units
215
251
  - [ ] Reached saturation or documented why not
216
252
  - [ ] Listed uncertain areas and limitations
253
+ - [ ] Grouped discovered units into PRD units (step 7, after all discovery steps complete)
254
+ - [ ] Final response is the JSON output
217
255
 
218
256
  ## Output Self-Check
219
257
  - [ ] Output is limited to scope discovery (no PRD or Design Doc content generated)
@@ -101,6 +101,9 @@ Each finding must include a `rationale` field whose content depends on the categ
101
101
  | **hardening** | Why the current state is acceptable, and what improvement would add |
102
102
  | **policy** | Why this is not a technical vulnerability (what mitigates the technical risk) |
103
103
 
104
+ ### 6. Return JSON Result
105
+ Return the JSON result as the final response. See Output Format for the schema.
106
+
104
107
  ## Output Format
105
108
 
106
109
  ```json
@@ -155,6 +158,7 @@ Each finding must include a `rationale` field whose content depends on the categ
155
158
  - [ ] Each finding classified into confirmed_risk / defense_gap / hardening / policy
156
159
  - [ ] False positives excluded considering runtime environment and existing mitigations
157
160
  - [ ] Committed secrets checked (blocked status if found)
161
+ - [ ] Final response is the JSON output
158
162
 
159
163
  ## Completion Gate [BLOCKING]
160
164
 
@@ -111,12 +111,15 @@ Recommendation strategy based on confidence:
111
111
  - medium: Staged approach, verify with low-impact fixes before full implementation
112
112
  - low: Start with conservative mitigation, prioritize solutions that address multiple possible causes
113
113
 
114
- ### Step 5: Implementation Steps Creation and Output
114
+ ### Step 5: Implementation Steps Creation
115
115
  - Each step independently verifiable
116
116
  - Explicitly state dependencies between steps
117
117
  - Define completion conditions for each step
118
118
  - Include rollback procedures
119
- - Output structured report in JSON format
119
+
120
+ ### Step 6: Return JSON Result
121
+
122
+ Return the JSON result as the final response. See Output Format for the schema.
120
123
 
121
124
  ## Output Format
122
125
 
@@ -184,6 +187,7 @@ Recommendation strategy based on confidence:
184
187
  - [ ] Documented residual risks
185
188
  - [ ] Verified solutions align with project rules or best practices
186
189
  - [ ] Verified input consistency with user report
190
+ - [ ] Final response is the JSON output
187
191
 
188
192
  ## Output Self-Check
189
193
  - [ ] Solution addresses the user's reported symptoms (not just the technical conclusion)
@@ -184,6 +184,11 @@ Select and execute files with pattern `docs/plans/tasks/*-task-*.md` that have u
184
184
  Task complete when all checkbox items completed and operation verification complete.
185
185
  For research tasks, includes creating deliverable files specified in metadata "Provides" section.
186
186
 
187
+ ### 5. Return JSON Result
188
+ Return one of the following as the final response (see Structured Response Specification for schemas):
189
+ - `status: "completed"` — task fully implemented
190
+ - `status: "escalation_needed"` — design deviation or similar component discovered
191
+
187
192
  ## Research Task Deliverables
188
193
 
189
194
  Research/analysis tasks create deliverable files specified in metadata "Provides".
@@ -291,6 +296,10 @@ When discovering similar components/hooks during existing code investigation, es
291
296
  - Design Doc deviation → escalate to orchestrator immediately
292
297
  - Component patterns → use functional components exclusively (React standard)
293
298
 
299
+ ## Completion Criteria
300
+
301
+ - [ ] Final response is a single JSON with status `completed` or `escalation_needed`
302
+
294
303
  ## Completion Gate [BLOCKING]
295
304
 
296
305
  ☐ All completion criteria met with evidence
@@ -185,6 +185,11 @@ Select and execute files with pattern `docs/plans/tasks/*-task-*.md` that have u
185
185
  Task complete when all checkbox items completed and operation verification complete.
186
186
  For research tasks, includes creating deliverable files specified in metadata "Provides" section.
187
187
 
188
+ ### 5. Return JSON Result
189
+ Return one of the following as the final response (see Structured Response Specification for schemas):
190
+ - `status: "completed"` — task fully implemented
191
+ - `status: "escalation_needed"` — design deviation or similar function discovered
192
+
188
193
  ## Research Task Deliverables
189
194
 
190
195
  Research/analysis tasks create deliverable files specified in metadata "Provides".
@@ -293,6 +298,10 @@ When discovering similar functions during existing code investigation, escalate
293
298
  - Escalate when: design deviation, similar functions found, test environment missing
294
299
  - Stop after implementation and test creation — quality checks and commits are handled separately
295
300
 
301
+ ## Completion Criteria
302
+
303
+ - [ ] Final response is a single JSON with status `completed` or `escalation_needed`
304
+
296
305
  ## Completion Gate [BLOCKING]
297
306
 
298
307
  ☐ All completion criteria met with evidence