create-ai-project 1.20.9 → 1.22.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.
- package/.claude/agents-en/acceptance-test-generator.md +112 -50
- package/.claude/agents-en/task-decomposer.md +40 -4
- package/.claude/agents-en/ui-spec-designer.md +2 -0
- package/.claude/agents-en/work-planner.md +98 -29
- package/.claude/agents-ja/acceptance-test-generator.md +113 -49
- package/.claude/agents-ja/task-decomposer.md +44 -8
- package/.claude/agents-ja/ui-spec-designer.md +2 -0
- package/.claude/agents-ja/work-planner.md +96 -29
- package/.claude/commands-en/add-integration-tests.md +8 -0
- package/.claude/commands-en/build.md +75 -23
- package/.claude/commands-en/front-build.md +56 -25
- package/.claude/commands-en/front-plan.md +7 -6
- package/.claude/commands-en/front-review.md +81 -19
- package/.claude/commands-en/implement.md +36 -5
- package/.claude/commands-en/plan.md +9 -8
- package/.claude/commands-en/prepare-implementation.md +191 -0
- package/.claude/commands-en/project-inject.md +84 -56
- package/.claude/commands-en/review.md +79 -20
- package/.claude/commands-ja/add-integration-tests.md +8 -0
- package/.claude/commands-ja/build.md +77 -25
- package/.claude/commands-ja/front-build.md +59 -28
- package/.claude/commands-ja/front-plan.md +8 -7
- package/.claude/commands-ja/front-review.md +81 -19
- package/.claude/commands-ja/implement.md +36 -5
- package/.claude/commands-ja/plan.md +10 -9
- package/.claude/commands-ja/prepare-implementation.md +191 -0
- package/.claude/commands-ja/project-inject.md +84 -56
- package/.claude/commands-ja/review.md +79 -20
- package/.claude/skills-en/documentation-criteria/references/plan-template.md +22 -0
- package/.claude/skills-en/documentation-criteria/references/ui-spec-template.md +2 -0
- package/.claude/skills-en/frontend-typescript-testing/references/e2e.md +81 -7
- package/.claude/skills-en/integration-e2e-testing/SKILL.md +48 -23
- package/.claude/skills-en/integration-e2e-testing/references/e2e-design.md +31 -13
- package/.claude/skills-en/project-context/SKILL.md +2 -15
- package/.claude/skills-en/project-context/references/external-resources-api.md +76 -0
- package/.claude/skills-en/project-context/references/external-resources-backend.md +76 -0
- package/.claude/skills-en/project-context/references/external-resources-frontend.md +74 -0
- package/.claude/skills-en/project-context/references/external-resources-infra.md +76 -0
- package/.claude/skills-en/project-context/references/template.md +154 -0
- package/.claude/skills-en/subagents-orchestration-guide/SKILL.md +36 -14
- package/.claude/skills-en/task-analyzer/references/skills-index.yaml +0 -5
- package/.claude/skills-ja/documentation-criteria/references/plan-template.md +22 -0
- package/.claude/skills-ja/documentation-criteria/references/ui-spec-template.md +2 -0
- package/.claude/skills-ja/frontend-typescript-testing/references/e2e.md +81 -7
- package/.claude/skills-ja/integration-e2e-testing/SKILL.md +48 -23
- package/.claude/skills-ja/integration-e2e-testing/references/e2e-design.md +31 -13
- package/.claude/skills-ja/project-context/SKILL.md +2 -15
- package/.claude/skills-ja/project-context/references/external-resources-api.md +76 -0
- package/.claude/skills-ja/project-context/references/external-resources-backend.md +76 -0
- package/.claude/skills-ja/project-context/references/external-resources-frontend.md +74 -0
- package/.claude/skills-ja/project-context/references/external-resources-infra.md +76 -0
- package/.claude/skills-ja/project-context/references/template.md +154 -0
- package/.claude/skills-ja/subagents-orchestration-guide/SKILL.md +36 -14
- package/.claude/skills-ja/task-analyzer/references/skills-index.yaml +0 -5
- package/.husky/pre-commit +1 -0
- package/CHANGELOG.md +55 -6
- package/README.ja.md +3 -2
- package/README.md +3 -2
- package/docs/guides/en/use-cases.md +18 -3
- package/docs/guides/ja/use-cases.md +18 -3
- package/package.json +2 -1
- package/scripts/check-skills-index.mjs +173 -0
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# E2E Test Implementation with Playwright
|
|
2
2
|
|
|
3
|
+
## Lane Selection
|
|
4
|
+
|
|
5
|
+
E2E tests in this workflow split into two lanes (defined in integration-e2e-testing skill):
|
|
6
|
+
|
|
7
|
+
| Lane | Backend setup | Use these patterns |
|
|
8
|
+
|------|---------------|-------------------|
|
|
9
|
+
| **fixture-e2e** | Mocked via `page.route()` or fixture loaders; no live services | Page Object Pattern, Locator Strategy, Assertions, the **Fixture-Based Backend** section below |
|
|
10
|
+
| **service-integration-e2e** | Live local stack with real services | All patterns above PLUS a real auth fixture against the application's login flow and seeded test data |
|
|
11
|
+
|
|
12
|
+
The skeleton's `@lane:` annotation declares which lane the test belongs to. Choose implementation patterns to match.
|
|
13
|
+
|
|
3
14
|
## Test Framework
|
|
4
15
|
- **Playwright Test**: `@playwright/test`
|
|
5
16
|
- Test imports: `import { test, expect } from '@playwright/test'`
|
|
@@ -10,18 +21,23 @@
|
|
|
10
21
|
```
|
|
11
22
|
tests/
|
|
12
23
|
└── e2e/
|
|
13
|
-
├── pages/
|
|
24
|
+
├── pages/ # Page objects (shared across lanes)
|
|
14
25
|
│ ├── login.page.ts
|
|
15
26
|
│ └── dashboard.page.ts
|
|
16
|
-
├── fixtures/
|
|
27
|
+
├── fixtures/ # Test fixtures (auth, seed)
|
|
17
28
|
│ └── auth.fixture.ts
|
|
18
|
-
|
|
29
|
+
├── data/ # Static fixture data for fixture-e2e
|
|
30
|
+
│ └── *.fixture.json
|
|
31
|
+
├── *.fixture-e2e.test.ts # fixture-e2e test files
|
|
32
|
+
└── *.service-e2e.test.ts # service-integration-e2e test files
|
|
19
33
|
```
|
|
20
34
|
|
|
21
35
|
### Naming Conventions
|
|
22
|
-
-
|
|
36
|
+
- fixture-e2e files: `{FeatureName}.fixture-e2e.test.ts`
|
|
37
|
+
- service-integration-e2e files: `{FeatureName}.service-e2e.test.ts`
|
|
23
38
|
- Page objects: `{PageName}.page.ts`
|
|
24
39
|
- Fixtures: `{Purpose}.fixture.ts`
|
|
40
|
+
- Static fixture data: `{scenario}.fixture.json`
|
|
25
41
|
|
|
26
42
|
## Page Object Pattern
|
|
27
43
|
|
|
@@ -102,6 +118,59 @@ export const test = base.extend<{ authenticatedPage: Page }>({
|
|
|
102
118
|
})
|
|
103
119
|
```
|
|
104
120
|
|
|
121
|
+
## Fixture-Based Backend (fixture-e2e)
|
|
122
|
+
|
|
123
|
+
fixture-e2e tests run a real browser against deterministic fixtures — no live backend, no DB, no external services. Use one of these patterns to fake the network:
|
|
124
|
+
|
|
125
|
+
### Pattern A: page.route() interception
|
|
126
|
+
|
|
127
|
+
```typescript
|
|
128
|
+
import { test, expect } from '@playwright/test'
|
|
129
|
+
import cardsFixture from './data/cards.fixture.json'
|
|
130
|
+
|
|
131
|
+
test('Dismiss-then-Undo restores card', async ({ page }) => {
|
|
132
|
+
// Arrange: intercept all backend calls with deterministic responses
|
|
133
|
+
await page.route('**/api/cards', async (route) => {
|
|
134
|
+
await route.fulfill({ json: cardsFixture })
|
|
135
|
+
})
|
|
136
|
+
await page.route('**/api/cards/*/dismiss', async (route) => {
|
|
137
|
+
await route.fulfill({ status: 204 })
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
await page.goto('/cards')
|
|
141
|
+
await page.getByRole('button', { name: 'Dismiss' }).first().click()
|
|
142
|
+
await page.getByRole('button', { name: 'Undo' }).click()
|
|
143
|
+
|
|
144
|
+
await expect(page.getByText(cardsFixture[0].title)).toBeVisible()
|
|
145
|
+
})
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Pattern B: Fixture loader injection
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
// data/cards-with-dismiss.fixture.json — committed alongside the test
|
|
152
|
+
// Loaded via a route helper or app-level test mode
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Principles for fixture-e2e**:
|
|
156
|
+
- Backend is faked, not running. No `npm run start:backend` required to execute these tests
|
|
157
|
+
- Fixtures are versioned in the repo (`tests/e2e/data/`) so tests are deterministic across machines
|
|
158
|
+
- Auth, when needed, is faked too (set a test cookie via `page.context().addCookies()` or use a fixture-mode bypass)
|
|
159
|
+
- These tests run in CI without provisioning external infrastructure
|
|
160
|
+
|
|
161
|
+
## E2E Environment Prerequisites (service-integration-e2e only)
|
|
162
|
+
|
|
163
|
+
service-integration-e2e tests require a running application with real data state. Unlike fixture-e2e, environment setup is part of test implementation scope.
|
|
164
|
+
|
|
165
|
+
Before service-integration-e2e tests can pass, verify:
|
|
166
|
+
- [ ] Application is running and accessible at `baseURL`
|
|
167
|
+
- [ ] Database has required seed data (test users, required records)
|
|
168
|
+
- [ ] Authentication flow works with test credentials against the real auth flow
|
|
169
|
+
- [ ] Environment variables are set (`E2E_*` prefixed)
|
|
170
|
+
- [ ] External services are either available or stubbed
|
|
171
|
+
|
|
172
|
+
When the work plan includes dedicated environment setup tasks (Phase 0), follow those tasks. When no setup tasks exist in the plan, address missing prerequisites as part of the test implementation task itself, OR consider whether the verification could move to fixture-e2e instead.
|
|
173
|
+
|
|
105
174
|
## Locator Strategy
|
|
106
175
|
|
|
107
176
|
Prefer accessible locators in this order:
|
|
@@ -168,13 +237,14 @@ test.describe('responsive navigation', () => {
|
|
|
168
237
|
|
|
169
238
|
## Skeleton Comment Format
|
|
170
239
|
|
|
171
|
-
E2E test skeletons follow the same annotation format as integration tests:
|
|
240
|
+
E2E test skeletons follow the same annotation format as integration tests, with a required `@lane:` annotation declaring the lane (see Lane Selection above):
|
|
172
241
|
|
|
173
242
|
```typescript
|
|
174
243
|
// AC: [Original acceptance criteria text]
|
|
175
244
|
// Behavior: [User action] → [System response] → [Observable result]
|
|
176
|
-
// @category: e2e
|
|
177
|
-
// @
|
|
245
|
+
// @category: fixture-e2e | service-integration-e2e
|
|
246
|
+
// @lane: fixture-e2e | service-integration-e2e
|
|
247
|
+
// @dependency: full-ui (mocked backend) | full-system
|
|
178
248
|
// @complexity: high
|
|
179
249
|
// ROI: [score]
|
|
180
250
|
test('AC1: [Description]', async ({ page }) => {
|
|
@@ -183,3 +253,7 @@ test('AC1: [Description]', async ({ page }) => {
|
|
|
183
253
|
// Assert: [Verification description]
|
|
184
254
|
})
|
|
185
255
|
```
|
|
256
|
+
|
|
257
|
+
**`@dependency` selection by lane**:
|
|
258
|
+
- `fixture-e2e` → `@dependency: full-ui (mocked backend)` (no live services; intercept network via `page.route()` or fixture loaders)
|
|
259
|
+
- `service-integration-e2e` → `@dependency: full-system` (running local stack required)
|
|
@@ -12,10 +12,17 @@ description: Designs integration and E2E tests with mock boundaries and behavior
|
|
|
12
12
|
|
|
13
13
|
## Test Types and Limits
|
|
14
14
|
|
|
15
|
-
| Type | Purpose | File Format | Limit |
|
|
16
|
-
|
|
17
|
-
| Integration
|
|
18
|
-
|
|
|
15
|
+
| Test Type | Purpose | Scope | External Deps | File Format | Limit per Feature | Implementation Timing |
|
|
16
|
+
|-----------|---------|-------|---------------|-------------|-------------------|----------------------|
|
|
17
|
+
| Integration | Verify component interactions in-process | Partial system integration (in-process modules; for UI components, RTL+MSW for React/TS) | Mocked or in-process | `*.int.test.ts` | MAX 3 | Created alongside implementation |
|
|
18
|
+
| fixture-e2e | Verify UI behavior in a browser with deterministic fixtures | Full UI flow with mocked backend / fixture-driven state | Mocked / fixture only — no live services | `*.fixture-e2e.test.ts` | MAX 3 | Created alongside the UI feature |
|
|
19
|
+
| service-integration-e2e | Verify critical user journeys against a running local stack | Full system across services | Live local services or stubs | `*.service-e2e.test.ts` | MAX 1-2 | Executed only in the final phase |
|
|
20
|
+
|
|
21
|
+
**Lane selection (E2E only)**:
|
|
22
|
+
- Default lane for user-facing UI journeys is **fixture-e2e** — it runs a real browser against deterministic fixtures, catches the bugs that unit/integration tests miss (button no-op, state never updates, navigation breaks), and runs in CI without infrastructure setup
|
|
23
|
+
- Add **service-integration-e2e** only when the journey's correctness depends on real cross-service behavior (data persistence, transactional consistency, external service contracts) that cannot be faked safely
|
|
24
|
+
|
|
25
|
+
The two E2E lanes are budgeted independently — having a fixture-e2e for a journey does not consume the service-integration-e2e budget and vice versa.
|
|
19
26
|
|
|
20
27
|
**Critical User Journey**: Features with revenue impact, legal requirements, or daily use by majority of users
|
|
21
28
|
|
|
@@ -44,12 +51,18 @@ Each test MUST include the following annotations.
|
|
|
44
51
|
// AC: "[Acceptance criteria original text]"
|
|
45
52
|
// ROI: [0-100] | Business Value: [0-10] | Frequency: [0-10]
|
|
46
53
|
// Behavior: [Trigger] -> [Process] -> [Observable Result]
|
|
47
|
-
// @category: core-functionality | integration | edge-case | ux | e2e
|
|
48
|
-
// @
|
|
54
|
+
// @category: core-functionality | integration | edge-case | ux | fixture-e2e | service-integration-e2e
|
|
55
|
+
// @lane: integration | fixture-e2e | service-integration-e2e
|
|
56
|
+
// @dependency: none | [component names] | full-ui (mocked backend) | full-system
|
|
49
57
|
// @complexity: low | medium | high
|
|
50
58
|
// @real-dependency: [component name] (optional, when Test Boundaries specify non-mock setup)
|
|
51
59
|
```
|
|
52
60
|
|
|
61
|
+
**`@lane` selection rule**:
|
|
62
|
+
- `integration` — Component interaction in-process, no browser (e.g., RTL+MSW for React/TS, in-process module/handler integration in any language)
|
|
63
|
+
- `fixture-e2e` — Browser-level UI verification with mocked backend / fixture-driven state. `@dependency` is typically `full-ui (mocked backend)`
|
|
64
|
+
- `service-integration-e2e` — Browser-level or end-to-end verification against running local services or stubs. `@dependency` is `full-system`
|
|
65
|
+
|
|
53
66
|
### Property Annotations
|
|
54
67
|
|
|
55
68
|
```typescript
|
|
@@ -71,17 +84,14 @@ A feature qualifies as containing a **multi-step user journey** when ALL of the
|
|
|
71
84
|
|
|
72
85
|
### User-Facing vs Service-Internal Journeys
|
|
73
86
|
|
|
74
|
-
Multi-step journeys are
|
|
87
|
+
Multi-step journeys are classified for reserved-slot eligibility:
|
|
75
88
|
|
|
76
|
-
| Classification | Condition |
|
|
89
|
+
| Classification | Condition | Reserved Slot Eligibility | Example |
|
|
77
90
|
|---|---|---|---|
|
|
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 |
|
|
91
|
+
| **User-facing** | A human user directly triggers and observes the steps (via UI, CLI, or direct API interaction) | Eligible — defaults to **fixture-e2e** reserved slot. Add a service-integration-e2e reserved slot only when the journey's correctness depends on real cross-service behavior | Web checkout flow, CLI setup wizard, mobile onboarding |
|
|
92
|
+
| **Service-internal** | Steps are triggered by backend services without direct user interaction | Not eligible for reserved slot — use integration tests. service-integration-e2e through normal ROI > 50 path is still valid when full-system verification is warranted | Async job pipeline, service-to-service saga, scheduled batch processing |
|
|
80
93
|
|
|
81
|
-
|
|
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.
|
|
94
|
+
This classification applies to the reserved-slot rule and the E2E Gap Check. Other selection follows lane-specific ROI rules below.
|
|
85
95
|
|
|
86
96
|
### ROI Calculation
|
|
87
97
|
|
|
@@ -94,20 +104,29 @@ ROI Score = Business Value × User Frequency + Legal Requirement × 10 + Defect
|
|
|
94
104
|
|
|
95
105
|
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
106
|
|
|
97
|
-
### ROI
|
|
107
|
+
### ROI Thresholds by Lane
|
|
98
108
|
|
|
99
|
-
E2E
|
|
109
|
+
The two E2E lanes have very different ownership costs and use independent thresholds.
|
|
110
|
+
|
|
111
|
+
| Lane | ROI threshold | Rationale |
|
|
112
|
+
|------|---------------|-----------|
|
|
113
|
+
| fixture-e2e | ROI ≥ 20 (beyond reserved slot) | Cost is comparable to integration tests once the harness exists; the floor avoids filling MAX 3 with low-signal tests when fewer would suffice |
|
|
114
|
+
| service-integration-e2e | ROI > 50 (beyond reserved slot) | Creation, execution, and maintenance cost is 3-10× higher than integration; reserve for journeys whose value cannot be proven any other way |
|
|
115
|
+
|
|
116
|
+
Reserved slot rules apply per lane and override the threshold (the reserved candidate is emitted regardless of its ROI score). Below-floor candidates beyond the reserved slot are not emitted, leaving budget intentionally unfilled rather than padding with low-value tests.
|
|
100
117
|
|
|
101
118
|
### ROI Calculation Examples
|
|
102
119
|
|
|
103
120
|
| Scenario | BV | Freq | Legal | Defect | ROI Score | Test Type | Selection Outcome |
|
|
104
121
|
|----------|----|------|-------|--------|-----------|-----------|-------------------|
|
|
105
|
-
| Core checkout flow | 10 | 9 | true | 9 | 109 |
|
|
106
|
-
|
|
|
107
|
-
|
|
|
122
|
+
| Core checkout UI flow | 10 | 9 | true | 9 | 109 | fixture-e2e | Selected (reserved slot: user-facing multi-step journey, browser verification with fixtures) |
|
|
123
|
+
| Core checkout against live payment service | 10 | 9 | true | 9 | 109 | service-integration-e2e | Selected (real-service correctness above ROI threshold) |
|
|
124
|
+
| Dismiss button updates UI state | 6 | 7 | false | 8 | 50 | fixture-e2e | Selected (rank 2 of 3 fixture-e2e budget) |
|
|
125
|
+
| Payment error message display (UI) | 5 | 4 | false | 7 | 27 | fixture-e2e | Selected (rank 3 of 3 fixture-e2e budget) |
|
|
126
|
+
| Optional filter toggle | 3 | 4 | false | 2 | 14 | fixture-e2e | Not selected (rank 4, budget full) |
|
|
127
|
+
| Payment retry against real provider | 8 | 3 | false | 7 | 31 | service-integration-e2e | Below ROI threshold (31 < 50), not selected |
|
|
108
128
|
| DB persistence check | 8 | 8 | false | 8 | 72 | Integration | Selected (rank 1 of 3) |
|
|
109
|
-
|
|
|
110
|
-
| Optional filter toggle | 3 | 4 | false | 2 | 14 | Integration | Not selected (rank 4, budget full) |
|
|
129
|
+
| Pure data transformation | 5 | 3 | false | 4 | 19 | Integration | Selected (rank 2 of 3) |
|
|
111
130
|
|
|
112
131
|
## Implementation Rules
|
|
113
132
|
|
|
@@ -169,8 +188,14 @@ it('AC2-property: Model name is always gemini-3-pro-image-preview', () => {
|
|
|
169
188
|
|
|
170
189
|
### E2E Test Execution Conditions
|
|
171
190
|
|
|
172
|
-
-
|
|
173
|
-
-
|
|
191
|
+
**fixture-e2e**:
|
|
192
|
+
- Execute alongside the UI feature implementation phase (not deferred to the end)
|
|
193
|
+
- Use mocked backend / fixture-driven state (`@dependency: full-ui (mocked backend)`); no live services required
|
|
194
|
+
- Runs in CI without infrastructure setup
|
|
195
|
+
|
|
196
|
+
**service-integration-e2e**:
|
|
197
|
+
- Execute only in the final phase, after all components are implemented and the local stack is up
|
|
198
|
+
- Use real local services or service stubs — no in-process mocks for the components under verification (`@dependency: full-system`)
|
|
174
199
|
|
|
175
200
|
## Review Criteria
|
|
176
201
|
|
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
# E2E Test Design
|
|
1
|
+
# E2E Test Design (Browser Harness)
|
|
2
|
+
|
|
3
|
+
This reference uses Playwright as the default example throughout because it is the standard E2E browser harness assumed by these workflows. Adapt patterns to the project's chosen framework when different (Cypress, Selenium, etc.); the lane definitions, ROI rules, and budgets remain the same.
|
|
4
|
+
|
|
5
|
+
## Two E2E Lanes
|
|
6
|
+
|
|
7
|
+
E2E tests in this workflow split into two lanes (see parent skill Test Types and Limits):
|
|
8
|
+
|
|
9
|
+
| Lane | When | ROI gate | Cost |
|
|
10
|
+
|------|------|----------|------|
|
|
11
|
+
| **fixture-e2e** | UI journey verification with deterministic fixtures (mocked backend / fixture data) | Reserved slot is exempt; additional slots within MAX 3 require ROI ≥ 20 | Comparable to integration; runs in CI without infrastructure setup |
|
|
12
|
+
| **service-integration-e2e** | Journey correctness depends on real cross-service behavior (data persistence, transactional consistency, external contracts) | ROI > 50 (beyond reserved slot) | 3-10× higher than integration; reserved for what cannot be faked safely |
|
|
13
|
+
|
|
14
|
+
Both lanes typically use Playwright; the difference is whether the backend is mocked / fixture-driven or running for real.
|
|
2
15
|
|
|
3
16
|
## When to Create E2E Tests
|
|
4
17
|
|
|
5
|
-
E2E
|
|
18
|
+
E2E candidates target **critical user journeys** that span multiple pages or require real browser interaction. Pick the lane based on whether real services are required for the verification.
|
|
6
19
|
|
|
7
20
|
### Candidate Sources
|
|
8
21
|
|
|
@@ -21,10 +34,10 @@ E2E tests target **critical user journeys** that span multiple pages or require
|
|
|
21
34
|
- Accessibility verification requiring actual DOM rendering
|
|
22
35
|
- Responsive behavior across viewports
|
|
23
36
|
|
|
24
|
-
**
|
|
25
|
-
-
|
|
26
|
-
- API response handling (
|
|
27
|
-
-
|
|
37
|
+
**Use integration tests instead when**:
|
|
38
|
+
- Testing single-component state changes → in-process component renderer (RTL for React/TS)
|
|
39
|
+
- Testing API response handling → in-process API mock + component renderer (MSW + RTL for React/TS)
|
|
40
|
+
- Testing pure data transformations → unit tests
|
|
28
41
|
|
|
29
42
|
## UI Spec to E2E Test Mapping
|
|
30
43
|
|
|
@@ -41,12 +54,15 @@ When a UI Spec exists, use it as the primary source for E2E test design:
|
|
|
41
54
|
Screen Transition: [Screen A] → [Screen B] → [Screen C]
|
|
42
55
|
AC Reference: AC-{id}
|
|
43
56
|
User Journey: [Description of what the user accomplishes]
|
|
44
|
-
|
|
57
|
+
Lane: fixture-e2e | service-integration-e2e
|
|
58
|
+
Preconditions: [Auth state, data state — note whether these are fixture-driven or live]
|
|
45
59
|
Verification Points:
|
|
46
60
|
- [What to assert at each step]
|
|
47
61
|
E2E ROI Score: [calculated score]
|
|
48
62
|
```
|
|
49
63
|
|
|
64
|
+
**Lane decision**: choose `fixture-e2e` by default. Promote to `service-integration-e2e` when the verification requires observing real cross-service behavior (e.g., the test asserts that data persists across a real DB write, or that an external service receives the correct payload).
|
|
65
|
+
|
|
50
66
|
## Playwright Test Architecture
|
|
51
67
|
|
|
52
68
|
### Page Object Pattern
|
|
@@ -56,9 +72,11 @@ Organize browser interactions through page objects for maintainability:
|
|
|
56
72
|
```
|
|
57
73
|
tests/
|
|
58
74
|
├── e2e/
|
|
59
|
-
│ ├── pages/
|
|
60
|
-
│ ├── fixtures/
|
|
61
|
-
│
|
|
75
|
+
│ ├── pages/ # Page objects (shared across lanes)
|
|
76
|
+
│ ├── fixtures/ # Test fixtures and helpers (auth, seed)
|
|
77
|
+
│ ├── data/ # Static fixture data for fixture-e2e
|
|
78
|
+
│ ├── *.fixture-e2e.test.ts # fixture-e2e test files
|
|
79
|
+
│ └── *.service-e2e.test.ts # service-integration-e2e test files
|
|
62
80
|
```
|
|
63
81
|
|
|
64
82
|
### Test Isolation
|
|
@@ -81,6 +99,6 @@ When UI Spec defines responsive behavior, test critical breakpoints:
|
|
|
81
99
|
## Budget Enforcement
|
|
82
100
|
|
|
83
101
|
Hard limits per feature (same as parent skill):
|
|
84
|
-
- **
|
|
85
|
-
-
|
|
86
|
-
- Prefer fewer, comprehensive journey tests over many granular tests
|
|
102
|
+
- **fixture-e2e**: MAX 3 tests. Reserved slot is exempt from the ROI gate; additional slots require ROI ≥ 20
|
|
103
|
+
- **service-integration-e2e**: MAX 1-2 tests, ROI > 50 beyond the reserved slot
|
|
104
|
+
- Prefer fewer, comprehensive journey tests over many granular tests in both lanes
|
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: project-context
|
|
3
|
-
description: Provides project-specific prerequisites for AI execution accuracy. Use when checking project structure.
|
|
3
|
+
description: Provides project-specific prerequisites for AI execution accuracy — domain constraints, development phase, directory conventions, external resource access methods. Use when the session starts, when checking project structure, or when a task references domain rules or external resources outside the repository.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Project Context
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
## Project Overview
|
|
11
|
-
- **What this project does**: (to be configured)
|
|
12
|
-
- **Domain**: (to be configured)
|
|
13
|
-
|
|
14
|
-
## Domain Constraints
|
|
15
|
-
(Domain-specific rules that affect AI decision-making)
|
|
16
|
-
|
|
17
|
-
## Development Phase
|
|
18
|
-
- **Phase**: (Prototype / Production / In operation)
|
|
19
|
-
|
|
20
|
-
## Directory Conventions
|
|
21
|
-
(File placement rules, if any)
|
|
8
|
+
Run `/project-inject` to populate this skill.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# API Contract External Resource Axes
|
|
2
|
+
|
|
3
|
+
Hearing axes for API contract design, client integration, or server endpoint implementation. `/project-inject` loads this file when the user selects the API domain.
|
|
4
|
+
|
|
5
|
+
## Axis 1: API Schema Source
|
|
6
|
+
|
|
7
|
+
The canonical source of API contracts (request/response shapes, endpoints, RPC methods).
|
|
8
|
+
|
|
9
|
+
**AskUserQuestion choices**:
|
|
10
|
+
- OpenAPI / Swagger specification (file in repository or hosted URL)
|
|
11
|
+
- Protobuf definitions (file in repository)
|
|
12
|
+
- GraphQL schema (SDL file or introspection endpoint)
|
|
13
|
+
- Code-first contract definitions in the repository (e.g., TypeScript types shared between client and server)
|
|
14
|
+
- Ad-hoc JSON (no formal contract)
|
|
15
|
+
- Not applicable
|
|
16
|
+
|
|
17
|
+
**Follow-up (when the axis is present)**: Capture two fields:
|
|
18
|
+
- **Location**: file path or URL.
|
|
19
|
+
- **Access method**: file read or WebFetch.
|
|
20
|
+
|
|
21
|
+
When multiple contracts exist (public API, internal services), capture each as a separate entry per the multiple-instance rule in `template.md`, using the contract purpose as the disambiguating suffix.
|
|
22
|
+
|
|
23
|
+
## Axis 2: Mock Environment
|
|
24
|
+
|
|
25
|
+
How clients exercise the API in isolation from the live server.
|
|
26
|
+
|
|
27
|
+
**AskUserQuestion choices**:
|
|
28
|
+
- Generated mocks from the schema (e.g., from OpenAPI / Protobuf tooling)
|
|
29
|
+
- Hand-written mock server in the repository
|
|
30
|
+
- Hosted mock service (URL)
|
|
31
|
+
- Live development server (no separate mock)
|
|
32
|
+
- Not applicable
|
|
33
|
+
|
|
34
|
+
**Follow-up (when the axis is present)**: Capture two fields:
|
|
35
|
+
- **Location**: mock URL or repository path.
|
|
36
|
+
- **Access method**: CLI command, WebFetch, or generation step name. State whether the mock auto-updates when the schema changes (e.g., `regenerate from openapi.yaml on commit`).
|
|
37
|
+
|
|
38
|
+
## Axis 3: Authentication Method
|
|
39
|
+
|
|
40
|
+
How the API authenticates and authorizes requests.
|
|
41
|
+
|
|
42
|
+
**AskUserQuestion choices**:
|
|
43
|
+
- Bearer token (e.g., JWT) issued by an auth service
|
|
44
|
+
- API key in a header or query parameter
|
|
45
|
+
- Session cookie set by a separate login flow
|
|
46
|
+
- Mutual TLS
|
|
47
|
+
- No authentication
|
|
48
|
+
- Not applicable
|
|
49
|
+
|
|
50
|
+
**Follow-up (when the axis is present)**: Capture two fields:
|
|
51
|
+
- **Location**: auth service URL, environment variable name, or fixture file path used in development and testing.
|
|
52
|
+
- **Access method**: SDK call, CLI command, or file read.
|
|
53
|
+
|
|
54
|
+
When the same secrets live in the backend secret store, render this axis as a cross-axis reference back to that location (notation defined in `template.md`).
|
|
55
|
+
|
|
56
|
+
## Axis 4: Schema Change Process
|
|
57
|
+
|
|
58
|
+
How breaking and non-breaking schema changes are reviewed and rolled out.
|
|
59
|
+
|
|
60
|
+
**AskUserQuestion choices**:
|
|
61
|
+
- Documented contract review process (link to the document)
|
|
62
|
+
- Versioned endpoints (e.g., `/v1/`, `/v2/`)
|
|
63
|
+
- Backward-compatible changes only, no formal versioning
|
|
64
|
+
- Not applicable
|
|
65
|
+
|
|
66
|
+
**Follow-up (when the axis is present)**: Capture two fields:
|
|
67
|
+
- **Location**: document path or URL.
|
|
68
|
+
- **Access method**: file read, WebFetch, or version negotiation rule statement (e.g., `breaking changes require a new /vN/ path`).
|
|
69
|
+
|
|
70
|
+
## Self-Declaration Phase
|
|
71
|
+
|
|
72
|
+
After the four structured axes, ask once: "Are there any other API external resources this project depends on beyond what the structured questions covered? List each in your next message, or reply 'none'."
|
|
73
|
+
|
|
74
|
+
Capture free-form answers under the "Additional Resources" subsection of the API block. Run this phase even when every structured axis returned "Not applicable".
|
|
75
|
+
|
|
76
|
+
Examples of resources that surface only via self-declaration: rate-limit configuration, gateway or proxy in front of the API, contract test suite (e.g., Pact broker URL), API gateway management consoles, third-party API documentation consulted during design.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Backend External Resource Axes
|
|
2
|
+
|
|
3
|
+
Hearing axes for server-side, data, or storage work. `/project-inject` loads this file when the user selects the Backend domain.
|
|
4
|
+
|
|
5
|
+
## Axis 1: Database Schema Source
|
|
6
|
+
|
|
7
|
+
The canonical source of the database schema (tables, columns, indexes, constraints).
|
|
8
|
+
|
|
9
|
+
**AskUserQuestion choices**:
|
|
10
|
+
- Migration files in the repository (e.g., a `migrations/` directory)
|
|
11
|
+
- Schema file in the repository (e.g., `schema.sql`, `prisma/schema.prisma`)
|
|
12
|
+
- Database MCP server that introspects a live database
|
|
13
|
+
- External schema registry (URL or hosted catalog)
|
|
14
|
+
- No persistent database
|
|
15
|
+
- Not applicable
|
|
16
|
+
|
|
17
|
+
**Follow-up (when the axis is present)**: Capture two fields:
|
|
18
|
+
- **Location**: file path, URL, or MCP target identifier.
|
|
19
|
+
- **Access method**: file read, WebFetch, or MCP server name.
|
|
20
|
+
|
|
21
|
+
When multiple databases exist (primary, analytics, cache), capture each as a separate entry per the multiple-instance rule in `template.md`, using the database purpose as the disambiguating suffix.
|
|
22
|
+
|
|
23
|
+
## Axis 2: Migration History
|
|
24
|
+
|
|
25
|
+
How schema changes are tracked over time.
|
|
26
|
+
|
|
27
|
+
**AskUserQuestion choices**:
|
|
28
|
+
- Versioned migration files in the repository
|
|
29
|
+
- ORM-managed migration tool (e.g., Alembic, Flyway, Prisma Migrate)
|
|
30
|
+
- Manual change log document
|
|
31
|
+
- No migration tracking
|
|
32
|
+
- Not applicable
|
|
33
|
+
|
|
34
|
+
**Follow-up (when the axis is present)**: Capture two fields:
|
|
35
|
+
- **Location**: directory path or migration tool name.
|
|
36
|
+
- **Access method**: CLI command for manual runs, or CI step / deployment hook name when migrations apply automatically.
|
|
37
|
+
|
|
38
|
+
## Axis 3: Secret Store
|
|
39
|
+
|
|
40
|
+
Where credentials, API keys, and other secrets are stored and accessed.
|
|
41
|
+
|
|
42
|
+
**AskUserQuestion choices**:
|
|
43
|
+
- Secret manager service (e.g., AWS Secrets Manager, Vault, GCP Secret Manager)
|
|
44
|
+
- Environment variables loaded from a `.env` file (development only)
|
|
45
|
+
- Encrypted file in the repository
|
|
46
|
+
- No secrets required
|
|
47
|
+
- Not applicable
|
|
48
|
+
|
|
49
|
+
**Follow-up (when the axis is present)**: Capture two fields:
|
|
50
|
+
- **Location**: secret manager service name or MCP target.
|
|
51
|
+
- **Access method**: MCP server name, CLI command, or SDK call used to read secrets.
|
|
52
|
+
|
|
53
|
+
The actual secret values live in the store and are read from there at runtime — capture only how to reach them.
|
|
54
|
+
|
|
55
|
+
## Axis 4: Background Job Infrastructure
|
|
56
|
+
|
|
57
|
+
How asynchronous work is dispatched and observed.
|
|
58
|
+
|
|
59
|
+
**AskUserQuestion choices**:
|
|
60
|
+
- Queue service (e.g., SQS, Pub/Sub, RabbitMQ)
|
|
61
|
+
- Cron / scheduled tasks managed by the deployment platform
|
|
62
|
+
- In-process worker thread
|
|
63
|
+
- No background work
|
|
64
|
+
- Not applicable
|
|
65
|
+
|
|
66
|
+
**Follow-up (when the axis is present)**: Capture two fields:
|
|
67
|
+
- **Location**: queue name or scheduler identifier.
|
|
68
|
+
- **Access method**: enqueue command, inspect command, or platform console URL.
|
|
69
|
+
|
|
70
|
+
## Self-Declaration Phase
|
|
71
|
+
|
|
72
|
+
After the four structured axes, ask once: "Are there any other backend external resources this project depends on beyond what the structured questions covered? List each in your next message, or reply 'none'."
|
|
73
|
+
|
|
74
|
+
Capture free-form answers under the "Additional Resources" subsection of the Backend block. Run this phase even when every structured axis returned "Not applicable".
|
|
75
|
+
|
|
76
|
+
Examples of resources that surface only via self-declaration: third-party SaaS APIs (payment, email, search index), distributed cache services (Redis, Memcached), object storage (S3, GCS), feature flag services consumed server-side, observability platforms (logs, traces, metrics).
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Frontend External Resource Axes
|
|
2
|
+
|
|
3
|
+
Hearing axes for frontend work — component implementation, screen design, visual adjustment, design system migration. `/project-inject` loads this file when the user selects the Frontend domain.
|
|
4
|
+
|
|
5
|
+
## Axis 1: Design Origin
|
|
6
|
+
|
|
7
|
+
The canonical source of the visual specification.
|
|
8
|
+
|
|
9
|
+
**AskUserQuestion choices**:
|
|
10
|
+
- Design tool (a hosted design platform)
|
|
11
|
+
- Specification file in the repository (e.g., `DESIGN.md`, `docs/design/...`)
|
|
12
|
+
- Public documentation URL
|
|
13
|
+
- Existing implementation only (no separate design source)
|
|
14
|
+
- Not applicable
|
|
15
|
+
|
|
16
|
+
**Follow-up (when the axis is present)**: Capture two fields (Source type is set by the choice above):
|
|
17
|
+
- **Location**: public URL, repository file path, or MCP target identifier.
|
|
18
|
+
- **Access method**: WebFetch, file read, MCP server name, or manual screenshot procedure.
|
|
19
|
+
|
|
20
|
+
## Axis 2: Design System
|
|
21
|
+
|
|
22
|
+
Reusable component library and design tokens.
|
|
23
|
+
|
|
24
|
+
**AskUserQuestion choices**:
|
|
25
|
+
- Component library with MCP server access
|
|
26
|
+
- Component library with documentation URL
|
|
27
|
+
- Storybook or equivalent component catalog
|
|
28
|
+
- Internal package with team-internal documentation only
|
|
29
|
+
- No design system (ad-hoc components)
|
|
30
|
+
- Not applicable
|
|
31
|
+
|
|
32
|
+
**Follow-up (when the axis is present)**: Capture two fields:
|
|
33
|
+
- **Location**: Storybook URL, package name, or internal documentation path.
|
|
34
|
+
- **Access method**: WebFetch, file read, or MCP server name.
|
|
35
|
+
|
|
36
|
+
## Axis 3: Guidelines
|
|
37
|
+
|
|
38
|
+
Usage guidance, accessibility rules, anti-patterns, naming conventions for UI work.
|
|
39
|
+
|
|
40
|
+
**AskUserQuestion choices**:
|
|
41
|
+
- Project-level guideline file (e.g., `DESIGN.md`, `docs/guidelines/...`)
|
|
42
|
+
- External documentation site
|
|
43
|
+
- Inline guidance inside the design system catalog
|
|
44
|
+
- No documented guidelines
|
|
45
|
+
- Not applicable
|
|
46
|
+
|
|
47
|
+
**Follow-up (when the axis is present)**: Capture two fields:
|
|
48
|
+
- **Location**: file path or URL.
|
|
49
|
+
- **Access method**: file read or WebFetch.
|
|
50
|
+
|
|
51
|
+
When multiple files address different concerns (CSS, accessibility, i18n), capture each as a separate entry per the multiple-instance rule in `template.md`.
|
|
52
|
+
|
|
53
|
+
## Axis 4: Visual Verification Environment
|
|
54
|
+
|
|
55
|
+
How rendered output is confirmed during implementation.
|
|
56
|
+
|
|
57
|
+
**AskUserQuestion choices**:
|
|
58
|
+
- End-to-end test runner with screenshot capability
|
|
59
|
+
- Storybook or equivalent isolated component preview
|
|
60
|
+
- Browser automation tool (dedicated CLI or MCP server)
|
|
61
|
+
- Manual browser inspection only
|
|
62
|
+
- Not applicable
|
|
63
|
+
|
|
64
|
+
**Follow-up (when the axis is present)**: Capture two fields:
|
|
65
|
+
- **Location**: preview URL, MCP target, or test runner identifier.
|
|
66
|
+
- **Access method**: entry command, MCP server name, or browser automation tool name.
|
|
67
|
+
|
|
68
|
+
## Self-Declaration Phase
|
|
69
|
+
|
|
70
|
+
After the four structured axes, ask once: "Are there any other frontend external resources this project depends on beyond what the structured questions covered? List each in your next message, or reply 'none'."
|
|
71
|
+
|
|
72
|
+
Capture free-form answers under the "Additional Resources" subsection of the Frontend block. Run this phase even when every structured axis returned "Not applicable".
|
|
73
|
+
|
|
74
|
+
Examples of resources that surface only via self-declaration: brand asset CDNs, font hosting services, icon library subscriptions, A/B testing dashboards that gate visual variants, analytics dashboards consulted for visual KPIs.
|