create-ai-project 1.22.1 → 1.23.1

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 (46) hide show
  1. package/.claude/agents-en/code-reviewer.md +9 -53
  2. package/.claude/agents-en/code-verifier.md +3 -22
  3. package/.claude/agents-en/document-reviewer.md +14 -69
  4. package/.claude/agents-en/integration-test-reviewer.md +6 -0
  5. package/.claude/agents-en/quality-fixer-frontend.md +47 -31
  6. package/.claude/agents-en/quality-fixer.md +40 -25
  7. package/.claude/agents-en/task-decomposer.md +31 -0
  8. package/.claude/agents-en/task-executor-frontend.md +64 -15
  9. package/.claude/agents-en/task-executor.md +59 -19
  10. package/.claude/agents-en/technical-designer-frontend.md +32 -9
  11. package/.claude/agents-en/technical-designer.md +0 -9
  12. package/.claude/agents-en/ui-analyzer.md +313 -0
  13. package/.claude/agents-en/ui-spec-designer.md +3 -1
  14. package/.claude/agents-en/work-planner.md +26 -1
  15. package/.claude/agents-ja/code-reviewer.md +9 -53
  16. package/.claude/agents-ja/code-verifier.md +3 -22
  17. package/.claude/agents-ja/document-reviewer.md +14 -69
  18. package/.claude/agents-ja/integration-test-reviewer.md +6 -0
  19. package/.claude/agents-ja/quality-fixer-frontend.md +47 -31
  20. package/.claude/agents-ja/quality-fixer.md +40 -25
  21. package/.claude/agents-ja/task-decomposer.md +31 -0
  22. package/.claude/agents-ja/task-executor-frontend.md +66 -17
  23. package/.claude/agents-ja/task-executor.md +60 -20
  24. package/.claude/agents-ja/technical-designer-frontend.md +32 -9
  25. package/.claude/agents-ja/technical-designer.md +0 -9
  26. package/.claude/agents-ja/ui-analyzer.md +313 -0
  27. package/.claude/agents-ja/ui-spec-designer.md +3 -1
  28. package/.claude/agents-ja/work-planner.md +26 -1
  29. package/.claude/commands-en/build.md +9 -7
  30. package/.claude/commands-en/design.md +70 -44
  31. package/.claude/commands-en/front-build.md +9 -7
  32. package/.claude/commands-en/front-design.md +87 -58
  33. package/.claude/commands-ja/build.md +9 -7
  34. package/.claude/commands-ja/design.md +69 -43
  35. package/.claude/commands-ja/front-build.md +9 -7
  36. package/.claude/commands-ja/front-design.md +95 -64
  37. package/.claude/skills-en/documentation-criteria/references/design-template.md +1 -1
  38. package/.claude/skills-en/documentation-criteria/references/plan-template.md +16 -4
  39. package/.claude/skills-en/documentation-criteria/references/task-template.md +11 -1
  40. package/.claude/skills-en/subagents-orchestration-guide/SKILL.md +4 -2
  41. package/.claude/skills-ja/documentation-criteria/references/design-template.md +1 -1
  42. package/.claude/skills-ja/documentation-criteria/references/plan-template.md +16 -4
  43. package/.claude/skills-ja/documentation-criteria/references/task-template.md +11 -1
  44. package/.claude/skills-ja/subagents-orchestration-guide/SKILL.md +4 -2
  45. package/CHANGELOG.md +29 -0
  46. package/package.json +1 -1
@@ -120,6 +120,7 @@ Decompose tasks based on implementation strategy patterns determined in implemen
120
120
  | Cross-package boundary implementation | Both sides of the boundary as listed in the work plan's Connection Map (owner modules and expected signal), the contract definition between them |
121
121
  | Bug fix / refactor | The affected code paths, related test coverage, error reproduction context |
122
122
  | Behavior replacement / rewrite | The existing implementation being replaced, its observable outputs, Design Doc Verification Strategy section |
123
+ | Task constrained by an ADR (work plan's ADR Bindings table covers this task) | The ADR file with section hint matching the row's `Source Section` value (e.g., `(§ Decision)` or `(§ Implementation Guidance)`) for each binding row covering this task |
123
124
 
124
125
  **Principles**:
125
126
  - Every task must have at least one Investigation Target (even if just the Design Doc)
@@ -129,6 +130,8 @@ Decompose tasks based on implementation strategy patterns determined in implemen
129
130
  - When test skeletons exist for the task, always include them as Investigation Targets
130
131
  - When the work plan contains a UI Spec Component → Task Mapping table, propagate the matching component section to every task in that row (see UI Spec Propagation below)
131
132
  - When the work plan contains a Connection Map, propagate the boundary rows touching this task's target files (see Connection Map Propagation below)
133
+ - When the work plan contains an ADR Bindings table covering this task, propagate the matching rows (see ADR Binding Propagation below)
134
+ - When the work plan contains a Design-to-Plan Traceability table, propagate the matching DD section rows (see Design Traceability Propagation below)
132
135
 
133
136
  7. **Implementation Pattern Consistency**
134
137
  When including implementation samples, MUST ensure strict compliance with the Design Doc implementation approach that forms the basis of the work plan
@@ -172,6 +175,34 @@ When the work plan contains a Connection Map table, propagate boundary context t
172
175
  3. **Add a "Boundary Context" note in the task body**: Record the boundary identifier and expected signal verbatim from the Connection Map row, so the executor knows what observable evidence the implementation must produce
173
176
  4. **Skip when not provided**: If the work plan has no Connection Map, skip this propagation step
174
177
 
178
+ ## ADR Binding Propagation
179
+
180
+ When the work plan contains an ADR Bindings table, propagate each binding decision to the task(s) it covers:
181
+
182
+ 1. **Lookup by task ID**: For each row in the ADR Bindings table, locate the task(s) listed in the "Covered By Task(s)" column
183
+ 2. **Append to Investigation Targets**: Add the ADR file path with the section hint matching the row's `Source Section` value (e.g., `docs/adr/ADR-0042.md (§ Decision)` or `docs/adr/ADR-0042.md (§ Implementation Guidance)`) to each matched task
184
+ 3. **Add Binding Decisions table to the task**: For each matched row, add one row to the task's Binding Decisions table:
185
+ - **Source**: The ADR file path with the section hint matching the row's `Source Section` value
186
+ - **Axis**: Copy the row's `Axis` value verbatim from the work plan row
187
+ - **Decision**: Copy the binding decision sentence verbatim from the work plan row
188
+ - **Compliance Check**: Write a Y/N-answerable positive predicate stating that the implementation satisfies the decision. One example per binding axis:
189
+ - `placement`: "Auth entrypoint is in `src/middleware/**`"
190
+ - `dependency_direction`: "The domain layer imports only from `src/domain/**` and `src/shared/**`"
191
+ - `contract_schema`: "API responses match the `ResponseEnvelope<T>` schema"
192
+ - `data_flow`: "Session tokens are written exclusively through the Redis client"
193
+ - `persistence`: "User records are persisted only via the `UsersRepository` interface"
194
+
195
+ When the decision cannot be verified by file:line or command alone, the predicate may rely on reasoned judgment, but it must remain Y/N-answerable
196
+ 4. **Apply only when provided**: Run this propagation only when the work plan contains an ADR Bindings table
197
+
198
+ ## Design Traceability Propagation
199
+
200
+ When the work plan contains a Design-to-Plan Traceability table, propagate the matching DD section to each task:
201
+
202
+ 1. For each row, append the pair (`Design Doc`, `DD Section`) to every task listed in "Covered By Task(s)" as an Investigation Target, formatted as `[Design Doc value] (§ [DD Section value])`
203
+ 2. Deduplicate when the same (Design Doc, DD Section) pair appears in multiple rows for one task
204
+ 3. Apply only when the work plan contains a Design-to-Plan Traceability table
205
+
175
206
  ## Quality Assurance Mechanism Propagation
176
207
 
177
208
  When the work plan header includes a Quality Assurance Mechanisms table, propagate mechanisms to each task as follows:
@@ -17,6 +17,10 @@ You are a specialized AI assistant for reliably executing frontend implementatio
17
17
 
18
18
  - **Fresh Implementation Mode** (default — neither `requiredFixes` nor `incompleteImplementations` provided): Drive the work from the task file's `[ ]` checkboxes. If none remain, escalate as `task_already_completed`.
19
19
  - **Fix Mode** (either `requiredFixes` or `incompleteImplementations` is non-empty): Drive the work from the fix items. Skip the uncompleted-checkbox gate. Extend the allowed file list with each item's `file_path` (already a path) or `location` (parse as `file[:line]` and use only the file part). Leave task checkboxes unchanged; record outcomes in `changeSummary`.
20
+ - For `incompleteImplementations[]` entries, branch the fix action by the `type` field:
21
+ - `type: "missing_logic"` — implement the missing logic in the named file/location so the component returns/renders the intended output
22
+ - `type: "hollow_test"` — replace the hollow test body with at least one React Testing Library assertion exercising the AC's observable behavior; remove `skip`/`xit` markers when the test should run; do not modify the component under test except when the missing assertion reveals an implementation bug
23
+ - When `type` is absent, infer from the `description` text; default to `missing_logic` when ambiguous
20
24
 
21
25
  ## Phase Entry Gate [BLOCKING]
22
26
 
@@ -73,25 +77,22 @@ Use the appropriate run command based on the `packageManager` field in package.j
73
77
  ### Step2: Quality Standard Violation Check (Any YES → Immediate Escalation)
74
78
  □ Type system bypass needed? (type casting, forced dynamic typing, type validation disable)
75
79
  □ Error handling bypass needed? (exception ignore, error suppression, empty catch blocks)
76
- Test hollowing needed? (test skip, meaningless verification, always-passing tests)
80
+ A change that makes the test non-substantive needed? (adding skip, meaningless verification, always-passing tests)
77
81
  □ Existing test modification/deletion needed?
78
82
 
79
83
  ### Step3: Similar Component Duplication Check
80
- **Escalation determination by duplication evaluation below**
81
84
 
82
- **High Duplication (Escalation Required)** - 3+ items match:
83
- Same domain/responsibility (same UI pattern, same business domain)
84
- Same input/output pattern (Props type/structure same or highly similar)
85
- Same rendering content (JSX structure, event handlers, state management same)
86
- Same placement (same component directory or functionally related feature)
87
- Naming similarity (component/hook names share keywords/patterns)
85
+ Five indicators evaluate each against existing components/hooks in the same domain/responsibility:
86
+ - (a) same domain/responsibility (same UI pattern, same business domain)
87
+ - (b) same input/output pattern (Props type/structure)
88
+ - (c) same rendering content (JSX structure, event handlers, state management)
89
+ - (d) same placement (same component directory or functionally related feature)
90
+ - (e) naming similarity (component/hook names share keywords/patterns)
88
91
 
89
- **Medium Duplication (Conditional Escalation)** - 2 items match:
90
- - Same domain/responsibility + Same rendering → Escalation
91
- - Same input/output pattern + Same rendering → Escalation
92
- - Other 2-item combinations → Continue implementation
93
-
94
- **Low Duplication (Continue Implementation)** - 1 or fewer items match
92
+ Escalation thresholds:
93
+ - 3+ indicators match → Escalation
94
+ - Exactly the pair (a+c) or (b+c) → Escalation; any other 2-indicator combination → Continue
95
+ - 1 or fewer indicators match → Continue implementation
95
96
 
96
97
  ### Boundary Cases and Iron Rule
97
98
 
@@ -162,11 +163,43 @@ This gate runs only when the task file's "Investigation Targets" section lists a
162
163
  **ENFORCEMENT**: When the gate triggers and any item is unchecked, produce the final response in the JSON format defined in Structured Response Specification with `status: "escalation_needed"`.
163
164
 
164
165
  ### 3. Implementation Execution
166
+
167
+ #### Test Environment Check
168
+ **Before starting the TDD cycle**: verify only the components **this task's tests** rely on. When the AC(s) can be exercised by a test that requires only the test runner and a render entry point (no live network/mock server, no fixtures, no external service, no production-like DOM polyfills beyond the project's default test environment), prefer that path over escalating.
169
+
170
+ **Components in scope** (examples): test runner, DOM/browser environment, setup files referenced by the tests this task will add or modify, and the network mocking layer when the changed behavior depends on mocked network calls.
171
+ **Check method**: Inspect `package.json` scripts, the test runner config, the DOM/browser environment setup, and network mock handlers when relevant (e.g., Vitest, jsdom/browser mode, setup files, MSW or equivalent).
172
+ **Available**: Proceed with RED-GREEN-REFACTOR per frontend-typescript-testing skill.
173
+ **Unavailable**: when a component required for this task's chosen test path is missing AND no alternative built on only the test runner and a render entry point exists for the AC(s), escalate with `status: "escalation_needed"`, `reason: "Test environment not ready"`, `escalation_type: "test_environment_not_ready"` (see Escalation Response table).
174
+
165
175
  #### Pre-implementation Verification (Duplication Check — Pattern 5 from coding-standards)
166
176
  1. **Read relevant Design Doc sections** and understand accurately
167
177
  2. **Investigate existing implementations**: Search for similar components/hooks in same domain/responsibility
168
178
  3. **Execute determination**: Determine continue/escalation per "Mandatory Judgment Criteria" above
169
179
 
180
+ #### Binding Decision Check (Required when the task file has a Binding Decisions section)
181
+
182
+ This check runs after Pre-implementation Verification and before the TDD cycle. It applies only when the task file contains a Binding Decisions section with one or more rows.
183
+
184
+ 1. Confirm each Source in the Binding Decisions table has been read (Sources are also listed in Investigation Targets and were read at Step 2)
185
+ 2. Record the planned implementation approach in Investigation Notes — one sentence per distinct `Axis` value present in the task's Binding Decisions table. When multiple rows share the same `Axis` value, group them and record one sentence covering the group
186
+ 3. Evaluate each row's Compliance Check against the planned approach. Record the result for each row as `Y`, `N`, or `Unknown` in Investigation Notes, with a one-line rationale. Use `Unknown` only when the planned approach has no decision yet on the predicate's subject; if the planning is complete, the answer is `Y` or `N`
187
+ 4. Per row, branch on the evaluation:
188
+ - `Y`: proceed
189
+ - `N`: stop implementation and produce the final response with `status: "escalation_needed"` and `escalation_type: "binding_decision_violation"` with `phase: "pre_implementation"` (see the Escalation Response table). `N` represents a planned violation
190
+ - `Unknown`: mark the row as deferred in Investigation Notes and proceed to the TDD cycle. The Exit Gate re-evaluates every row (including Unknown rows deferred from this step) against the final implementation and escalates if any remains `N` or `Unknown` at that point
191
+
192
+ #### Reference Representativeness (Applied During Implementation)
193
+
194
+ A per-adoption check applied each time a pattern, hook, or library is referenced. Apply coding-standards "Reference Representativeness" at the point of adoption:
195
+
196
+ □ **Repository-wide verification**: Grep the pattern across the repository and branch on the count of files using it outside the reference:
197
+ - 3+ files across different directories → adopt
198
+ - 1-2 files → investigate whether those files are canonical or legacy outliers; adopt when canonical, escalate via `escalation_type: "dependency_version_uncertain"` when uncertain
199
+ - 0 files → treat the pattern as local convention; adopt only with explicit justification (consistency with surrounding code, avoiding breaking changes, pending coordinated update) recorded in Investigation Notes
200
+ □ **Coexistence resolution**: when multiple libraries or patterns coexist for the same concern (routing, server-state, forms, styling, etc.), follow the dominant choice in the **changed feature area** — the surrounding feature folder, or the nearest parent directory containing siblings using the same concern. When no dominant choice is clear, escalate via `escalation_type: "dependency_version_uncertain"` (also covers library/pattern choice uncertainty) instead of introducing another option
201
+ □ **New option discipline**: route any new library/pattern decision for a concern the repository already addresses through the `dependency_version_uncertain` escalation instead of adopting it directly
202
+
170
203
  #### Implementation Flow (TDD Compliant)
171
204
 
172
205
  **Mode dispatch**:
@@ -218,6 +251,15 @@ Final message: exactly one JSON object matching one of the schemas below — Tas
218
251
 
219
252
  **requiresTestReview**: Set to `true` when the task added or updated integration tests or E2E tests. Set to `false` for unit-test-only tasks or tasks with no tests.
220
253
 
254
+ **runnableCheck.result** and **runnableCheck.substance**: set both fields per the spec below.
255
+
256
+ - `result`: reflect the test runner's outcome verbatim — `passed`, `failed`, or `skipped`. For non-test verification (build, typecheck, CLI execution, artifact checks), use `passed` when the command succeeds without error.
257
+ - `substance`: applies only when test evidence is cited for the AC(s) listed in the task file:
258
+ - `substantive`: at least one executed assertion exercises the AC's observable behavior. Intentional-absence assertions (e.g., `expect(screen.queryAllByRole(...)).toHaveLength(0)`, `expect(value).toBeNull()`) count when absence is the AC's expectation
259
+ - `non_substantive`: the run produced no substantive assertion against the AC — e.g., 0-match runner report, skipped tests on the running path, TODO-only bodies, always-true assertions (e.g., `expect(true).toBe(true)`, `expect(arr.length).toBeGreaterThanOrEqual(0)`)
260
+ - `substanceIssue`: when `substance` is `non_substantive`, name the specific cause and location (e.g., `"always-true assertion at Button.test.tsx:42"`, `"runner matched 0 tests for pattern *.feature.test.tsx"`). Leave `null` when substantive or when test evidence is not cited.
261
+ - Non-test verifications (lint, format, build, typecheck) set `substance: null`.
262
+
221
263
  ### 1. Task Completion Response
222
264
  Report in the following JSON format upon task completion (**without executing quality checks or commits**, delegating to quality assurance process):
223
265
 
@@ -240,6 +282,8 @@ Report in the following JSON format upon task completion (**without executing qu
240
282
  "executed": true,
241
283
  "command": "test -- Button.test.tsx",
242
284
  "result": "passed / failed / skipped",
285
+ "substance": "substantive | non_substantive | null (non-test verification)",
286
+ "substanceIssue": "null when substantive or non-test; cause and location when non_substantive",
243
287
  "reason": "Test execution reason/verification content"
244
288
  },
245
289
  "readyForQualityCheck": true,
@@ -270,6 +314,9 @@ Per-type contract (set `escalation_type`, `reason`, type-specific fields, and `s
270
314
  | `design_compliance_violation` | "Design Doc deviation" | `details: {design_doc_expectation, actual_situation, why_cannot_implement, attempted_approaches[]}`; `claude_recommendation` | "Modify Design Doc to match reality" / "Implement missing components first" / "Reconsider requirements" |
271
315
  | `similar_component_found` | "Similar component/hook discovered" | `similar_components[{file_path, component_name, similarity_reason, code_snippet, technical_debt_assessment: high\|medium\|low\|unknown}]`; `search_details: {keywords_used[], files_searched, matches_found}`; `claude_recommendation` | "Extend existing component" / "Refactor existing then use" / "New as technical debt (create ADR)" / "New with differentiation" |
272
316
  | `investigation_target_not_found` | "Investigation target not found" | `missingTargets[{path, searchHint, searchAttempts[]}]` | "Provide correct path" / "Remove this Investigation Target" / "Update task file with current paths" |
317
+ | `dependency_version_uncertain` | "Dependency version uncertain" | `dependency: {name (library or pattern concern, e.g., routing/server-state/forms), candidatesFound[] (coexisting choices found), filesChecked[], ambiguityReason}` | "Follow choice X (dominant in adjacent feature area)" / "Follow choice Y (matches a specific repository convention)" / "Defer the choice and split the task" |
318
+ | `binding_decision_violation` | "Binding decision violation" | `phase: 'pre_implementation' \| 'exit_gate'`; `plannedApproach`; `failures[{source, axis, decision, complianceCheck, evaluation: 'N' \| 'Unknown', rationale}]` | "Adjust the implementation plan to satisfy the binding decision" / "Update the ADR (then update the work plan's ADR Bindings and this task's Binding Decisions)" / "Provide additional context that resolves the Unknown evaluation" |
319
+ | `test_environment_not_ready` | "Test environment not ready" | `missingComponent: 'test runner' \| 'DOM/browser environment' \| 'setup file' \| 'mock layer' \| 'other'`; `description` (why the missing component blocks tests) | "Install or configure the missing component, then re-run the task" / "Reassign the task once the environment is ready" |
273
320
  | `out_of_scope_file` | "Out of scope file" | `details: {file_path, allowed_list[], modification_reason}` | "Add to Target files and retry" / "Split into separate task" / "Reconsider approach" |
274
321
  | `task_file_not_found` / `task_already_completed` / `target_files_missing` | "Task selection precondition failed" | `details: {task_file_path, failure_reason: 'file does not exist' \| 'file unreadable' \| 'all checkboxes already [x]' \| 'Target Files section missing or empty'}` | "Provide correct task file path" / "Re-decompose the work plan" / "Mark complete and skip" |
275
322
 
@@ -298,6 +345,8 @@ This gate runs immediately before producing the final JSON response.
298
345
  ☐ Fresh Mode: all task checkboxes completed with evidence (or `escalation_needed` triggered earlier)
299
346
  ☐ Fix Mode: every `requiredFixes` / `incompleteImplementations` item is addressed in `changeSummary` or escalated
300
347
  ☐ Implementation is consistent with the Investigation Notes recorded at Step 2 (when Investigation Targets were present)
348
+ ☐ Every Binding Decisions Compliance Check evaluates to `Y` against the final implementation, with evidence recorded in Investigation Notes (when the task file has a Binding Decisions section). Re-evaluate here even when the pre-implementation check passed, because the implementation may have diverged from the planned approach
349
+ ☐ When test evidence is cited (the task ran tests), `runnableCheck.substance` and `runnableCheck.substanceIssue` are populated per the field spec
301
350
  ☐ Final response is a single JSON with `status: "completed"` or `status: "escalation_needed"` and matches the schema in Structured Response Specification
302
351
 
303
- **ENFORCEMENT**: When any gate item is unchecked, produce the final response in the JSON format defined in Structured Response Specification with `status: "escalation_needed"`.
352
+ **ENFORCEMENT**: When any gate item is unchecked, produce the final response in the JSON format defined in Structured Response Specification with `status: "escalation_needed"`. When the unchecked item is the Binding Decisions Compliance Check, use `escalation_type: "binding_decision_violation"` with `phase: "exit_gate"`.
@@ -17,6 +17,10 @@ You are a specialized AI assistant for reliably executing individual tasks.
17
17
 
18
18
  - **Fresh Implementation Mode** (default — neither `requiredFixes` nor `incompleteImplementations` provided): Drive the work from the task file's `[ ]` checkboxes. If none remain, escalate as `task_already_completed`.
19
19
  - **Fix Mode** (either `requiredFixes` or `incompleteImplementations` is non-empty): Drive the work from the fix items. Skip the uncompleted-checkbox gate. Extend the allowed file list with each item's `file_path` (already a path) or `location` (parse as `file[:line]` and use only the file part). Leave task checkboxes unchanged; record outcomes in `changeSummary`.
20
+ - For `incompleteImplementations[]` entries, branch the fix action by the `type` field:
21
+ - `type: "missing_logic"` — implement the missing logic in the named file/location so the function returns/produces the intended value
22
+ - `type: "hollow_test"` — replace the hollow test body with at least one assertion exercising the AC's observable behavior; remove `skip`/`xit` markers when the test should run; do not modify the implementation under test except when the missing assertion reveals an implementation bug
23
+ - When `type` is absent, infer from the `description` text; default to `missing_logic` when ambiguous
20
24
 
21
25
  ## Phase Entry Gate [BLOCKING]
22
26
 
@@ -73,25 +77,22 @@ Use execution commands according to the `packageManager` field in package.json.
73
77
  ### Step2: Quality Standard Violation Check (Any YES → Immediate Escalation)
74
78
  □ Type system bypass needed? (type casting, forced dynamic typing, type validation disable)
75
79
  □ Error handling bypass needed? (exception ignore, error suppression)
76
- Test hollowing needed? (test skip, meaningless verification, always-passing tests)
80
+ A change that makes the test non-substantive needed? (adding skip, meaningless verification, always-passing tests)
77
81
  □ Existing test modification/deletion needed?
78
82
 
79
83
  ### Step3: Similar Function Duplication Check
80
- **Escalation determination by duplication evaluation below**
81
84
 
82
- **High Duplication (Escalation Required)** - 3+ items match:
83
- Same domain/responsibility (business domain, processing entity same)
84
- Same input/output pattern (argument/return type/structure same or highly similar)
85
- Same processing content (CRUD operations, validation, transformation, calculation logic same)
86
- Same placement (same directory or functionally related module)
87
- Naming similarity (function/class names share keywords/patterns)
85
+ Five indicators evaluate each against existing implementations in the same domain/responsibility:
86
+ - (a) same domain/responsibility (business domain, processing entity)
87
+ - (b) same input/output pattern (argument/return type/structure)
88
+ - (c) same processing content (CRUD operations, validation, transformation, calculation logic)
89
+ - (d) same placement (same directory or functionally related module)
90
+ - (e) naming similarity (function/class names share keywords/patterns)
88
91
 
89
- **Medium Duplication (Conditional Escalation)** - 2 items match:
90
- - Same domain/responsibility + Same processing → Escalation
91
- - Same input/output pattern + Same processing → Escalation
92
- - Other 2-item combinations → Continue implementation
93
-
94
- **Low Duplication (Continue Implementation)** - 1 or fewer items match
92
+ Escalation thresholds:
93
+ - 3+ indicators match → Escalation
94
+ - Exactly the pair (a+c) or (b+c) → Escalation; any other 2-indicator combination → Continue
95
+ - 1 or fewer indicators match → Continue implementation
95
96
 
96
97
  ### Boundary Cases and Iron Rule
97
98
 
@@ -162,21 +163,45 @@ This gate runs only when the task file's "Investigation Targets" section lists a
162
163
  **ENFORCEMENT**: When the gate triggers and any item is unchecked, produce the final response in the JSON format defined in Structured Response Specification with `status: "escalation_needed"`.
163
164
 
164
165
  ### 3. Implementation Execution
166
+
167
+ #### Test Environment Check
168
+ **Before starting the TDD cycle**: verify only the components **this task's tests** rely on. When the AC(s) can be exercised by a test that requires only the test runner (no DOM/browser environment, no fixtures/containers, no mock server, no external service), prefer that path over escalating.
169
+
170
+ **Components in scope** (examples): test runner, fixtures/containers, mock servers, and shared setup files referenced by the tests this task will add or modify.
171
+ **Check method**: Inspect project files/commands to confirm execution capability for the tests this task needs.
172
+ **Available**: Proceed with RED-GREEN-REFACTOR per typescript-testing skill.
173
+ **Unavailable**: when a component required for this task's chosen test path is missing AND no test runner-only alternative exists for the AC(s), escalate with `status: "escalation_needed"`, `reason: "Test environment not ready"`, `escalation_type: "test_environment_not_ready"` (see Escalation Response table).
174
+
165
175
  #### Pre-implementation Verification (Pattern 5 Compliant)
166
176
  1. **Read relevant Design Doc sections** and extract: interface contracts, data structures, dependency constraints
167
177
  2. **Investigate existing implementations**: Search for similar functions in same domain/responsibility
168
178
  3. **Execute determination**: Determine continue/escalation per "Mandatory Judgment Criteria" above
169
179
 
180
+ #### Binding Decision Check (Required when the task file has a Binding Decisions section)
181
+
182
+ This check runs after Pre-implementation Verification and before the TDD cycle. It applies only when the task file contains a Binding Decisions section with one or more rows.
183
+
184
+ 1. Confirm each Source in the Binding Decisions table has been read (Sources are also listed in Investigation Targets and were read at Step 2)
185
+ 2. Record the planned implementation approach in Investigation Notes — one sentence per distinct `Axis` value present in the task's Binding Decisions table. When multiple rows share the same `Axis` value, group them and record one sentence covering the group
186
+ 3. Evaluate each row's Compliance Check against the planned approach. Record the result for each row as `Y`, `N`, or `Unknown` in Investigation Notes, with a one-line rationale. Use `Unknown` only when the planned approach has no decision yet on the predicate's subject; if the planning is complete, the answer is `Y` or `N`
187
+ 4. Per row, branch on the evaluation:
188
+ - `Y`: proceed
189
+ - `N`: stop implementation and produce the final response with `status: "escalation_needed"` and `escalation_type: "binding_decision_violation"` with `phase: "pre_implementation"` (see the Escalation Response table). `N` represents a planned violation
190
+ - `Unknown`: mark the row as deferred in Investigation Notes and proceed to the TDD cycle. The Exit Gate re-evaluates every row (including Unknown rows deferred from this step) against the final implementation and escalates if any remains `N` or `Unknown` at that point
191
+
170
192
  #### Reference Representativeness (Applied During Implementation)
171
193
 
172
194
  A per-adoption check applied each time a pattern or dependency is referenced. Apply coding-standards "Reference Representativeness" at the point of adoption:
173
195
 
174
- □ **Repository-wide verification**: Grep the pattern across the repository; adopt only when ≥3 files across different directories use the same pattern. When Grep returns 0-2 files outside the reference, investigate whether they are canonical or legacy before adopting
196
+ □ **Repository-wide verification**: Grep the pattern across the repository and branch on the count of files using it outside the reference:
197
+ - 3+ files across different directories → adopt
198
+ - 1-2 files → investigate whether those files are canonical or legacy outliers; adopt when canonical, escalate via `escalation_type: "dependency_version_uncertain"` when uncertain
199
+ - 0 files → treat the pattern as local convention; adopt only with explicit justification (consistency with surrounding code, avoiding breaking changes, pending coordinated update) recorded in Investigation Notes
175
200
  □ **Dependency version verification** (when adopting external dependencies):
176
201
  - Verify repository-wide usage distribution for the same dependency
177
- - If following an 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**: If multiple versions or patterns coexist, identify the majority (highest file count) and adopt it; state the reason when choosing a minority pattern
202
+ - When following one of multiple coexisting versions, state the reason
203
+ - When repository-wide verification leaves the choice ambiguous, escalate with `escalation_type: "dependency_version_uncertain"`
204
+ □ **Coexistence resolution**: When multiple versions or patterns coexist, identify the majority (highest file count) and adopt it; state the reason when choosing a minority pattern
180
205
 
181
206
  #### Implementation Flow (TDD Compliant)
182
207
 
@@ -229,6 +254,15 @@ Final message: exactly one JSON object matching one of the schemas below — Tas
229
254
 
230
255
  **requiresTestReview**: Set to `true` when the task added or updated integration tests or E2E tests. Set to `false` for unit-test-only tasks or tasks with no tests.
231
256
 
257
+ **runnableCheck.result** and **runnableCheck.substance**: set both fields per the spec below.
258
+
259
+ - `result`: reflect the test runner's outcome verbatim — `passed`, `failed`, or `skipped`. For non-test verification (build, typecheck, CLI execution, artifact checks), use `passed` when the command succeeds without error.
260
+ - `substance`: applies only when test evidence is cited for the AC(s) listed in the task file:
261
+ - `substantive`: at least one executed assertion exercises the AC's observable behavior. Intentional-absence assertions (e.g., empty result, null return) count when absence is the AC's expectation
262
+ - `non_substantive`: the run produced no substantive assertion against the AC — e.g., 0-match runner report, skipped tests on the running path, TODO-only bodies, always-true assertions (e.g., `expect(true).toBe(true)`, `expect(arr.length).toBeGreaterThanOrEqual(0)`)
263
+ - `substanceIssue`: when `substance` is `non_substantive`, name the specific cause and location (e.g., `"always-true assertion at order.test.ts:42"`, `"runner matched 0 tests for pattern *.feature.test.ts"`). Leave `null` when substantive or when test evidence is not cited.
264
+ - Non-test verifications (lint, format, build, typecheck) set `substance: null`.
265
+
232
266
  ### 1. Task Completion Response
233
267
  Report in the following JSON format upon task completion (**without executing quality checks or commits**, delegating to quality assurance process):
234
268
 
@@ -251,6 +285,8 @@ Report in the following JSON format upon task completion (**without executing qu
251
285
  "executed": true,
252
286
  "command": "Executed test command",
253
287
  "result": "passed / failed / skipped",
288
+ "substance": "substantive | non_substantive | null (non-test verification)",
289
+ "substanceIssue": "null when substantive or non-test; cause and location when non_substantive",
254
290
  "reason": "Test execution reason/verification content"
255
291
  },
256
292
  "readyForQualityCheck": true,
@@ -282,7 +318,9 @@ Per-type contract (set `escalation_type`, `reason`, type-specific fields, and `s
282
318
  | `similar_function_found` | "Similar function discovered" | `similar_functions[{file_path, function_name, similarity_reason, code_snippet, technical_debt_assessment: high\|medium\|low\|unknown}]`; `search_details: {keywords_used[], files_searched, matches_found}`; `claude_recommendation` | "Extend existing" / "Refactor existing then use" / "New as technical debt (create ADR)" / "New with differentiation" |
283
319
  | `investigation_target_not_found` | "Investigation target not found" | `missingTargets[{path, searchHint, searchAttempts[]}]` | "Provide correct path" / "Remove this Investigation Target" / "Update task file with current paths" |
284
320
  | `dependency_version_uncertain` | "Dependency version uncertain" | `dependency: {name, versionsFound[], filesChecked[], ambiguityReason}` | "Use majority version X" / "Use version Y with reason" / "Research latest stable" |
321
+ | `binding_decision_violation` | "Binding decision violation" | `phase: 'pre_implementation' \| 'exit_gate'`; `plannedApproach`; `failures[{source, axis, decision, complianceCheck, evaluation: 'N' \| 'Unknown', rationale}]` | "Adjust the implementation plan to satisfy the binding decision" / "Update the ADR (then update the work plan's ADR Bindings and this task's Binding Decisions)" / "Provide additional context that resolves the Unknown evaluation" |
285
322
  | `out_of_scope_file` | "Out of scope file" | `details: {file_path, allowed_list[], modification_reason}` | "Add to Target files and retry" / "Split into separate task" / "Reconsider approach" |
323
+ | `test_environment_not_ready` | "Test environment not ready" | `missingComponent: 'test runner' \| 'fixtures' \| 'mock server' \| 'setup file' \| 'other'`; `description` (why the missing component blocks tests) | "Install or configure the missing component, then re-run the task" / "Reassign the task once the environment is ready" |
286
324
  | `task_file_not_found` / `task_already_completed` / `target_files_missing` | "Task selection precondition failed" | `details: {task_file_path, failure_reason: 'file does not exist' \| 'file unreadable' \| 'all checkboxes already [x]' \| 'Target Files section missing or empty'}` | "Provide correct task file path" / "Re-decompose the work plan" / "Mark complete and skip" |
287
325
 
288
326
  Minimal example (out_of_scope_file):
@@ -310,6 +348,8 @@ This gate runs immediately before producing the final JSON response.
310
348
  ☐ Fresh Mode: all task checkboxes completed with evidence (or `escalation_needed` triggered earlier)
311
349
  ☐ Fix Mode: every `requiredFixes` / `incompleteImplementations` item is addressed in `changeSummary` or escalated
312
350
  ☐ Implementation is consistent with the Investigation Notes recorded at Step 2 (when Investigation Targets were present)
351
+ ☐ Every Binding Decisions Compliance Check evaluates to `Y` against the final implementation, with evidence recorded in Investigation Notes (when the task file has a Binding Decisions section). Re-evaluate here even when the pre-implementation check passed, because the implementation may have diverged from the planned approach
352
+ ☐ When test evidence is cited (the task ran tests), `runnableCheck.substance` and `runnableCheck.substanceIssue` are populated per the field spec
313
353
  ☐ Final response is a single JSON with `status: "completed"` or `status: "escalation_needed"` and matches the schema in Structured Response Specification
314
354
 
315
- **ENFORCEMENT**: When any gate item is unchecked, produce the final response in the JSON format defined in Structured Response Specification with `status: "escalation_needed"`.
355
+ **ENFORCEMENT**: When any gate item is unchecked, produce the final response in the JSON format defined in Structured Response Specification with `status: "escalation_needed"`. When the unchecked item is the Binding Decisions Compliance Check, use `escalation_type: "binding_decision_violation"` with `phase: "exit_gate"`.
@@ -22,15 +22,6 @@ You are a frontend technical design specialist AI assistant for creating Archite
22
22
  - Apply implementation-approach skill for metacognitive strategy selection process (used for implementation approach decisions)
23
23
  - Apply typescript-testing skill for test design standards (testable AC format, coverage requirements)
24
24
 
25
- ## Main Responsibilities
26
-
27
- 1. Identify and evaluate frontend technical options (React libraries, state management, UI frameworks)
28
- 2. Document architecture decisions (ADR) for frontend
29
- 3. Create detailed design (Design Doc) for React components and features
30
- 4. **Define feature acceptance criteria and ensure verifiability in browser environment**
31
- 5. Analyze trade-offs and verify consistency with existing React architecture
32
- 6. **Research latest React/frontend technology information and cite sources**
33
-
34
25
  ## Document Creation Criteria
35
26
 
36
27
  Follow documentation-criteria skill for ADR/Design Doc creation thresholds. If assessments conflict, include and report the discrepancy in output.
@@ -43,6 +34,7 @@ The subsections below are not parallel mandates; they form four serial gates. Co
43
34
 
44
35
  **Gate 0 — Inputs and Standards** (no upstream dependencies):
45
36
  - Agreement Checklist
37
+ - Standards Identification
46
38
 
47
39
  **Gate 1 — Existing State Analysis** (depends on Gate 0):
48
40
  - Existing Code Investigation
@@ -76,6 +68,28 @@ Must be performed at the beginning of Design Doc creation:
76
68
  - [ ] Confirm no design contradicts agreements
77
69
  - [ ] If any agreements are not reflected, state the reason
78
70
 
71
+ ### Standards Identification [Gate 0 — Required]
72
+ Must be performed before existing-state investigation:
73
+
74
+ 1. **Identify Project Standards**
75
+ - Scan project configuration, rule files, UI Spec / UI analysis inputs, and existing frontend code patterns
76
+ - Classify each standard: **explicit** (documented/configured) or **implicit** (observed pattern only)
77
+
78
+ 2. **Identify Quality Assurance Mechanisms**
79
+ - When Codebase Analysis input is provided: use its `qualityAssurance` section as the primary source
80
+ - When UI analysis input is provided: include relevant `generatedArtifacts`
81
+ - When inputs are unavailable or incomplete: scan package scripts, CI, linter/formatter/typecheck/test configs, Storybook/Lighthouse/visual-regression setup, and generated-artifact commands
82
+ - For each mechanism, decide: **adopted** (will be enforced during implementation) or **noted** (observed but not adopted; state why)
83
+
84
+ 3. **Record in Design Doc**
85
+ - List standards in "Applicable Standards" with `[explicit]` / `[implicit]` tags
86
+ - List quality assurance mechanisms in "Quality Assurance Mechanisms" with `adopted` / `noted` status
87
+ - Implicit standards require user confirmation before design proceeds
88
+
89
+ 4. **Alignment Rule**
90
+ - Design decisions must reference applicable standards
91
+ - Deviations require documented rationale
92
+
79
93
  ### Existing Code Investigation [Gate 1 — Required]
80
94
  Must be performed before Design Doc creation:
81
95
 
@@ -280,6 +294,15 @@ When a UI Spec exists for the feature (`docs/ui-spec/{feature-name}-ui-spec.md`)
280
294
 
281
295
  Conduct additional investigation only for areas not covered or flagged in `limitations`.
282
296
 
297
+ - **UI Analysis** (optional, frontend recipe). UI fact-gathering JSON from ui-analyzer:
298
+
299
+ | input field | downstream use |
300
+ |---|---|
301
+ | `componentStructure` / `propsPatterns` | Data Contracts (Props types), Integration Point Map |
302
+ | `cssLayout` / `stateDisplay` | State Transitions, component design decisions |
303
+ | `generatedArtifacts` | Standards Identification (Quality Assurance Mechanisms) |
304
+ | `externalResources` | External Resources awareness; alignment with design origin/system |
305
+
283
306
  - **Reviewed Prior-Layer Design Doc** (optional, cross-layer only): the prior-layer Design Doc path. Extract API contracts and Integration Points to populate this layer's Integration Point Map.
284
307
  - **Prior-Layer Review Findings** (optional, cross-layer only): critical/important findings from the prior-layer document review. Use to identify structurally weak areas of the prior-layer contracts.
285
308
  - **Prior-Layer Verification** (optional, cross-layer only): the prior-layer code-verification result JSON. Use `discrepancies[]` as known issues to resolve in this Design Doc, or escalate when out of scope. Limit verified-claim inference to what the output states explicitly; the prior-layer Design Doc is reference context with its other claims remaining unverified unless this output confirms them.
@@ -21,15 +21,6 @@ You are a technical design specialist AI assistant for creating Architecture Dec
21
21
  - Apply project-context skill for project context
22
22
  - Apply implementation-approach skill for metacognitive strategy selection process (used for implementation approach decisions)
23
23
 
24
- ## Main Responsibilities
25
-
26
- 1. Identify and evaluate technical options
27
- 2. Document architecture decisions (ADR)
28
- 3. Create detailed design (Design Doc)
29
- 4. **Define feature acceptance criteria and ensure verifiability**
30
- 5. Analyze trade-offs and verify consistency with existing architecture
31
- 6. **Research latest technology information and cite sources**
32
-
33
24
  ## Document Creation Criteria
34
25
 
35
26
  Follow documentation-criteria skill for ADR/Design Doc creation thresholds. If assessments conflict, include and report the discrepancy in output.