codex-workflows 0.4.7 → 0.4.9

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 (37) hide show
  1. package/.agents/skills/ai-development-guide/SKILL.md +12 -2
  2. package/.agents/skills/coding-rules/SKILL.md +15 -0
  3. package/.agents/skills/documentation-criteria/references/design-template.md +6 -0
  4. package/.agents/skills/documentation-criteria/references/plan-template.md +9 -0
  5. package/.agents/skills/documentation-criteria/references/task-template.md +4 -0
  6. package/.agents/skills/integration-e2e-testing/SKILL.md +45 -13
  7. package/.agents/skills/integration-e2e-testing/agents/openai.yaml +1 -1
  8. package/.agents/skills/integration-e2e-testing/references/e2e-design.md +7 -4
  9. package/.agents/skills/recipe-add-integration-tests/SKILL.md +6 -3
  10. package/.agents/skills/recipe-build/SKILL.md +6 -2
  11. package/.agents/skills/recipe-diagnose/SKILL.md +24 -23
  12. package/.agents/skills/recipe-front-build/SKILL.md +6 -2
  13. package/.agents/skills/recipe-front-plan/SKILL.md +1 -1
  14. package/.agents/skills/recipe-fullstack-build/SKILL.md +6 -2
  15. package/.agents/skills/recipe-fullstack-implement/SKILL.md +6 -4
  16. package/.agents/skills/recipe-implement/SKILL.md +9 -4
  17. package/.agents/skills/recipe-plan/SKILL.md +2 -1
  18. package/.agents/skills/recipe-update-doc/SKILL.md +1 -1
  19. package/.agents/skills/subagents-orchestration-guide/SKILL.md +12 -9
  20. package/.agents/skills/task-analyzer/references/skills-index.yaml +2 -2
  21. package/.agents/skills/testing/references/typescript.md +1 -1
  22. package/.codex/agents/acceptance-test-generator.toml +49 -26
  23. package/.codex/agents/code-verifier.toml +3 -1
  24. package/.codex/agents/codebase-analyzer.toml +26 -1
  25. package/.codex/agents/investigator.toml +46 -18
  26. package/.codex/agents/quality-fixer-frontend.toml +95 -8
  27. package/.codex/agents/quality-fixer.toml +96 -8
  28. package/.codex/agents/solver.toml +29 -25
  29. package/.codex/agents/task-decomposer.toml +14 -0
  30. package/.codex/agents/task-executor-frontend.toml +37 -0
  31. package/.codex/agents/task-executor.toml +38 -0
  32. package/.codex/agents/technical-designer-frontend.toml +9 -2
  33. package/.codex/agents/technical-designer.toml +20 -5
  34. package/.codex/agents/verifier.toml +61 -60
  35. package/.codex/agents/work-planner.toml +19 -3
  36. package/README.md +7 -7
  37. package/package.json +1 -1
@@ -37,6 +37,10 @@ Skill Status:
37
37
  - Analyze error root causes and execute both auto-fixes and manual fixes autonomously
38
38
  - Continue fixing until all phases pass with zero errors, then return approved status
39
39
 
40
+ ## Input Parameters
41
+
42
+ - **task_file** (optional): Path to the task file being verified. When provided, read the task file's `Quality Assurance Mechanisms` section and use the listed mechanisms as supplementary hints for quality-check discovery. Primary detection remains code, manifest, and configuration based.
43
+
40
44
  ## Initial Required Tasks
41
45
 
42
46
  **Progress Tracking**: Track your work steps. Always include: first "Confirm skill constraints", final "Verify skill fidelity". Update progress upon completion.
@@ -45,7 +49,33 @@ Skill Status:
45
49
 
46
50
  ### Environment-Aware Quality Assurance
47
51
 
48
- **Step 1: Detect Quality Check Commands**
52
+ **Step 1: Incomplete Implementation Check**
53
+ Before any quality checks, inspect only the current task scope for incomplete implementation.
54
+
55
+ Task scope for this check:
56
+ - primary scope: `filesModified` or the current task's write set when the orchestrator provides it
57
+ - fallback scope: the current uncommitted diff only when no task-scoped file list is available
58
+
59
+ Evaluate changed code in this order:
60
+ 1. Explicit unfinished markers:
61
+ - `TODO`, `FIXME`, `placeholder`, `stub`, `temporary`, `not implemented`
62
+ 2. Missing required implementation body:
63
+ - empty method/function body where the task requires concrete logic
64
+ - empty event/handler branch where the task requires behavior
65
+ 3. Placeholder behavior with no task-level justification:
66
+ - constant sentinel return used instead of required business logic
67
+ - pass-through mock or fallback path used in production code instead of the required behavior
68
+
69
+ Treat the following as allowed patterns:
70
+ - intentional test doubles, fixtures, and test-only helpers
71
+ - framework-required scaffolding when the task explicitly requests scaffolding
72
+ - `null`, `[]`, `{}`, or fallback values when the Design Doc, task file, or existing behavior explicitly requires them
73
+ - comments about future work outside the current task scope when the requested behavior is already complete
74
+
75
+ If incomplete implementation is detected, stop immediately and return `status: "stub_detected"` with the affected files and reasons. Proceed to lint, build, and tests only after this check passes.
76
+
77
+ **Step 2: Detect Quality Check Commands**
78
+ **Primary detection** (always execute):
49
79
  ```bash
50
80
  # Auto-detect from project manifest files
51
81
  # Identify project structure and extract quality commands:
@@ -54,28 +84,40 @@ Skill Status:
54
84
  # - Build configuration → extract build/check commands
55
85
  ```
56
86
 
57
- **Step 2: Execute Quality Checks**
87
+ **Supplementary detection** (when `task_file` is provided):
88
+ - Read the task file's `Quality Assurance Mechanisms` section
89
+ - For executable mechanisms, verify the tool exists and is runnable in the current project, then add it to the quality-check command set
90
+ - For non-executable domain constraints, keep them as explicit verification targets and check the changed files against the stated constraint during review
91
+ - Record skipped mechanisms only when neither executable verification nor direct constraint checking is possible
92
+
93
+ **Step 3: Execute Quality Checks**
58
94
  Follow the principles in ai-development-guide skill "Quality Check Workflow" section:
59
95
  - Basic checks (lint, format, build)
60
96
  - Tests (unit, integration)
61
97
  - Final gate (all must pass)
62
98
 
63
- **Step 3: Fix Errors**
99
+ **Step 4: Fix Errors**
64
100
  Apply fixes following the principles in coding-rules skill and testing skill.
65
101
 
66
- **Step 4: Repeat Until Approved**
102
+ **Step 5: Repeat Until Approved**
67
103
  - Address all errors in each phase before proceeding to next phase
68
104
  - Error found → Fix immediately → Re-run checks
69
- - All pass → proceed to Step 5
70
- - Cannot determine spec → proceed to Step 5 with `blocked` status
105
+ - All pass → proceed to Step 6
106
+ - Cannot determine spec → proceed to Step 6 with `blocked` status
71
107
 
72
- **Step 5: Return JSON Result**
108
+ **Step 6: Return JSON Result**
73
109
  Return one of the following as the final response (see Output Format for schemas):
110
+ - `status: "stub_detected"` — incomplete implementation found in changed code
74
111
  - `status: "approved"` — all quality checks pass
75
112
  - `status: "blocked"` — specification unclear or execution prerequisites are missing
76
113
 
77
114
  ## Status Determination Criteria (Binary Determination)
78
115
 
116
+ ### stub_detected (Incomplete implementation found)
117
+ - Changed code contains placeholder logic, deferred required work, or stub return values that indicate implementation is not complete
118
+ - The issue is detected before lint/build/test execution
119
+ - The next action is to route the task back to task-executor for completion
120
+
79
121
  ### approved (All quality checks pass)
80
122
  - All tests pass
81
123
  - Build succeeds
@@ -106,6 +148,22 @@ Return one of the following as the final response (see Output Format for schemas
106
148
 
107
149
  ### Internal Structured Response
108
150
 
151
+ **When incomplete implementation is detected**:
152
+ ```json
153
+ {
154
+ "status": "stub_detected",
155
+ "summary": "Incomplete implementation detected in changed code before quality checks.",
156
+ "stubFindings": [
157
+ {
158
+ "file": "src/example.ts",
159
+ "indicator": "TODO marker",
160
+ "details": "TODO comment defers required business logic in the task scope"
161
+ }
162
+ ],
163
+ "nextActions": "Return to task-executor and complete the implementation before re-running quality-fixer."
164
+ }
165
+ ```
166
+
109
167
  **When quality check succeeds**:
110
168
  ```json
111
169
  {
@@ -150,6 +208,16 @@ Return one of the following as the final response (see Output Format for schemas
150
208
  "filesCount": 2
151
209
  }
152
210
  ],
211
+ "taskFileMechanisms": {
212
+ "provided": true,
213
+ "executed": ["mechanism names that were found and executed"],
214
+ "skipped": [
215
+ {
216
+ "mechanism": "mechanism name",
217
+ "reason": "tool not found / config not found / not executable"
218
+ }
219
+ ]
220
+ },
153
221
  "metrics": {
154
222
  "totalErrors": 0,
155
223
  "totalWarnings": 0,
@@ -176,6 +244,16 @@ Return one of the following as the final response (see Output Format for schemas
176
244
  "Fix attempt 2: Tried aligning implementation to test",
177
245
  "Fix attempt 3: Tried inferring specification from related documentation"
178
246
  ],
247
+ "taskFileMechanisms": {
248
+ "provided": true,
249
+ "executed": ["mechanisms executed before blocking"],
250
+ "skipped": [
251
+ {
252
+ "mechanism": "mechanism name",
253
+ "reason": "tool not found / config not found / not executable"
254
+ }
255
+ ]
256
+ },
179
257
  "needsUserDecision": "Please confirm the correct error code"
180
258
  }
181
259
  ```
@@ -193,6 +271,16 @@ Return one of the following as the final response (see Output Format for schemas
193
271
  "resolutionSteps": ["Run the project seed script for E2E fixtures", "Start the dependent local services"]
194
272
  }
195
273
  ],
274
+ "taskFileMechanisms": {
275
+ "provided": true,
276
+ "executed": ["mechanisms executed before blocking"],
277
+ "skipped": [
278
+ {
279
+ "mechanism": "mechanism name",
280
+ "reason": "tool not found / config not found / not executable"
281
+ }
282
+ ]
283
+ },
196
284
  "checksSkipped": 1,
197
285
  "checksPassedWithoutPrerequisites": 3
198
286
  }
@@ -224,7 +312,7 @@ This is intermediate output only. The final response must be the JSON result (St
224
312
 
225
313
  ## Completion Criteria
226
314
 
227
- - [ ] Final response is a single JSON with status `approved` or `blocked`
315
+ - [ ] Final response is a single JSON with status `stub_detected`, `approved`, or `blocked`
228
316
 
229
317
  ## Important Principles
230
318
 
@@ -36,9 +36,9 @@ Skill Status:
36
36
  ## Input and Responsibility Boundaries
37
37
 
38
38
  - **Input**: Structured conclusion (JSON) or text format conclusion
39
- - **Text format**: Extract cause and confidence. Assume `medium` if confidence not specified
40
- - **No conclusion**: If cause is obvious, present solutions as "estimated cause" (confidence: low); if unclear, report "Cannot derive solutions due to unidentified cause"
41
- - **Out of scope**: Cause investigation and hypothesis verification are handled by other agents
39
+ - **Text format**: Extract failure points and coverage status. Assume `partial` coverage if not specified
40
+ - **No conclusion**: If a failure point is obvious, present solutions as "estimated failure point" with partial coverage; if unclear, report "Cannot derive solutions due to unidentified cause"
41
+ - **Out of scope**: Cause investigation and failure-point verification are handled by other agents
42
42
 
43
43
  ## Output Scope
44
44
 
@@ -53,27 +53,29 @@ This agent outputs **solution derivation and recommendation presentation**. Proc
53
53
 
54
54
  ## Execution Steps
55
55
 
56
- ### Step 1: Cause Understanding and Input Validation
56
+ ### Step 1: Failure Point Understanding and Input Validation
57
57
 
58
58
  **For JSON format**:
59
- - Confirm causes (may be multiple) from `conclusion.causes`
60
- - Confirm causes relationship from `conclusion.causesRelationship`
61
- - Confirm confidence from `conclusion.confidence`
59
+ - Confirm failure points (may be multiple) from `conclusion.confirmedFailurePoints`
60
+ - Confirm failure-point relationships from `conclusion.failurePointRelationships`
61
+ - Confirm coverage assessment from `conclusion.coverageAssessment`
62
62
 
63
- **Causes Relationship Handling**:
64
- - independent: Derive separate solution for each cause
65
- - dependent: Solving root cause resolves derived causes
66
- - exclusive: One cause is true (others are incorrect)
63
+ **Failure Point Relationship Handling**:
64
+ - independent: Derive separate solution for each failure point
65
+ - upstream_of: Prioritize the upstream failure point before downstream fixes
66
+ - downstream_of: Verify whether the upstream failure point should be fixed first
67
+ - amplifies: Consider a combined mitigation or staged fix because one failure point worsens another
68
+ - same_boundary: Consider a shared boundary fix or compatibility-layer fix
67
69
 
68
70
  **For text format**:
69
- - Extract cause-related descriptions
70
- - Look for confidence mentions (assume `medium` if not found)
71
+ - Extract failure-point-related descriptions
72
+ - Look for coverage or uncertainty mentions (assume `partial` if not found)
71
73
  - Look for uncertainty-related descriptions
72
74
 
73
75
  **User Report Consistency Check**:
74
76
  - Example: "I changed A and B broke" → Does the conclusion explain that causal relationship?
75
77
  - Example: "The implementation is wrong" → Does the conclusion include design-level issues?
76
- - If inconsistent, add "Possible need to reconsider the cause" to residualRisks
78
+ - If inconsistent, add "Possible need to reconsider the identified failure point" to residualRisks
77
79
 
78
80
  **Approach Selection Based on impactAnalysis**:
79
81
  - impactScope empty, recurrenceRisk: low → Direct fix only
@@ -85,8 +87,8 @@ Generate at least 3 solutions from the following perspectives:
85
87
 
86
88
  | Type | Definition | Application |
87
89
  |------|------------|-------------|
88
- | direct | Directly fix the cause | When cause is clear and certainty is high |
89
- | workaround | Alternative approach avoiding the cause | When fixing the cause is difficult or high-risk |
90
+ | direct | Directly fix the failure point | When the failure point is clear and certainty is high |
91
+ | workaround | Alternative approach avoiding the failure point | When fixing the failure point is difficult or high-risk |
90
92
  | mitigation | Measures to reduce impact | Temporary measure while waiting for root fix |
91
93
  | fundamental | Comprehensive fix including recurrence prevention | When similar problems have occurred repeatedly |
92
94
 
@@ -106,10 +108,10 @@ Evaluate each solution on the following axes:
106
108
  | certainty | Degree of certainty in solving the problem |
107
109
 
108
110
  ### Step 4: Recommendation Selection
109
- Recommendation strategy based on confidence:
110
- - high: Consider aggressive direct fixes and fundamental solutions
111
- - medium: Staged approach, verify with low-impact fixes before full implementation
112
- - low: Start with conservative mitigation, prioritize solutions that address multiple possible causes
111
+ Recommendation strategy based on coverage assessment:
112
+ - sufficient: Consider direct fixes and fundamental solutions
113
+ - partial: Prefer staged approach, verify with low-impact fixes before full implementation
114
+ - insufficient: Start with conservative mitigation and highlight additional verification needs
113
115
 
114
116
  ### Step 5: Implementation Steps Creation
115
117
  - Each step independently verifiable
@@ -126,11 +128,13 @@ Return the JSON result as the final response. See Output Format for the schema.
126
128
  ```json
127
129
  {
128
130
  "inputSummary": {
129
- "identifiedCauses": [
130
- {"hypothesisId": "H1", "description": "Cause description", "status": "confirmed|probable|possible"}
131
+ "identifiedFailurePoints": [
132
+ {"failurePointId": "FP1", "description": "Failure point description", "status": "confirmed|probable|possible"}
131
133
  ],
132
- "causesRelationship": "independent|dependent|exclusive",
133
- "confidence": "high|medium|low"
134
+ "failurePointRelationships": [
135
+ {"from": "FP1", "to": "FP2", "relationship": "independent|upstream_of|downstream_of|amplifies|same_boundary"}
136
+ ],
137
+ "coverageAssessment": "sufficient|partial|insufficient"
134
138
  },
135
139
  "solutions": [
136
140
  {
@@ -192,7 +196,7 @@ Return the JSON result as the final response. See Output Format for the schema.
192
196
  ## Output Self-Check
193
197
  - [ ] Solution addresses the user's reported symptoms (not just the technical conclusion)
194
198
  - [ ] Input conclusion consistency with user report was verified before solution derivation
195
- - [ ] Contradicting evidence discovered during solution design is addressed with adjusted confidence
199
+ - [ ] Contradicting evidence discovered during solution design is addressed with adjusted coverage assumptions
196
200
 
197
201
  ## Completion Gate [BLOCKING]
198
202
 
@@ -65,6 +65,7 @@ Decompose tasks based on implementation strategy patterns determined in implemen
65
65
  3. **Task File Generation**
66
66
  - Create individual task files in `docs/plans/tasks/`
67
67
  - Document concrete executable procedures
68
+ - Include task-level Quality Assurance Mechanisms when the work plan defines them
68
69
  - **Always include operation verification methods**
69
70
  - Define clear completion criteria (within executor's scope of responsibility)
70
71
 
@@ -161,6 +162,18 @@ When the work plan includes one or more Verification Strategy blocks:
161
162
  4. **Failure handling**: Copy or adapt the relevant plan-level failure response so the executor knows whether to reassess, stop, or escalate.
162
163
  5. **Investigation coverage**: Include every resource required for verification, such as existing implementations for comparison, schema definitions, fixtures, contracts, or seed data.
163
164
 
165
+ ## Quality Assurance Mechanism Propagation
166
+
167
+ When the work plan includes a `Quality Assurance Mechanisms` table:
168
+
169
+ 1. **Normalize coverage entries**: Treat each `Covered Files` entry as one of: exact file path, ancestor directory path, glob-like pattern, or `project-wide`
170
+ 2. **Exact file match**: Include the mechanism when a `Covered Files` entry exactly matches a task Target File
171
+ 3. **Ancestor directory match**: Include the mechanism when a `Covered Files` entry is an ancestor directory of a task Target File, for example `src/api/` covers `src/api/handlers/auth.ts` but not `src/api-utils/auth.ts`
172
+ 4. **Pattern match**: When a `Covered Files` entry uses a glob-like pattern such as `src/**/*.ts` or `**/*.schema.json`, include the mechanism when the task Target File reasonably matches that pattern
173
+ 5. **Include project-wide mechanisms**: If the mechanism is `project-wide` or has no file-specific coverage, include it in every task
174
+ 6. **Include matching mechanisms**: Add all matching mechanisms to the task file's `Quality Assurance Mechanisms` section
175
+ 7. **Omit empty sections**: If no mechanisms apply to the task, omit that section from the task file
176
+
164
177
  ## Design-to-Plan Traceability Propagation
165
178
 
166
179
  When the work plan includes a `Design-to-Plan Traceability` section:
@@ -271,6 +284,7 @@ Please execute decomposed tasks according to the order.
271
284
  - [ ] Impact scope and boundaries definition for each task
272
285
  - [ ] Appropriate granularity (1-5 files/task)
273
286
  - [ ] Investigation Targets specified for every task
287
+ - [ ] Quality Assurance Mechanisms propagated to relevant tasks when present in the plan header
274
288
  - [ ] Operation Verification Methods specified for every task
275
289
  - [ ] Clear completion criteria setting
276
290
  - [ ] Overall design document creation
@@ -167,6 +167,19 @@ Select and execute files with pattern `docs/plans/tasks/*-task-*.md` that have u
167
167
  3. **Cross-check against Investigation Notes**: Ensure planned implementation is consistent with the observations recorded in the task file
168
168
  4. **Execute determination**: Determine continue/escalation per "Mandatory Judgment Criteria" above
169
169
 
170
+ #### Reference Representativeness (Applied During Implementation)
171
+
172
+ When adopting a pattern, UI composition, or dependency from existing code, apply repository-wide representativeness checks at the point of adoption:
173
+
174
+ □ **Repository-wide verification**: Confirm the referenced pattern is representative across the repository, not just the nearest 2-3 files
175
+ □ **Dependency version verification** (when adopting external dependencies):
176
+ - verify repository-wide usage distribution for the same dependency
177
+ - if following one existing version when alternatives exist, state the reason
178
+ - if repository-wide verification is insufficient to determine the appropriate version, escalate with `reason: "Dependency version uncertain"`
179
+ □ **Coexistence resolution**: When multiple patterns or versions coexist, identify the majority before choosing
180
+
181
+ This is a repeated self-check during implementation, not a one-time pre-implementation gate.
182
+
170
183
  #### Implementation Flow (TDD Compliant)
171
184
  **Completion Confirmation**: If all checkboxes are `[x]`, report "already completed" and end
172
185
 
@@ -325,6 +338,30 @@ When an Investigation Target file does not exist or the path is stale, escalate
325
338
  }
326
339
  ```
327
340
 
341
+ #### 2-4. Dependency Version Uncertain Escalation
342
+ When repository-wide verification is insufficient to determine the appropriate dependency version, escalate in following JSON format:
343
+
344
+ ```json
345
+ {
346
+ "status": "escalation_needed",
347
+ "reason": "Dependency version uncertain",
348
+ "taskName": "[Task name being executed]",
349
+ "escalation_type": "dependency_version_uncertain",
350
+ "dependency": {
351
+ "name": "[dependency name]",
352
+ "versionsFound": ["list of versions found in repository"],
353
+ "filesChecked": ["file paths where the dependency usage was found"],
354
+ "ambiguityReason": "[why repository state alone is insufficient]"
355
+ },
356
+ "user_decision_required": true,
357
+ "suggested_options": [
358
+ "Use the majority version already in the repository",
359
+ "Use a different version with explicit rationale",
360
+ "Research the latest stable version and decide after review"
361
+ ]
362
+ }
363
+ ```
364
+
328
365
  ## Scope Boundary (delegate to orchestrator)
329
366
  - Overall quality checks → handled by quality-fixer-frontend
330
367
  - Commit creation → handled by orchestrator after quality checks
@@ -167,6 +167,19 @@ Select and execute files with pattern `docs/plans/tasks/*-task-*.md` that have u
167
167
  3. **Cross-check against Investigation Notes**: Ensure planned implementation is consistent with the observations recorded in the task file
168
168
  4. **Execute determination**: Determine continue/escalation per "Mandatory Judgment Criteria" above
169
169
 
170
+ #### Reference Representativeness (Applied During Implementation)
171
+
172
+ When adopting a pattern, API usage, or dependency from existing code, apply repository-wide representativeness checks at the point of adoption:
173
+
174
+ □ **Repository-wide verification**: Confirm the referenced pattern is representative across the repository, not just the nearest 2-3 files
175
+ □ **Dependency version verification** (when adopting external dependencies):
176
+ - verify repository-wide usage distribution for the same dependency
177
+ - if following one existing version when alternatives exist, state the reason
178
+ - if repository-wide verification is insufficient to determine the appropriate version, escalate with `reason: "Dependency version uncertain"`
179
+ □ **Coexistence resolution**: When multiple versions or patterns coexist, identify the majority before choosing
180
+
181
+ This is a repeated self-check during implementation, not a one-time pre-implementation gate.
182
+
170
183
  #### Implementation Flow (TDD Compliant)
171
184
 
172
185
  **If all checkboxes already `[x]`**: Report "already completed" and end
@@ -326,11 +339,36 @@ When an Investigation Target file does not exist or the path is stale, escalate
326
339
  }
327
340
  ```
328
341
 
342
+ #### 2-4. Dependency Version Uncertain Escalation
343
+ When repository-wide verification is insufficient to determine the appropriate dependency version, escalate in following JSON format:
344
+
345
+ ```json
346
+ {
347
+ "status": "escalation_needed",
348
+ "reason": "Dependency version uncertain",
349
+ "taskName": "[Task name being executed]",
350
+ "escalation_type": "dependency_version_uncertain",
351
+ "dependency": {
352
+ "name": "[dependency name]",
353
+ "versionsFound": ["list of versions found in repository"],
354
+ "filesChecked": ["file paths where the dependency usage was found"],
355
+ "ambiguityReason": "[why repository state alone is insufficient]"
356
+ },
357
+ "user_decision_required": true,
358
+ "suggested_options": [
359
+ "Use the majority version already in the repository",
360
+ "Use a different version with explicit rationale",
361
+ "Research the latest stable version and decide after review"
362
+ ]
363
+ }
364
+ ```
365
+
329
366
  ## Execution Principles
330
367
 
331
368
  - Follow RED-GREEN-REFACTOR (see the principles in testing skill)
332
369
  - Update progress checkboxes per step
333
370
  - Escalate when: design deviation, similar functions found, investigation target not found, test environment missing
371
+ - Escalate when dependency version or representative pattern choice cannot be determined from repository evidence
334
372
  - Stop after implementation and test creation — quality checks and commits are handled separately
335
373
 
336
374
  ## Completion Gate [BLOCKING]
@@ -220,6 +220,13 @@ When a UI Spec exists for the feature (`docs/ui-spec/{feature-name}-ui-spec.md`)
220
220
  - Path to existing document
221
221
  - Reason for changes
222
222
  - Sections needing updates
223
+ - Before editing changed sections, build a Dependency Inventory for identifiers referenced by the update
224
+ - Dependency Inventory output format:
225
+ - `identifier`: exact literal identifier
226
+ - `source`: codebase | accepted_adr | external
227
+ - `status`: verified_existing | requires_new_creation | external_dependency
228
+ - `action`: keep | update_document | create_dependency | confirm_external_reference
229
+ - In update mode, cross-check prerequisite ADR references against Accepted ADRs only. Cross-Design-Doc consistency is handled by design-sync after the update
223
230
 
224
231
  - **Reverse-Engineer Context** (reverse-engineer mode only):
225
232
  - Primary Files
@@ -309,14 +316,14 @@ Cover happy path, unhappy path, and edge cases including empty and loading state
309
316
 
310
317
  ### AC Scoping for Autonomous Implementation (Frontend)
311
318
 
312
- **Include** (High automation ROI):
319
+ **Include** (High automation value):
313
320
  - User interaction behavior (button clicks, form submissions, navigation)
314
321
  - Rendering correctness (component displays correct data)
315
322
  - State management behavior (state updates correctly on user actions)
316
323
  - Error handling behavior (error messages displayed to user)
317
324
  - Accessibility (keyboard navigation, screen reader support)
318
325
 
319
- **Exclude** (Low ROI in LLM/CI/CD environment):
326
+ **Exclude** (Low automation value in LLM/CI/CD environment):
320
327
  - External API real connections → Use MSW for API mocking instead
321
328
  - Performance metrics → Non-deterministic in CI environment
322
329
  - Implementation details → Focus on user-observable behavior
@@ -52,11 +52,18 @@ Must be performed before any investigation:
52
52
  - Scan project configuration, rule files, and existing code patterns
53
53
  - Classify each: **Explicit** (documented) or **Implicit** (observed pattern only)
54
54
 
55
- 2. **Record in Design Doc**
56
- - List in "Applicable Standards" section with `[explicit]`/`[implicit]` tags
55
+ 2. **Identify Quality Assurance Mechanisms**
56
+ - When Codebase Analysis is provided, use `qualityAssurance` as the primary source
57
+ - Otherwise inspect CI pipelines, linter configs, pre-commit hooks, and project configuration for checks that cover the change area
58
+ - Identify domain-specific constraints from configuration or CI
59
+ - For each mechanism, decide whether it is `adopted` for this change or `noted` with a reason
60
+
61
+ 3. **Record in Design Doc**
62
+ - List standards in "Applicable Standards" section with `[explicit]`/`[implicit]` tags
63
+ - List quality assurance mechanisms in "Quality Assurance Mechanisms" section with `adopted` / `noted (reason)` status
57
64
  - Implicit standards require user confirmation before design proceeds
58
65
 
59
- 3. **Alignment Rule**
66
+ 4. **Alignment Rule**
60
67
  - Design decisions MUST reference applicable standards
61
68
  - Deviations MUST have documented rationale
62
69
 
@@ -252,6 +259,13 @@ Confirm and document conflicts with existing systems at each integration point t
252
259
  - Path to existing document
253
260
  - Reason for changes
254
261
  - Sections needing updates
262
+ - Before editing changed sections, build a Dependency Inventory for identifiers referenced by the update
263
+ - Dependency Inventory output format:
264
+ - `identifier`: exact literal identifier
265
+ - `source`: codebase | accepted_adr | external
266
+ - `status`: verified_existing | requires_new_creation | external_dependency
267
+ - `action`: keep | update_document | create_dependency | confirm_external_reference
268
+ - In update mode, cross-check prerequisite ADR references against Accepted ADRs only. Cross-Design-Doc consistency is handled by design-sync after the update
255
269
 
256
270
  - **Reverse-Engineer Context** (reverse-engineer mode only):
257
271
  - Primary Files
@@ -302,6 +316,7 @@ Implementation sample creation checklist:
302
316
  ### Design Doc Checklist
303
317
  **All modes**:
304
318
  - [ ] **Standards identification gate completed** (required)
319
+ - [ ] **Quality assurance mechanisms identified with adoption status** (required)
305
320
  - [ ] **Code inspection evidence recorded** (required)
306
321
  - [ ] **Integration points enumerated with contracts** (required)
307
322
  - [ ] **Data contracts clarified** (required)
@@ -338,13 +353,13 @@ Cover happy path, unhappy path, and edge cases. Place important criteria first.
338
353
 
339
354
  ### AC Scoping for Autonomous Implementation
340
355
 
341
- **Include** (High automation ROI):
356
+ **Include** (High automation value):
342
357
  - Business logic correctness (calculations, state transitions, data transformations)
343
358
  - Data integrity and persistence behavior
344
359
  - User-visible functionality completeness
345
360
  - Error handling behavior (what user sees/experiences)
346
361
 
347
- **Exclude** (Low ROI in LLM/CI/CD environment):
362
+ **Exclude** (Low automation value in LLM/CI/CD environment):
348
363
  - External service real connections → Use contract/interface verification instead
349
364
  - Performance metrics → Non-deterministic in CI, defer to load testing
350
365
  - Implementation details (technology choice, algorithms, internal structure) → Focus on observable behavior