bmad-method 6.0.0-alpha.4 → 6.0.0-alpha.5

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 (162) hide show
  1. package/.claude/commands/bmad/bmm/agents/architect.md +0 -1
  2. package/.claude/commands/bmad/bmm/agents/sm.md +1 -1
  3. package/.claude/commands/bmad/bmm/agents/tech-writer.md +82 -0
  4. package/.claude/commands/bmad/bmm/workflows/README.md +1 -1
  5. package/.claude/commands/bmad/bmm/workflows/epic-tech-context.md +15 -0
  6. package/.claude/commands/bmad/core/workflows/README.md +10 -0
  7. package/.claude/settings.local.json +4 -8
  8. package/CHANGELOG.md +305 -0
  9. package/README.md +88 -39
  10. package/bmad/_cfg/agent-manifest.csv +2 -1
  11. package/bmad/_cfg/agents/bmm-tech-writer.customize.yaml +42 -0
  12. package/bmad/_cfg/files-manifest.csv +40 -62
  13. package/bmad/_cfg/ides/claude-code.yaml +1 -1
  14. package/bmad/_cfg/manifest.yaml +4 -3
  15. package/bmad/_cfg/task-manifest.csv +4 -1
  16. package/bmad/_cfg/tool-manifest.csv +1 -0
  17. package/bmad/_cfg/workflow-manifest.csv +3 -1
  18. package/bmad/bmb/config.yaml +2 -2
  19. package/bmad/bmb/workflows/audit-workflow/instructions.md +1 -1
  20. package/bmad/bmm/README.md +79 -120
  21. package/bmad/bmm/README.md.bak +169 -0
  22. package/bmad/bmm/agents/analyst.md.bak +67 -0
  23. package/bmad/bmm/agents/architect.md +0 -1
  24. package/bmad/bmm/agents/architect.md.bak +73 -0
  25. package/bmad/bmm/agents/dev.md.bak +69 -0
  26. package/bmad/bmm/agents/pm.md.bak +76 -0
  27. package/bmad/bmm/agents/sm.md +1 -1
  28. package/bmad/bmm/agents/sm.md.bak +85 -0
  29. package/bmad/bmm/agents/tea.md.bak +72 -0
  30. package/bmad/bmm/agents/tech-writer.md +82 -0
  31. package/bmad/bmm/agents/ux-designer.md.bak +71 -0
  32. package/bmad/bmm/config.yaml +2 -2
  33. package/bmad/bmm/docs/README.md +235 -0
  34. package/bmad/bmm/docs/agents-guide.md +1057 -0
  35. package/bmad/bmm/docs/brownfield-guide.md +471 -972
  36. package/bmad/bmm/docs/enterprise-agentic-development.md +680 -0
  37. package/bmad/bmm/docs/faq.md +589 -0
  38. package/bmad/bmm/docs/glossary.md +321 -0
  39. package/bmad/bmm/docs/party-mode.md +224 -0
  40. package/bmad/bmm/docs/quick-spec-flow.md +64 -57
  41. package/bmad/bmm/docs/quick-start.md +72 -47
  42. package/bmad/bmm/docs/scale-adaptive-system.md +332 -778
  43. package/bmad/bmm/docs/troubleshooting.md +680 -0
  44. package/bmad/bmm/{workflows/3-solutioning/architecture/README.md → docs/workflow-architecture-reference.md} +130 -77
  45. package/bmad/bmm/{workflows/document-project/README.md → docs/workflow-document-project-reference.md} +45 -2
  46. package/bmad/bmm/docs/workflows-analysis.md +670 -0
  47. package/bmad/bmm/docs/workflows-implementation.md +1758 -0
  48. package/bmad/bmm/docs/workflows-planning.md +1086 -0
  49. package/bmad/bmm/docs/workflows-solutioning.md +726 -0
  50. package/bmad/bmm/tasks/daily-standup.xml +1 -1
  51. package/bmad/bmm/workflows/2-plan-workflows/tech-spec/workflow.yaml.bak +60 -0
  52. package/bmad/bmm/workflows/4-implementation/epic-tech-context/workflow.yaml +1 -1
  53. package/bmad/bmm/workflows/techdoc/documentation-standards.md +2 -1
  54. package/bmad/bmm/workflows/techdoc/documentation-standards.md.bak +238 -0
  55. package/bmad/bmm/workflows/workflow-status/init/instructions.md +623 -242
  56. package/bmad/bmm/workflows/workflow-status/init/workflow.yaml.bak +27 -0
  57. package/bmad/bmm/workflows/workflow-status/paths/enterprise-brownfield.yaml +120 -0
  58. package/bmad/bmm/workflows/workflow-status/paths/enterprise-greenfield.yaml +108 -0
  59. package/{src/modules/bmm/workflows/workflow-status/paths/brownfield-level-3.yaml → bmad/bmm/workflows/workflow-status/paths/method-brownfield.yaml} +33 -31
  60. package/{src/modules/bmm/workflows/workflow-status/paths/greenfield-level-2.yaml → bmad/bmm/workflows/workflow-status/paths/method-greenfield.yaml} +31 -21
  61. package/{src/modules/bmm/workflows/workflow-status/paths/brownfield-level-1.yaml → bmad/bmm/workflows/workflow-status/paths/quick-flow-brownfield.yaml} +18 -18
  62. package/bmad/bmm/workflows/workflow-status/paths/{greenfield-level-1.yaml → quick-flow-greenfield.yaml} +16 -18
  63. package/bmad/bmm/workflows/workflow-status/workflow-status-template.yaml +4 -4
  64. package/bmad/cis/agents/brainstorming-coach.md.bak +62 -0
  65. package/bmad/cis/agents/creative-problem-solver.md.bak +62 -0
  66. package/bmad/cis/agents/design-thinking-coach.md.bak +62 -0
  67. package/bmad/cis/agents/innovation-strategist.md.bak +62 -0
  68. package/bmad/cis/agents/storyteller.md.bak +59 -0
  69. package/bmad/cis/config.yaml +2 -2
  70. package/bmad/core/agents/bmad-master.md.bak +15 -13
  71. package/bmad/core/config.yaml +2 -2
  72. package/bmad/core/tasks/workflow.xml +1 -11
  73. package/package.json +1 -1
  74. package/src/core/tasks/workflow.xml +1 -11
  75. package/src/modules/bmb/workflows/audit-workflow/instructions.md +1 -1
  76. package/src/modules/bmm/README.md +1 -1
  77. package/src/modules/bmm/agents/architect.agent.yaml +0 -4
  78. package/src/modules/bmm/agents/game-dev.agent.yaml +8 -12
  79. package/src/modules/bmm/agents/sm.agent.yaml +1 -1
  80. package/src/modules/bmm/agents/{paige.agent.yaml → tech-writer.agent.yaml} +4 -4
  81. package/src/modules/bmm/docs/README.md +9 -9
  82. package/src/modules/bmm/docs/agents-guide.md +46 -98
  83. package/src/modules/bmm/docs/brownfield-guide.md +211 -90
  84. package/src/modules/bmm/docs/enterprise-agentic-development.md +380 -740
  85. package/src/modules/bmm/docs/faq.md +10 -10
  86. package/src/modules/bmm/docs/glossary.md +36 -42
  87. package/src/modules/bmm/docs/party-mode.md +110 -1122
  88. package/src/modules/bmm/docs/quick-spec-flow.md +33 -33
  89. package/src/modules/bmm/docs/quick-start.md +29 -29
  90. package/src/modules/bmm/docs/scale-adaptive-system.md +303 -453
  91. package/src/modules/bmm/docs/troubleshooting.md +1 -1
  92. package/src/modules/bmm/docs/workflows-implementation.md +20 -21
  93. package/src/modules/bmm/docs/workflows-solutioning.md +1 -1
  94. package/src/modules/bmm/tasks/daily-standup.xml +1 -1
  95. package/src/modules/bmm/workflows/2-plan-workflows/create-ux-design/instructions.md +1 -19
  96. package/src/modules/bmm/workflows/2-plan-workflows/prd/checklist.md +10 -9
  97. package/src/modules/bmm/workflows/2-plan-workflows/prd/create-epics-and-stories/epics-template.md +23 -34
  98. package/src/modules/bmm/workflows/2-plan-workflows/prd/create-epics-and-stories/instructions.md +105 -331
  99. package/src/modules/bmm/workflows/2-plan-workflows/prd/create-epics-and-stories/workflow.yaml +23 -11
  100. package/src/modules/bmm/workflows/2-plan-workflows/prd/instructions.md +23 -38
  101. package/src/modules/bmm/workflows/2-plan-workflows/prd/workflow.yaml +2 -2
  102. package/src/modules/bmm/workflows/2-plan-workflows/tech-spec/epics-template.md +38 -16
  103. package/src/modules/bmm/workflows/2-plan-workflows/tech-spec/instructions.md +1 -19
  104. package/src/modules/bmm/workflows/2-plan-workflows/tech-spec/user-story-template.md +35 -32
  105. package/src/modules/bmm/workflows/2-plan-workflows/tech-spec/workflow.yaml +2 -2
  106. package/src/modules/bmm/workflows/3-solutioning/architecture/instructions.md +7 -18
  107. package/src/modules/bmm/workflows/3-solutioning/solutioning-gate-check/instructions.md +1 -18
  108. package/src/modules/bmm/workflows/3-solutioning/solutioning-gate-check/workflow.yaml +6 -6
  109. package/src/modules/bmm/workflows/4-implementation/epic-tech-context/workflow.yaml +1 -1
  110. package/src/modules/bmm/workflows/techdoc/documentation-standards.md +1 -1
  111. package/src/modules/bmm/workflows/workflow-status/init/instructions.md +623 -242
  112. package/src/modules/bmm/workflows/workflow-status/paths/enterprise-brownfield.yaml +120 -0
  113. package/src/modules/bmm/workflows/workflow-status/paths/enterprise-greenfield.yaml +108 -0
  114. package/{bmad/bmm/workflows/workflow-status/paths/brownfield-level-3.yaml → src/modules/bmm/workflows/workflow-status/paths/method-brownfield.yaml} +33 -31
  115. package/{bmad/bmm/workflows/workflow-status/paths/greenfield-level-2.yaml → src/modules/bmm/workflows/workflow-status/paths/method-greenfield.yaml} +31 -21
  116. package/{bmad/bmm/workflows/workflow-status/paths/brownfield-level-1.yaml → src/modules/bmm/workflows/workflow-status/paths/quick-flow-brownfield.yaml} +18 -18
  117. package/src/modules/bmm/workflows/workflow-status/paths/{greenfield-level-1.yaml → quick-flow-greenfield.yaml} +16 -18
  118. package/src/modules/bmm/workflows/workflow-status/workflow-status-template.yaml +4 -4
  119. package/bmad/bmm/tasks/retrospective.xml +0 -104
  120. package/bmad/bmm/testarch/README.md +0 -311
  121. package/bmad/bmm/workflows/1-analysis/brainstorm-project/README.md +0 -113
  122. package/bmad/bmm/workflows/1-analysis/product-brief/README.md +0 -180
  123. package/bmad/bmm/workflows/1-analysis/research/README.md +0 -454
  124. package/bmad/bmm/workflows/2-plan-workflows/README.md +0 -258
  125. package/bmad/bmm/workflows/3-solutioning/README.md +0 -1
  126. package/bmad/bmm/workflows/3-solutioning/solutioning-gate-check/README.md +0 -177
  127. package/bmad/bmm/workflows/4-implementation/README.md +0 -221
  128. package/bmad/bmm/workflows/4-implementation/code-review/README.md +0 -69
  129. package/bmad/bmm/workflows/4-implementation/correct-course/README.md +0 -73
  130. package/bmad/bmm/workflows/4-implementation/create-story/README.md +0 -146
  131. package/bmad/bmm/workflows/4-implementation/dev-story/README.md +0 -206
  132. package/bmad/bmm/workflows/4-implementation/epic-tech-context/README.md +0 -195
  133. package/bmad/bmm/workflows/4-implementation/retrospective/README.md +0 -77
  134. package/bmad/bmm/workflows/4-implementation/sprint-planning/README.md +0 -156
  135. package/bmad/bmm/workflows/4-implementation/story-context/README.md +0 -234
  136. package/bmad/bmm/workflows/README.md +0 -256
  137. package/bmad/bmm/workflows/document-project/templates/README.md +0 -38
  138. package/bmad/bmm/workflows/testarch/README.md +0 -26
  139. package/bmad/bmm/workflows/testarch/atdd/README.md +0 -672
  140. package/bmad/bmm/workflows/testarch/automate/README.md +0 -869
  141. package/bmad/bmm/workflows/testarch/ci/README.md +0 -493
  142. package/bmad/bmm/workflows/testarch/framework/README.md +0 -340
  143. package/bmad/bmm/workflows/testarch/nfr-assess/README.md +0 -469
  144. package/bmad/bmm/workflows/testarch/test-design/README.md +0 -493
  145. package/bmad/bmm/workflows/testarch/test-review/README.md +0 -775
  146. package/bmad/bmm/workflows/testarch/trace/README.md +0 -802
  147. package/bmad/bmm/workflows/workflow-status/README.md +0 -260
  148. package/bmad/bmm/workflows/workflow-status/paths/brownfield-level-0.yaml +0 -54
  149. package/bmad/bmm/workflows/workflow-status/paths/brownfield-level-2.yaml +0 -76
  150. package/bmad/bmm/workflows/workflow-status/paths/brownfield-level-4.yaml +0 -88
  151. package/bmad/bmm/workflows/workflow-status/paths/greenfield-level-0.yaml +0 -45
  152. package/bmad/bmm/workflows/workflow-status/paths/greenfield-level-3.yaml +0 -73
  153. package/bmad/bmm/workflows/workflow-status/paths/greenfield-level-4.yaml +0 -75
  154. package/src/modules/bmm/docs/brownfield-guide.md.backup +0 -1324
  155. package/src/modules/bmm/docs/workflows-testing.md +0 -1572
  156. package/src/modules/bmm/workflows/workflow-status/paths/brownfield-level-0.yaml +0 -54
  157. package/src/modules/bmm/workflows/workflow-status/paths/brownfield-level-2.yaml +0 -76
  158. package/src/modules/bmm/workflows/workflow-status/paths/brownfield-level-4.yaml +0 -88
  159. package/src/modules/bmm/workflows/workflow-status/paths/greenfield-level-0.yaml +0 -45
  160. package/src/modules/bmm/workflows/workflow-status/paths/greenfield-level-3.yaml +0 -73
  161. package/src/modules/bmm/workflows/workflow-status/paths/greenfield-level-4.yaml +0 -75
  162. /package/bmad/bmm/agents/{paige.md → paige.md.bak} +0 -0
@@ -1,1572 +0,0 @@
1
- # BMM Testing & QA Workflows (Testarch)
2
-
3
- **Reading Time:** ~18 minutes
4
-
5
- ## Overview
6
-
7
- Testarch workflows provide comprehensive testing infrastructure and quality assurance. Unlike Phases 1-4 which are sequential, **testing workflows run in parallel** with implementation and can be invoked as needed throughout the project lifecycle.
8
-
9
- **Key principle:** Testing is not a phase—it's a continuous practice integrated into every story.
10
-
11
- ## Quick Reference
12
-
13
- | Workflow | Duration | When to Run | Purpose |
14
- | ------------------- | ----------------- | ---------------------- | -------------------------------------- |
15
- | **framework** | 1-2 hours | Once (setup) | Scaffold test infrastructure |
16
- | **test-design** | 2-4 hours | Before implementation | Risk assessment and test planning |
17
- | **atdd** | 30-90 min/story | Per story (before dev) | Generate failing acceptance tests |
18
- | **automate** | 1-3 hours/feature | After dev-story | Expand regression suite |
19
- | **ci** | 1-2 hours | Once (after framework) | CI/CD pipeline with burn-in |
20
- | **trace** (Phase 1) | 15-30 min | After tests written | Traceability matrix |
21
- | **trace** (Phase 2) | 15-30 min | Before release | Quality gate decision |
22
- | **nfr-assess** | 1-2 hours | Before release | Non-functional requirements validation |
23
- | **test-review** | 30-60 min | After test creation | Test quality validation |
24
-
25
- ---
26
-
27
- ## Understanding Testarch
28
-
29
- ### TEA Agent (Test Architect)
30
-
31
- All testarch workflows are executed by the **TEA agent** - your dedicated test architect and quality assurance specialist.
32
-
33
- **TEA's Responsibilities:**
34
-
35
- - Design test strategies
36
- - Generate test code
37
- - Validate test quality
38
- - Ensure coverage
39
- - Make quality gate decisions
40
-
41
- **TEA's Knowledge Base:**
42
-
43
- - 22+ knowledge fragments (tea-index.csv)
44
- - Best practices for Playwright, Cypress, Jest, Vitest
45
- - Test patterns: fixtures, factories, network-first, burn-in
46
- - Quality standards: determinism, isolation, no flakiness
47
-
48
- ### Testing Integration with Implementation
49
-
50
- **Parallel Execution Model:**
51
-
52
- ```
53
- Implementation (Phase 4) Testing (Continuous)
54
- ───────────────────── ───────────────────
55
- framework (once) → Test infrastructure ready
56
- test-design (per epic) → Risk assessment complete
57
- create-story → atdd (generate failing tests)
58
- dev-story → Tests now pass
59
- → automate (expand coverage)
60
- code-review → test-review (validate quality)
61
- → trace (check coverage)
62
- sprint complete → nfr-assess (validate NFRs)
63
- → trace Phase 2 (quality gate)
64
- ```
65
-
66
- ### Testarch vs Traditional QA
67
-
68
- | Aspect | Traditional QA | Testarch |
69
- | --------------- | ------------------ | ------------------------- |
70
- | **When** | After development | Throughout development |
71
- | **Who** | QA team | TEA agent + DEV agent |
72
- | **Tests** | Manual → Automated | Generated → Validated |
73
- | **Coverage** | Variable | Systematic (P0-P3) |
74
- | **Integration** | Separate process | Built into workflows |
75
- | **Knowledge** | Tribal | Codified (knowledge base) |
76
-
77
- ---
78
-
79
- ## framework
80
-
81
- ### Purpose
82
-
83
- Scaffold production-ready test infrastructure including framework configuration, directory structure, fixtures, factories, and helper utilities.
84
-
85
- **Agent:** TEA (Test Architect)
86
- **When to Run:** Once at project start (before implementation)
87
- **Duration:** 1-2 hours
88
- **Required:** Yes (for all projects with tests)
89
-
90
- ### When to Use
91
-
92
- Run **before writing any tests** to establish test infrastructure.
93
-
94
- **Trigger Points:**
95
-
96
- - After Phase 3 (Solutioning) completes
97
- - Before first dev-story workflow
98
- - When starting a new project
99
-
100
- **Skip if:**
101
-
102
- - Tests already exist (brownfield with good test setup)
103
- - Prototype/POC without tests
104
-
105
- ### What Framework Provides
106
-
107
- **1. Framework Configuration**
108
-
109
- - playwright.config.ts (or cypress.config.ts, jest.config.js)
110
- - Environment-based configuration
111
- - Browser/device targeting
112
- - Parallel execution setup
113
- - Reporter configuration
114
-
115
- **2. Directory Structure**
116
-
117
- ```
118
- /tests
119
- /e2e - End-to-end tests
120
- /api - API/integration tests
121
- /component - Component tests
122
- /unit - Unit tests
123
- /support
124
- /fixtures - Test fixtures (setup/teardown)
125
- /factories - Data factories (test data generation)
126
- /helpers - Utility functions
127
- /reports - Test reports
128
- README.md - Test documentation
129
- ```
130
-
131
- **3. Base Fixtures**
132
-
133
- - Authentication fixtures
134
- - Database fixtures (if applicable)
135
- - API client fixtures
136
- - Common test utilities
137
-
138
- **4. Data Factories**
139
-
140
- - User factory (with faker.js)
141
- - Common entity factories
142
- - Factory utilities
143
-
144
- **5. Helper Utilities**
145
-
146
- - Wait utilities
147
- - Retry utilities
148
- - API helpers
149
- - Database helpers
150
-
151
- ### Process Overview
152
-
153
- **Phase 1: Framework Selection (Steps 1-2)**
154
-
155
- - Detect project type (web app, API, mobile, desktop)
156
- - Recommend framework (Playwright, Cypress, Jest, Vitest, etc.)
157
- - Confirm with user
158
-
159
- **Phase 2: Configuration (Steps 3-5)**
160
-
161
- - Generate framework config file
162
- - Configure environments (local, CI, staging, prod)
163
- - Set up parallel execution
164
- - Configure reporters
165
-
166
- **Phase 3: Directory Structure (Step 6)**
167
-
168
- - Create test directories
169
- - Generate README with test guidelines
170
-
171
- **Phase 4: Fixtures and Factories (Steps 7-9)**
172
-
173
- - Generate base fixtures
174
- - Generate data factories
175
- - Create helper utilities
176
-
177
- **Phase 5: Validation (Step 10)**
178
-
179
- - Generate sample test
180
- - Run sample test to verify setup
181
- - Document test execution commands
182
-
183
- ### Inputs
184
-
185
- Required:
186
-
187
- - Project type (web, API, mobile, desktop)
188
- - Framework preference (optional, will recommend)
189
-
190
- Optional:
191
-
192
- - Existing package.json
193
- - Technology stack (React, Vue, Node, etc.)
194
-
195
- ### Outputs
196
-
197
- **Primary Outputs:**
198
-
199
- 1. **Framework Configuration File**
200
- - `playwright.config.ts` (Playwright)
201
- - `cypress.config.ts` (Cypress)
202
- - `jest.config.js` (Jest)
203
- - `vitest.config.ts` (Vitest)
204
-
205
- 2. **Directory Structure** (all directories created)
206
-
207
- 3. **Base Fixtures** (`/tests/support/fixtures/`)
208
- - `auth.fixture.ts` - Authentication fixture
209
- - `base.fixture.ts` - Base fixture utilities
210
-
211
- 4. **Data Factories** (`/tests/support/factories/`)
212
- - `user.factory.ts` - User data factory
213
- - `factory-utils.ts` - Factory utilities
214
-
215
- 5. **Helpers** (`/tests/support/helpers/`)
216
- - `wait.ts` - Wait utilities
217
- - `retry.ts` - Retry utilities
218
-
219
- 6. **Documentation**
220
- - `/tests/README.md` - Test execution guide
221
-
222
- 7. **Sample Test**
223
- - `/tests/e2e/sample.spec.ts` - Verify setup works
224
-
225
- ### Example Output: Playwright Configuration
226
-
227
- ```typescript
228
- // playwright.config.ts
229
- import { defineConfig, devices } from '@playwright/test';
230
-
231
- export default defineConfig({
232
- testDir: './tests',
233
- fullyParallel: true,
234
- forbidOnly: !!process.env.CI,
235
- retries: process.env.CI ? 2 : 0,
236
- workers: process.env.CI ? 4 : undefined,
237
- reporter: [
238
- ['html', { outputFolder: 'tests/reports' }],
239
- ['json', { outputFile: 'tests/reports/results.json' }],
240
- ],
241
- use: {
242
- baseURL: process.env.BASE_URL || 'http://localhost:3000',
243
- trace: 'on-first-retry',
244
- screenshot: 'only-on-failure',
245
- video: 'retain-on-failure',
246
- },
247
- projects: [
248
- {
249
- name: 'chromium',
250
- use: { ...devices['Desktop Chrome'] },
251
- },
252
- {
253
- name: 'firefox',
254
- use: { ...devices['Desktop Firefox'] },
255
- },
256
- {
257
- name: 'webkit',
258
- use: { ...devices['Desktop Safari'] },
259
- },
260
- {
261
- name: 'mobile-chrome',
262
- use: { ...devices['Pixel 5'] },
263
- },
264
- ],
265
- webServer: {
266
- command: 'npm run dev',
267
- url: 'http://localhost:3000',
268
- reuseExistingServer: !process.env.CI,
269
- },
270
- });
271
- ```
272
-
273
- ### Related Workflows
274
-
275
- - **ci** - Configure CI/CD using framework config
276
- - **test-design** - Plan test coverage using framework
277
- - **atdd** - Generate tests using framework
278
-
279
- ---
280
-
281
- ## test-design
282
-
283
- ### Purpose
284
-
285
- Plan comprehensive test coverage strategy with risk assessment (probability × impact scoring), priority classification (P0-P3), and resource estimation.
286
-
287
- **Agent:** TEA (Test Architect)
288
- **When to Run:** Before implementation (per epic or per project)
289
- **Duration:** 2-4 hours
290
- **Required:** Recommended for Level 3-4, Optional for Level 2
291
-
292
- ### When to Use
293
-
294
- Run **before implementing tests** to plan coverage strategy.
295
-
296
- **Trigger Points:**
297
-
298
- - After PRD/GDD creation (project-wide planning)
299
- - Before each epic (epic-specific planning)
300
- - When assessing test coverage needs
301
-
302
- **Skip if:**
303
-
304
- - Level 0-1 (simple changes, test strategy obvious)
305
- - Continuing existing project with established strategy
306
-
307
- ### Risk Assessment Framework
308
-
309
- **Risk Score = Probability × Impact**
310
-
311
- **Probability (1-3):**
312
-
313
- - 1 (Unlikely): <10% chance
314
- - 2 (Possible): 10-50% chance
315
- - 3 (Likely): >50% chance
316
-
317
- **Impact (1-3):**
318
-
319
- - 1 (Minor): Cosmetic, workaround exists
320
- - 2 (Degraded): Feature impaired
321
- - 3 (Critical): System failure, no workaround
322
-
323
- **Risk Scores:**
324
-
325
- - **6-9 (High)**: Immediate attention, P0 tests required
326
- - **3-4 (Medium)**: Plan mitigation, P1-P2 tests
327
- - **1-2 (Low)**: Monitor, P3 tests optional
328
-
329
- ### Priority Classification (P0-P3)
330
-
331
- | Priority | Run Frequency | Coverage Requirement | Characteristics |
332
- | -------- | ------------- | -------------------- | ---------------------------------------- |
333
- | **P0** | Every commit | 100% | Critical paths, security, data integrity |
334
- | **P1** | PR to main | 90% | Important features, common workflows |
335
- | **P2** | Nightly | 80% | Edge cases, secondary features |
336
- | **P3** | On-demand | No requirement | Nice-to-have, exploratory |
337
-
338
- ### Process Overview
339
-
340
- **Phase 1: Context Loading (Steps 1-2)**
341
-
342
- - Load PRD/GDD
343
- - Load architecture
344
- - Load story files
345
-
346
- **Phase 2: Risk Assessment (Steps 3-5)**
347
-
348
- - Identify risk categories (TECH, SEC, PERF, DATA, BUS, OPS)
349
- - Score risks (probability × impact)
350
- - Flag high-risk items (≥6)
351
-
352
- **Phase 3: Coverage Planning (Steps 6-8)**
353
-
354
- - Map requirements to test levels (E2E/API/Component/Unit)
355
- - Assign priorities (P0/P1/P2/P3)
356
- - Avoid duplicate coverage
357
-
358
- **Phase 4: Resource Estimation (Steps 9-10)**
359
-
360
- - Estimate hours per priority
361
- - Calculate total effort
362
- - Define execution order
363
-
364
- **Phase 5: Documentation (Step 11)**
365
-
366
- - Generate test-design document
367
- - Create coverage matrix
368
- - Define quality gates
369
-
370
- ### Inputs
371
-
372
- Required:
373
-
374
- - PRD.md or GDD.md
375
- - Epic files (for epic-specific design)
376
-
377
- Optional:
378
-
379
- - architecture.md
380
- - Historical bug data
381
- - Security audit results
382
-
383
- ### Outputs
384
-
385
- **Primary Output:** `test-design-epic-{N}.md` or `test-design-project.md`
386
-
387
- **Document Structure:**
388
-
389
- 1. **Risk Assessment Matrix**
390
- - Risk ID, category, description
391
- - Probability × Impact = Score
392
- - High-priority risks flagged
393
-
394
- 2. **Coverage Matrix**
395
- - Requirement → Test Level mapping
396
- - Priority assignment (P0-P3)
397
- - Test count estimates
398
-
399
- 3. **Execution Order**
400
- - Smoke tests (P0 subset, <5 min)
401
- - P0 tests (critical paths, <10 min)
402
- - P1 tests (important features, <30 min)
403
- - P2/P3 tests (full regression, <60 min)
404
-
405
- 4. **Resource Estimates**
406
- - Hours per priority level
407
- - Total effort in days
408
-
409
- 5. **Quality Gate Criteria**
410
- - P0 pass rate: 100%
411
- - P1 pass rate: ≥95%
412
- - Coverage targets
413
-
414
- ### Example: Test Design for Authentication Epic
415
-
416
- **Risk Assessment:**
417
-
418
- - R-001 (SEC): Password bypass, P=2 × I=3 = **6 (HIGH)** → P0 tests required
419
- - R-002 (SEC): Session hijacking, P=2 × I=3 = **6 (HIGH)** → P0 tests required
420
- - R-003 (PERF): Login slow, P=2 × I=2 = 4 (MEDIUM) → P1 tests
421
-
422
- **Coverage Plan:**
423
-
424
- | Requirement | Test Level | Priority | Test Count |
425
- | ------------------- | ---------- | -------- | ---------- |
426
- | User registration | E2E | P0 | 1 |
427
- | Password validation | Unit | P0 | 5 |
428
- | Login flow | E2E | P0 | 1 |
429
- | Session creation | API | P0 | 2 |
430
- | Password reset | E2E | P1 | 1 |
431
- | Email verification | E2E | P1 | 1 |
432
- | Remember me | E2E | P2 | 1 |
433
-
434
- **Total:** 12 tests (P0: 9, P1: 2, P2: 1)
435
-
436
- **Effort Estimate:**
437
-
438
- - P0: 9 tests × 2h = 18 hours
439
- - P1: 2 tests × 1h = 2 hours
440
- - P2: 1 test × 0.5h = 0.5 hours
441
- - **Total: 20.5 hours (~3 days)**
442
-
443
- ### Related Workflows
444
-
445
- - **atdd** - Generate P0 tests from design
446
- - **automate** - Generate P1/P2 tests from design
447
- - **trace** - Validate coverage against design
448
-
449
- ---
450
-
451
- ## atdd (Acceptance Test-Driven Development)
452
-
453
- ### Purpose
454
-
455
- Generate failing acceptance tests from story acceptance criteria before implementation. Creates deterministic, production-quality tests using BDD patterns and knowledge base best practices.
456
-
457
- **Agent:** TEA (Test Architect)
458
- **When to Run:** Before dev-story (per story)
459
- **Duration:** 30-90 minutes per story
460
- **Required:** Recommended for P0/P1 stories
461
-
462
- ### When to Use
463
-
464
- Run **before implementing a story** to create failing tests first.
465
-
466
- **Trigger Points:**
467
-
468
- - After create-story workflow
469
- - Before dev-story workflow
470
- - For P0/P1 stories (required)
471
- - For P2/P3 stories (optional)
472
-
473
- **Workflow Sequence:**
474
-
475
- ```
476
- create-story → atdd (failing tests) → dev-story (make tests pass) → code-review
477
- ```
478
-
479
- ### Test-Driven Development Approach
480
-
481
- **Red-Green-Refactor Cycle:**
482
-
483
- 1. **Red**: Write failing test (atdd workflow)
484
- 2. **Green**: Make test pass (dev-story workflow)
485
- 3. **Refactor**: Improve code (dev-story workflow)
486
-
487
- **Benefits:**
488
-
489
- - Tests define behavior first
490
- - Implementation guided by tests
491
- - Higher confidence in correctness
492
- - Better test quality (not retrofitted)
493
-
494
- ### Process Overview
495
-
496
- **Phase 1: Story Loading (Steps 1-2)**
497
-
498
- - Load story file
499
- - Load story-context.xml
500
- - Extract acceptance criteria
501
-
502
- **Phase 2: Test Planning (Steps 3-4)**
503
-
504
- - Map AC to test levels (E2E, API, Component, Unit)
505
- - Identify test scenarios (happy path, sad path, edge cases)
506
- - Plan test fixtures and data
507
-
508
- **Phase 3: Test Generation (Steps 5-8)**
509
-
510
- - Generate E2E tests (critical user journeys)
511
- - Generate API tests (business logic validation)
512
- - Generate Component tests (UI behavior)
513
- - Generate Unit tests (pure logic)
514
-
515
- **Phase 4: Quality Validation (Steps 9-10)**
516
-
517
- - Apply knowledge base patterns
518
- - Ensure Given-When-Then structure
519
- - Use data-testid selectors
520
- - Network-first patterns
521
- - No hard waits or flaky patterns
522
-
523
- **Phase 5: Execution (Step 11)**
524
-
525
- - Run tests (should fail - RED)
526
- - Verify tests fail for right reasons
527
- - Document expected behavior
528
-
529
- ### Test Generation Modes
530
-
531
- **1. AI Generation (Default)**
532
-
533
- - TEA generates tests using knowledge base
534
- - Fast, consistent, high quality
535
- - Best for standard patterns
536
-
537
- **2. Recording Mode (MCP-Enhanced)**
538
-
539
- - Interactive browser recording
540
- - TEA records user actions
541
- - Best for complex UI flows
542
- - Requires Playwright MCP server
543
-
544
- **Selection Logic:**
545
-
546
- - Simple CRUD, standard forms → AI generation
547
- - Complex wizards, drag-drop → Recording mode
548
- - API-only → AI generation (no UI to record)
549
-
550
- ### Inputs
551
-
552
- Required:
553
-
554
- - story-{epic}.{num}-{title}.md
555
- - story-{epic}.{num}-context.xml
556
-
557
- Optional:
558
-
559
- - test-design-epic-{N}.md (risk/priority context)
560
- - Playwright MCP (for recording mode)
561
-
562
- ### Outputs
563
-
564
- **Test Files Created:**
565
-
566
- - `/tests/e2e/{story-id}-{feature}.spec.ts` (E2E tests)
567
- - `/tests/api/{story-id}-{feature}.api.spec.ts` (API tests)
568
- - `/tests/component/{ComponentName}.test.tsx` (Component tests)
569
- - `/tests/unit/{module}.test.ts` (Unit tests)
570
-
571
- **Supporting Files:**
572
-
573
- - `/tests/support/fixtures/{feature}.fixture.ts` (if needed)
574
- - `/tests/support/factories/{entity}.factory.ts` (if needed)
575
-
576
- **Test Structure (Example E2E):**
577
-
578
- ```typescript
579
- // tests/e2e/1.2-login.spec.ts
580
- import { test, expect } from '@playwright/test';
581
- import { authenticatedUser } from '../support/fixtures/auth.fixture';
582
-
583
- test.describe('1.2-E2E-001: User Login Flow', () => {
584
- test('[P0] should login with valid credentials and redirect to dashboard', async ({ page }) => {
585
- // GIVEN: User is on login page
586
- await page.goto('/login');
587
-
588
- // WHEN: User submits valid credentials
589
- await page.fill('[data-testid="email-input"]', 'user@example.com');
590
- await page.fill('[data-testid="password-input"]', 'ValidPassword123!');
591
- await page.click('[data-testid="login-button"]');
592
-
593
- // THEN: User is redirected to dashboard
594
- await expect(page).toHaveURL('/dashboard');
595
- await expect(page.locator('[data-testid="user-menu"]')).toBeVisible();
596
- });
597
-
598
- test('[P1] should show error message for invalid credentials', async ({ page }) => {
599
- // GIVEN: User is on login page
600
- await page.goto('/login');
601
-
602
- // WHEN: User submits invalid credentials
603
- await page.fill('[data-testid="email-input"]', 'user@example.com');
604
- await page.fill('[data-testid="password-input"]', 'WrongPassword');
605
- await page.click('[data-testid="login-button"]');
606
-
607
- // THEN: Error message is displayed
608
- await expect(page.locator('[data-testid="error-message"]')).toContainText('Invalid credentials');
609
- await expect(page).toHaveURL('/login'); // Still on login page
610
- });
611
- });
612
- ```
613
-
614
- ### Quality Standards Enforced
615
-
616
- **All generated tests must:**
617
-
618
- - ✅ Use Given-When-Then format
619
- - ✅ Have priority tags ([P0], [P1], [P2], [P3])
620
- - ✅ Use data-testid selectors (not CSS classes)
621
- - ✅ No hard waits (page.waitForTimeout)
622
- - ✅ Network-first pattern (route intercept before navigate)
623
- - ✅ Self-cleaning (fixtures with auto-cleanup)
624
- - ✅ Deterministic (no conditionals, try-catch)
625
- - ✅ Test IDs: {STORY_ID}-{LEVEL}-{SEQ} (e.g., 1.2-E2E-001)
626
-
627
- ### Related Workflows
628
-
629
- - **test-design** - Provides test planning context
630
- - **dev-story** - Makes failing tests pass
631
- - **test-review** - Validates test quality
632
- - **automate** - Expands beyond ATDD tests
633
-
634
- ---
635
-
636
- ## automate
637
-
638
- ### Purpose
639
-
640
- Expand test automation coverage by generating comprehensive test suites at appropriate levels (E2E, API, Component, Unit) with supporting infrastructure. Works seamlessly WITH or WITHOUT BMad artifacts.
641
-
642
- **Agent:** TEA (Test Architect)
643
- **When to Run:** After dev-story (per story or feature)
644
- **Duration:** 1-3 hours per feature
645
- **Required:** Recommended for comprehensive coverage
646
-
647
- ### Dual-Mode Operation
648
-
649
- **1. BMad-Integrated Mode** (story available):
650
-
651
- - Uses story acceptance criteria
652
- - Aligns with test-design priorities
653
- - Expands ATDD tests with edge cases
654
- - **Story enhances coverage but NOT required**
655
-
656
- **2. Standalone Mode** (no story):
657
-
658
- - Analyzes source code independently
659
- - Identifies coverage gaps automatically
660
- - Works with any project (BMad or non-BMad)
661
- - "Work out of thin air"
662
-
663
- **3. Auto-Discover Mode** (no targets):
664
-
665
- - Scans codebase for features needing tests
666
- - Prioritizes features with no coverage
667
- - Generates comprehensive test plan
668
-
669
- ### When to Use
670
-
671
- **BMad-Integrated:**
672
-
673
- - After dev-story completes
674
- - To expand beyond ATDD tests
675
- - For P1/P2 edge cases and regression
676
-
677
- **Standalone:**
678
-
679
- - Brownfield project with missing tests
680
- - Non-BMad projects
681
- - Point TEA at any codebase/feature
682
-
683
- **Auto-Discover:**
684
-
685
- - No specific targets
686
- - Want comprehensive coverage audit
687
- - Identify coverage gaps
688
-
689
- ### Process Overview
690
-
691
- **Phase 1: Mode Detection (Step 1)**
692
-
693
- - Check if story file exists
694
- - Check if target feature specified
695
- - Auto-detect mode (BMad/Standalone/Auto-discover)
696
-
697
- **Phase 2: Context Loading (Steps 2-3)**
698
-
699
- - BMad mode: Load story, tech-spec, test-design
700
- - Standalone: Load source code, existing tests
701
- - Auto-discover: Scan codebase for features
702
-
703
- **Phase 3: Gap Analysis (Steps 4-5)**
704
-
705
- - Identify coverage gaps (missing tests)
706
- - Prioritize by risk (P0-P3)
707
- - Avoid duplicate coverage
708
-
709
- **Phase 4: Test Generation (Steps 6-10)**
710
-
711
- - Generate E2E tests (critical paths only)
712
- - Generate API tests (business logic variations)
713
- - Generate Component tests (UI edge cases)
714
- - Generate Unit tests (pure logic edge cases)
715
- - Generate fixtures and factories
716
-
717
- **Phase 5: Validation & Healing (Steps 11-13)**
718
-
719
- - Run generated tests (if auto_validate enabled)
720
- - Heal failures (if auto_heal_failures enabled)
721
- - Mark unfixable as test.fixme()
722
-
723
- ### Test Healing Capabilities (NEW)
724
-
725
- **Automatic Test Healing:**
726
- When tests fail after generation, TEA can automatically heal them.
727
-
728
- **Configuration:** `config.tea_use_mcp_enhancements` (default: true)
729
-
730
- - If true + MCP available → MCP-assisted healing
731
- - If true + MCP unavailable → Pattern-based healing
732
- - If false → No healing, document failures
733
-
734
- **Pattern-Based Healing** (always available):
735
-
736
- 1. Parse error messages from test output
737
- 2. Match patterns against known failures
738
- 3. Apply fixes from healing knowledge fragments:
739
- - `test-healing-patterns.md` - Common failures
740
- - `selector-resilience.md` - Selector fixes
741
- - `timing-debugging.md` - Race condition fixes
742
- 4. Re-run tests (max 3 iterations)
743
- 5. Mark unfixable as `test.fixme()`
744
-
745
- **MCP-Enhanced Healing** (when Playwright MCP available):
746
-
747
- - **Interactive debugging** before pattern fixes
748
- - **Visual context** with browser snapshots
749
- - **Live DOM inspection** to find correct selectors
750
- - **Console analysis** for JS errors
751
- - **Network inspection** for API failures
752
-
753
- **Example Healing:**
754
-
755
- ```typescript
756
- // ❌ Original (failing): CSS class selector
757
- await page.locator('.submit-btn').click();
758
-
759
- // ✅ Healed: data-testid selector
760
- await page.getByTestId('submit-button').click();
761
- ```
762
-
763
- ### Recording Mode (MCP-Enhanced)
764
-
765
- **Complex UI interactions** can be recorded instead of AI-generated.
766
-
767
- **When Recording Mode Activates:**
768
-
769
- - Complex scenarios: drag-drop, wizards, multi-page flows
770
- - Visual workflows: modals, animations
771
- - Fallback: AI generation (automatic, silent)
772
-
773
- **Recording Workflow:**
774
-
775
- 1. Use `browser_*` tools to interact with UI
776
- 2. Capture interactions as test steps
777
- 3. Add verifications with `browser_verify_*`
778
- 4. Generate test file from recording
779
- 5. Enhance with knowledge base patterns
780
-
781
- ### Inputs
782
-
783
- **BMad-Integrated Mode:**
784
-
785
- - story file (optional, enhances coverage)
786
- - tech-spec (optional)
787
- - test-design (optional)
788
-
789
- **Standalone Mode:**
790
-
791
- - target_feature: Feature name or directory (e.g., "user-authentication" or "src/auth/")
792
- - target_files: Specific files (comma-separated)
793
-
794
- **Both Modes:**
795
-
796
- - Framework config (playwright.config.ts)
797
- - Existing tests (for gap analysis)
798
- - Knowledge base fragments
799
-
800
- ### Outputs
801
-
802
- **Test Files Created:**
803
-
804
- - E2E tests: `/tests/e2e/{feature}.spec.ts`
805
- - API tests: `/tests/api/{feature}.api.spec.ts`
806
- - Component tests: `/tests/component/{ComponentName}.test.tsx`
807
- - Unit tests: `/tests/unit/{module}.test.ts`
808
-
809
- **Supporting Infrastructure:**
810
-
811
- - Fixtures: `/tests/support/fixtures/{feature}.fixture.ts`
812
- - Factories: `/tests/support/factories/{entity}.factory.ts`
813
- - Helpers: `/tests/support/helpers/{utility}.ts`
814
-
815
- **Documentation:**
816
-
817
- - **automation-summary.md**: Comprehensive report with:
818
- - Execution mode (BMad/Standalone/Auto-discover)
819
- - Feature analysis (coverage gaps)
820
- - Tests created (counts, paths, priorities)
821
- - Infrastructure created
822
- - Healing report (if enabled)
823
- - Next steps
824
-
825
- ### Example: Standalone Mode
826
-
827
- **Input:**
828
-
829
- ```bash
830
- bmad tea *automate --target-feature "src/auth/"
831
- ```
832
-
833
- **Output:**
834
-
835
- ```markdown
836
- # Automation Summary - src/auth/
837
-
838
- **Mode:** Standalone (no story)
839
- **Date:** 2025-11-02
840
-
841
- ## Feature Analysis
842
-
843
- **Source Files Analyzed:**
844
-
845
- - src/auth/login.ts
846
- - src/auth/session.ts
847
- - src/auth/validation.ts
848
-
849
- **Existing Coverage:** 0 tests found
850
-
851
- **Coverage Gaps:**
852
-
853
- - ❌ No E2E tests for login flow
854
- - ❌ No API tests for /auth/login endpoint
855
- - ❌ No unit tests for validateEmail()
856
-
857
- ## Tests Created
858
-
859
- ### E2E Tests (2 tests, P0-P1)
860
-
861
- - tests/e2e/user-authentication.spec.ts (87 lines)
862
- - [P0] Login with valid credentials → Dashboard
863
- - [P1] Invalid credentials → Error message
864
-
865
- ### API Tests (3 tests, P1-P2)
866
-
867
- - tests/api/auth.api.spec.ts (102 lines)
868
- - [P1] POST /auth/login - valid → 200 + token
869
- - [P1] POST /auth/login - invalid → 401
870
- - [P2] POST /auth/login - missing fields → 400
871
-
872
- ### Unit Tests (4 tests, P2)
873
-
874
- - tests/unit/validation.test.ts (45 lines)
875
- - [P2] validateEmail - valid formats
876
- - [P2] validateEmail - invalid formats
877
- - [P2] validatePassword - strength rules
878
- - [P2] validatePassword - edge cases
879
-
880
- ## Infrastructure Created
881
-
882
- - Fixtures: tests/support/fixtures/auth.fixture.ts
883
- - Factories: tests/support/factories/user.factory.ts
884
-
885
- ## Coverage Analysis
886
-
887
- **Total:** 9 tests (P0: 1, P1: 4, P2: 4)
888
- **Levels:** E2E: 2, API: 3, Unit: 4
889
-
890
- ✅ Critical paths covered (E2E + API)
891
- ✅ Error cases covered (API)
892
- ✅ Edge cases covered (Unit)
893
-
894
- ## Recommendations
895
-
896
- 1. **High Priority (P0-P1):**
897
- - Add E2E test for password reset flow
898
- - Add API tests for token refresh endpoint
899
-
900
- 2. **Medium Priority (P2):**
901
- - Add unit tests for session timeout logic
902
- ```
903
-
904
- ### Related Workflows
905
-
906
- - **atdd** - atdd creates P0 tests, automate expands with P1/P2
907
- - **test-design** - Provides priority context
908
- - **trace** - Validates coverage
909
- - **test-review** - Validates quality
910
-
911
- ---
912
-
913
- ## ci (CI/CD Pipeline)
914
-
915
- ### Purpose
916
-
917
- Scaffold production-ready CI/CD quality pipeline with test execution, burn-in loops for flaky test detection, parallel sharding, and artifact collection.
918
-
919
- **Agent:** TEA (Test Architect)
920
- **When to Run:** Once (after framework setup)
921
- **Duration:** 1-2 hours
922
- **Required:** Recommended for all projects
923
-
924
- ### When to Use
925
-
926
- Run **after framework workflow** to enable continuous integration.
927
-
928
- **Trigger Points:**
929
-
930
- - After framework setup complete
931
- - Before first sprint
932
- - When ready to enable CI/CD
933
-
934
- ### Key Features
935
-
936
- **1. Burn-In Loop** (flaky test detection):
937
-
938
- - Runs tests 10 times consecutively
939
- - Catches non-deterministic failures
940
- - Prevents flaky tests from reaching main
941
-
942
- **2. Parallel Sharding** (4 shards):
943
-
944
- - 75% time reduction (40 min → 10 min per shard)
945
- - Configurable shard count
946
- - Faster feedback on PRs
947
-
948
- **3. Smart Caching**:
949
-
950
- - Node modules + browser binaries cached
951
- - 2-5 min savings per run
952
- - Automatic invalidation on dependency changes
953
-
954
- **4. Selective Testing**:
955
-
956
- - Run only tests affected by code changes
957
- - 50-80% time reduction for focused PRs
958
- - Full suite still runs on main branch
959
-
960
- **5. Failure-Only Artifacts**:
961
-
962
- - Upload traces/screenshots/videos only on failure
963
- - 90% storage cost reduction
964
- - 30-day retention default
965
-
966
- ### Process Overview
967
-
968
- **Phase 1: Platform Detection (Steps 1-2)**
969
-
970
- - Auto-detect CI platform (GitHub Actions, GitLab CI, Circle CI)
971
- - Confirm with user
972
-
973
- **Phase 2: Pipeline Configuration (Steps 3-6)**
974
-
975
- - Generate CI config file
976
- - Configure parallel sharding (4 jobs)
977
- - Configure burn-in loop (10 iterations)
978
- - Configure caching (dependencies + browsers)
979
- - Configure artifact collection (failure-only)
980
-
981
- **Phase 3: Helper Scripts (Steps 7-9)**
982
-
983
- - Generate test-changed.sh (selective testing)
984
- - Generate ci-local.sh (local CI mirror)
985
- - Generate burn-in.sh (standalone burn-in)
986
-
987
- **Phase 4: Documentation (Step 10)**
988
-
989
- - Generate ci.md (pipeline guide)
990
- - Generate ci-secrets-checklist.md (required secrets)
991
-
992
- ### Inputs
993
-
994
- Required:
995
-
996
- - Framework config (playwright.config.ts, etc.)
997
- - package.json
998
-
999
- Optional:
1000
-
1001
- - .git/config (for platform auto-detection)
1002
- - .nvmrc (Node version)
1003
-
1004
- ### Outputs
1005
-
1006
- **1. CI Configuration File:**
1007
-
1008
- - `.github/workflows/test.yml` (GitHub Actions)
1009
- - `.gitlab-ci.yml` (GitLab CI)
1010
-
1011
- **2. Helper Scripts:**
1012
-
1013
- - `scripts/test-changed.sh`
1014
- - `scripts/ci-local.sh`
1015
- - `scripts/burn-in.sh`
1016
-
1017
- **3. Documentation:**
1018
-
1019
- - `docs/ci.md`
1020
- - `docs/ci-secrets-checklist.md`
1021
-
1022
- ### Example: GitHub Actions Pipeline
1023
-
1024
- ```yaml
1025
- # .github/workflows/test.yml
1026
- name: Test
1027
-
1028
- on:
1029
- pull_request:
1030
- push:
1031
- branches: [main]
1032
-
1033
- jobs:
1034
- lint:
1035
- runs-on: ubuntu-latest
1036
- steps:
1037
- - uses: actions/checkout@v4
1038
- - uses: actions/setup-node@v4
1039
- with:
1040
- node-version: 20
1041
- cache: 'npm'
1042
- - run: npm ci
1043
- - run: npm run lint
1044
-
1045
- test:
1046
- runs-on: ubuntu-latest
1047
- strategy:
1048
- matrix:
1049
- shard: [1, 2, 3, 4]
1050
- steps:
1051
- - uses: actions/checkout@v4
1052
- - uses: actions/setup-node@v4
1053
- with:
1054
- node-version: 20
1055
- cache: 'npm'
1056
- - run: npm ci
1057
- - run: npx playwright install --with-deps
1058
- - run: npm run test:e2e -- --shard=${{ matrix.shard }}/4
1059
- - uses: actions/upload-artifact@v4
1060
- if: failure()
1061
- with:
1062
- name: test-results-${{ matrix.shard }}
1063
- path: test-results/
1064
- retention-days: 30
1065
-
1066
- burn-in:
1067
- runs-on: ubuntu-latest
1068
- if: github.event_name == 'pull_request'
1069
- steps:
1070
- - uses: actions/checkout@v4
1071
- - uses: actions/setup-node@v4
1072
- with:
1073
- node-version: 20
1074
- cache: 'npm'
1075
- - run: npm ci
1076
- - run: npx playwright install --with-deps
1077
- - name: Burn-in loop
1078
- run: |
1079
- for i in {1..10}; do
1080
- echo "🔥 Burn-in iteration $i/10"
1081
- npm run test:e2e || exit 1
1082
- done
1083
- ```
1084
-
1085
- **Performance Targets:**
1086
-
1087
- - Lint: <2 minutes
1088
- - Test (per shard): <10 minutes
1089
- - Burn-in: <30 minutes
1090
- - **Total: <45 minutes** (20× faster than sequential)
1091
-
1092
- ### Related Workflows
1093
-
1094
- - **framework** - Must run before ci
1095
- - **trace** (Phase 2) - Uses CI results for gate decision
1096
-
1097
- ---
1098
-
1099
- ## trace (Traceability & Quality Gate)
1100
-
1101
- ### Purpose
1102
-
1103
- **Two-phase workflow:** (1) Generate requirements-to-tests traceability matrix, then (2) Make deterministic quality gate decision for deployment readiness.
1104
-
1105
- **Agent:** TEA (Test Architect)
1106
- **When to Run:**
1107
-
1108
- - **Phase 1**: After tests written (per story/epic)
1109
- - **Phase 2**: Before release (quality gate)
1110
- **Duration:**
1111
- - **Phase 1**: 15-30 minutes
1112
- - **Phase 2**: 15-30 minutes
1113
-
1114
- ### Phase 1: Requirements Traceability
1115
-
1116
- **Purpose:** Map acceptance criteria to tests, identify coverage gaps.
1117
-
1118
- **Process:**
1119
-
1120
- 1. Load story file (acceptance criteria)
1121
- 2. Auto-discover tests related to story
1122
- 3. Map AC to test cases
1123
- 4. Classify coverage (FULL, PARTIAL, NONE)
1124
- 5. Generate traceability matrix
1125
-
1126
- **Output:** `traceability-matrix.md`
1127
-
1128
- **Example:**
1129
-
1130
- ```markdown
1131
- # Traceability Matrix - Story 1.2
1132
-
1133
- ## Coverage Summary
1134
-
1135
- | Priority | Total | FULL | Coverage % | Status |
1136
- | -------- | ----- | ---- | ---------- | ------- |
1137
- | P0 | 3 | 3 | 100% | ✅ PASS |
1138
- | P1 | 2 | 2 | 100% | ✅ PASS |
1139
-
1140
- ## Detailed Mapping
1141
-
1142
- ### AC-1: User can login with valid credentials
1143
-
1144
- **Tests:**
1145
-
1146
- - 1.2-E2E-001: Login happy path ✅
1147
- - 1.2-API-001: POST /auth/login valid creds ✅
1148
-
1149
- **Coverage:** FULL ✅
1150
-
1151
- ### AC-2: Invalid credentials show error
1152
-
1153
- **Tests:**
1154
-
1155
- - 1.2-E2E-002: Login with invalid password ✅
1156
- - 1.2-API-002: POST /auth/login invalid creds ✅
1157
-
1158
- **Coverage:** FULL ✅
1159
-
1160
- ## Gap Analysis
1161
-
1162
- **Critical Gaps:** None ✅
1163
- **High Priority Gaps:** None ✅
1164
- **Medium Priority Gaps:** None ✅
1165
- ```
1166
-
1167
- ### Phase 2: Quality Gate Decision
1168
-
1169
- **Purpose:** Make PASS/CONCERNS/FAIL/WAIVED decision for deployment.
1170
-
1171
- **Process:**
1172
-
1173
- 1. Load traceability results (Phase 1)
1174
- 2. Load test execution results (CI/CD reports)
1175
- 3. Load NFR assessment (if exists)
1176
- 4. Apply deterministic decision rules
1177
- 5. Generate gate decision document
1178
-
1179
- **Decision Rules:**
1180
-
1181
- **PASS** ✅ (All criteria met):
1182
-
1183
- - P0 coverage = 100%
1184
- - P1 coverage ≥ 90%
1185
- - P0 pass rate = 100%
1186
- - P1 pass rate ≥ 95%
1187
- - Security issues = 0
1188
- - Critical NFRs met
1189
-
1190
- **CONCERNS** ⚠️ (P0 met, P1 degraded):
1191
-
1192
- - P0 coverage = 100%
1193
- - P1 coverage 80-89%
1194
- - P1 pass rate 90-94%
1195
- - No security issues
1196
-
1197
- **FAIL** ❌ (P0 criteria failed):
1198
-
1199
- - P0 coverage <100%
1200
- - P0 pass rate <100%
1201
- - Security issues >0
1202
- - Critical NFRs failed
1203
-
1204
- **WAIVED** 🔓 (FAIL + business approval):
1205
-
1206
- - FAIL status + VP/CTO approval
1207
- - Business justification documented
1208
- - Remediation plan with timeline
1209
- - **Never waive: security, data corruption**
1210
-
1211
- **Output:** `gate-decision-story-{X}.{X}.md`
1212
-
1213
- **Example:**
1214
-
1215
- ```markdown
1216
- # Quality Gate Decision: Story 1.2
1217
-
1218
- **Decision:** ✅ PASS
1219
- **Date:** 2025-11-02
1220
-
1221
- ## Evidence
1222
-
1223
- - P0 Coverage: 100% ✅ (3/3 AC covered)
1224
- - P1 Coverage: 100% ✅ (2/2 AC covered)
1225
- - P0 Pass Rate: 100% ✅ (5/5 tests passing)
1226
- - P1 Pass Rate: 100% ✅ (4/4 tests passing)
1227
- - Overall Pass Rate: 100% ✅ (9/9 tests passing)
1228
- - Security Issues: 0 ✅
1229
-
1230
- ## Next Steps
1231
-
1232
- 1. Deploy to staging
1233
- 2. Monitor for 24 hours
1234
- 3. Deploy to production
1235
- ```
1236
-
1237
- ### Related Workflows
1238
-
1239
- - **test-design** - Defines P0-P3 priorities
1240
- - **atdd** / **automate** - Generate tests that trace validates
1241
- - **nfr-assess** - Provides NFR validation for gate
1242
-
1243
- ---
1244
-
1245
- ## nfr-assess (Non-Functional Requirements)
1246
-
1247
- ### Purpose
1248
-
1249
- Assess non-functional requirements (performance, security, reliability, maintainability) against defined thresholds using evidence-based validation.
1250
-
1251
- **Agent:** TEA (Test Architect)
1252
- **When to Run:** Before release (after implementation)
1253
- **Duration:** 1-2 hours
1254
- **Required:** Recommended for releases
1255
-
1256
- ### When to Use
1257
-
1258
- Run **before quality gate decision** to validate NFRs.
1259
-
1260
- **Trigger Points:**
1261
-
1262
- - Before release
1263
- - Before major deployment
1264
- - After performance/security testing
1265
-
1266
- ### NFR Categories
1267
-
1268
- **Performance:**
1269
-
1270
- - Response time (p95: 500ms)
1271
- - Throughput (100 RPS)
1272
- - CPU usage (<70%)
1273
- - Memory usage (<80%)
1274
-
1275
- **Security:**
1276
-
1277
- - Security score (≥85/100)
1278
- - Critical vulnerabilities (0)
1279
- - High vulnerabilities (<3)
1280
- - MFA enabled
1281
-
1282
- **Reliability:**
1283
-
1284
- - Uptime (≥99.9%)
1285
- - Error rate (<0.1%)
1286
- - MTTR (<15 min)
1287
- - CI burn-in (100 runs)
1288
-
1289
- **Maintainability:**
1290
-
1291
- - Test coverage (≥80%)
1292
- - Code quality (≥85/100)
1293
- - Technical debt (<5%)
1294
- - Documentation (≥90%)
1295
-
1296
- ### Process Overview
1297
-
1298
- **Phase 1: Load Context (Steps 1-2)**
1299
-
1300
- - Load tech-spec/PRD for NFR requirements
1301
- - Load test results, metrics, logs
1302
-
1303
- **Phase 2: Assess NFRs (Steps 3-6)**
1304
-
1305
- - Performance assessment (against thresholds)
1306
- - Security assessment
1307
- - Reliability assessment
1308
- - Maintainability assessment
1309
-
1310
- **Phase 3: Evidence Validation (Steps 7-8)**
1311
-
1312
- - Validate evidence exists and is fresh
1313
- - Apply deterministic PASS/CONCERNS/FAIL rules
1314
-
1315
- **Phase 4: Reporting (Step 9)**
1316
-
1317
- - Generate NFR assessment report
1318
- - Identify quick wins
1319
- - Provide recommendations
1320
-
1321
- ### Assessment Rules
1322
-
1323
- **PASS** ✅: Evidence exists AND meets/exceeds threshold
1324
- **CONCERNS** ⚠️: Threshold unknown OR evidence missing/incomplete OR close to threshold
1325
- **FAIL** ❌: Evidence exists BUT does NOT meet threshold
1326
-
1327
- ### Example Output
1328
-
1329
- ```markdown
1330
- # NFR Assessment - Story 1.2
1331
-
1332
- **Overall Status:** PASS ✅
1333
-
1334
- ## Performance Assessment
1335
-
1336
- - Response Time p95: PASS ✅ (320ms < 500ms)
1337
- - Throughput: PASS ✅ (250 RPS > 100 RPS)
1338
-
1339
- **Evidence:** Load test results (2025-11-02)
1340
-
1341
- ## Security Assessment
1342
-
1343
- - Authentication: PASS ✅ (MFA enforced)
1344
- - Data Protection: PASS ✅ (AES-256 + TLS 1.3)
1345
-
1346
- **Evidence:** Security audit (2025-11-02)
1347
-
1348
- ## Reliability Assessment
1349
-
1350
- - Uptime: PASS ✅ (99.95% > 99.9%)
1351
- - Error Rate: PASS ✅ (0.05% < 0.1%)
1352
- - CI Burn-in: PASS ✅ (100 consecutive runs, 0 failures)
1353
-
1354
- **Evidence:** Monitoring data (last 7 days), CI logs
1355
-
1356
- ## Maintainability Assessment
1357
-
1358
- - Test Coverage: PASS ✅ (87% > 80%)
1359
- - Code Quality: PASS ✅ (92/100 > 85/100)
1360
-
1361
- **Evidence:** Coverage report, SonarQube scan
1362
-
1363
- Gate Status: PASS ✅ - All NFRs met
1364
- ```
1365
-
1366
- ### Related Workflows
1367
-
1368
- - **trace** (Phase 2) - Uses NFR assessment in gate decision
1369
-
1370
- ---
1371
-
1372
- ## test-review
1373
-
1374
- ### Purpose
1375
-
1376
- Perform comprehensive quality validation of test code using TEA's knowledge base, detecting flaky patterns, validating structure, and providing actionable feedback.
1377
-
1378
- **Agent:** TEA (Test Architect)
1379
- **When to Run:** After test creation (per test file or suite)
1380
- **Duration:** 30-60 minutes
1381
- **Required:** Recommended for critical tests
1382
-
1383
- ### When to Use
1384
-
1385
- Run **after test creation** to validate quality.
1386
-
1387
- **Trigger Points:**
1388
-
1389
- - After atdd workflow
1390
- - After automate workflow
1391
- - After developer writes tests
1392
- - Before code-review workflow
1393
- - Periodic quality audits
1394
-
1395
- ### Quality Scoring (0-100)
1396
-
1397
- **Score Calculation:**
1398
-
1399
- ```
1400
- Starting Score: 100
1401
-
1402
- Deductions:
1403
- - Critical (P0): -10 points each
1404
- - High (P1): -5 points each
1405
- - Medium (P2): -2 points each
1406
- - Low (P3): -1 point each
1407
-
1408
- Bonus (max +30):
1409
- + Excellent BDD structure: +5
1410
- + Comprehensive fixtures: +5
1411
- + Data factories: +5
1412
- + Network-first pattern: +5
1413
- + Perfect isolation: +5
1414
- + All test IDs present: +5
1415
- ```
1416
-
1417
- **Quality Grades:**
1418
-
1419
- - **90-100 (A+)**: Excellent - Production-ready
1420
- - **80-89 (A)**: Good - Minor improvements
1421
- - **70-79 (B)**: Acceptable - Some issues
1422
- - **60-69 (C)**: Needs Improvement
1423
- - **<60 (F)**: Critical Issues
1424
-
1425
- ### Quality Criteria Checked
1426
-
1427
- 1. **BDD Format** (Given-When-Then)
1428
- 2. **Test IDs** ({STORY_ID}-{LEVEL}-{SEQ})
1429
- 3. **Priority Markers** (P0/P1/P2/P3)
1430
- 4. **No Hard Waits** (page.waitForTimeout)
1431
- 5. **Determinism** (no conditionals/try-catch)
1432
- 6. **Isolation** (tests clean up, no shared state)
1433
- 7. **Fixture Patterns** (pure function → fixture → mergeTests)
1434
- 8. **Data Factories** (faker.js, no hardcoded data)
1435
- 9. **Network-First Pattern** (route before navigate)
1436
- 10. **Explicit Assertions**
1437
- 11. **Test Length** (≤300 lines)
1438
- 12. **Test Duration** (≤1.5 min)
1439
- 13. **Flakiness Patterns** (tight timeouts, race conditions)
1440
-
1441
- ### Example Output
1442
-
1443
- ```markdown
1444
- # Test Quality Review: login.spec.ts
1445
-
1446
- **Quality Score:** 92/100 (A+ - Excellent)
1447
- **Recommendation:** Approve - Production Ready
1448
-
1449
- ## Executive Summary
1450
-
1451
- Excellent test quality with comprehensive coverage and best practices.
1452
-
1453
- **Strengths:**
1454
- ✅ Clear Given-When-Then structure
1455
- ✅ All test IDs present (1.2-E2E-001, 1.2-E2E-002)
1456
- ✅ Network-first pattern used consistently
1457
- ✅ Perfect test isolation with cleanup
1458
- ✅ Data factories for test data
1459
-
1460
- **Minor Issues:**
1461
- ⚠️ One test slightly verbose (245 lines) - consider helper function
1462
-
1463
- **Recommendation:** Approve without changes.
1464
- ```
1465
-
1466
- ### Related Workflows
1467
-
1468
- - **atdd** - Review after ATDD generation
1469
- - **automate** - Review after automation expansion
1470
- - **code-review** - Test quality feeds into overall review
1471
-
1472
- ---
1473
-
1474
- ## Testing Workflow Integration
1475
-
1476
- ### With Implementation Workflows
1477
-
1478
- ```
1479
- Phase 4: Implementation Testarch (Parallel)
1480
- ────────────────────── ───────────────────
1481
-
1482
- → framework (once at start)
1483
- → test-design (per epic)
1484
-
1485
- create-story → atdd (P0/P1 failing tests)
1486
- story-context
1487
- dev-story → Tests pass (RED → GREEN)
1488
- → automate (expand P1/P2 coverage)
1489
- code-review → test-review (validate quality)
1490
- story-done
1491
- → trace Phase 1 (coverage check)
1492
-
1493
- Epic complete → retrospective
1494
- → nfr-assess (NFRs)
1495
- → trace Phase 2 (quality gate)
1496
- ```
1497
-
1498
- ### Recommended Testing Strategy
1499
-
1500
- **Level 0-1 Projects:**
1501
-
1502
- - framework (optional)
1503
- - atdd (optional, if tests needed)
1504
- - Skip test-design, automate
1505
-
1506
- **Level 2 Projects:**
1507
-
1508
- - framework (required)
1509
- - test-design (optional)
1510
- - atdd (P0 stories)
1511
- - automate (optional)
1512
- - trace Phase 1 (optional)
1513
-
1514
- **Level 3-4 Projects:**
1515
-
1516
- - framework (required)
1517
- - test-design (required)
1518
- - atdd (all P0/P1 stories)
1519
- - automate (comprehensive coverage)
1520
- - ci (required)
1521
- - trace Phase 1 (required)
1522
- - nfr-assess (before release)
1523
- - trace Phase 2 (quality gate)
1524
- - test-review (critical tests)
1525
-
1526
- ---
1527
-
1528
- ## Best Practices
1529
-
1530
- ### 1. Test Early, Test Often
1531
-
1532
- Run **atdd before dev-story** for P0/P1 stories. Write failing tests first.
1533
-
1534
- ### 2. Use Test Design for Complex Projects
1535
-
1536
- Don't skip test-design for Level 3-4. Risk assessment prevents gaps.
1537
-
1538
- ### 3. Trust the Burn-In Loop
1539
-
1540
- Flaky tests are poison. Always run burn-in in CI to catch them.
1541
-
1542
- ### 4. Review Test Quality
1543
-
1544
- Don't assume generated tests are perfect. Run test-review for critical tests.
1545
-
1546
- ### 5. Make Quality Gates Explicit
1547
-
1548
- Use trace Phase 2 for release decisions. Document gate criteria.
1549
-
1550
- ### 6. Heal Failures Automatically
1551
-
1552
- Enable auto-healing for faster iteration. Pattern-based healing works without MCP.
1553
-
1554
- ---
1555
-
1556
- ## Summary
1557
-
1558
- Testarch workflows provide comprehensive testing infrastructure:
1559
-
1560
- | Workflow | Frequency | Critical For |
1561
- | ------------------- | ----------------- | ----------------------- |
1562
- | **framework** | Once | All projects with tests |
1563
- | **test-design** | Per epic/project | Level 3-4 planning |
1564
- | **atdd** | Per story (P0/P1) | Test-driven development |
1565
- | **automate** | Per feature | Comprehensive coverage |
1566
- | **ci** | Once | Continuous integration |
1567
- | **trace** (Phase 1) | Per story/epic | Coverage validation |
1568
- | **trace** (Phase 2) | Before release | Quality gate |
1569
- | **nfr-assess** | Before release | NFR validation |
1570
- | **test-review** | As needed | Test quality |
1571
-
1572
- **Key Takeaway:** Testing is not a phase—it's a continuous practice integrated throughout implementation. Use testarch workflows to ensure comprehensive, high-quality test coverage.