create-ai-project 1.20.4 → 1.20.6

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 (56) hide show
  1. package/.claude/agents-en/acceptance-test-generator.md +70 -25
  2. package/.claude/agents-en/code-verifier.md +4 -2
  3. package/.claude/agents-en/design-sync.md +145 -54
  4. package/.claude/agents-en/investigator.md +92 -39
  5. package/.claude/agents-en/quality-fixer-frontend.md +67 -12
  6. package/.claude/agents-en/quality-fixer.md +67 -12
  7. package/.claude/agents-en/solver.md +30 -27
  8. package/.claude/agents-en/technical-designer-frontend.md +18 -0
  9. package/.claude/agents-en/technical-designer.md +18 -0
  10. package/.claude/agents-en/verifier.md +100 -74
  11. package/.claude/agents-en/work-planner.md +40 -3
  12. package/.claude/agents-ja/acceptance-test-generator.md +70 -25
  13. package/.claude/agents-ja/code-verifier.md +4 -2
  14. package/.claude/agents-ja/design-sync.md +145 -54
  15. package/.claude/agents-ja/investigator.md +93 -40
  16. package/.claude/agents-ja/quality-fixer-frontend.md +71 -16
  17. package/.claude/agents-ja/quality-fixer.md +71 -16
  18. package/.claude/agents-ja/solver.md +32 -29
  19. package/.claude/agents-ja/technical-designer-frontend.md +18 -0
  20. package/.claude/agents-ja/technical-designer.md +18 -0
  21. package/.claude/agents-ja/verifier.md +100 -74
  22. package/.claude/agents-ja/work-planner.md +40 -3
  23. package/.claude/commands-en/add-integration-tests.md +7 -2
  24. package/.claude/commands-en/build.md +6 -2
  25. package/.claude/commands-en/diagnose.md +46 -34
  26. package/.claude/commands-en/front-build.md +6 -2
  27. package/.claude/commands-en/front-plan.md +8 -2
  28. package/.claude/commands-en/implement.md +8 -4
  29. package/.claude/commands-en/plan.md +4 -1
  30. package/.claude/commands-en/update-doc.md +3 -0
  31. package/.claude/commands-ja/add-integration-tests.md +7 -2
  32. package/.claude/commands-ja/build.md +6 -2
  33. package/.claude/commands-ja/diagnose.md +46 -34
  34. package/.claude/commands-ja/front-build.md +8 -4
  35. package/.claude/commands-ja/front-plan.md +8 -2
  36. package/.claude/commands-ja/implement.md +8 -4
  37. package/.claude/commands-ja/plan.md +4 -1
  38. package/.claude/commands-ja/update-doc.md +3 -0
  39. package/.claude/skills-en/documentation-criteria/SKILL.md +2 -1
  40. package/.claude/skills-en/documentation-criteria/references/design-template.md +10 -4
  41. package/.claude/skills-en/documentation-criteria/references/plan-template.md +13 -0
  42. package/.claude/skills-en/documentation-criteria/references/prd-template.md +4 -3
  43. package/.claude/skills-en/documentation-criteria/references/ui-spec-template.md +60 -6
  44. package/.claude/skills-en/integration-e2e-testing/SKILL.md +46 -5
  45. package/.claude/skills-en/subagents-orchestration-guide/SKILL.md +16 -8
  46. package/.claude/skills-ja/documentation-criteria/SKILL.md +2 -1
  47. package/.claude/skills-ja/documentation-criteria/references/design-template.md +10 -4
  48. package/.claude/skills-ja/documentation-criteria/references/plan-template.md +13 -0
  49. package/.claude/skills-ja/documentation-criteria/references/prd-template.md +4 -3
  50. package/.claude/skills-ja/documentation-criteria/references/ui-spec-template.md +61 -7
  51. package/.claude/skills-ja/integration-e2e-testing/SKILL.md +45 -5
  52. package/.claude/skills-ja/subagents-orchestration-guide/SKILL.md +16 -8
  53. package/CHANGELOG.md +44 -0
  54. package/README.ja.md +3 -3
  55. package/README.md +3 -3
  56. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: documentation-criteria
3
- description: Guides PRD, ADR, Design Doc, and Work Plan creation. Use when creating or reviewing technical documents.
3
+ description: Guides PRD, ADR, Design Doc, UI Spec, and Work Plan creation. Use when creating or reviewing technical documents, or when "UI spec/screen design/component decomposition" is mentioned.
4
4
  ---
5
5
 
6
6
  # Documentation Creation Criteria
@@ -53,6 +53,7 @@ description: Guides PRD, ADR, Design Doc, and Work Plan creation. Use when creat
53
53
  - Success metrics and KPIs (each metric specifies a numeric target, measurement method, and timeframe)
54
54
  - User stories and use cases
55
55
  - MoSCoW prioritization (Must/Should/Could/Won't)
56
+ - Acceptance criteria with sequential IDs (AC-001, AC-002, ...) for downstream traceability
56
57
  - MVP and Future phase separation
57
58
  - User journey diagram (required)
58
59
  - Scope boundary diagram (required)
@@ -120,6 +120,12 @@ No Ripple Effect:
120
120
  - [Explicitly specify unaffected features]
121
121
  ```
122
122
 
123
+ ### Interface Change Matrix
124
+
125
+ | Existing | New | Conversion Required | Compatibility Method |
126
+ |----------|-----|--------------------|--------------------|
127
+ | [Function/method/operation name] | [Function/method/operation name] | [Yes/No] | [Approach: adapter, wrapper, deprecation, etc.] |
128
+
123
129
  ### Architecture Overview
124
130
 
125
131
  [How this feature is positioned within the overall system]
@@ -132,10 +138,10 @@ No Ripple Effect:
132
138
 
133
139
  ### Integration Points List
134
140
 
135
- | Integration Point | Location | Old Implementation | New Implementation | Switching Method |
136
- |-------------------|----------|-------------------|-------------------|------------------|
137
- | Integration Point 1 | [Class/Function] | [Existing Process] | [New Process] | [DI/Factory etc.] |
138
- | Integration Point 2 | [Another Location] | [Existing] | [New] | [Method] |
141
+ | Integration Point | Location | Old Implementation | New Implementation | Switching Method | Verification Method |
142
+ |-------------------|----------|-------------------|-------------------|------------------|-------------------|
143
+ | Integration Point 1 | [Class/Function] | [Existing Process] | [New Process] | [DI/Factory etc.] | [How to verify this switching works] |
144
+ | Integration Point 2 | [Another Location] | [Existing] | [New] | [Method] | [Verification approach] |
139
145
 
140
146
  ### Main Components
141
147
 
@@ -24,6 +24,19 @@ Related Issue/PR: #XXX (if any)
24
24
  - **Success criteria**: [extracted from Design Doc]
25
25
  - **Failure response**: [extracted from Design Doc]
26
26
 
27
+ ## Design-to-Plan Traceability
28
+
29
+ Maps each Design Doc technical requirement to the covering task(s). One row per extracted item. Every row must have at least one covering task, or an explicit gap justification.
30
+
31
+ | DD Section | DD Item | Category | Covered By Task(s) | Gap Status | Notes |
32
+ |---|---|---|---|---|---|
33
+ | [Section name from DD] | [Specific item] | impl-target / connection-switching / contract-change / verification / prerequisite | [Phase X Task Y] | covered | |
34
+ | Security Considerations | Input validation for API | prerequisite | — | gap | Deferred to Phase 2 per user decision |
35
+
36
+ **Category values**: `impl-target` (implementation target), `connection-switching` (connection/switching/registration), `contract-change` (contract change and propagation), `verification` (verification requirement), `prerequisite` (prerequisite work)
37
+
38
+ **Gap Status values**: `covered` (task exists), `gap` (no task — requires justification in Notes, user confirmation required before plan approval)
39
+
27
40
  ## Objective
28
41
  [Why this change is necessary, what problem it solves]
29
42
 
@@ -50,13 +50,14 @@ C4Context
50
50
 
51
51
  ### Must Have (P1 - MVP)
52
52
  - [ ] Requirement 1: [Detailed description]
53
- - AC: [Acceptance criteria - Given/When/Then format or measurable standard]
53
+ - AC-001: [Acceptance criteria - Given/When/Then format or measurable standard]
54
+ - AC-002: [Acceptance criteria]
54
55
  - [ ] Requirement 2: [Detailed description]
55
- - AC: [Acceptance criteria]
56
+ - AC-003: [Acceptance criteria]
56
57
 
57
58
  ### Should Have (P2)
58
59
  - [ ] Requirement 1: [Detailed description]
59
- - AC: [Acceptance criteria]
60
+ - AC-004: [Acceptance criteria]
60
61
 
61
62
  ### Could Have (P3)
62
63
  - [ ] Requirement 1: [Detailed description]
@@ -28,7 +28,7 @@ Map PRD acceptance criteria to prototype references. Skip this section if no pro
28
28
 
29
29
  | AC ID | AC Summary | Screen / State | Prototype Reference (element ID / path) | Adoption Decision |
30
30
  |-------|-----------|----------------|----------------------------------------|-------------------|
31
- | AC-01 | [EARS AC summary] | [Screen / state name] | [element or file reference] | Adopted / Not adopted / On hold |
31
+ | AC-001 | [EARS AC summary] | [Screen / state name] | [element or file reference] | Adopted / Not adopted / On hold |
32
32
 
33
33
  ## Screen List and Transitions
34
34
 
@@ -63,13 +63,13 @@ Map PRD acceptance criteria to prototype references. Skip this section if no pro
63
63
 
64
64
  | State | Default | Loading | Empty | Error | Partial |
65
65
  |-------|---------|---------|-------|-------|---------|
66
- | Display | [Normal display] | [Skeleton / spinner] | [Empty state + CTA] | [Error message + recovery action] | [Cached / partial display] |
66
+ | Display | [Normal display] | [Specific pattern: e.g., Skeleton of `ExistingComponent` / Spinner from `ui/Spinner`] | [Empty state message + CTA: e.g., "No items yet" + `Button` "Create first item"] | [Error message + recovery: e.g., `Alert` variant="error" + `Button` "Retry"] | [Cached display + `Banner` "Connection lost, showing cached data"] |
67
67
 
68
68
  #### Interaction Definition
69
69
 
70
70
  | AC ID | EARS Condition | User Action | System Response | State Transition | Error Handling |
71
71
  |-------|---------------|-------------|-----------------|-----------------|----------------|
72
- | AC-01 | When [trigger] | [Click / input / etc.] | [Expected behavior] | [From state -> To state] | [Retry / Reset / Fallback] |
72
+ | AC-001 | When [trigger] | [Click / input / etc.] | [Expected behavior] | [From state -> To state] | [Retry / Reset / Fallback] |
73
73
 
74
74
  ### Component: [ComponentName2]
75
75
 
@@ -78,10 +78,18 @@ Map PRD acceptance criteria to prototype references. Skip this section if no pro
78
78
  ## Design Tokens and Component Map
79
79
 
80
80
  ### Environment Constraints
81
+
81
82
  - Target browsers: [e.g., Chrome 120+, Safari 17+]
82
- - Responsive breakpoints: [e.g., 768px, 1024px, 1280px]
83
83
  - Theme support: [e.g., light/dark, system preference]
84
84
 
85
+ #### Responsive Behavior
86
+
87
+ | Breakpoint | Width | Key Changes |
88
+ |-----------|-------|-------------|
89
+ | Mobile | [e.g., < 768px] | [e.g., single column, hamburger nav, 14px body text] |
90
+ | Tablet | [e.g., 768px - 1023px] | [e.g., 2-column grid, collapsed sidebar] |
91
+ | Desktop | [e.g., ≥ 1024px] | [e.g., full layout, expanded nav, sidebar visible] |
92
+
85
93
  ### Existing Component Reuse Map
86
94
 
87
95
  | UI Element | Decision | Existing Component | Notes |
@@ -92,10 +100,56 @@ Map PRD acceptance criteria to prototype references. Skip this section if no pro
92
100
 
93
101
  ### Design Tokens
94
102
 
103
+ #### Color Roles
104
+
105
+ | Role | Token | Value | Usage |
106
+ |------|-------|-------|-------|
107
+ | Background Surface | [bg-primary] | [e.g., #FFFFFF] | [Page background] |
108
+ | Background Surface | [bg-secondary] | [e.g., #F9FAFB] | [Card, section background] |
109
+ | Text | [text-primary] | [e.g., #111827] | [Headings, body text] |
110
+ | Text | [text-secondary] | [e.g., #6B7280] | [Captions, placeholders] |
111
+ | Brand / Accent | [color-brand] | [e.g., #1A73E8] | [Primary actions, links] |
112
+ | Status | [color-success] | [e.g., #22C55E] | [Success states, confirmations] |
113
+ | Status | [color-error] | [e.g., #EF4444] | [Error states, destructive actions] |
114
+ | Border | [border-primary] | [e.g., #E5E7EB] | [Card borders, dividers] |
115
+
116
+ #### Typography Hierarchy
117
+
118
+ | Role | Font | Size | Weight | Line Height | Letter Spacing |
119
+ |------|------|------|--------|-------------|----------------|
120
+ | Heading 1 | [e.g., Inter] | [e.g., 30px] | [e.g., 700] | [e.g., 1.2] | [e.g., -0.02em] |
121
+ | Heading 2 | [e.g., Inter] | [e.g., 24px] | [e.g., 600] | [e.g., 1.3] | [e.g., -0.01em] |
122
+ | Body | [e.g., Inter] | [e.g., 16px] | [e.g., 400] | [e.g., 1.5] | [e.g., 0] |
123
+ | Caption | [e.g., Inter] | [e.g., 12px] | [e.g., 400] | [e.g., 1.4] | [e.g., 0.01em] |
124
+ | Monospace | [e.g., JetBrains Mono] | [e.g., 14px] | [e.g., 400] | [e.g., 1.6] | [e.g., 0] |
125
+
126
+ #### Spacing Scale
127
+
128
+ | Token | Value | Usage |
129
+ |-------|-------|-------|
130
+ | [spacing-xs] | [e.g., 4px] | [Inline element gaps] |
131
+ | [spacing-sm] | [e.g., 8px] | [Compact padding] |
132
+ | [spacing-md] | [e.g., 16px] | [Default component padding] |
133
+ | [spacing-lg] | [e.g., 24px] | [Section spacing] |
134
+ | [spacing-xl] | [e.g., 40px] | [Page section separation] |
135
+
136
+ #### Elevation (Depth)
137
+
138
+ | Level | Treatment | Usage |
139
+ |-------|-----------|-------|
140
+ | 0 (Flat) | [e.g., none] | [Inline elements, text] |
141
+ | 1 (Raised) | [e.g., 0 1px 2px rgba(0,0,0,0.05)] | [Cards, buttons] |
142
+ | 2 (Floating) | [e.g., 0 4px 12px rgba(0,0,0,0.1)] | [Dropdowns, popovers] |
143
+ | 3 (Overlay) | [e.g., 0 8px 24px rgba(0,0,0,0.15)] | [Modals, dialogs] |
144
+
145
+ #### Border Radius Scale
146
+
95
147
  | Token | Value | Usage |
96
148
  |-------|-------|-------|
97
- | [color-primary] | [value] | [Primary actions] |
98
- | [spacing-md] | [value] | [Component spacing] |
149
+ | [radius-sm] | [e.g., 4px] | [Badges, chips] |
150
+ | [radius-md] | [e.g., 8px] | [Cards, inputs] |
151
+ | [radius-lg] | [e.g., 12px] | [Modals, panels] |
152
+ | [radius-full] | [e.g., 9999px] | [Avatars, pills] |
99
153
 
100
154
  ## Visual Acceptance
101
155
 
@@ -57,16 +57,57 @@ Each test MUST include the following annotations.
57
57
  // fast-check: fc.property(fc.[arbitrary], (input) => [invariant])
58
58
  ```
59
59
 
60
+ ## Multi-Step User Journey Definition
61
+
62
+ A feature qualifies as containing a **multi-step user journey** when ALL of the following are true:
63
+
64
+ 1. **2+ distinct interaction boundaries** are traversed in sequence to complete a user goal. What counts as a boundary depends on the system type:
65
+ - Web: distinct routes/pages
66
+ - Mobile native: distinct screens/views
67
+ - CLI: distinct command invocations or interactive prompts
68
+ - API: distinct API calls forming a transaction (e.g., create → confirm → finalize)
69
+ 2. **State carries across steps** — data produced or actions taken in one step affect what the next step accepts or displays
70
+ 3. **The journey has a completion point** — a final state the user or caller reaches (e.g., confirmation page, saved record, API success response, completed workflow)
71
+
72
+ ### User-Facing vs Service-Internal Journeys
73
+
74
+ Multi-step journeys are further classified for E2E budget decisions:
75
+
76
+ | Classification | Condition | E2E Reserved Slot | Example |
77
+ |---|---|---|---|
78
+ | **User-facing** | A human user directly triggers and observes the steps (via UI, CLI, or direct API interaction) | Eligible | Web checkout flow, CLI setup wizard, mobile onboarding |
79
+ | **Service-internal** | Steps are triggered by backend services without direct user interaction | Not eligible for reserved slot | Async job pipeline, service-to-service saga, scheduled batch processing |
80
+
81
+ **Scope of this classification**:
82
+ - **Reserved E2E slot**: Only user-facing journeys qualify. Service-internal journeys are excluded from the reserved slot.
83
+ - **Normal ROI > 50 path**: Both user-facing and service-internal journeys compete for the additional E2E slot (up to 1) on ROI merit alone. Classification does not affect this path.
84
+ - **E2E Gap Check**: Only user-facing journeys trigger the gap warning. Service-internal journeys do not.
85
+
60
86
  ### ROI Calculation
61
87
 
88
+ ROI is used to **rank candidates within the same test type** (integration candidates against each other, E2E candidates against each other). Cross-type comparison is unnecessary because integration and E2E budgets are selected independently.
89
+
62
90
  ```
63
- ROI = (Business Value x Frequency + Legal Requirement x 10 + Defect Detection) / Total Cost
91
+ ROI Score = Business Value × User Frequency + Legal Requirement × 10 + Defect Detection
92
+ (range: 0–120)
64
93
  ```
65
94
 
66
- | Type | Total Cost | E2E Generation Condition |
67
- |------|------------|-------------------------|
68
- | Integration | 11 | - |
69
- | E2E | 38 | ROI > 50 |
95
+ Higher ROI Score = higher priority within its test type. No normalization or capping is applied — the raw score is used directly for ranking. Deduplication is a separate step that removes candidates entirely; it does not modify scores.
96
+
97
+ ### ROI Threshold for E2E
98
+
99
+ E2E tests have high ownership cost (creation, execution, and maintenance are each 3-10× higher than integration tests). To justify creation, an E2E candidate (beyond the must-keep reserved slot) requires **ROI Score > 50**.
100
+
101
+ ### ROI Calculation Examples
102
+
103
+ | Scenario | BV | Freq | Legal | Defect | ROI Score | Test Type | Selection Outcome |
104
+ |----------|----|------|-------|--------|-----------|-----------|-------------------|
105
+ | Core checkout flow | 10 | 9 | true | 9 | 109 | E2E | Selected (reserved slot: user-facing multi-step journey) |
106
+ | Payment error handling | 8 | 3 | false | 7 | 31 | E2E | Below threshold (31 < 50), not selected |
107
+ | Profile save flow | 7 | 6 | false | 6 | 48 | E2E | Below threshold (48 < 50), not selected |
108
+ | DB persistence check | 8 | 8 | false | 8 | 72 | Integration | Selected (rank 1 of 3) |
109
+ | Error message display | 5 | 3 | false | 4 | 19 | Integration | Selected (rank 2 of 3) |
110
+ | Optional filter toggle | 3 | 4 | false | 2 | 14 | Integration | Not selected (rank 4, budget full) |
70
111
 
71
112
  ## Implementation Rules
72
113
 
@@ -134,12 +134,12 @@ Subagents respond in JSON format. Key fields for orchestrator decisions:
134
134
  | codebase-analyzer | analysisScope.categoriesDetected, dataModel.detected, focusAreas[], existingElements count, limitations | Pass focusAreas to technical-designer as context |
135
135
  | code-verifier | status (consistent/mostly_consistent/needs_review/inconsistent), consistencyScore, discrepancies[], reverseCoverage (dataOperationsInCode, testBoundariesSectionPresent). Pre-implementation: verifies Design Doc claims against existing codebase. Post-implementation: verifies implementation consistency against Design Doc (pass `code_paths` scoped to changed files) | Flag discrepancies for document-reviewer |
136
136
  | task-executor | status (escalation_needed/completed), escalation_type, testsAdded, requiresTestReview | On escalation_needed: handle by escalation_type (design_compliance_violation, similar_function_found, similar_component_found, investigation_target_not_found, out_of_scope_file) |
137
- | quality-fixer | status (approved/blocked), reason, blockingIssues[], missingPrerequisites[] | On blocked: see quality-fixer blocked handling below |
137
+ | quality-fixer | status (approved/stub_detected/blocked). `stub_detected` → route back to task-executor with `incompleteImplementations[]` details for completion, then re-run quality-fixer. `blocked` see quality-fixer blocked handling below | On stub_detected: re-invoke task-executor. On blocked: see handling below |
138
138
  | document-reviewer | approvalReady (true/false) | Proceed to next step on true; request fixes on false |
139
- | design-sync | sync_status (synced/conflicts_found) | On conflicts_found: present conflicts to user before proceeding |
139
+ | design-sync | sync_status (NO_CONFLICTS/CONFLICTS_FOUND) | On CONFLICTS_FOUND: present conflicts to user before proceeding |
140
140
  | integration-test-reviewer | status (approved/needs_revision/blocked), requiredFixes | On needs_revision: pass requiredFixes back to task-executor |
141
141
  | security-reviewer | status (approved/approved_with_notes/needs_revision/blocked), findings, notes, requiredFixes | On needs_revision: pass requiredFixes back to task-executor |
142
- | acceptance-test-generator | status, generatedFiles | Pass generatedFiles to work-planner |
142
+ | acceptance-test-generator | status, generatedFiles (integration: path\|null, e2e: path\|null), budgetUsage, e2eAbsenceReason (null when E2E emitted, otherwise: no_multi_step_journey\|below_threshold_user_confirmed) | Verify files exist, pass to work-planner with absence reason |
143
143
 
144
144
  ### quality-fixer Blocked Handling
145
145
 
@@ -301,7 +301,13 @@ Construct the prompt from the agent's Input Parameters section and the deliverab
301
301
 
302
302
  #### technical-designer → work-planner
303
303
 
304
- **Pass to work-planner**: Design Doc path. Work-planner extracts Verification Strategy from the Design Doc and includes it in the work plan header.
304
+ **Pass to work-planner**: Design Doc path. Work-planner scans all DD sections and extracts technical requirements per its Step 5 categories (impl-target, connection-switching, contract-change, verification, prerequisite), then produces a Design-to-Plan Traceability table.
305
+
306
+ **Gap handling (orchestrator responsibility)**: If work-planner outputs a draft plan containing `gap` entries, the orchestrator MUST:
307
+ 1. Present the gap entries to the user with justifications
308
+ 2. Keep the plan in draft status until the user confirms each gap
309
+ 3. Do NOT pass the plan to downstream agents (task-decomposer, etc.) until all gaps are resolved or confirmed
310
+ Unjustified gaps are errors — return to work-planner to add covering tasks or justification.
305
311
 
306
312
  #### *1 acceptance-test-generator → work-planner
307
313
 
@@ -310,14 +316,16 @@ Construct the prompt from the agent's Input Parameters section and the deliverab
310
316
  - UI Spec: [path] (if exists)
311
317
 
312
318
  **Orchestrator verification items**:
313
- - Verify integration test file path retrieval and existence
314
- - Verify E2E test file path retrieval and existence
319
+ - Verify `generatedFiles.integration` is a valid path (when not null) and the file exists
320
+ - Verify `generatedFiles.e2e` is a valid path (when not null) and the file exists
321
+ - When `generatedFiles.e2e` is null, verify `e2eAbsenceReason` is present — this is intentional absence, not an error
315
322
 
316
323
  **Pass to work-planner**:
317
324
  - Integration test file: [path] (create and execute simultaneously with each phase implementation)
318
- - E2E test file: [path] (execute only in final phase)
325
+ - E2E test file: [path] or null (execute only in final phase, when provided)
326
+ - E2E absence reason: [reason] (when E2E is null — pass this so work-planner can skip E2E Gap Check for intentional absence)
319
327
 
320
- **On error**: Escalate to user if files are not generated
328
+ **On error**: Escalate to user if integration file generation failed unexpectedly (status != completed). E2E being null with a valid absence reason is not an error.
321
329
  3. **ADR Status Management**: Update ADR status after user decision (Accepted/Rejected)
322
330
 
323
331
  ## Important Constraints
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: documentation-criteria
3
- description: PRD、ADR、Design Doc、作業計画書の作成を支援。技術ドキュメントの作成・レビュー時に使用。
3
+ description: PRD、ADR、Design Doc、UI Spec、作業計画書の作成を支援。技術ドキュメントの作成・レビュー時、または「UI Spec/画面設計/コンポーネント分解」が言及された時に使用。
4
4
  ---
5
5
 
6
6
  # ドキュメント作成基準
@@ -53,6 +53,7 @@ description: PRD、ADR、Design Doc、作業計画書の作成を支援。技術
53
53
  - 成功指標とKPI(各指標に数値目標、測定方法、期間を明記)
54
54
  - ユーザーストーリーとユースケース
55
55
  - MoSCoW法による優先順位(Must/Should/Could/Won't)
56
+ - 受入基準に連番ID(AC-001, AC-002, ...)を付与し、下流でのトレーサビリティを確保
56
57
  - MVPとFutureフェーズの分離
57
58
  - ユーザージャーニー図(必須)
58
59
  - スコープ境界図(必須)
@@ -120,6 +120,12 @@ unknowns:
120
120
  - [明示的に影響を受けない機能]
121
121
  ```
122
122
 
123
+ ### インターフェース変更マトリクス
124
+
125
+ | 既存 | 新規 | 変換要否 | 互換方式 |
126
+ |------|------|---------|---------|
127
+ | [関数/メソッド/操作名] | [関数/メソッド/操作名] | [Yes/No] | [手法: adapter, wrapper, deprecation等] |
128
+
123
129
  ### アーキテクチャ概要
124
130
 
125
131
  [この機能がシステム全体の中でどのように位置づけられるか]
@@ -132,10 +138,10 @@ unknowns:
132
138
 
133
139
  ### 統合ポイント一覧
134
140
 
135
- | 統合ポイント | 箇所 | 旧実装 | 新実装 | 切替方式 |
136
- |------------|-----|-------|-------|---------|
137
- | 統合ポイント1 | [クラス/関数] | [既存処理] | [新処理] | [DI/Factoryなど] |
138
- | 統合ポイント2 | [別の箇所] | [既存] | [新規] | [方式] |
141
+ | 統合ポイント | 箇所 | 旧実装 | 新実装 | 切替方式 | 検証方式 |
142
+ |------------|-----|-------|-------|---------|---------|
143
+ | 統合ポイント1 | [クラス/関数] | [既存処理] | [新処理] | [DI/Factoryなど] | [この切替が動作することの検証方法] |
144
+ | 統合ポイント2 | [別の箇所] | [既存] | [新規] | [方式] | [検証方法] |
139
145
 
140
146
  ### 主要コンポーネント
141
147
 
@@ -24,6 +24,19 @@
24
24
  - **成功基準**: [Design Docから抽出]
25
25
  - **失敗時の対応**: [Design Docから抽出]
26
26
 
27
+ ## 設計-計画トレーサビリティ
28
+
29
+ Design Docの各技術要件をカバーするタスクへのマッピング。抽出した項目ごとに1行。各行には対応タスクが少なくとも1つ必要。タスクがない場合は明示的なギャップ理由が必要。
30
+
31
+ | DDセクション | DD項目 | カテゴリ | カバーするタスク | ギャップステータス | 備考 |
32
+ |---|---|---|---|---|---|
33
+ | [DDのセクション名] | [具体的な項目] | impl-target / connection-switching / contract-change / verification / prerequisite | [Phase X タスクY] | covered | |
34
+ | セキュリティ考慮事項 | APIの入力バリデーション | prerequisite | — | gap | ユーザー判断によりPhase 2に延期 |
35
+
36
+ **カテゴリ値**: `impl-target`(実装対象)、`connection-switching`(接続/切替/登録)、`contract-change`(コントラクト変更と伝搬)、`verification`(検証要件)、`prerequisite`(前提作業)
37
+
38
+ **ギャップステータス値**: `covered`(タスクあり)、`gap`(タスクなし — 備考に理由必須、計画承認前にユーザー確認が必要)
39
+
27
40
  ## 目的
28
41
  [なぜこの変更が必要か、何を解決するか]
29
42
 
@@ -50,13 +50,14 @@ C4Context
50
50
 
51
51
  ### Must Have (P1 - MVP)
52
52
  - [ ] 要件1: [詳細説明]
53
- - AC: [受入条件 - Given/When/Then形式または測定可能な基準]
53
+ - AC-001: [受入条件 - Given/When/Then形式または測定可能な基準]
54
+ - AC-002: [受入条件]
54
55
  - [ ] 要件2: [詳細説明]
55
- - AC: [受入条件]
56
+ - AC-003: [受入条件]
56
57
 
57
58
  ### Should Have (P2)
58
59
  - [ ] 要件1: [詳細説明]
59
- - AC: [受入条件]
60
+ - AC-004: [受入条件]
60
61
 
61
62
  ### Could Have (P3)
62
63
  - [ ] 要件1: [詳細説明]
@@ -28,7 +28,7 @@ PRDの受入条件をプロトタイプの参照先にマッピング。プロ
28
28
 
29
29
  | AC ID | AC概要 | 画面 / 状態 | プロトタイプ参照先(要素ID / パス) | 採用判定 |
30
30
  |-------|--------|------------|----------------------------------|---------|
31
- | AC-01 | [EARS AC概要] | [画面名 / 状態名] | [要素またはファイルの参照先] | 採用 / 不採用 / 保留 |
31
+ | AC-001 | [EARS AC概要] | [画面名 / 状態名] | [要素またはファイルの参照先] | 採用 / 不採用 / 保留 |
32
32
 
33
33
  ## 画面リストと遷移
34
34
 
@@ -62,14 +62,14 @@ PRDの受入条件をプロトタイプの参照先にマッピング。プロ
62
62
  #### 状態×表示マトリクス
63
63
 
64
64
  | 状態 | デフォルト | ローディング | Empty | エラー | 部分表示 |
65
- |------|----------|------------|-------|-------|---------|
66
- | 表示 | [通常表示] | [スケルトン / スピナー] | [Empty状態 + CTA] | [エラーメッセージ + 回復アクション] | [キャッシュ / 部分表示] |
65
+ |------|---------|---------|-------|-------|---------|
66
+ | 表示 | [通常表示] | [具体パターン: 例 `ExistingComponent`のSkeleton / `ui/Spinner`] | [Emptyメッセージ + CTA: 例 "データがありません" + `Button` "新規作成"] | [エラーメッセージ + 回復: 例 `Alert` variant="error" + `Button` "再試行"] | [キャッシュ表示 + `Banner` "接続が切断されました。キャッシュデータを表示中"] |
67
67
 
68
68
  #### インタラクション定義
69
69
 
70
70
  | AC ID | EARS条件 | ユーザーアクション | システムレスポンス | 状態遷移 | エラーハンドリング |
71
71
  |-------|---------|-----------------|------------------|---------|-----------------|
72
- | AC-01 | When [トリガー] | [クリック / 入力 / 等] | [期待される動作] | [遷移元状態 → 遷移先状態] | [リトライ / リセット / フォールバック] |
72
+ | AC-001 | When [トリガー] | [クリック / 入力 / 等] | [期待される動作] | [遷移元状態 → 遷移先状態] | [リトライ / リセット / フォールバック] |
73
73
 
74
74
  ### コンポーネント: [ComponentName2]
75
75
 
@@ -78,10 +78,18 @@ PRDの受入条件をプロトタイプの参照先にマッピング。プロ
78
78
  ## デザイントークンとコンポーネントマップ
79
79
 
80
80
  ### 環境制約
81
+
81
82
  - 対象ブラウザ: [例: Chrome 120+, Safari 17+]
82
- - レスポンシブBreakpoint: [例: 768px, 1024px, 1280px]
83
83
  - テーマ対応: [例: ライト/ダーク、システム設定に追従]
84
84
 
85
+ #### レスポンシブ動作
86
+
87
+ | ブレークポイント | 幅 | 主な変更点 |
88
+ |----------------|-----|-----------|
89
+ | モバイル | [例: < 768px] | [例: シングルカラム、ハンバーガーナビ、本文14px] |
90
+ | タブレット | [例: 768px - 1023px] | [例: 2カラムグリッド、サイドバー折りたたみ] |
91
+ | デスクトップ | [例: ≥ 1024px] | [例: フルレイアウト、ナビ展開、サイドバー表示] |
92
+
85
93
  ### 既存コンポーネント再利用マップ
86
94
 
87
95
  | UI要素 | 判定 | 既存コンポーネント | 備考 |
@@ -92,10 +100,56 @@ PRDの受入条件をプロトタイプの参照先にマッピング。プロ
92
100
 
93
101
  ### デザイントークン
94
102
 
103
+ #### Color Roles
104
+
105
+ | ロール | トークン | 値 | 用途 |
106
+ |--------|---------|-----|------|
107
+ | Background Surface | [bg-primary] | [例: #FFFFFF] | [ページ背景] |
108
+ | Background Surface | [bg-secondary] | [例: #F9FAFB] | [カード、セクション背景] |
109
+ | Text | [text-primary] | [例: #111827] | [見出し、本文] |
110
+ | Text | [text-secondary] | [例: #6B7280] | [キャプション、プレースホルダー] |
111
+ | Brand / Accent | [color-brand] | [例: #1A73E8] | [プライマリアクション、リンク] |
112
+ | Status | [color-success] | [例: #22C55E] | [成功状態、確認] |
113
+ | Status | [color-error] | [例: #EF4444] | [エラー状態、破壊的アクション] |
114
+ | Border | [border-primary] | [例: #E5E7EB] | [カードボーダー、区切り線] |
115
+
116
+ #### Typography Hierarchy
117
+
118
+ | ロール | フォント | サイズ | ウェイト | 行間 | 字間 |
119
+ |--------|---------|--------|---------|------|------|
120
+ | Heading 1 | [例: Inter] | [例: 30px] | [例: 700] | [例: 1.2] | [例: -0.02em] |
121
+ | Heading 2 | [例: Inter] | [例: 24px] | [例: 600] | [例: 1.3] | [例: -0.01em] |
122
+ | Body | [例: Inter] | [例: 16px] | [例: 400] | [例: 1.5] | [例: 0] |
123
+ | Caption | [例: Inter] | [例: 12px] | [例: 400] | [例: 1.4] | [例: 0.01em] |
124
+ | Monospace | [例: JetBrains Mono] | [例: 14px] | [例: 400] | [例: 1.6] | [例: 0] |
125
+
126
+ #### Spacing Scale
127
+
128
+ | トークン | 値 | 用途 |
129
+ |---------|-----|------|
130
+ | [spacing-xs] | [例: 4px] | [インライン要素間のギャップ] |
131
+ | [spacing-sm] | [例: 8px] | [コンパクトなパディング] |
132
+ | [spacing-md] | [例: 16px] | [デフォルトのコンポーネントパディング] |
133
+ | [spacing-lg] | [例: 24px] | [セクション間隔] |
134
+ | [spacing-xl] | [例: 40px] | [ページセクション間の分離] |
135
+
136
+ #### Elevation(Depth)
137
+
138
+ | レベル | 値 | 用途 |
139
+ |--------|-----|------|
140
+ | 0 (Flat) | [例: none] | [インライン要素、テキスト] |
141
+ | 1 (Raised) | [例: 0 1px 2px rgba(0,0,0,0.05)] | [カード、ボタン] |
142
+ | 2 (Floating) | [例: 0 4px 12px rgba(0,0,0,0.1)] | [ドロップダウン、ポップオーバー] |
143
+ | 3 (Overlay) | [例: 0 8px 24px rgba(0,0,0,0.15)] | [モーダル、ダイアログ] |
144
+
145
+ #### Border Radius Scale
146
+
95
147
  | トークン | 値 | 用途 |
96
148
  |---------|-----|------|
97
- | [color-primary] | [] | [プライマリアクション] |
98
- | [spacing-md] | [] | [コンポーネント間隔] |
149
+ | [radius-sm] | [例: 4px] | [バッジ、チップ] |
150
+ | [radius-md] | [例: 8px] | [カード、入力フィールド] |
151
+ | [radius-lg] | [例: 12px] | [モーダル、パネル] |
152
+ | [radius-full] | [例: 9999px] | [アバター、ピル] |
99
153
 
100
154
  ## ビジュアル受入条件
101
155
 
@@ -59,16 +59,56 @@ it.todo('[AC番号]: [テスト名]')
59
59
  it.todo('[AC番号]-property: [不変条件記述]')
60
60
  ```
61
61
 
62
+ ## マルチステップユーザージャーニーの定義
63
+
64
+ 以下の3条件を**すべて**満たす場合、その機能にはマルチステップユーザージャーニーが含まれる:
65
+
66
+ 1. **2つ以上の異なるインタラクション境界**をユーザーゴール達成のために順番に通過する。何が境界に該当するかはシステムタイプによる:
67
+ - Web: 異なるルート/ページ
68
+ - モバイルネイティブ: 異なる画面/ビュー
69
+ - CLI: 異なるコマンド呼び出しまたは対話型プロンプト
70
+ - API: トランザクションを形成する異なるAPI呼び出し(例: 作成 → 確認 → 確定)
71
+ 2. **ステップ間で状態が伝搬する** — あるステップで生成されたデータや実行されたアクションが、次のステップの受け入れや表示に影響する
72
+ 3. **ジャーニーに完了ポイントがある** — ユーザーまたは呼び出し元が到達する最終状態(例: 確認ページ、保存されたレコード、API成功レスポンス、完了したワークフロー)
73
+
74
+ ### ユーザー向け vs サービス内部の分類
75
+
76
+ マルチステップジャーニーはE2E予算判断のためにさらに分類される:
77
+
78
+ | 分類 | 条件 | E2E予約スロット | 例 |
79
+ |------|------|----------------|-----|
80
+ | **ユーザー向け** | 人間のユーザーが直接ステップをトリガーし結果を観察する(UI、CLI、または直接的なAPIインタラクション経由) | 対象 | Web購入フロー、CLIセットアップウィザード、モバイルオンボーディング |
81
+ | **サービス内部** | バックエンドサービスがユーザーの直接操作なしにステップをトリガーする | 予約スロット対象外 | 非同期ジョブパイプライン、サービス間saga、スケジュールバッチ処理 |
82
+
83
+ **この分類のスコープ**:
84
+ - **E2E予約スロット**: ユーザー向けジャーニーのみが対象。サービス内部ジャーニーは予約スロットから除外される。
85
+ - **通常のROI > 50パス**: ユーザー向け・サービス内部の両方が追加E2Eスロット(最大1件)をROI実績で競う。この分類はこのパスに影響しない。
86
+ - **E2Eギャップチェック**: ユーザー向けジャーニーのみがgap警告をトリガーする。サービス内部ジャーニーはトリガーしない。
87
+
62
88
  ### ROI計算
63
89
 
64
90
  ```
65
- ROI = (ビジネス価値 × 頻度 + 法的要件 × 10 + 欠陥検出) / 総コスト
91
+ ROI Score = Business Value × User Frequency + Legal Requirement × 10 + Defect Detection(範囲: 0–120)
66
92
  ```
67
93
 
68
- | 種別 | 総コスト | E2E生成条件 |
69
- |------|---------|------------|
70
- | 統合 | 11 | - |
71
- | E2E | 38 | ROI > 50 |
94
+ ROI Scoreは**同一テスト種別内での優先順位付け**に使用する(統合テスト同士、E2Eテスト同士)。テスト種別間の比較には使用しない。統合とE2Eの予算は独立して選択されるため、種別間比較は不要。
95
+
96
+ ROI Scoreが高い = 同一テスト種別内での優先度が高い。正規化やキャッピングは適用しない 生のスコアをそのままランキングに使用する。重複排除は候補自体を除外する別のステップであり、スコアは変更しない。
97
+
98
+ #### E2EのROI閾値
99
+
100
+ E2Eテストは所有コストが高い(作成・実行・保守それぞれが統合テストの3〜10倍)。予約スロット(ユーザー向けマルチステップジャーニー)を超える追加E2Eスロットには **ROI Score > 50** が必要。
101
+
102
+ #### ROI計算例
103
+
104
+ | シナリオ | BV | Freq | Legal | Defect | ROI Score | テスト種別 | 選択結果 |
105
+ |----------|----|------|-------|--------|-----------|-----------|---------|
106
+ | コア決済フロー | 10 | 9 | true | 9 | 109 | E2E | 選択(予約スロット: ユーザー向けマルチステップジャーニー) |
107
+ | 決済エラー処理 | 8 | 3 | false | 7 | 31 | E2E | 閾値未満(31 < 50)、不選択 |
108
+ | プロフィール保存フロー | 7 | 6 | false | 6 | 48 | E2E | 閾値未満(48 < 50)、不選択 |
109
+ | DB永続化チェック | 8 | 8 | false | 8 | 72 | 統合 | 選択(3件中ランク1位) |
110
+ | エラーメッセージ表示 | 5 | 3 | false | 4 | 19 | 統合 | 選択(3件中ランク2位) |
111
+ | 任意フィルタ切替 | 3 | 4 | false | 2 | 14 | 統合 | 不選択(ランク4位、上限到達) |
72
112
 
73
113
  ## 実装ルール
74
114
 
@@ -132,12 +132,12 @@ description: サブエージェントのタスク分担と連携を調整。規
132
132
  | codebase-analyzer | analysisScope.categoriesDetected, dataModel.detected, focusAreas[], existingElements count, limitations | focusAreasをtechnical-designerにコンテキストとして渡す |
133
133
  | code-verifier | status (consistent/mostly_consistent/needs_review/inconsistent), consistencyScore, discrepancies[], reverseCoverage (dataOperationsInCode, testBoundariesSectionPresent). 実装前: Design Docの主張を既存コードに対して検証。実装後: 実装のDesign Doc整合性を検証(`code_paths`で変更ファイルにスコープ) | discrepanciesをdocument-reviewerに連携 |
134
134
  | task-executor | status (escalation_needed/completed), escalation_type, testsAdded, requiresTestReview | escalation_needed時: escalation_type別に対応(design_compliance_violation, similar_function_found, similar_component_found, investigation_target_not_found, out_of_scope_file) |
135
- | quality-fixer | status (approved/blocked), reason, blockingIssues[], missingPrerequisites[] | blocked時: 下記quality-fixer blockedハンドリング参照 |
135
+ | quality-fixer | status (approved/stub_detected/blocked), reason, blockingIssues[], missingPrerequisites[] | approved: コミット可。stub_detected: スタブ実装を検出、task-executorに差し戻して本実装を完了させる。blocked: 下記quality-fixer blockedハンドリング参照 |
136
136
  | document-reviewer | approvalReady (true/false) | trueで次ステップへ。falseで修正を依頼 |
137
- | design-sync | sync_status (synced/conflicts_found) | conflicts_found時: 矛盾をユーザーに提示してから進む |
137
+ | design-sync | sync_status (NO_CONFLICTS/CONFLICTS_FOUND) | CONFLICTS_FOUND時: 矛盾をユーザーに提示してから進む |
138
138
  | integration-test-reviewer | status (approved/needs_revision/blocked), requiredFixes | needs_revision時: requiredFixesをtask-executorに戻す |
139
139
  | security-reviewer | status (approved/approved_with_notes/needs_revision/blocked), findings, notes, requiredFixes | needs_revision時: requiredFixesをtask-executorに戻す |
140
- | acceptance-test-generator | status, generatedFiles | generatedFileswork-plannerに渡す |
140
+ | acceptance-test-generator | status, generatedFiles { integration: string, e2e: string | null }, e2eAbsenceReason: string | null | generatedFiles.integrationとgeneratedFiles.e2e(nullable)をwork-plannerに渡す。e2eがnullの場合、e2eAbsenceReasonが妥当であればエラーではない |
141
141
 
142
142
  ### quality-fixer blockedハンドリング
143
143
 
@@ -297,7 +297,13 @@ requirement-analyzerが複数レイヤー(backend + frontend)にまたがる
297
297
 
298
298
  #### technical-designer → work-planner
299
299
 
300
- **work-plannerへの入力**: Design Docパス。work-plannerがDesign Docから検証戦略を抽出し、作業計画書ヘッダーに記載する。
300
+ **work-plannerへの入力**: Design Docパス。work-plannerがDDの全セクションをスキャンし、Step 5のカテゴリ(impl-target, connection-switching, contract-change, verification, prerequisite)に沿って技術要件を抽出した上で、設計-計画トレーサビリティ表を作成する。
301
+
302
+ **ギャップ発生時の制御(オーケストレーターの責務)**: work-plannerが`gap`を含むドラフト計画書を出力した場合、オーケストレーターは以下を実行する:
303
+ 1. ギャップ項目と理由をユーザーに提示する
304
+ 2. ユーザーが各ギャップを確認するまで計画書をドラフト状態に保つ
305
+ 3. 全ギャップの解消または確認が完了するまで、後続エージェント(task-decomposer等)に計画書を渡さない
306
+ 理由なしのギャップはエラーとして扱い、work-plannerに差し戻してカバーするタスクの追加または理由の記載を求める。
301
307
 
302
308
  #### *1 acceptance-test-generator → work-planner
303
309
 
@@ -306,14 +312,16 @@ requirement-analyzerが複数レイヤー(backend + frontend)にまたがる
306
312
  - UI Spec: [パス](存在する場合)
307
313
 
308
314
  **オーケストレーター確認項目**:
309
- - 統合テストファイルパスの取得と存在確認
310
- - E2Eテストファイルパスの取得と存在確認
315
+ - `generatedFiles.integration`が有効なパスであり(nullでない場合)、ファイルが存在すること
316
+ - `generatedFiles.e2e`が有効なパスであり(nullでない場合)、ファイルが存在すること
317
+ - `generatedFiles.e2e`がnullの場合、`e2eAbsenceReason`が存在すること — これは意図的な不在であり、エラーではない
311
318
 
312
319
  **work-plannerへの入力**:
313
320
  - 統合テストファイル: [パス](各フェーズの実装と同時に作成・実行)
314
- - E2Eテストファイル: [パス](最終フェーズでのみ実行)
321
+ - E2Eテストファイル: [パス]またはnull(提供された場合のみ最終フェーズで実行)
322
+ - E2E不在理由: [理由](E2Eがnullの場合 — work-plannerがE2Eギャップチェックをスキップするために渡す)
315
323
 
316
- **エラー時**: ファイルが生成されない場合はユーザーにエスカレーション
324
+ **エラー時**: 統合テストファイル生成が予期せず失敗した場合(status != completed)はユーザーにエスカレーション。E2Eがnullかつ不在理由が妥当な場合はエラーではない。
317
325
  3. **ADRステータス管理**: ユーザー判断後のADRステータス更新(Accepted/Rejected)
318
326
 
319
327
  ## 重要な制約