specweave 0.23.18 → 0.24.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.
Files changed (174) hide show
  1. package/.claude-plugin/marketplace.json +144 -45
  2. package/CLAUDE.md +137 -4
  3. package/dist/src/cli/helpers/ado-area-path-mapper.d.ts +89 -0
  4. package/dist/src/cli/helpers/ado-area-path-mapper.d.ts.map +1 -0
  5. package/dist/src/cli/helpers/ado-area-path-mapper.js +213 -0
  6. package/dist/src/cli/helpers/ado-area-path-mapper.js.map +1 -0
  7. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts +29 -0
  8. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts.map +1 -0
  9. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js +109 -0
  10. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js.map +1 -0
  11. package/dist/src/cli/helpers/issue-tracker/ado.d.ts +1 -0
  12. package/dist/src/cli/helpers/issue-tracker/ado.d.ts.map +1 -1
  13. package/dist/src/cli/helpers/issue-tracker/ado.js +2 -0
  14. package/dist/src/cli/helpers/issue-tracker/ado.js.map +1 -1
  15. package/dist/src/cli/helpers/smart-filter.d.ts +83 -0
  16. package/dist/src/cli/helpers/smart-filter.d.ts.map +1 -0
  17. package/dist/src/cli/helpers/smart-filter.js +265 -0
  18. package/dist/src/cli/helpers/smart-filter.js.map +1 -0
  19. package/dist/src/core/qa/quality-gate-decider.d.ts +1 -1
  20. package/dist/src/core/qa/quality-gate-decider.js +2 -2
  21. package/dist/src/core/qa/quality-gate-decider.js.map +1 -1
  22. package/dist/src/core/qa/risk-calculator.d.ts +2 -2
  23. package/dist/src/core/qa/risk-calculator.js +2 -2
  24. package/dist/src/core/repo-structure/repo-structure-manager.d.ts.map +1 -1
  25. package/dist/src/core/repo-structure/repo-structure-manager.js +76 -43
  26. package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
  27. package/dist/src/core/validators/ac-presence-validator.d.ts +56 -0
  28. package/dist/src/core/validators/ac-presence-validator.d.ts.map +1 -0
  29. package/dist/src/core/validators/ac-presence-validator.js +149 -0
  30. package/dist/src/core/validators/ac-presence-validator.js.map +1 -0
  31. package/dist/src/integrations/ado/area-path-mapper.d.ts +137 -0
  32. package/dist/src/integrations/ado/area-path-mapper.d.ts.map +1 -0
  33. package/dist/src/integrations/ado/area-path-mapper.js +267 -0
  34. package/dist/src/integrations/ado/area-path-mapper.js.map +1 -0
  35. package/dist/src/integrations/jira/filter-processor.d.ts +126 -0
  36. package/dist/src/integrations/jira/filter-processor.d.ts.map +1 -0
  37. package/dist/src/integrations/jira/filter-processor.js +207 -0
  38. package/dist/src/integrations/jira/filter-processor.js.map +1 -0
  39. package/dist/src/integrations/jira/jira-client.d.ts +13 -0
  40. package/dist/src/integrations/jira/jira-client.d.ts.map +1 -1
  41. package/dist/src/integrations/jira/jira-client.js +33 -0
  42. package/dist/src/integrations/jira/jira-client.js.map +1 -1
  43. package/dist/src/utils/ac-embedder.d.ts +63 -0
  44. package/dist/src/utils/ac-embedder.d.ts.map +1 -0
  45. package/dist/src/utils/ac-embedder.js +217 -0
  46. package/dist/src/utils/ac-embedder.js.map +1 -0
  47. package/dist/src/utils/env-manager.d.ts +86 -0
  48. package/dist/src/utils/env-manager.d.ts.map +1 -0
  49. package/dist/src/utils/env-manager.js +188 -0
  50. package/dist/src/utils/env-manager.js.map +1 -0
  51. package/package.json +1 -1
  52. package/plugins/specweave/.claude-plugin/plugin.json +1 -1
  53. package/plugins/specweave/agents/AGENTS-INDEX.md +1 -1
  54. package/plugins/specweave/agents/increment-quality-judge-v2/AGENT.md +9 -9
  55. package/plugins/specweave/commands/specweave-do.md +37 -0
  56. package/plugins/specweave/commands/specweave-done.md +159 -0
  57. package/plugins/specweave/commands/specweave-embed-acs.md +446 -0
  58. package/plugins/specweave/commands/specweave-next.md +148 -3
  59. package/plugins/specweave/commands/specweave-qa.md +2 -2
  60. package/plugins/specweave/hooks/pre-increment-start.sh +168 -0
  61. package/plugins/specweave/skills/SKILLS-INDEX.md +1 -1
  62. package/plugins/specweave-ado/.claude-plugin/plugin.json +1 -1
  63. package/plugins/specweave-ado/commands/specweave-ado-import-projects.md +331 -0
  64. package/plugins/specweave-alternatives/.claude-plugin/plugin.json +10 -0
  65. package/plugins/specweave-alternatives/commands/alternatives-analyze.md +336 -0
  66. package/plugins/specweave-alternatives/skills/architecture-alternatives/SKILL.md +651 -0
  67. package/plugins/specweave-alternatives/skills/bmad-method/SKILL.md +420 -0
  68. package/plugins/specweave-alternatives/skills/spec-kit-expert/SKILL.md +487 -0
  69. package/plugins/specweave-backend/commands/api-scaffold.md +80 -0
  70. package/plugins/specweave-backend/commands/crud-generate.md +109 -0
  71. package/plugins/specweave-backend/commands/migration-generate.md +139 -0
  72. package/plugins/specweave-confluent/commands/connector-deploy.md +154 -0
  73. package/plugins/specweave-confluent/commands/ksqldb-query.md +179 -0
  74. package/plugins/specweave-confluent/commands/schema-register.md +123 -0
  75. package/plugins/specweave-core/.claude-plugin/plugin.json +21 -0
  76. package/plugins/specweave-core/commands/architecture-review.md +288 -0
  77. package/plugins/specweave-core/commands/code-review.md +213 -0
  78. package/plugins/specweave-core/commands/refactor-plan.md +249 -0
  79. package/plugins/specweave-core/skills/code-quality/SKILL.md +157 -0
  80. package/plugins/specweave-core/skills/design-patterns/SKILL.md +244 -0
  81. package/plugins/specweave-core/skills/software-architecture/SKILL.md +83 -0
  82. package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +22 -0
  83. package/plugins/specweave-cost-optimizer/commands/cost-analyze.md +360 -0
  84. package/plugins/specweave-cost-optimizer/commands/cost-optimize.md +480 -0
  85. package/plugins/specweave-cost-optimizer/skills/aws-cost-expert/SKILL.md +416 -0
  86. package/plugins/specweave-cost-optimizer/skills/cloud-pricing/SKILL.md +325 -0
  87. package/plugins/specweave-cost-optimizer/skills/cost-optimization/SKILL.md +337 -0
  88. package/plugins/specweave-diagrams/.claude-plugin/plugin.json +1 -1
  89. package/plugins/specweave-diagrams/commands/diagrams-generate.md +168 -0
  90. package/plugins/specweave-docs/.claude-plugin/plugin.json +10 -0
  91. package/plugins/specweave-docs/commands/docs-generate.md +441 -0
  92. package/plugins/specweave-docs/commands/docs-init.md +334 -0
  93. package/plugins/specweave-docs/skills/docusaurus/SKILL.md +581 -0
  94. package/plugins/specweave-docs/skills/spec-driven-brainstorming/SKILL.md +689 -0
  95. package/plugins/specweave-docs/skills/technical-writing/SKILL.md +1039 -0
  96. package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +1 -1
  97. package/plugins/specweave-figma/.claude-plugin/plugin.json +23 -0
  98. package/plugins/specweave-figma/commands/figma-import.md +690 -0
  99. package/plugins/specweave-figma/commands/figma-to-react.md +834 -0
  100. package/plugins/specweave-figma/commands/figma-tokens.md +815 -0
  101. package/plugins/specweave-frontend/.claude-plugin/plugin.json +21 -0
  102. package/plugins/specweave-frontend/agents/frontend-architect/AGENT.md +408 -0
  103. package/plugins/specweave-frontend/agents/frontend-architect/README.md +385 -0
  104. package/plugins/specweave-frontend/agents/frontend-architect/examples.md +590 -0
  105. package/plugins/specweave-frontend/agents/frontend-architect/templates/component-template.tsx +152 -0
  106. package/plugins/specweave-frontend/agents/frontend-architect/templates/hook-template.ts +311 -0
  107. package/plugins/specweave-frontend/agents/frontend-architect/templates/page-template.tsx +228 -0
  108. package/plugins/specweave-frontend/commands/component-generate.md +510 -0
  109. package/plugins/specweave-frontend/commands/design-system-init.md +494 -0
  110. package/plugins/specweave-frontend/commands/frontend-scaffold.md +207 -0
  111. package/plugins/specweave-frontend/commands/nextjs-setup.md +396 -0
  112. package/plugins/specweave-frontend/skills/design-system-architect/SKILL.md +278 -0
  113. package/plugins/specweave-frontend/skills/frontend/SKILL.md +420 -0
  114. package/plugins/specweave-frontend/skills/nextjs/SKILL.md +546 -0
  115. package/plugins/specweave-github/.claude-plugin/plugin.json +1 -1
  116. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +212 -0
  117. package/plugins/specweave-infrastructure/.claude-plugin/plugin.json +1 -1
  118. package/plugins/specweave-jira/.claude-plugin/plugin.json +1 -1
  119. package/plugins/specweave-jira/commands/import-projects.js +183 -0
  120. package/plugins/specweave-jira/commands/import-projects.md +97 -0
  121. package/plugins/specweave-jira/commands/import-projects.ts +288 -0
  122. package/plugins/specweave-jira/commands/specweave-jira-import-projects.md +298 -0
  123. package/plugins/specweave-kafka/.claude-plugin/plugin.json +1 -1
  124. package/plugins/specweave-kafka-streams/.claude-plugin/plugin.json +1 -1
  125. package/plugins/specweave-kubernetes/commands/cluster-setup.md +262 -0
  126. package/plugins/specweave-kubernetes/commands/deployment-generate.md +242 -0
  127. package/plugins/specweave-kubernetes/commands/helm-scaffold.md +333 -0
  128. package/plugins/specweave-ml/.claude-plugin/plugin.json +1 -1
  129. package/plugins/specweave-mobile/commands/app-scaffold.md +233 -0
  130. package/plugins/specweave-mobile/commands/build-config.md +256 -0
  131. package/plugins/specweave-mobile/commands/screen-generate.md +289 -0
  132. package/plugins/specweave-n8n/.claude-plugin/plugin.json +1 -1
  133. package/plugins/specweave-payments/commands/stripe-setup.md +931 -0
  134. package/plugins/specweave-payments/commands/subscription-flow.md +1193 -0
  135. package/plugins/specweave-payments/commands/subscription-manage.md +386 -0
  136. package/plugins/specweave-payments/commands/webhook-setup.md +295 -0
  137. package/plugins/specweave-plugin-dev/.claude-plugin/plugin.json +13 -12
  138. package/plugins/specweave-plugin-dev/commands/plugin-create.md +333 -0
  139. package/plugins/specweave-plugin-dev/commands/plugin-publish.md +339 -0
  140. package/plugins/specweave-plugin-dev/commands/plugin-test.md +293 -0
  141. package/plugins/specweave-plugin-dev/skills/claude-sdk/SKILL.md +162 -0
  142. package/plugins/specweave-plugin-dev/skills/marketplace-publishing/SKILL.md +263 -0
  143. package/plugins/specweave-plugin-dev/skills/plugin-development/SKILL.md +316 -0
  144. package/plugins/specweave-release/.claude-plugin/plugin.json +1 -1
  145. package/plugins/specweave-release/commands/specweave-release-npm.md +110 -0
  146. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +168 -0
  147. package/plugins/specweave-testing/.claude-plugin/plugin.json +21 -0
  148. package/plugins/specweave-testing/agents/qa-engineer/AGENT.md +818 -0
  149. package/plugins/specweave-testing/agents/qa-engineer/README.md +443 -0
  150. package/plugins/specweave-testing/agents/qa-engineer/templates/playwright-e2e-test.ts +470 -0
  151. package/plugins/specweave-testing/agents/qa-engineer/templates/test-data-factory.ts +507 -0
  152. package/plugins/specweave-testing/agents/qa-engineer/templates/vitest-unit-test.ts +400 -0
  153. package/plugins/specweave-testing/agents/qa-engineer/test-strategies.md +726 -0
  154. package/plugins/specweave-testing/commands/e2e-setup.md +1081 -0
  155. package/plugins/specweave-testing/commands/test-coverage.md +979 -0
  156. package/plugins/specweave-testing/commands/test-generate.md +1156 -0
  157. package/plugins/specweave-testing/commands/test-init.md +409 -0
  158. package/plugins/specweave-testing/skills/e2e-playwright/SKILL.md +769 -0
  159. package/plugins/specweave-testing/skills/tdd-expert/SKILL.md +934 -0
  160. package/plugins/specweave-testing/skills/unit-testing-expert/SKILL.md +1011 -0
  161. package/plugins/specweave-tooling/.claude-plugin/plugin.json +22 -0
  162. package/plugins/specweave-tooling/commands/specweave-tooling-skill-create.md +691 -0
  163. package/plugins/specweave-tooling/commands/specweave-tooling-skill-package.md +751 -0
  164. package/plugins/specweave-tooling/commands/specweave-tooling-skill-validate.md +858 -0
  165. package/plugins/specweave-ui/.claude-plugin/plugin.json +10 -0
  166. package/plugins/specweave-ui/commands/ui-automate.md +199 -0
  167. package/plugins/specweave-ui/commands/ui-inspect.md +70 -0
  168. package/plugins/specweave-ui/skills/browser-automation/SKILL.md +314 -0
  169. package/plugins/specweave-ui/skills/ui-testing/SKILL.md +716 -0
  170. package/plugins/specweave-ui/skills/visual-regression/SKILL.md +728 -0
  171. package/plugins/specweave/commands/check-hooks.md +0 -257
  172. package/plugins/specweave/commands/specweave-archive-increments.md +0 -82
  173. package/plugins/specweave-plugin-dev/skills/plugin-expert/SKILL.md +0 -1231
  174. /package/plugins/specweave/{agents/code-reviewer.md → skills/code-reviewer/SKILL.md} +0 -0
@@ -0,0 +1,443 @@
1
+ # QA Engineer Agent
2
+
3
+ ## Overview
4
+
5
+ The QA Engineer agent is a specialized AI agent designed to help with test strategy, test planning, test automation, and comprehensive quality assurance for modern software projects.
6
+
7
+ ## When to Use This Agent
8
+
9
+ Invoke this agent when you need:
10
+
11
+ - **Test Strategy**: Design comprehensive testing approaches (unit, integration, E2E)
12
+ - **Test Planning**: Break down features into testable scenarios
13
+ - **Test Automation**: Set up Playwright, Vitest, Cypress, or other testing frameworks
14
+ - **TDD Workflow**: Implement test-driven development practices
15
+ - **Quality Gates**: Define coverage thresholds and quality metrics
16
+ - **Performance Testing**: Load testing, stress testing, benchmarking
17
+ - **Accessibility Testing**: WCAG compliance, a11y automation
18
+ - **Security Testing**: Vulnerability scanning, penetration testing
19
+ - **CI/CD Integration**: Automated testing in pipelines
20
+ - **Test Maintenance**: Refactor flaky tests, improve test reliability
21
+
22
+ ## How to Invoke
23
+
24
+ Use the Task tool with `subagent_type`:
25
+
26
+ ```typescript
27
+ Task({
28
+ subagent_type: "specweave-testing:qa-engineer:qa-engineer",
29
+ prompt: "Design a comprehensive test strategy for a React e-commerce application with Vitest unit tests, Playwright E2E tests, and accessibility testing"
30
+ });
31
+ ```
32
+
33
+ ## Agent Capabilities
34
+
35
+ ### 1. Testing Frameworks
36
+
37
+ **JavaScript/TypeScript**:
38
+ - Vitest for unit and integration testing
39
+ - Playwright for cross-browser E2E testing
40
+ - Cypress for browser automation
41
+ - Testing Library (React, Vue, Angular)
42
+ - MSW (Mock Service Worker) for API mocking
43
+ - Jest with modern features
44
+
45
+ **Other Languages**:
46
+ - pytest (Python) with fixtures
47
+ - JUnit 5 (Java) with Mockito
48
+ - RSpec (Ruby) with factories
49
+ - Go testing package with testify
50
+
51
+ **Specialized Testing**:
52
+ - Percy/Chromatic for visual regression
53
+ - axe-core for accessibility
54
+ - k6 for load testing
55
+ - OWASP ZAP for security
56
+
57
+ ### 2. Testing Strategies
58
+
59
+ **Testing Pyramid**:
60
+ - Unit Tests (70%): Fast, isolated, single responsibility
61
+ - Integration Tests (20%): Module interactions, API contracts
62
+ - E2E Tests (10%): Critical user journeys
63
+
64
+ **Test-Driven Development (TDD)**:
65
+ - Red-Green-Refactor cycle
66
+ - Behavior-driven naming
67
+ - Design through tests
68
+ - Refactoring safety net
69
+
70
+ **Behavior-Driven Development (BDD)**:
71
+ - Given-When-Then format
72
+ - Cucumber/Gherkin syntax
73
+ - Living documentation
74
+ - Stakeholder-readable tests
75
+
76
+ ### 3. Test Coverage & Quality
77
+
78
+ - Code coverage (line, branch, statement, function)
79
+ - Mutation testing (Stryker)
80
+ - Risk-based prioritization
81
+ - Boundary value analysis
82
+ - State transition testing
83
+ - Quality gates and thresholds
84
+
85
+ ### 4. Test Organization
86
+
87
+ - AAA pattern (Arrange-Act-Assert)
88
+ - Page Object Model (POM) for E2E
89
+ - Test fixtures and factories
90
+ - Tagging and categorization
91
+ - Parallel test execution
92
+ - Test data management
93
+
94
+ ### 5. CI/CD Integration
95
+
96
+ - GitHub Actions workflows
97
+ - GitLab CI pipelines
98
+ - Pre-commit hooks (Husky)
99
+ - Pull request checks
100
+ - Automated regression runs
101
+ - Test result reporting
102
+
103
+ ## Common Use Cases
104
+
105
+ ### 1. Design Test Strategy
106
+
107
+ **Prompt**:
108
+ ```
109
+ "Design a test strategy for a Next.js SaaS application with:
110
+ - User authentication (OAuth, email/password)
111
+ - Real-time dashboard with WebSocket
112
+ - Payment processing (Stripe)
113
+ - Admin panel with RBAC
114
+ - Multi-tenancy support
115
+
116
+ Target: 80%+ code coverage, < 5 min test execution, zero flaky tests"
117
+ ```
118
+
119
+ **What the agent provides**:
120
+ - Testing pyramid breakdown
121
+ - Framework selection (Vitest, Playwright, etc.)
122
+ - Coverage targets per layer
123
+ - Test data management strategy
124
+ - CI/CD integration plan
125
+ - Quality gates definition
126
+
127
+ ### 2. Implement Unit Tests
128
+
129
+ **Prompt**:
130
+ ```
131
+ "Set up Vitest for a TypeScript React project with:
132
+ - Unit tests for custom hooks
133
+ - Component tests with Testing Library
134
+ - API mocking with MSW
135
+ - Coverage thresholds (80%+ lines, 75%+ branches)
136
+ - Watch mode for development
137
+ - CI integration"
138
+ ```
139
+
140
+ **What the agent provides**:
141
+ - Vitest configuration
142
+ - Test file structure
143
+ - Mock setup examples
144
+ - Coverage configuration
145
+ - CI workflow YAML
146
+ - Best practices documentation
147
+
148
+ ### 3. Implement E2E Tests
149
+
150
+ **Prompt**:
151
+ ```
152
+ "Set up Playwright E2E tests for an e-commerce checkout flow:
153
+ - Product search and filtering
154
+ - Add to cart
155
+ - Checkout with guest and authenticated users
156
+ - Payment processing (test mode)
157
+ - Order confirmation
158
+
159
+ Cross-browser testing (Chrome, Firefox, Safari)
160
+ Mobile emulation (iPhone, Android)
161
+ Visual regression testing
162
+ Parallel execution"
163
+ ```
164
+
165
+ **What the agent provides**:
166
+ - Playwright configuration
167
+ - Page Object Model architecture
168
+ - Test fixtures for authentication
169
+ - API mocking strategies
170
+ - Visual regression setup
171
+ - Parallelization strategy
172
+
173
+ ### 4. Implement TDD Workflow
174
+
175
+ **Prompt**:
176
+ ```
177
+ "Guide me through TDD for implementing a shopping cart feature:
178
+ - Add item to cart
179
+ - Remove item from cart
180
+ - Update quantity
181
+ - Calculate total with tax
182
+ - Apply discount code
183
+
184
+ Use Vitest, follow red-green-refactor strictly"
185
+ ```
186
+
187
+ **What the agent provides**:
188
+ - Step-by-step TDD cycle
189
+ - Failing test examples (RED)
190
+ - Minimal implementation (GREEN)
191
+ - Refactoring strategies
192
+ - Test-first design patterns
193
+ - Best practices checklist
194
+
195
+ ### 5. Accessibility Testing
196
+
197
+ **Prompt**:
198
+ ```
199
+ "Set up automated accessibility testing for a React application:
200
+ - WCAG AA compliance
201
+ - axe-core integration in Vitest
202
+ - Playwright accessibility assertions
203
+ - Keyboard navigation tests
204
+ - Screen reader compatibility
205
+ - Color contrast validation
206
+
207
+ Target: Lighthouse accessibility score 95+"
208
+ ```
209
+
210
+ **What the agent provides**:
211
+ - axe-core setup with Vitest
212
+ - Playwright accessibility tests
213
+ - Keyboard navigation test examples
214
+ - Manual testing checklist
215
+ - WCAG compliance guide
216
+ - Accessibility audit process
217
+
218
+ ### 6. Performance Testing
219
+
220
+ **Prompt**:
221
+ ```
222
+ "Set up performance testing for a REST API:
223
+ - Load testing (1000 concurrent users)
224
+ - Stress testing (find breaking point)
225
+ - Soak testing (24 hour sustained load)
226
+ - Metrics: p50, p95, p99 response times
227
+
228
+ Use k6, integrate with CI/CD, track trends"
229
+ ```
230
+
231
+ **What the agent provides**:
232
+ - k6 test scripts
233
+ - Load testing scenarios
234
+ - Performance thresholds
235
+ - CI integration (GitHub Actions)
236
+ - Grafana dashboard setup
237
+ - Performance budget definition
238
+
239
+ ## Example Workflows
240
+
241
+ ### Workflow 1: TDD Feature Development
242
+
243
+ 1. **Write Failing Test (RED)**: Define expected behavior
244
+ 2. **Implement Minimally (GREEN)**: Make test pass
245
+ 3. **Refactor**: Improve code quality
246
+ 4. **Repeat**: Next requirement
247
+
248
+ ### Workflow 2: E2E Test Setup
249
+
250
+ 1. **Install Playwright**: `npm install -D @playwright/test`
251
+ 2. **Configure**: Browser setup, base URL, screenshots
252
+ 3. **Create Page Objects**: Reusable page interactions
253
+ 4. **Write Tests**: Critical user journeys
254
+ 5. **CI Integration**: Run on every PR
255
+ 6. **Monitor**: Track flakiness and execution time
256
+
257
+ ### Workflow 3: Quality Audit
258
+
259
+ 1. **Analyze Coverage**: Identify gaps
260
+ 2. **Review Test Quality**: Flaky tests, slow tests
261
+ 3. **Refactor**: Improve reliability
262
+ 4. **Set Thresholds**: Enforce quality gates
263
+ 5. **Monitor**: Track metrics over time
264
+
265
+ ## Input Format
266
+
267
+ The agent expects a clear, specific prompt describing:
268
+
269
+ 1. **Context**: What are you testing? What technology stack?
270
+ 2. **Requirements**: What features need tests?
271
+ 3. **Quality Targets**: Coverage %, performance, accessibility
272
+ 4. **Constraints**: Team size, timeline, CI/CD platform
273
+
274
+ **Good prompt**:
275
+ ```
276
+ "Design test strategy for Node.js REST API with:
277
+ - 50+ endpoints (CRUD operations)
278
+ - Authentication (JWT)
279
+ - Rate limiting
280
+ - PostgreSQL database
281
+ - Redis caching
282
+
283
+ Stack: TypeScript, Express, Prisma
284
+ Target: 85%+ coverage, < 2 min test execution
285
+ CI: GitHub Actions
286
+ Team: 5 developers, all familiar with Jest"
287
+ ```
288
+
289
+ **Poor prompt**:
290
+ ```
291
+ "Need tests for my API"
292
+ ```
293
+
294
+ ## Output Format
295
+
296
+ The agent provides:
297
+
298
+ 1. **Test Strategy**: High-level approach and distribution
299
+ 2. **Framework Setup**: Configuration files and installation
300
+ 3. **Test Examples**: Code samples for each test type
301
+ 4. **Best Practices**: Patterns and anti-patterns
302
+ 5. **CI/CD Integration**: Workflow files
303
+ 6. **Quality Metrics**: Coverage targets, thresholds
304
+ 7. **Documentation**: Testing guidelines for team
305
+
306
+ ## Best Practices
307
+
308
+ ### 1. Test Behavior, Not Implementation
309
+ Focus on what code does, not how it does it.
310
+
311
+ ### 2. Independent Tests
312
+ No shared state between tests.
313
+
314
+ ### 3. Fast Feedback
315
+ Unit tests should run in seconds.
316
+
317
+ ### 4. Readable Tests
318
+ Self-documenting test names and structure.
319
+
320
+ ### 5. Maintainable Tests
321
+ Page Object Model, fixtures, utilities.
322
+
323
+ ### 6. Realistic Tests
324
+ Test against production-like environment.
325
+
326
+ ### 7. Coverage Targets
327
+ 80%+ code coverage, 100% critical paths.
328
+
329
+ ### 8. Flakiness Zero Tolerance
330
+ Fix or quarantine flaky tests immediately.
331
+
332
+ ## Integration with SpecWeave
333
+
334
+ ### Use with /specweave:increment
335
+
336
+ When planning a feature increment:
337
+
338
+ ```bash
339
+ # 1. Plan increment
340
+ /specweave:increment "Implement user authentication with OAuth"
341
+
342
+ # 2. Generate test strategy
343
+ Task({
344
+ subagent_type: "specweave-testing:qa-engineer:qa-engineer",
345
+ prompt: "Design test strategy for OAuth authentication with Google, GitHub, and email/password. Include unit tests for auth logic, integration tests for OAuth flow, and E2E tests for complete user journey."
346
+ });
347
+
348
+ # 3. Implement with TDD
349
+ /specweave:do
350
+ ```
351
+
352
+ ### Use with /specweave:qa
353
+
354
+ After implementation, validate test coverage:
355
+
356
+ ```bash
357
+ # Run quality assessment
358
+ /specweave:qa 0123
359
+
360
+ # Agent checks:
361
+ # - Test coverage (lines, branches, functions)
362
+ # - Test quality (independent, fast, readable)
363
+ # - Critical path coverage
364
+ # - E2E test completeness
365
+ # - Accessibility test coverage
366
+ ```
367
+
368
+ ## Troubleshooting
369
+
370
+ ### Issue: Flaky tests
371
+
372
+ **Solution**:
373
+ - Use proper wait strategies (no hardcoded delays)
374
+ - Isolate test data
375
+ - Mock external dependencies
376
+ - Use fake timers for time-based code
377
+
378
+ ### Issue: Slow tests
379
+
380
+ **Solution**:
381
+ - Mock expensive operations (DB, API, file I/O)
382
+ - Use fake timers
383
+ - Run tests in parallel
384
+ - Profile slow tests
385
+
386
+ ### Issue: Low coverage
387
+
388
+ **Solution**:
389
+ - Identify untested paths
390
+ - Add tests for edge cases
391
+ - Test error handling
392
+ - Use mutation testing to find weak tests
393
+
394
+ ## Advanced Usage
395
+
396
+ ### Contract Testing
397
+
398
+ ```typescript
399
+ Task({
400
+ subagent_type: "specweave-testing:qa-engineer:qa-engineer",
401
+ prompt: `Set up Pact contract testing between:
402
+ - Frontend (React SPA)
403
+ - Backend API (Node.js)
404
+ - Third-party payment API (Stripe)
405
+
406
+ Ensure API compatibility across teams`
407
+ });
408
+ ```
409
+
410
+ ### Visual Regression Testing
411
+
412
+ ```typescript
413
+ Task({
414
+ subagent_type: "specweave-testing:qa-engineer:qa-engineer",
415
+ prompt: `Set up visual regression testing with Percy for:
416
+ - 20+ pages across 3 breakpoints (mobile, tablet, desktop)
417
+ - 5+ themes (light, dark, high-contrast)
418
+ - Component library (Storybook integration)
419
+
420
+ CI integration, baseline management`
421
+ });
422
+ ```
423
+
424
+ ## Resources
425
+
426
+ - **Vitest Docs**: https://vitest.dev
427
+ - **Playwright Docs**: https://playwright.dev
428
+ - **Testing Library**: https://testing-library.com
429
+ - **TDD Guide**: https://martinfowler.com/bliki/TestDrivenDevelopment.html
430
+ - **Testing Best Practices**: https://testingjavascript.com
431
+
432
+ ## Version History
433
+
434
+ - **v1.0.0** (2025-01-22): Initial release with Vitest, Playwright, TDD expertise
435
+ - **v1.1.0** (TBD): Add mobile testing support (Appium, Detox)
436
+ - **v1.2.0** (TBD): Add chaos engineering guidance
437
+
438
+ ## Support
439
+
440
+ For issues or questions:
441
+ - GitHub Issues: https://github.com/anton-abyzov/specweave/issues
442
+ - Discord: https://discord.gg/specweave
443
+ - Documentation: https://spec-weave.com