@zigrivers/scaffold 2.1.2 → 2.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +272 -59
- package/knowledge/core/adr-craft.md +53 -0
- package/knowledge/core/ai-memory-management.md +246 -0
- package/knowledge/core/api-design.md +4 -0
- package/knowledge/core/claude-md-patterns.md +254 -0
- package/knowledge/core/coding-conventions.md +246 -0
- package/knowledge/core/database-design.md +4 -0
- package/knowledge/core/design-system-tokens.md +465 -0
- package/knowledge/core/dev-environment.md +223 -0
- package/knowledge/core/domain-modeling.md +4 -0
- package/knowledge/core/eval-craft.md +1008 -0
- package/knowledge/core/multi-model-review-dispatch.md +250 -0
- package/knowledge/core/operations-runbook.md +37 -226
- package/knowledge/core/project-structure-patterns.md +231 -0
- package/knowledge/core/review-step-template.md +247 -0
- package/knowledge/core/{security-review.md → security-best-practices.md} +5 -1
- package/knowledge/core/task-decomposition.md +57 -34
- package/knowledge/core/task-tracking.md +225 -0
- package/knowledge/core/tech-stack-selection.md +214 -0
- package/knowledge/core/testing-strategy.md +63 -70
- package/knowledge/core/user-stories.md +69 -60
- package/knowledge/core/user-story-innovation.md +57 -0
- package/knowledge/core/ux-specification.md +5 -148
- package/knowledge/finalization/apply-fixes-and-freeze.md +165 -14
- package/knowledge/product/prd-craft.md +55 -34
- package/knowledge/review/review-adr.md +32 -0
- package/knowledge/review/{review-api-contracts.md → review-api-design.md} +34 -1
- package/knowledge/review/{review-database-schema.md → review-database-design.md} +27 -1
- package/knowledge/review/review-domain-modeling.md +33 -0
- package/knowledge/review/review-implementation-tasks.md +50 -0
- package/knowledge/review/review-operations.md +55 -0
- package/knowledge/review/review-prd.md +33 -0
- package/knowledge/review/review-security.md +53 -0
- package/knowledge/review/review-system-architecture.md +28 -0
- package/knowledge/review/review-testing-strategy.md +51 -0
- package/knowledge/review/review-user-stories.md +54 -0
- package/knowledge/review/{review-ux-spec.md → review-ux-specification.md} +37 -1
- package/methodology/custom-defaults.yml +32 -3
- package/methodology/deep.yml +32 -3
- package/methodology/mvp.yml +32 -3
- package/package.json +2 -1
- package/pipeline/architecture/review-architecture.md +18 -6
- package/pipeline/architecture/system-architecture.md +14 -2
- package/pipeline/consolidation/claude-md-optimization.md +73 -0
- package/pipeline/consolidation/workflow-audit.md +73 -0
- package/pipeline/decisions/adrs.md +14 -2
- package/pipeline/decisions/review-adrs.md +18 -5
- package/pipeline/environment/ai-memory-setup.md +70 -0
- package/pipeline/environment/automated-pr-review.md +70 -0
- package/pipeline/environment/design-system.md +73 -0
- package/pipeline/environment/dev-env-setup.md +65 -0
- package/pipeline/environment/git-workflow.md +71 -0
- package/pipeline/finalization/apply-fixes-and-freeze.md +1 -1
- package/pipeline/finalization/developer-onboarding-guide.md +1 -1
- package/pipeline/finalization/implementation-playbook.md +3 -3
- package/pipeline/foundation/beads.md +68 -0
- package/pipeline/foundation/coding-standards.md +68 -0
- package/pipeline/foundation/project-structure.md +69 -0
- package/pipeline/foundation/tdd.md +60 -0
- package/pipeline/foundation/tech-stack.md +74 -0
- package/pipeline/integration/add-e2e-testing.md +65 -0
- package/pipeline/modeling/domain-modeling.md +14 -2
- package/pipeline/modeling/review-domain-modeling.md +18 -5
- package/pipeline/parity/platform-parity-review.md +70 -0
- package/pipeline/planning/implementation-plan-review.md +56 -0
- package/pipeline/planning/{implementation-tasks.md → implementation-plan.md} +29 -9
- package/pipeline/pre/create-prd.md +13 -4
- package/pipeline/pre/innovate-prd.md +37 -8
- package/pipeline/pre/innovate-user-stories.md +38 -7
- package/pipeline/pre/review-prd.md +18 -6
- package/pipeline/pre/review-user-stories.md +23 -6
- package/pipeline/pre/user-stories.md +12 -2
- package/pipeline/quality/create-evals.md +102 -0
- package/pipeline/quality/operations.md +38 -13
- package/pipeline/quality/review-operations.md +17 -5
- package/pipeline/quality/review-security.md +17 -5
- package/pipeline/quality/review-testing.md +20 -8
- package/pipeline/quality/security.md +25 -3
- package/pipeline/quality/story-tests.md +73 -0
- package/pipeline/specification/api-contracts.md +17 -2
- package/pipeline/specification/database-schema.md +17 -2
- package/pipeline/specification/review-api.md +18 -6
- package/pipeline/specification/review-database.md +18 -6
- package/pipeline/specification/review-ux.md +19 -7
- package/pipeline/specification/ux-spec.md +29 -10
- package/pipeline/validation/critical-path-walkthrough.md +34 -7
- package/pipeline/validation/cross-phase-consistency.md +34 -7
- package/pipeline/validation/decision-completeness.md +34 -7
- package/pipeline/validation/dependency-graph-validation.md +34 -7
- package/pipeline/validation/implementability-dry-run.md +34 -7
- package/pipeline/validation/scope-creep-check.md +34 -7
- package/pipeline/validation/traceability-matrix.md +34 -7
- package/skills/multi-model-dispatch/SKILL.md +326 -0
- package/skills/scaffold-pipeline/SKILL.md +195 -0
- package/skills/scaffold-runner/SKILL.md +465 -0
- package/pipeline/planning/review-tasks.md +0 -38
- package/pipeline/quality/testing-strategy.md +0 -42
|
@@ -4,9 +4,13 @@ description: Test pyramid, testing patterns, coverage strategy, and quality gate
|
|
|
4
4
|
topics: [testing, tdd, test-pyramid, quality-gates, coverage, test-data, mocking]
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
# Testing Strategy
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Expert knowledge for test pyramid design, testing patterns, coverage strategy, and quality gates across all test levels.
|
|
10
|
+
|
|
11
|
+
## Summary
|
|
12
|
+
|
|
13
|
+
### Test Pyramid
|
|
10
14
|
|
|
11
15
|
```
|
|
12
16
|
/ E2E Tests \ Few, slow, high confidence
|
|
@@ -15,7 +19,28 @@ The test pyramid organizes tests by scope, speed, and confidence:
|
|
|
15
19
|
________________________
|
|
16
20
|
```
|
|
17
21
|
|
|
18
|
-
###
|
|
22
|
+
### Test Level Definitions
|
|
23
|
+
|
|
24
|
+
- **Unit Tests** — Single function/method/class in isolation. No I/O, deterministic, millisecond execution. Test pure business logic, state machines, edge cases, error handling.
|
|
25
|
+
- **Integration Tests** — Interaction between 2+ components with real infrastructure. Seconds to execute. Test API handlers, DB queries, auth middleware, external service integrations.
|
|
26
|
+
- **E2E Tests** — Complete user flows with real browser/device. Seconds to minutes. Test critical user journeys only (5-15 tests for most apps).
|
|
27
|
+
|
|
28
|
+
### Basic Patterns
|
|
29
|
+
|
|
30
|
+
- **Arrange/Act/Assert (AAA)** — Set up conditions, perform action, verify result.
|
|
31
|
+
- **Given/When/Then (BDD)** — Behavior-oriented variant for integration and E2E tests.
|
|
32
|
+
- **Test Doubles** — Stubs (return predetermined data), Mocks (verify interactions), Spies (wrap real implementations), Fakes (simplified working implementations).
|
|
33
|
+
|
|
34
|
+
### What NOT to Mock
|
|
35
|
+
|
|
36
|
+
- The thing you're testing
|
|
37
|
+
- Value objects and simple data transformations
|
|
38
|
+
- The database in integration tests
|
|
39
|
+
- Too many things (if 10 mocks needed, refactor the code)
|
|
40
|
+
|
|
41
|
+
## Deep Guidance
|
|
42
|
+
|
|
43
|
+
### Unit Tests — Extended
|
|
19
44
|
|
|
20
45
|
**What they test:** A single function, method, or class in isolation from all external dependencies (database, network, file system, other modules).
|
|
21
46
|
|
|
@@ -62,7 +87,7 @@ describe('calculateOrderTotal', () => {
|
|
|
62
87
|
});
|
|
63
88
|
```
|
|
64
89
|
|
|
65
|
-
### Integration Tests
|
|
90
|
+
### Integration Tests — Extended
|
|
66
91
|
|
|
67
92
|
**What they test:** The interaction between two or more components, including real infrastructure (database, API calls between layers, message queues).
|
|
68
93
|
|
|
@@ -113,7 +138,7 @@ describe('POST /api/v1/users', () => {
|
|
|
113
138
|
});
|
|
114
139
|
```
|
|
115
140
|
|
|
116
|
-
### End-to-End (E2E) Tests
|
|
141
|
+
### End-to-End (E2E) Tests — Extended
|
|
117
142
|
|
|
118
143
|
**What they test:** Complete user flows from the user's perspective, using a real browser (for web apps) or real device/emulator (for mobile apps).
|
|
119
144
|
|
|
@@ -139,60 +164,19 @@ describe('POST /api/v1/users', () => {
|
|
|
139
164
|
- Each tests a complete user journey, not a single interaction
|
|
140
165
|
- If an E2E test breaks, it reveals a real user-facing problem
|
|
141
166
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
### Arrange / Act / Assert (AAA)
|
|
145
|
-
|
|
146
|
-
Every test follows three phases:
|
|
147
|
-
|
|
148
|
-
```typescript
|
|
149
|
-
it('calculates discount for premium members', () => {
|
|
150
|
-
// Arrange: set up the test conditions
|
|
151
|
-
const member = createMember({ tier: 'premium' });
|
|
152
|
-
const order = createOrder({ items: [{ price: 10000 }] });
|
|
153
|
-
|
|
154
|
-
// Act: perform the action being tested
|
|
155
|
-
const discount = calculateDiscount(member, order);
|
|
156
|
-
|
|
157
|
-
// Assert: verify the result
|
|
158
|
-
expect(discount).toBe(1000); // 10% discount
|
|
159
|
-
});
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
### Given / When / Then (BDD)
|
|
163
|
-
|
|
164
|
-
Behavior-oriented variant, often used for integration and E2E tests:
|
|
165
|
-
|
|
166
|
-
```typescript
|
|
167
|
-
describe('Order submission', () => {
|
|
168
|
-
it('sends confirmation email when order is submitted', async () => {
|
|
169
|
-
// Given: a draft order with valid items
|
|
170
|
-
const order = await createDraftOrder({ customerId, items: validItems });
|
|
171
|
-
|
|
172
|
-
// When: the order is submitted
|
|
173
|
-
await orderService.submit(order.id);
|
|
174
|
-
|
|
175
|
-
// Then: a confirmation email is queued
|
|
176
|
-
expect(emailQueue.messages).toContainEqual(
|
|
177
|
-
expect.objectContaining({
|
|
178
|
-
to: customer.email,
|
|
179
|
-
template: 'order-confirmation',
|
|
180
|
-
data: { orderId: order.id }
|
|
181
|
-
})
|
|
182
|
-
);
|
|
183
|
-
});
|
|
184
|
-
});
|
|
185
|
-
```
|
|
167
|
+
### Test Doubles — Detailed Patterns
|
|
186
168
|
|
|
187
|
-
|
|
169
|
+
#### Stubs
|
|
188
170
|
|
|
189
|
-
|
|
171
|
+
Return predetermined responses. Use when you need to control what a dependency returns.
|
|
190
172
|
|
|
191
173
|
```typescript
|
|
192
174
|
const userRepo = { findById: jest.fn().mockResolvedValue({ id: '1', name: 'Alice' }) };
|
|
193
175
|
```
|
|
194
176
|
|
|
195
|
-
|
|
177
|
+
#### Mocks
|
|
178
|
+
|
|
179
|
+
Record calls and verify interactions. Use when you need to verify that a dependency was called correctly.
|
|
196
180
|
|
|
197
181
|
```typescript
|
|
198
182
|
const emailService = { send: jest.fn() };
|
|
@@ -203,17 +187,22 @@ expect(emailService.send).toHaveBeenCalledWith({
|
|
|
203
187
|
});
|
|
204
188
|
```
|
|
205
189
|
|
|
206
|
-
|
|
190
|
+
#### Spies
|
|
191
|
+
|
|
192
|
+
Wrap real implementations and record calls. Use when you want real behavior but also want to verify calls.
|
|
193
|
+
|
|
194
|
+
#### Fakes
|
|
207
195
|
|
|
208
|
-
|
|
196
|
+
Working implementations with simplified behavior. Use for expensive dependencies in tests (in-memory database instead of real database).
|
|
197
|
+
|
|
198
|
+
#### When to Use Which
|
|
209
199
|
|
|
210
|
-
**When to use which:**
|
|
211
200
|
- Stub external services (HTTP APIs, email, payment)
|
|
212
201
|
- Mock side-effect-producing dependencies (to verify they're called)
|
|
213
202
|
- Spy on internal functions (to verify call patterns without changing behavior)
|
|
214
203
|
- Fake databases in unit tests (in-memory implementations of repository interfaces)
|
|
215
204
|
|
|
216
|
-
### What NOT to Mock
|
|
205
|
+
### What NOT to Mock — Extended
|
|
217
206
|
|
|
218
207
|
- **The thing you're testing.** If you mock the function under test, you're testing the mock, not the code.
|
|
219
208
|
- **Value objects and simple data transformations.** Use real instances; they're fast and deterministic.
|
|
@@ -243,9 +232,9 @@ Verify that a service provider and its consumers agree on the API contract:
|
|
|
243
232
|
|
|
244
233
|
Best for: microservices, separate frontend/backend teams, or any system where the API producer and consumer are developed independently.
|
|
245
234
|
|
|
246
|
-
|
|
235
|
+
### Coverage Strategy — In Depth
|
|
247
236
|
|
|
248
|
-
|
|
237
|
+
#### Coverage Targets by Layer
|
|
249
238
|
|
|
250
239
|
Coverage targets should vary by the criticality and testability of each layer:
|
|
251
240
|
|
|
@@ -257,7 +246,7 @@ Coverage targets should vary by the criticality and testability of each layer:
|
|
|
257
246
|
| Infrastructure (adapters, config) | 50-70% line | Low logic density; over-testing adds maintenance burden |
|
|
258
247
|
| Generated code | 0% | Don't test generated code; test the generator |
|
|
259
248
|
|
|
260
|
-
|
|
249
|
+
#### Meaningful vs. Vanity Coverage
|
|
261
250
|
|
|
262
251
|
**Meaningful coverage** tests behavior that could break:
|
|
263
252
|
- Branch coverage (both sides of every `if` statement)
|
|
@@ -283,9 +272,9 @@ Tools: Stryker (JavaScript/TypeScript), mutmut (Python), PITest (Java).
|
|
|
283
272
|
|
|
284
273
|
Use mutation testing periodically (not on every CI run — it's slow) to assess test suite quality.
|
|
285
274
|
|
|
286
|
-
|
|
275
|
+
### Quality Gates — Detailed
|
|
287
276
|
|
|
288
|
-
|
|
277
|
+
#### Pre-Commit Checks
|
|
289
278
|
|
|
290
279
|
Run on every commit (should complete in <10 seconds):
|
|
291
280
|
|
|
@@ -295,7 +284,7 @@ Run on every commit (should complete in <10 seconds):
|
|
|
295
284
|
|
|
296
285
|
These are fast, catch obvious mistakes, and prevent noisy diffs in PRs.
|
|
297
286
|
|
|
298
|
-
|
|
287
|
+
#### CI Pipeline Checks
|
|
299
288
|
|
|
300
289
|
Run on every push and PR (should complete in <5 minutes):
|
|
301
290
|
|
|
@@ -305,7 +294,7 @@ Run on every push and PR (should complete in <5 minutes):
|
|
|
305
294
|
- **Build verification** (the application compiles and builds successfully)
|
|
306
295
|
- **Security audit** (dependency vulnerability scan)
|
|
307
296
|
|
|
308
|
-
|
|
297
|
+
#### Pre-Merge Requirements
|
|
309
298
|
|
|
310
299
|
Before a PR can be merged:
|
|
311
300
|
|
|
@@ -314,7 +303,7 @@ Before a PR can be merged:
|
|
|
314
303
|
- No merge conflicts
|
|
315
304
|
- Branch is up-to-date with main (or rebased)
|
|
316
305
|
|
|
317
|
-
|
|
306
|
+
#### Performance Benchmarks (Optional)
|
|
318
307
|
|
|
319
308
|
For performance-critical applications:
|
|
320
309
|
|
|
@@ -323,9 +312,9 @@ For performance-critical applications:
|
|
|
323
312
|
- Significant regressions (>10% degradation) block merge
|
|
324
313
|
- Baselines updated when intentional changes affect performance
|
|
325
314
|
|
|
326
|
-
|
|
315
|
+
### Test Data Management
|
|
327
316
|
|
|
328
|
-
|
|
317
|
+
#### Fixtures
|
|
329
318
|
|
|
330
319
|
Static test data stored in files or constants. Best for:
|
|
331
320
|
- Reference data (country lists, category hierarchies, status enums)
|
|
@@ -347,7 +336,7 @@ export const adminUser = {
|
|
|
347
336
|
};
|
|
348
337
|
```
|
|
349
338
|
|
|
350
|
-
|
|
339
|
+
#### Factories
|
|
351
340
|
|
|
352
341
|
Functions that generate test data with sensible defaults and selective overrides. Best for:
|
|
353
342
|
- Creating many variations of the same entity
|
|
@@ -370,7 +359,7 @@ function createUser(overrides: Partial<User> = {}): User {
|
|
|
370
359
|
const suspendedUser = createUser({ status: 'suspended' });
|
|
371
360
|
```
|
|
372
361
|
|
|
373
|
-
|
|
362
|
+
#### Seeds
|
|
374
363
|
|
|
375
364
|
Initial data loaded into the test database for integration tests. Rules:
|
|
376
365
|
- Seed data represents realistic scenarios (not just one record per table)
|
|
@@ -378,7 +367,7 @@ Initial data loaded into the test database for integration tests. Rules:
|
|
|
378
367
|
- Seed data is minimal (only what tests need; don't replicate production)
|
|
379
368
|
- Seed data includes edge cases (user with no orders, order with many items)
|
|
380
369
|
|
|
381
|
-
|
|
370
|
+
#### Test Database Management
|
|
382
371
|
|
|
383
372
|
**Transaction rollback pattern:** Each test runs inside a database transaction that is rolled back after the test. Fast, clean, but doesn't test commit behavior.
|
|
384
373
|
|
|
@@ -388,7 +377,7 @@ Initial data loaded into the test database for integration tests. Rules:
|
|
|
388
377
|
|
|
389
378
|
**Recommendation:** Use transaction rollback for unit-level database tests. Use truncate-and-seed for integration test suites. Use dedicated databases for CI.
|
|
390
379
|
|
|
391
|
-
|
|
380
|
+
### Common Pitfalls
|
|
392
381
|
|
|
393
382
|
**Testing implementation details.** "Verify that `_processPayment` was called with exactly these parameters." This test breaks whenever the internal implementation changes, even if the observable behavior is unchanged. Fix: test the observable outcome, not the internal mechanism.
|
|
394
383
|
|
|
@@ -407,3 +396,7 @@ Initial data loaded into the test database for integration tests. Rules:
|
|
|
407
396
|
**Skipped tests accumulate.** Tests marked as `skip` or `xit` that are never re-enabled. They represent either dead code or known bugs that nobody addresses. Fix: skipped tests are technical debt. Set a policy: fix or delete within one sprint.
|
|
408
397
|
|
|
409
398
|
**No test naming convention.** Test descriptions like "test 1," "works correctly," or "handles the thing." Uninformative when tests fail. Fix: test names should describe the scenario and expected outcome: "returns 404 when user does not exist," "applies 10% discount for premium members."
|
|
399
|
+
|
|
400
|
+
## See Also
|
|
401
|
+
|
|
402
|
+
- [api-design](../core/api-design.md) — Contract testing patterns
|
|
@@ -4,16 +4,47 @@ description: Expert knowledge for translating product requirements into well-for
|
|
|
4
4
|
topics: [user-stories, personas, acceptance-criteria, story-splitting, INVEST, epics, traceability]
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
# User Stories
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Expert knowledge for translating product requirements into well-formed user stories with acceptance criteria, epic structure, and traceability.
|
|
10
|
+
|
|
11
|
+
## Summary
|
|
12
|
+
|
|
13
|
+
### Story Anatomy
|
|
10
14
|
|
|
11
15
|
**"As a [persona], I want [action], so that [outcome]."**
|
|
12
16
|
|
|
13
|
-
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
16
|
-
|
|
17
|
+
- **Persona** — the specific user role from the PRD, not "a user"
|
|
18
|
+
- **Action** — what the user wants to do, in their language
|
|
19
|
+
- **Outcome** — the value they get (the most important part)
|
|
20
|
+
|
|
21
|
+
Deviations: **System stories** for background processes ("When a payment fails, the system retries twice...") and **Constraint stories** for NFRs ("All API responses within 500ms at p95").
|
|
22
|
+
|
|
23
|
+
### INVEST Criteria
|
|
24
|
+
|
|
25
|
+
- **Independent** — can be developed without requiring another story first
|
|
26
|
+
- **Negotiable** — describes what/why, not how
|
|
27
|
+
- **Valuable** — delivers value to a user or stakeholder
|
|
28
|
+
- **Estimable** — specific enough to estimate effort
|
|
29
|
+
- **Small** — implementable in 1-3 focused agent sessions
|
|
30
|
+
- **Testable** — acceptance criteria have clear pass/fail outcomes
|
|
31
|
+
|
|
32
|
+
### Acceptance Criteria Format
|
|
33
|
+
|
|
34
|
+
Use Given/When/Then for scenarios:
|
|
35
|
+
```
|
|
36
|
+
Given [precondition/context]
|
|
37
|
+
When [action/trigger]
|
|
38
|
+
Then [expected outcome]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Include parameterized scenarios for role variations, negative scenarios for every happy path, and boundary conditions at edges.
|
|
42
|
+
|
|
43
|
+
**AC vs. Test Cases**: ACs define WHAT should happen (business-level). Test cases define HOW to verify (technical-level, derived during implementation).
|
|
44
|
+
|
|
45
|
+
## Deep Guidance
|
|
46
|
+
|
|
47
|
+
### Story Anatomy — Extended
|
|
17
48
|
|
|
18
49
|
**Good stories:**
|
|
19
50
|
- "As a teacher, I want to assign homework to a class, so that students have practice material outside of class."
|
|
@@ -28,13 +59,9 @@ Each part serves a purpose:
|
|
|
28
59
|
- **System stories** describe behavior with no direct user action: "When a payment fails, the system retries twice with exponential backoff and notifies the user after final failure." These are acceptable for background processes, scheduled jobs, and automated workflows.
|
|
29
60
|
- **Constraint stories** capture non-functional requirements: "All API responses must complete within 500ms at p95 under normal load." These complement functional stories rather than replacing them.
|
|
30
61
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
## INVEST Criteria
|
|
62
|
+
### INVEST Criteria — Deep Dive
|
|
34
63
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
### Independent
|
|
64
|
+
#### Independent
|
|
38
65
|
|
|
39
66
|
The story can be developed and delivered without requiring another story to be done first. Stories with hard dependencies should be split or reordered.
|
|
40
67
|
|
|
@@ -42,7 +69,7 @@ The story can be developed and delivered without requiring another story to be d
|
|
|
42
69
|
- **Fail:** "As a user, I want to edit my profile photo" that silently depends on "As a user, I want to upload files" — if upload isn't done, this story is blocked.
|
|
43
70
|
- **Fix:** Make the dependency explicit and consider whether the stories should be combined or the shared functionality extracted.
|
|
44
71
|
|
|
45
|
-
|
|
72
|
+
#### Negotiable
|
|
46
73
|
|
|
47
74
|
The story describes what and why, not how. Implementation details are negotiated during development, not locked in the story.
|
|
48
75
|
|
|
@@ -50,7 +77,7 @@ The story describes what and why, not how. Implementation details are negotiated
|
|
|
50
77
|
- **Fail:** "As a user, I want to receive WebSocket push notifications rendered as toast components in the bottom-right corner using the Sonner library."
|
|
51
78
|
- **Fix:** Move implementation details to technical notes. The story stays focused on user value.
|
|
52
79
|
|
|
53
|
-
|
|
80
|
+
#### Valuable
|
|
54
81
|
|
|
55
82
|
The story delivers value to a user or stakeholder. Every story should have a clear beneficiary.
|
|
56
83
|
|
|
@@ -58,7 +85,7 @@ The story delivers value to a user or stakeholder. Every story should have a cle
|
|
|
58
85
|
- **Fail:** "As a developer, I want to refactor the authentication module." — No user value. This is a technical task, not a story.
|
|
59
86
|
- **Fix:** Frame technical work in terms of user value, or track it as a task rather than a story.
|
|
60
87
|
|
|
61
|
-
|
|
88
|
+
#### Estimable
|
|
62
89
|
|
|
63
90
|
The team (or agent) can estimate the effort. If a story is too vague to estimate, it needs more conversation or splitting.
|
|
64
91
|
|
|
@@ -66,7 +93,7 @@ The team (or agent) can estimate the effort. If a story is too vague to estimate
|
|
|
66
93
|
- **Fail:** "As a user, I want AI-powered recommendations" — too vague. What data? What algorithm? What UI?
|
|
67
94
|
- **Fix:** Split into smaller, more specific stories until each is estimable.
|
|
68
95
|
|
|
69
|
-
|
|
96
|
+
#### Small
|
|
70
97
|
|
|
71
98
|
A story should be implementable in 1-3 focused agent sessions. Larger stories need splitting.
|
|
72
99
|
|
|
@@ -74,7 +101,7 @@ A story should be implementable in 1-3 focused agent sessions. Larger stories ne
|
|
|
74
101
|
- **Fail:** "As a user, I want a complete e-commerce checkout flow with cart, address, payment, confirmation, and order tracking."
|
|
75
102
|
- **Fix:** Split by workflow step: cart management, address entry, payment processing, order confirmation, order tracking.
|
|
76
103
|
|
|
77
|
-
|
|
104
|
+
#### Testable
|
|
78
105
|
|
|
79
106
|
Acceptance criteria have clear pass/fail outcomes. If you can't write a test for it, the story isn't ready.
|
|
80
107
|
|
|
@@ -82,9 +109,7 @@ Acceptance criteria have clear pass/fail outcomes. If you can't write a test for
|
|
|
82
109
|
- **Fail:** "The checkout should be intuitive." — Not testable.
|
|
83
110
|
- **Fix:** Replace subjective language with observable behavior.
|
|
84
111
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
## Persona Definition
|
|
112
|
+
### Persona Definition
|
|
88
113
|
|
|
89
114
|
Personas are extracted from the PRD's user/stakeholder descriptions. Each persona is a specific user type with distinct goals, not a generic role label.
|
|
90
115
|
|
|
@@ -103,9 +128,7 @@ Personas are extracted from the PRD's user/stakeholder descriptions. Each person
|
|
|
103
128
|
- **Pain points** — what frustrates them today (informs acceptance criteria)
|
|
104
129
|
- **Context** — when, where, how they use the product (informs UX decisions)
|
|
105
130
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
## Epic Structure
|
|
131
|
+
### Epic Structure
|
|
109
132
|
|
|
110
133
|
Epics group related stories by user journey, not by system component.
|
|
111
134
|
|
|
@@ -125,13 +148,9 @@ Epics group related stories by user journey, not by system component.
|
|
|
125
148
|
- Use verb phrases that describe the user goal: "Managing Team Members," "Processing Payments," "Onboarding New Users."
|
|
126
149
|
- Avoid technical names: "REST API," "Database Layer," "Auth Module."
|
|
127
150
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
## Acceptance Criteria Patterns
|
|
151
|
+
### Acceptance Criteria Patterns — Extended
|
|
131
152
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
### Given/When/Then Format
|
|
153
|
+
#### Given/When/Then Format
|
|
135
154
|
|
|
136
155
|
The standard format for acceptance criteria scenarios:
|
|
137
156
|
|
|
@@ -148,7 +167,7 @@ When they enter valid credentials and click "Sign In"
|
|
|
148
167
|
Then they are redirected to the dashboard and see a welcome message with their name
|
|
149
168
|
```
|
|
150
169
|
|
|
151
|
-
|
|
170
|
+
#### Parameterized Scenarios
|
|
152
171
|
|
|
153
172
|
When the same behavior applies to multiple variations, use parameterized scenarios:
|
|
154
173
|
|
|
@@ -158,7 +177,7 @@ When they access the settings page
|
|
|
158
177
|
Then they see [all settings | team settings only | read-only view]
|
|
159
178
|
```
|
|
160
179
|
|
|
161
|
-
|
|
180
|
+
#### Negative Scenarios
|
|
162
181
|
|
|
163
182
|
Every happy path should have corresponding error scenarios:
|
|
164
183
|
|
|
@@ -169,7 +188,7 @@ Then they see "Invalid credentials" and the password field is cleared
|
|
|
169
188
|
And after 5 failed attempts, the account is locked for 15 minutes
|
|
170
189
|
```
|
|
171
190
|
|
|
172
|
-
|
|
191
|
+
#### Boundary Conditions
|
|
173
192
|
|
|
174
193
|
Test edges, not just middles:
|
|
175
194
|
|
|
@@ -181,19 +200,17 @@ When they enter 101 characters
|
|
|
181
200
|
Then they see "Name must be 100 characters or fewer" and the extra character is rejected
|
|
182
201
|
```
|
|
183
202
|
|
|
184
|
-
|
|
203
|
+
#### Acceptance Criteria vs. Test Cases
|
|
185
204
|
|
|
186
205
|
- **Acceptance criteria** define WHAT should happen (business-level behavior)
|
|
187
206
|
- **Test cases** define HOW to verify it (technical-level steps)
|
|
188
207
|
- Stories contain acceptance criteria. Test cases are derived later during implementation.
|
|
189
208
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
## Story Splitting Heuristics
|
|
209
|
+
### Story Splitting Heuristics
|
|
193
210
|
|
|
194
211
|
When a story is too large, use these patterns to split it into smaller, independently valuable stories.
|
|
195
212
|
|
|
196
|
-
|
|
213
|
+
#### By Workflow Step
|
|
197
214
|
|
|
198
215
|
Before: "As a user, I want to complete the checkout process."
|
|
199
216
|
After:
|
|
@@ -202,7 +219,7 @@ After:
|
|
|
202
219
|
- "As a shopper, I want to select a payment method and pay."
|
|
203
220
|
- "As a shopper, I want to see an order confirmation."
|
|
204
221
|
|
|
205
|
-
|
|
222
|
+
#### By Data Variation
|
|
206
223
|
|
|
207
224
|
Before: "As a user, I want to create posts."
|
|
208
225
|
After:
|
|
@@ -210,7 +227,7 @@ After:
|
|
|
210
227
|
- "As a user, I want to create posts with images."
|
|
211
228
|
- "As a user, I want to create posts with embedded videos."
|
|
212
229
|
|
|
213
|
-
|
|
230
|
+
#### By Operation (CRUD)
|
|
214
231
|
|
|
215
232
|
Before: "As an admin, I want to manage users."
|
|
216
233
|
After:
|
|
@@ -219,7 +236,7 @@ After:
|
|
|
219
236
|
- "As an admin, I want to edit user roles."
|
|
220
237
|
- "As an admin, I want to deactivate user accounts."
|
|
221
238
|
|
|
222
|
-
|
|
239
|
+
#### By User Role
|
|
223
240
|
|
|
224
241
|
Before: "As a user, I want to access the dashboard."
|
|
225
242
|
After:
|
|
@@ -227,16 +244,14 @@ After:
|
|
|
227
244
|
- "As a team lead, I want to see team progress metrics on the dashboard."
|
|
228
245
|
- "As an admin, I want to see system health and usage stats on the dashboard."
|
|
229
246
|
|
|
230
|
-
|
|
247
|
+
#### By Happy/Sad Path
|
|
231
248
|
|
|
232
249
|
Before: "As a user, I want to upload a document."
|
|
233
250
|
After:
|
|
234
251
|
- "As a user, I want to upload a PDF or Word document."
|
|
235
252
|
- "As a user, I want to see clear error messages when upload fails (wrong format, too large, network error)."
|
|
236
253
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
## Scope Boundaries
|
|
254
|
+
### Scope Boundaries
|
|
240
255
|
|
|
241
256
|
Every story should explicitly state what it does NOT include to prevent scope creep.
|
|
242
257
|
|
|
@@ -257,9 +272,7 @@ Every story should explicitly state what it does NOT include to prevent scope cr
|
|
|
257
272
|
- "Won't" items in MoSCoW are scope boundaries at the PRD level
|
|
258
273
|
- Story-level scope boundaries are more granular — they clarify what THIS story excludes even if another story covers it
|
|
259
274
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
## PRD-to-Story Traceability
|
|
275
|
+
### PRD-to-Story Traceability
|
|
263
276
|
|
|
264
277
|
Every PRD feature must map to at least one user story. This is a non-negotiable coverage requirement.
|
|
265
278
|
|
|
@@ -283,9 +296,7 @@ Every PRD feature must map to at least one user story. This is a non-negotiable
|
|
|
283
296
|
- Use IDs to create a traceable chain: PRD-REQ-001 → US-001 → (downstream: Task BD-42)
|
|
284
297
|
- Story IDs (US-001, US-002, ...) are stable — they persist through updates and are referenced by downstream phases
|
|
285
298
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
## Story Dependencies
|
|
299
|
+
### Story Dependencies
|
|
289
300
|
|
|
290
301
|
Some stories must be implemented before others. Document these explicitly.
|
|
291
302
|
|
|
@@ -304,34 +315,32 @@ Only blocked-by dependencies should be formal constraints. Informed-by relations
|
|
|
304
315
|
- If Story C depends on B which depends on A, ask: can C depend directly on A instead? Can C's dependency be satisfied with a mock or interface?
|
|
305
316
|
- Extract shared infrastructure into its own story at the front of the chain rather than letting it hide inside a feature story
|
|
306
317
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
## Common Pitfalls
|
|
318
|
+
### Common Pitfalls
|
|
310
319
|
|
|
311
|
-
|
|
320
|
+
#### Implementation Stories
|
|
312
321
|
- **Problem:** "As a developer, I want a REST endpoint for user CRUD."
|
|
313
322
|
- **Fix:** Rewrite from the user's perspective: "As a new visitor, I want to create an account with my email." The REST endpoint is an implementation detail, not a user story.
|
|
314
323
|
|
|
315
|
-
|
|
324
|
+
#### Stories Too Large
|
|
316
325
|
- **Problem:** A story with 10+ acceptance criteria spanning multiple workflows.
|
|
317
326
|
- **Fix:** Split using the heuristics above. Each resulting story should have 3-5 acceptance criteria.
|
|
318
327
|
|
|
319
|
-
|
|
328
|
+
#### Vague Acceptance Criteria
|
|
320
329
|
- **Problem:** "The feature works correctly and is user-friendly."
|
|
321
330
|
- **Fix:** Replace with Given/When/Then scenarios. Define "correctly" and "user-friendly" in observable terms.
|
|
322
331
|
|
|
323
|
-
|
|
332
|
+
#### Missing Personas
|
|
324
333
|
- **Problem:** Stories reference undefined personas ("a power user," "the operator").
|
|
325
334
|
- **Fix:** Map back to PRD personas. If the PRD doesn't define this persona, either add it to the PRD or use an existing persona.
|
|
326
335
|
|
|
327
|
-
|
|
336
|
+
#### Stories Without Value Statements
|
|
328
337
|
- **Problem:** "As a user, I want to click the submit button."
|
|
329
338
|
- **Fix:** Add the "so that" clause: "As a user, I want to submit my feedback form, so that the support team can address my issue."
|
|
330
339
|
|
|
331
|
-
|
|
340
|
+
#### Duplicate Stories Across Epics
|
|
332
341
|
- **Problem:** "Upload profile photo" appears in both "Account Setup" and "Profile Management" epics.
|
|
333
342
|
- **Fix:** Choose one epic. Add a scope boundary in the other epic referencing the canonical story.
|
|
334
343
|
|
|
335
|
-
|
|
344
|
+
#### Confusing Acceptance Criteria with Implementation Steps
|
|
336
345
|
- **Problem:** "1. Create a POST /api/users endpoint. 2. Validate email format with regex. 3. Hash password with bcrypt."
|
|
337
346
|
- **Fix:** These are implementation steps, not acceptance criteria. Rewrite as: "Given a valid email and password, when the user submits registration, then their account is created and they receive a confirmation email."
|
|
@@ -169,3 +169,60 @@ Group related suggestions for efficient decision-making. For each group:
|
|
|
169
169
|
2. State the cost (trivial/moderate/significant)
|
|
170
170
|
3. State your recommendation (must-have/backlog/reject)
|
|
171
171
|
4. Wait for approval before integrating into stories
|
|
172
|
+
|
|
173
|
+
### Example Innovation Finding
|
|
174
|
+
|
|
175
|
+
When documenting an innovation suggestion, use a structured format that makes the enhancement, its cost, and its impact immediately clear:
|
|
176
|
+
|
|
177
|
+
```markdown
|
|
178
|
+
## Innovation Finding: Smart Defaults for Checkout Address
|
|
179
|
+
|
|
180
|
+
**Category:** High-Value Low-Effort Enhancement — Smart Defaults
|
|
181
|
+
**Applies to:** Story 4.2 "As a returning customer, I want to enter my shipping address"
|
|
182
|
+
|
|
183
|
+
**Current behavior:** User must re-enter full shipping address on every order, even
|
|
184
|
+
if it has not changed since their last purchase.
|
|
185
|
+
|
|
186
|
+
**Proposed enhancement:** Pre-fill shipping address from the user's most recent order.
|
|
187
|
+
Show a "Same as last order" toggle that auto-populates all address fields. User can
|
|
188
|
+
still edit any field after pre-fill.
|
|
189
|
+
|
|
190
|
+
**User benefit:** Reduces a 6-field manual entry to a single click for repeat customers,
|
|
191
|
+
which account for 65% of orders per the PRD's user research.
|
|
192
|
+
|
|
193
|
+
**Cost:** Trivial — requires reading the most recent order's address (data already exists)
|
|
194
|
+
and pre-populating form fields. No new API endpoints, no new database tables.
|
|
195
|
+
|
|
196
|
+
**Impact:** Noticeable improvement — reduces checkout friction for the majority of users.
|
|
197
|
+
Directly supports the PRD success metric "reduce checkout abandonment from 72% to 45%."
|
|
198
|
+
|
|
199
|
+
**Recommendation:** Must-have for v1. High impact, trivial cost, directly tied to a
|
|
200
|
+
success metric.
|
|
201
|
+
|
|
202
|
+
**Acceptance criteria addition:**
|
|
203
|
+
- Given a returning customer with a previous order,
|
|
204
|
+
when they reach the shipping address step,
|
|
205
|
+
then all address fields are pre-filled with their most recent shipping address
|
|
206
|
+
- Given a new customer with no previous orders,
|
|
207
|
+
when they reach the shipping address step,
|
|
208
|
+
then all address fields are empty (current behavior)
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Integration With User Stories
|
|
214
|
+
|
|
215
|
+
When approved innovations are integrated into the story set, they modify stories in one of three ways:
|
|
216
|
+
|
|
217
|
+
**Adding acceptance criteria** — The most common integration for trivial-cost enhancements. The innovation becomes additional acceptance criteria on an existing story.
|
|
218
|
+
|
|
219
|
+
**Adding a new story** — For moderate-cost enhancements that warrant their own story. The new story should reference the innovation finding and include a clear "why" tying it back to the PRD.
|
|
220
|
+
|
|
221
|
+
**Modifying an existing story's scope** — For enhancements that change how a feature works rather than adding to it. The original story's description and acceptance criteria are updated to reflect the enhanced behavior.
|
|
222
|
+
|
|
223
|
+
### Traceability
|
|
224
|
+
|
|
225
|
+
Every innovation that gets integrated must be traceable:
|
|
226
|
+
- The innovation finding should reference the PRD requirement it enhances
|
|
227
|
+
- The modified or new story should reference the innovation finding
|
|
228
|
+
- The innovation decision (must-have/backlog/reject) should be recorded for audit
|