create-ai-project 1.16.2 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/.claude/agents-en/acceptance-test-generator.md +4 -3
  2. package/.claude/agents-en/code-reviewer.md +2 -2
  3. package/.claude/agents-en/code-verifier.md +2 -2
  4. package/.claude/agents-en/design-sync.md +2 -2
  5. package/.claude/agents-en/document-reviewer.md +4 -4
  6. package/.claude/agents-en/integration-test-reviewer.md +2 -2
  7. package/.claude/agents-en/investigator.md +2 -2
  8. package/.claude/agents-en/prd-creator.md +4 -2
  9. package/.claude/agents-en/quality-fixer-frontend.md +7 -5
  10. package/.claude/agents-en/quality-fixer.md +3 -3
  11. package/.claude/agents-en/requirement-analyzer.md +2 -2
  12. package/.claude/agents-en/scope-discoverer.md +2 -2
  13. package/.claude/agents-en/skill-creator.md +2 -2
  14. package/.claude/agents-en/skill-reviewer.md +2 -2
  15. package/.claude/agents-en/solver.md +2 -2
  16. package/.claude/agents-en/task-decomposer.md +2 -2
  17. package/.claude/agents-en/task-executor-frontend.md +3 -3
  18. package/.claude/agents-en/task-executor.md +2 -2
  19. package/.claude/agents-en/technical-designer-frontend.md +17 -6
  20. package/.claude/agents-en/technical-designer.md +2 -2
  21. package/.claude/agents-en/ui-spec-designer.md +115 -0
  22. package/.claude/agents-en/verifier.md +2 -2
  23. package/.claude/agents-en/work-planner.md +2 -2
  24. package/.claude/agents-ja/acceptance-test-generator.md +4 -3
  25. package/.claude/agents-ja/code-reviewer.md +2 -2
  26. package/.claude/agents-ja/code-verifier.md +2 -2
  27. package/.claude/agents-ja/design-sync.md +2 -2
  28. package/.claude/agents-ja/document-reviewer.md +4 -4
  29. package/.claude/agents-ja/integration-test-reviewer.md +2 -2
  30. package/.claude/agents-ja/investigator.md +2 -2
  31. package/.claude/agents-ja/prd-creator.md +4 -2
  32. package/.claude/agents-ja/quality-fixer-frontend.md +7 -5
  33. package/.claude/agents-ja/quality-fixer.md +3 -3
  34. package/.claude/agents-ja/requirement-analyzer.md +2 -2
  35. package/.claude/agents-ja/scope-discoverer.md +2 -2
  36. package/.claude/agents-ja/skill-creator.md +2 -2
  37. package/.claude/agents-ja/skill-reviewer.md +2 -2
  38. package/.claude/agents-ja/solver.md +2 -2
  39. package/.claude/agents-ja/task-decomposer.md +2 -2
  40. package/.claude/agents-ja/task-executor-frontend.md +3 -3
  41. package/.claude/agents-ja/task-executor.md +2 -2
  42. package/.claude/agents-ja/technical-designer-frontend.md +17 -6
  43. package/.claude/agents-ja/technical-designer.md +2 -2
  44. package/.claude/agents-ja/ui-spec-designer.md +115 -0
  45. package/.claude/agents-ja/verifier.md +2 -2
  46. package/.claude/agents-ja/work-planner.md +2 -2
  47. package/.claude/commands-en/add-integration-tests.md +1 -1
  48. package/.claude/commands-en/build.md +55 -19
  49. package/.claude/commands-en/create-skill.md +1 -1
  50. package/.claude/commands-en/design.md +1 -1
  51. package/.claude/commands-en/diagnose.md +2 -2
  52. package/.claude/commands-en/front-build.md +40 -20
  53. package/.claude/commands-en/front-design.md +25 -8
  54. package/.claude/commands-en/front-plan.md +17 -9
  55. package/.claude/commands-en/front-review.md +2 -2
  56. package/.claude/commands-en/implement.md +15 -10
  57. package/.claude/commands-en/project-inject.md +1 -1
  58. package/.claude/commands-en/refine-skill.md +1 -1
  59. package/.claude/commands-en/reverse-engineer.md +3 -3
  60. package/.claude/commands-en/review.md +2 -2
  61. package/.claude/commands-en/sync-skills.md +1 -1
  62. package/.claude/commands-en/update-doc.md +2 -2
  63. package/.claude/commands-ja/add-integration-tests.md +1 -1
  64. package/.claude/commands-ja/build.md +56 -18
  65. package/.claude/commands-ja/create-skill.md +1 -1
  66. package/.claude/commands-ja/design.md +1 -1
  67. package/.claude/commands-ja/diagnose.md +2 -2
  68. package/.claude/commands-ja/front-build.md +41 -21
  69. package/.claude/commands-ja/front-design.md +26 -9
  70. package/.claude/commands-ja/front-plan.md +15 -7
  71. package/.claude/commands-ja/front-review.md +2 -2
  72. package/.claude/commands-ja/implement.md +15 -10
  73. package/.claude/commands-ja/project-inject.md +1 -1
  74. package/.claude/commands-ja/refine-skill.md +1 -1
  75. package/.claude/commands-ja/reverse-engineer.md +3 -3
  76. package/.claude/commands-ja/review.md +2 -2
  77. package/.claude/commands-ja/sync-skills.md +1 -1
  78. package/.claude/commands-ja/update-doc.md +2 -2
  79. package/.claude/skills-en/documentation-criteria/SKILL.md +37 -1
  80. package/.claude/skills-en/documentation-criteria/references/design-template.md +24 -0
  81. package/.claude/skills-en/documentation-criteria/references/prd-template.md +10 -0
  82. package/.claude/skills-en/documentation-criteria/references/ui-spec-template.md +145 -0
  83. package/.claude/skills-en/{frontend/technical-spec → frontend-technical-spec}/SKILL.md +5 -5
  84. package/.claude/skills-en/{frontend/typescript-rules → frontend-typescript-rules}/SKILL.md +1 -1
  85. package/.claude/skills-en/{frontend/typescript-testing → frontend-typescript-testing}/SKILL.md +9 -2
  86. package/.claude/skills-en/frontend-typescript-testing/references/e2e.md +185 -0
  87. package/.claude/skills-en/integration-e2e-testing/SKILL.md +4 -0
  88. package/.claude/skills-en/integration-e2e-testing/references/e2e-design.md +86 -0
  89. package/.claude/skills-en/subagents-orchestration-guide/SKILL.md +44 -22
  90. package/.claude/skills-en/task-analyzer/references/skills-index.yaml +15 -11
  91. package/.claude/skills-en/technical-spec/SKILL.md +5 -4
  92. package/.claude/skills-ja/documentation-criteria/SKILL.md +37 -1
  93. package/.claude/skills-ja/documentation-criteria/references/design-template.md +24 -0
  94. package/.claude/skills-ja/documentation-criteria/references/prd-template.md +10 -0
  95. package/.claude/skills-ja/documentation-criteria/references/ui-spec-template.md +145 -0
  96. package/.claude/skills-ja/{frontend/technical-spec → frontend-technical-spec}/SKILL.md +5 -5
  97. package/.claude/skills-ja/{frontend/typescript-rules → frontend-typescript-rules}/SKILL.md +1 -1
  98. package/.claude/skills-ja/{frontend/typescript-testing → frontend-typescript-testing}/SKILL.md +2 -2
  99. package/.claude/skills-ja/frontend-typescript-testing/references/e2e.md +185 -0
  100. package/.claude/skills-ja/integration-e2e-testing/SKILL.md +4 -0
  101. package/.claude/skills-ja/integration-e2e-testing/references/e2e-design.md +86 -0
  102. package/.claude/skills-ja/subagents-orchestration-guide/SKILL.md +44 -22
  103. package/.claude/skills-ja/task-analyzer/references/skills-index.yaml +15 -11
  104. package/.claude/skills-ja/technical-spec/SKILL.md +5 -4
  105. package/CHANGELOG.md +67 -0
  106. package/CLAUDE.en.md +2 -2
  107. package/CLAUDE.ja.md +2 -2
  108. package/CLAUDE.md +68 -86
  109. package/README.ja.md +10 -7
  110. package/README.md +10 -7
  111. package/bin/create-project.js +76 -75
  112. package/biome.json +5 -8
  113. package/package.json +11 -24
  114. package/scripts/post-setup.js +54 -57
  115. package/scripts/set-language.js +107 -112
  116. package/scripts/setup-project.js +97 -92
  117. package/scripts/show-coverage.js +36 -22
  118. package/scripts/update-project.js +205 -201
  119. package/scripts/utils.js +19 -21
  120. package/tsconfig.json +3 -3
  121. package/vitest.config.mjs +2 -2
  122. package/.tsprunerc +0 -11
  123. package/scripts/check-unused-exports.js +0 -69
@@ -4,6 +4,10 @@
4
4
 
5
5
  [Explain the purpose and overview of this feature in 2-3 sentences]
6
6
 
7
+ ### Referenced UI Spec (when feature includes frontend)
8
+ - UI Spec path: [docs/ui-spec/xxx-ui-spec.md]
9
+ - Component structure and state design are inherited from UI Spec
10
+
7
11
  ## Design Summary (Meta)
8
12
 
9
13
  ```yaml
@@ -196,6 +200,26 @@ Invariants:
196
200
  - [Condition that must always hold true]
197
201
  - [Constraints on valid state transitions]
198
202
 
203
+ ### UI Error State Design (when feature includes frontend)
204
+
205
+ | Component / Screen | Loading | Empty | Error | Partial |
206
+ |-------------------|---------|-------|-------|---------|
207
+ | [Component name] | [Skeleton / spinner] | [Empty state + CTA] | [Error message + Retry] | [Cached display + Banner] |
208
+
209
+ ### Client State Design (when feature includes frontend)
210
+
211
+ | State Category | State | Management Method | Sync Strategy |
212
+ |---------------|-------|-------------------|---------------|
213
+ | Server state | [Fetched data] | [Cache library / custom hook] | [Polling / WebSocket / manual refresh] |
214
+ | Local UI state | [Modal open, tab selection] | [useState / useReducer] | - |
215
+ | Temporary state | [Form input, draft] | [useState / form library] | [Auto-save / manual save] |
216
+
217
+ ### UI Action - API Contract Mapping (when feature includes frontend)
218
+
219
+ | UI Action | API Endpoint | Request | Response | Error Contract |
220
+ |-----------|-------------|---------|----------|----------------|
221
+ | [Button click / form submit] | [POST /api/xxx] | [Request body fields] | [Response fields] | [Error codes and UI handling] |
222
+
199
223
  ### Error Handling
200
224
 
201
225
  [Types of errors and how to handle them]
@@ -60,6 +60,12 @@ So that [expected value/benefit]
60
60
  ### Scalability
61
61
  - [Considerations for future scaling]
62
62
 
63
+ ### Accessibility (when feature includes UI)
64
+ - Compliance standard: [Default: WCAG 2.1 AA (use organization standard if available)]
65
+ - Target assistive technologies: [Screen reader, keyboard operation, voice control, etc.]
66
+ - Platform requirements: [e.g., app store review requirements]
67
+ - Known constraints: [e.g., external library limitations]
68
+
63
69
  ## Success Criteria
64
70
 
65
71
  ### Quantitative Metrics
@@ -71,6 +77,10 @@ So that [expected value/benefit]
71
77
  1. [User experience metric 1]
72
78
  2. [User experience metric 2]
73
79
 
80
+ ### UI Quality Metrics (when feature includes UI)
81
+ 1. [Key operation completion rate / error recovery rate / retry success rate]
82
+ 2. [Accessibility audit target score]
83
+
74
84
  ## Technical Considerations
75
85
 
76
86
  ### Dependencies
@@ -0,0 +1,145 @@
1
+ # [Feature Name] UI Specification
2
+
3
+ ## Overview
4
+
5
+ [Purpose and scope of this UI Specification in 2-3 sentences]
6
+
7
+ ### Target PRD
8
+ - PRD path: [docs/prd/xxx-prd.md | "N/A — based on requirement-analyzer output"]
9
+ - Feature scope: [Which PRD requirements this UI Spec covers | Summary of analyzed requirements]
10
+
11
+ ### Design Source
12
+ | Source | Path | Version |
13
+ |--------|------|---------|
14
+ | Prototype code | [docs/ui-spec/assets/xxx/] | [commit SHA / tag] |
15
+
16
+ ## Prototype Management
17
+
18
+ Prototype code is an **attachment** to this UI Spec. The canonical specification is always this document + the Design Doc.
19
+
20
+ - **Attachment path**: [docs/ui-spec/assets/{feature-name}/]
21
+ - **Version identification**: [commit SHA / tag]
22
+ - **Compliance premise**: [e.g., design system compliance, component library usage]
23
+ - **Relationship to canonical spec**: Differences between prototype and this spec are resolved in favor of this document. Prototype serves as visual/behavioral reference only.
24
+
25
+ ## AC Traceability (Prototype)
26
+
27
+ Map PRD acceptance criteria to prototype references. Skip this section if no prototype is provided.
28
+
29
+ | AC ID | AC Summary | Screen / State | Prototype Reference (element ID / path) | Adoption Decision |
30
+ |-------|-----------|----------------|----------------------------------------|-------------------|
31
+ | AC-01 | [EARS AC summary] | [Screen / state name] | [element or file reference] | Adopted / Not adopted / On hold |
32
+
33
+ ## Screen List and Transitions
34
+
35
+ ### Screen List
36
+
37
+ | Screen ID | Screen Name | Description | Entry Condition |
38
+ |-----------|------------|-------------|-----------------|
39
+ | S-01 | [Screen name] | [Purpose] | [How user reaches this screen] |
40
+
41
+ ### Transition Conditions
42
+
43
+ | Source | Destination | Trigger | Guard Condition |
44
+ |--------|------------|---------|-----------------|
45
+ | S-01 | S-02 | [User action] | [Precondition if any] |
46
+
47
+ ## Component Decomposition
48
+
49
+ ### Component Tree
50
+
51
+ ```
52
+ [Page/Screen]
53
+ +-- [Container Component]
54
+ | +-- [Presentational Component A]
55
+ | +-- [Presentational Component B]
56
+ +-- [Container Component]
57
+ +-- [Presentational Component C]
58
+ ```
59
+
60
+ ### Component: [ComponentName]
61
+
62
+ #### State x Display Matrix
63
+
64
+ | State | Default | Loading | Empty | Error | Partial |
65
+ |-------|---------|---------|-------|-------|---------|
66
+ | Display | [Normal display] | [Skeleton / spinner] | [Empty state + CTA] | [Error message + recovery action] | [Cached / partial display] |
67
+
68
+ #### Interaction Definition
69
+
70
+ | AC ID | EARS Condition | User Action | System Response | State Transition | Error Handling |
71
+ |-------|---------------|-------------|-----------------|-----------------|----------------|
72
+ | AC-01 | When [trigger] | [Click / input / etc.] | [Expected behavior] | [From state -> To state] | [Retry / Reset / Fallback] |
73
+
74
+ ### Component: [ComponentName2]
75
+
76
+ [Repeat State x Display Matrix and Interaction Definition for each component]
77
+
78
+ ## Design Tokens and Component Map
79
+
80
+ ### Environment Constraints
81
+ - Target browsers: [e.g., Chrome 120+, Safari 17+]
82
+ - Responsive breakpoints: [e.g., 768px, 1024px, 1280px]
83
+ - Theme support: [e.g., light/dark, system preference]
84
+
85
+ ### Existing Component Reuse Map
86
+
87
+ | UI Element | Decision | Existing Component | Notes |
88
+ |-----------|----------|-------------------|-------|
89
+ | [Button] | Reuse | [components/ui/Button] | [No modifications needed] |
90
+ | [DataTable] | Extend | [components/ui/Table] | [Add sorting support] |
91
+ | [FeatureCard] | New | - | [No similar component exists] |
92
+
93
+ ### Design Tokens
94
+
95
+ | Token | Value | Usage |
96
+ |-------|-------|-------|
97
+ | [color-primary] | [value] | [Primary actions] |
98
+ | [spacing-md] | [value] | [Component spacing] |
99
+
100
+ ## Visual Acceptance
101
+
102
+ ### Golden States
103
+ Define the key visual states that serve as acceptance benchmarks:
104
+
105
+ 1. **[State name]**: [Description of what should be visually confirmed]
106
+ 2. **[State name]**: [Description]
107
+
108
+ ### Layout Constraints
109
+ - [Min/max width, height constraints]
110
+ - [Spacing rules between components]
111
+ - [Overflow behavior]
112
+
113
+ ## Accessibility Requirements
114
+
115
+ ### Keyboard Navigation
116
+
117
+ | Component | Tab Order | Key Binding | Behavior |
118
+ |-----------|-----------|-------------|----------|
119
+ | [Component] | [Order number] | [Enter / Space / Arrow] | [Expected behavior] |
120
+
121
+ ### Screen Reader
122
+
123
+ | Component | Role | Accessible Name | Live Region |
124
+ |-----------|------|-----------------|-------------|
125
+ | [Component] | [ARIA role] | [aria-label / aria-labelledby] | [polite / assertive / none] |
126
+
127
+ ### Contrast Requirements
128
+
129
+ | Element | Foreground | Background | Ratio Target |
130
+ |---------|-----------|------------|-------------|
131
+ | [Text element] | [Color] | [Color] | [4.5:1 for normal text / 3:1 for large text] |
132
+
133
+ ## Open Items
134
+
135
+ | ID | Description | Owner | Deadline |
136
+ |----|-------------|-------|----------|
137
+ | TBD-01 | [Unresolved question or decision] | [Who resolves] | [Target date] |
138
+
139
+ *All TBDs must have an owner and deadline. Resolve before Design Doc creation.*
140
+
141
+ ## Update History
142
+
143
+ | Date | Version | Changes | Author |
144
+ |------|---------|---------|--------|
145
+ | YYYY-MM-DD | 1.0 | Initial version | [Name] |
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: frontend/technical-spec
2
+ name: frontend-technical-spec
3
3
  description: Defines frontend environment variables, component design, and data flow patterns. Use when configuring React environment.
4
4
  ---
5
5
 
@@ -109,10 +109,10 @@ async function fetchUser(id: string): Promise<User> {
109
109
  Use the appropriate run command based on the `packageManager` field in package.json.
110
110
 
111
111
  ### Build Commands
112
- - `dev` - Development server
113
- - `build` - Production build
114
- - `preview` - Preview production build
115
- - `type-check` - Type check (no emit)
112
+ - Auto-detect and execute the following from package.json scripts:
113
+ - Development server
114
+ - Production build
115
+ - Type check (no emit)
116
116
 
117
117
  ### Testing Commands
118
118
  - `test` - Run tests
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: frontend/typescript-rules
2
+ name: frontend-typescript-rules
3
3
  description: Applies React/TypeScript type safety, component design, and state management rules. Use when implementing React components.
4
4
  ---
5
5
 
@@ -1,10 +1,17 @@
1
1
  ---
2
- name: frontend/typescript-testing
3
- description: Designs tests with React Testing Library and MSW. Applies component testing patterns.
2
+ name: frontend-typescript-testing
3
+ description: Designs tests with React Testing Library, MSW, and Playwright E2E. Applies component testing and E2E testing patterns.
4
4
  ---
5
5
 
6
6
  # TypeScript Testing Rules (Frontend)
7
7
 
8
+ ## References
9
+
10
+ | Test Type | Reference | When to Use |
11
+ |-----------|-----------|-------------|
12
+ | **Unit / Integration** | This document | Implementing React component tests with RTL + Vitest + MSW |
13
+ | **E2E** | [references/e2e.md](references/e2e.md) | Implementing browser-level E2E tests with Playwright |
14
+
8
15
  ## Test Framework
9
16
  - **Vitest**: This project uses Vitest
10
17
  - **React Testing Library**: For component testing
@@ -0,0 +1,185 @@
1
+ # E2E Test Implementation with Playwright
2
+
3
+ ## Test Framework
4
+ - **Playwright Test**: `@playwright/test`
5
+ - Test imports: `import { test, expect } from '@playwright/test'`
6
+
7
+ ## Test Structure
8
+
9
+ ### Directory Layout
10
+ ```
11
+ tests/
12
+ └── e2e/
13
+ ├── pages/ # Page objects
14
+ │ ├── login.page.ts
15
+ │ └── dashboard.page.ts
16
+ ├── fixtures/ # Test fixtures
17
+ │ └── auth.fixture.ts
18
+ └── *.e2e.test.ts # Test files
19
+ ```
20
+
21
+ ### Naming Conventions
22
+ - Test files: `{FeatureName}.e2e.test.ts`
23
+ - Page objects: `{PageName}.page.ts`
24
+ - Fixtures: `{Purpose}.fixture.ts`
25
+
26
+ ## Page Object Pattern
27
+
28
+ Encapsulate page interactions for reusability and maintainability:
29
+
30
+ ```typescript
31
+ import { type Page, type Locator } from '@playwright/test'
32
+
33
+ export class LoginPage {
34
+ readonly emailInput: Locator
35
+ readonly passwordInput: Locator
36
+ readonly submitButton: Locator
37
+
38
+ constructor(private page: Page) {
39
+ this.emailInput = page.getByLabel('Email')
40
+ this.passwordInput = page.getByLabel('Password')
41
+ this.submitButton = page.getByRole('button', { name: 'Sign in' })
42
+ }
43
+
44
+ async login(email: string, password: string) {
45
+ await this.emailInput.fill(email)
46
+ await this.passwordInput.fill(password)
47
+ await this.submitButton.click()
48
+ }
49
+ }
50
+ ```
51
+
52
+ ## Test Patterns
53
+
54
+ ### Basic Test
55
+ ```typescript
56
+ import { test, expect } from '@playwright/test'
57
+
58
+ test('user can navigate to dashboard after login', async ({ page }) => {
59
+ // Arrange
60
+ await page.goto('/login')
61
+
62
+ // Act
63
+ await page.getByLabel('Email').fill('user@example.com')
64
+ await page.getByLabel('Password').fill('password')
65
+ await page.getByRole('button', { name: 'Sign in' }).click()
66
+
67
+ // Assert
68
+ await expect(page).toHaveURL('/dashboard')
69
+ await expect(page.getByRole('heading', { name: 'Dashboard' })).toBeVisible()
70
+ })
71
+ ```
72
+
73
+ ### With Page Objects
74
+ ```typescript
75
+ import { test, expect } from '@playwright/test'
76
+ import { LoginPage } from './pages/login.page'
77
+ import { DashboardPage } from './pages/dashboard.page'
78
+
79
+ test('user completes purchase flow', async ({ page }) => {
80
+ const loginPage = new LoginPage(page)
81
+ const dashboardPage = new DashboardPage(page)
82
+
83
+ await page.goto('/login')
84
+ await loginPage.login('user@example.com', 'password')
85
+ await expect(dashboardPage.heading).toBeVisible()
86
+ })
87
+ ```
88
+
89
+ ### Auth Fixture
90
+ ```typescript
91
+ import { test as base } from '@playwright/test'
92
+
93
+ export const test = base.extend<{ authenticatedPage: Page }>({
94
+ authenticatedPage: async ({ page }, use) => {
95
+ await page.goto('/login')
96
+ await page.getByLabel('Email').fill('user@example.com')
97
+ await page.getByLabel('Password').fill('password')
98
+ await page.getByRole('button', { name: 'Sign in' }).click()
99
+ await page.waitForURL('/dashboard')
100
+ await use(page)
101
+ },
102
+ })
103
+ ```
104
+
105
+ ## Locator Strategy
106
+
107
+ Prefer accessible locators in this order:
108
+ 1. `page.getByRole()` — best for accessibility
109
+ 2. `page.getByLabel()` — form elements
110
+ 3. `page.getByText()` — visible text
111
+ 4. `page.getByTestId()` — last resort
112
+
113
+ ```typescript
114
+ // Preferred
115
+ await page.getByRole('button', { name: 'Submit' }).click()
116
+
117
+ // Avoid
118
+ await page.locator('#submit-btn').click()
119
+ await page.locator('.btn-primary').click()
120
+ ```
121
+
122
+ ## Assertions
123
+
124
+ ```typescript
125
+ // Visibility
126
+ await expect(page.getByText('Success')).toBeVisible()
127
+ await expect(page.getByText('Error')).not.toBeVisible()
128
+
129
+ // Navigation
130
+ await expect(page).toHaveURL('/dashboard')
131
+ await expect(page).toHaveTitle('Dashboard')
132
+
133
+ // Element state
134
+ await expect(page.getByRole('button')).toBeEnabled()
135
+ await expect(page.getByRole('button')).toBeDisabled()
136
+
137
+ // Content
138
+ await expect(page.getByRole('heading')).toHaveText('Welcome')
139
+ ```
140
+
141
+ ## Viewport Testing
142
+
143
+ When UI Spec defines responsive behavior:
144
+
145
+ ```typescript
146
+ test.describe('responsive navigation', () => {
147
+ test('shows hamburger menu on mobile', async ({ page }) => {
148
+ await page.setViewportSize({ width: 375, height: 667 })
149
+ await page.goto('/')
150
+ await expect(page.getByRole('button', { name: 'Menu' })).toBeVisible()
151
+ await expect(page.getByRole('navigation')).not.toBeVisible()
152
+ })
153
+
154
+ test('shows full navigation on desktop', async ({ page }) => {
155
+ await page.setViewportSize({ width: 1280, height: 720 })
156
+ await page.goto('/')
157
+ await expect(page.getByRole('navigation')).toBeVisible()
158
+ })
159
+ })
160
+ ```
161
+
162
+ ## Test Isolation
163
+
164
+ - Each test starts from a clean browser context
165
+ - No shared state between tests
166
+ - Use `beforeEach` for common setup (auth, navigation)
167
+ - Prefer `page.goto()` over in-test navigation for setup steps
168
+
169
+ ## Skeleton Comment Format
170
+
171
+ E2E test skeletons follow the same annotation format as integration tests:
172
+
173
+ ```typescript
174
+ // AC: [Original acceptance criteria text]
175
+ // Behavior: [User action] → [System response] → [Observable result]
176
+ // @category: e2e
177
+ // @dependency: full-system
178
+ // @complexity: high
179
+ // ROI: [score]
180
+ test('AC1: [Description]', async ({ page }) => {
181
+ // Arrange: [Setup description]
182
+ // Act: [Action description]
183
+ // Assert: [Verification description]
184
+ })
185
+ ```
@@ -5,6 +5,10 @@ description: Designs integration and E2E tests with mock boundaries and behavior
5
5
 
6
6
  # Integration Test & E2E Test Design/Implementation Rules
7
7
 
8
+ ## References
9
+
10
+ - **[references/e2e-design.md](references/e2e-design.md)** - E2E test design principles with Playwright (candidate sources, selection criteria, UI Spec mapping)
11
+
8
12
  ## Test Types and Limits
9
13
 
10
14
  | Type | Purpose | File Format | Limit |
@@ -0,0 +1,86 @@
1
+ # E2E Test Design with Playwright
2
+
3
+ ## When to Create E2E Tests
4
+
5
+ E2E tests target **critical user journeys** that span multiple pages or require real browser interaction. Apply the same ROI framework from the parent skill — only create E2E tests when ROI > 50.
6
+
7
+ ### Candidate Sources
8
+
9
+ | Source | What to Extract |
10
+ |--------|----------------|
11
+ | **Design Doc ACs** | User journeys with EARS "When" keyword spanning multiple screens |
12
+ | **UI Spec Screen Transitions** | Multi-step flows (e.g., form wizard, checkout) |
13
+ | **UI Spec State x Display Matrix** | Error/empty/loading states requiring browser-level verification |
14
+ | **UI Spec Interaction Definitions** | Complex interactions (drag-drop, keyboard navigation, responsive behavior) |
15
+
16
+ ### Selection Criteria
17
+
18
+ **Include** (high E2E ROI):
19
+ - Multi-page user journeys (login → dashboard → action → confirmation)
20
+ - Flows requiring real browser APIs (navigation, cookies, localStorage)
21
+ - Accessibility verification requiring actual DOM rendering
22
+ - Responsive behavior across viewports
23
+
24
+ **Exclude** (use integration tests instead):
25
+ - Single-component state changes (use RTL)
26
+ - API response handling (use MSW + RTL)
27
+ - Pure data transformations
28
+
29
+ ## UI Spec to E2E Test Mapping
30
+
31
+ When a UI Spec exists, use it as the primary source for E2E test design:
32
+
33
+ 1. **Extract screen transitions** → Each multi-step transition = 1 E2E candidate
34
+ 2. **Check state x display matrix** → Error states requiring navigation = E2E candidate
35
+ 3. **Review interaction definitions** → Browser-dependent interactions = E2E candidate
36
+ 4. **Cross-reference with Design Doc ACs** → Ensure E2E candidates map to acceptance criteria
37
+
38
+ ### Mapping Template
39
+
40
+ ```
41
+ Screen Transition: [Screen A] → [Screen B] → [Screen C]
42
+ AC Reference: AC-{id}
43
+ User Journey: [Description of what the user accomplishes]
44
+ Preconditions: [Auth state, data state]
45
+ Verification Points:
46
+ - [What to assert at each step]
47
+ E2E ROI Score: [calculated score]
48
+ ```
49
+
50
+ ## Playwright Test Architecture
51
+
52
+ ### Page Object Pattern
53
+
54
+ Organize browser interactions through page objects for maintainability:
55
+
56
+ ```
57
+ tests/
58
+ ├── e2e/
59
+ │ ├── pages/ # Page objects
60
+ │ ├── fixtures/ # Test fixtures and helpers
61
+ │ └── *.e2e.test.ts # Test files
62
+ ```
63
+
64
+ ### Test Isolation
65
+
66
+ - Each test starts from a clean browser context
67
+ - No shared state between tests
68
+ - Use `beforeEach` for common setup (auth, navigation)
69
+ - Prefer `page.goto()` over in-test navigation for setup
70
+
71
+ ### Viewport Testing
72
+
73
+ When UI Spec defines responsive behavior, test critical breakpoints:
74
+
75
+ | Breakpoint | Width | When to Test |
76
+ |-----------|-------|-------------|
77
+ | Mobile | 375px | If UI Spec defines mobile-specific interactions |
78
+ | Tablet | 768px | If UI Spec defines tablet layout differences |
79
+ | Desktop | 1280px | Default — always test |
80
+
81
+ ## Budget Enforcement
82
+
83
+ Hard limits per feature (same as parent skill):
84
+ - **E2E Tests**: MAX 1-2 tests
85
+ - Only generate if ROI score > 50
86
+ - Prefer fewer, comprehensive journey tests over many granular tests
@@ -56,11 +56,12 @@ graph TD
56
56
  ### Document Creation Agents
57
57
  5. **requirement-analyzer**: Requirement analysis and work scale determination (WebSearch enabled, latest technical information research)
58
58
  6. **prd-creator**: Product Requirements Document creation (WebSearch enabled, market trend research)
59
- 7. **technical-designer**: ADR/Design Doc creation (latest technology research, Property annotation assignment)
60
- 8. **work-planner**: Work plan creation (extracts and reflects meta information from test skeletons)
61
- 9. **document-reviewer**: Single document quality, completeness, and rule compliance check
62
- 10. **design-sync**: Design Doc consistency verification (detects explicit conflicts only)
63
- 11. **acceptance-test-generator**: Generate separate integration and E2E test skeletons from Design Doc ACs (EARS format, Property annotations, fast-check support)
59
+ 7. **ui-spec-designer**: UI Specification creation from PRD and optional prototype code (frontend/fullstack features)
60
+ 8. **technical-designer**: ADR/Design Doc creation (latest technology research, Property annotation assignment)
61
+ 9. **work-planner**: Work plan creation from Design Doc and test skeletons
62
+ 10. **document-reviewer**: Single document quality, completeness, and rule compliance check
63
+ 11. **design-sync**: Design Doc consistency verification (detects explicit conflicts only)
64
+ 12. **acceptance-test-generator**: Generate separate integration and E2E test skeletons from Design Doc ACs and optional UI Spec
64
65
 
65
66
  ## My Orchestration Principles
66
67
 
@@ -118,29 +119,33 @@ Subagents respond in JSON format. Key fields for orchestrator decisions:
118
119
  When receiving new features or change requests, I first request requirement analysis from requirement-analyzer.
119
120
  According to scale determination:
120
121
 
121
- ### Large Scale (6+ Files) - 11 Steps
122
+ ### Large Scale (6+ Files) - 11 Steps (backend) / 13 Steps (frontend/fullstack)
122
123
 
123
124
  1. requirement-analyzer → Requirement analysis + Check existing PRD **[Stop]**
124
125
  2. prd-creator → PRD creation
125
126
  3. document-reviewer → PRD review **[Stop: PRD Approval]**
126
- 4. technical-designer → ADR creation (if architecture/technology/data flow changes)
127
- 5. document-reviewer → ADR review (if ADR created) **[Stop: ADR Approval]**
128
- 6. technical-designer → Design Doc creation (cross-layer: per layer, see Cross-Layer Orchestration)
129
- 7. document-reviewer → Design Doc review (cross-layer: per Design Doc)
130
- 8. design-syncConsistency verification **[Stop: Design Doc Approval]**
131
- 9. acceptance-test-generatorTest skeleton generation, pass to work-planner (*1)
132
- 10. work-plannerWork plan creation **[Stop: Batch approval]**
133
- 11. task-decomposerAutonomous execution Completion report
134
-
135
- ### Medium Scale (3-5 Files) - 7 Steps
127
+ 4. **(frontend/fullstack only)** Ask user for prototype code → ui-spec-designer → UI Spec creation
128
+ 5. **(frontend/fullstack only)** document-reviewer → UI Spec review **[Stop: UI Spec Approval]**
129
+ 6. technical-designer → ADR creation (if architecture/technology/data flow changes)
130
+ 7. document-reviewer → ADR review (if ADR created) **[Stop: ADR Approval]**
131
+ 8. technical-designerDesign Doc creation (cross-layer: per layer, see Cross-Layer Orchestration)
132
+ 9. document-reviewerDesign Doc review (cross-layer: per Design Doc)
133
+ 10. design-syncConsistency verification **[Stop: Design Doc Approval]**
134
+ 11. acceptance-test-generatorTest skeleton generation, pass to work-planner (*1)
135
+ 12. work-planner → Work plan creation **[Stop: Batch approval]**
136
+ 13. task-decomposer Autonomous execution Completion report
137
+
138
+ ### Medium Scale (3-5 Files) - 7 Steps (backend) / 9 Steps (frontend/fullstack)
136
139
 
137
140
  1. requirement-analyzer → Requirement analysis **[Stop]**
138
- 2. technical-designer Design Doc creation (cross-layer: per layer, see Cross-Layer Orchestration)
139
- 3. document-reviewer → Design Doc review (cross-layer: per Design Doc)
140
- 4. design-syncConsistency verification **[Stop: Design Doc Approval]**
141
- 5. acceptance-test-generatorTest skeleton generation, pass to work-planner (*1)
142
- 6. work-plannerWork plan creation **[Stop: Batch approval]**
143
- 7. task-decomposerAutonomous execution Completion report
141
+ 2. **(frontend/fullstack only)** Ask user for prototype code → ui-spec-designer UI Spec creation
142
+ 3. **(frontend/fullstack only)** document-reviewer → UI Spec review **[Stop: UI Spec Approval]**
143
+ 4. technical-designerDesign Doc creation (cross-layer: per layer, see Cross-Layer Orchestration)
144
+ 5. document-reviewerDesign Doc review (cross-layer: per Design Doc)
145
+ 6. design-syncConsistency verification **[Stop: Design Doc Approval]**
146
+ 7. acceptance-test-generatorTest skeleton generation, pass to work-planner (*1)
147
+ 8. work-planner → Work plan creation **[Stop: Batch approval]**
148
+ 9. task-decomposer → Autonomous execution → Completion report
144
149
 
145
150
  ### Small Scale (1-2 Files) - 2 Steps
146
151
 
@@ -225,6 +230,22 @@ Stop autonomous execution and escalate to user in the following cases:
225
230
  - Extract necessary information from structured responses
226
231
  - Compose commit messages from changeSummary -> **Execute git commit with Bash**
227
232
  - Explicitly integrate initial and additional requirements when requirements change
233
+
234
+ #### *1 acceptance-test-generator → work-planner
235
+
236
+ **Pass to acceptance-test-generator**:
237
+ - Design Doc: [path]
238
+ - UI Spec: [path] (if exists)
239
+
240
+ **Orchestrator verification items**:
241
+ - Verify integration test file path retrieval and existence
242
+ - Verify E2E test file path retrieval and existence
243
+
244
+ **Pass to work-planner**:
245
+ - Integration test file: [path] (create and execute simultaneously with each phase implementation)
246
+ - E2E test file: [path] (execute only in final phase)
247
+
248
+ **On error**: Escalate to user if files are not generated
228
249
  3. **Quality Assurance and Commit Execution**: After confirming approved=true, immediately execute git commit
229
250
  4. **Autonomous Execution Mode Management**: Start/stop autonomous execution after approval, escalation decisions
230
251
  5. **ADR Status Management**: Update ADR status after user decision (Accepted/Rejected)
@@ -249,6 +270,7 @@ Stop autonomous execution and escalate to user in the following cases:
249
270
  ### Main Stop Points
250
271
  - **After requirement-analyzer completion**: Confirm requirement analysis results and questions
251
272
  - **After PRD creation -> document-reviewer execution**: Confirm requirement understanding and consistency (confirm with question list)
273
+ - **After UI Spec creation -> document-reviewer execution** (frontend/fullstack): Confirm UI specification completeness and consistency
252
274
  - **After ADR creation -> document-reviewer execution**: Confirm technical direction and consistency (present multiple options with comparison table)
253
275
  - On user approval: Main AI (me) updates Status to Accepted
254
276
  - On user rejection: Main AI (me) updates Status to Rejected