specweave 0.23.14 → 0.23.16

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 (54) hide show
  1. package/CLAUDE.md +55 -0
  2. package/dist/src/core/spec-detector.d.ts +5 -0
  3. package/dist/src/core/spec-detector.d.ts.map +1 -1
  4. package/dist/src/core/spec-detector.js +91 -33
  5. package/dist/src/core/spec-detector.js.map +1 -1
  6. package/package.json +1 -1
  7. package/plugins/specweave-github/.claude-plugin/plugin.json +15 -1
  8. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +16 -0
  9. package/plugins/specweave-github/hooks/post-task-completion.sh +53 -0
  10. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +24 -0
  11. package/plugins/specweave-alternatives/.claude-plugin/plugin.json +0 -21
  12. package/plugins/specweave-alternatives/skills/bmad-method-expert/SKILL.md +0 -626
  13. package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/analyze-project.js +0 -318
  14. package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/check-setup.js +0 -208
  15. package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/generate-template.js +0 -1149
  16. package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/validate-documents.js +0 -340
  17. package/plugins/specweave-alternatives/skills/spec-kit-expert/SKILL.md +0 -1010
  18. package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +0 -20
  19. package/plugins/specweave-cost-optimizer/skills/cost-optimizer/SKILL.md +0 -190
  20. package/plugins/specweave-docs/.claude-plugin/plugin.json +0 -19
  21. package/plugins/specweave-docs/skills/docusaurus/SKILL.md +0 -613
  22. package/plugins/specweave-docs/skills/spec-driven-brainstorming/README.md +0 -264
  23. package/plugins/specweave-docs/skills/spec-driven-brainstorming/SKILL.md +0 -439
  24. package/plugins/specweave-docs/skills/spec-driven-debugging/README.md +0 -479
  25. package/plugins/specweave-docs/skills/spec-driven-debugging/SKILL.md +0 -652
  26. package/plugins/specweave-figma/.claude-plugin/.mcp.json +0 -12
  27. package/plugins/specweave-figma/.claude-plugin/plugin.json +0 -20
  28. package/plugins/specweave-figma/ARCHITECTURE.md +0 -453
  29. package/plugins/specweave-figma/README.md +0 -728
  30. package/plugins/specweave-figma/skills/figma-to-code/SKILL.md +0 -632
  31. package/plugins/specweave-figma/skills/figma-to-code/test-1-token-generation.yaml +0 -29
  32. package/plugins/specweave-figma/skills/figma-to-code/test-2-component-generation.yaml +0 -27
  33. package/plugins/specweave-figma/skills/figma-to-code/test-3-typescript-generation.yaml +0 -28
  34. package/plugins/specweave-frontend/.claude-plugin/plugin.json +0 -21
  35. package/plugins/specweave-frontend/skills/design-system-architect/SKILL.md +0 -107
  36. package/plugins/specweave-frontend/skills/frontend/SKILL.md +0 -177
  37. package/plugins/specweave-frontend/skills/nextjs/SKILL.md +0 -176
  38. package/plugins/specweave-testing/.claude-plugin/plugin.json +0 -20
  39. package/plugins/specweave-testing/skills/e2e-playwright/README.md +0 -506
  40. package/plugins/specweave-testing/skills/e2e-playwright/SKILL.md +0 -457
  41. package/plugins/specweave-testing/skills/e2e-playwright/execute.js +0 -373
  42. package/plugins/specweave-testing/skills/e2e-playwright/lib/utils.js +0 -514
  43. package/plugins/specweave-testing/skills/e2e-playwright/package.json +0 -33
  44. package/plugins/specweave-tooling/.claude-plugin/plugin.json +0 -19
  45. package/plugins/specweave-tooling/skills/skill-creator/LICENSE.txt +0 -202
  46. package/plugins/specweave-tooling/skills/skill-creator/SKILL.md +0 -209
  47. package/plugins/specweave-tooling/skills/skill-creator/scripts/init_skill.py +0 -303
  48. package/plugins/specweave-tooling/skills/skill-creator/scripts/package_skill.py +0 -110
  49. package/plugins/specweave-tooling/skills/skill-creator/scripts/quick_validate.py +0 -65
  50. package/plugins/specweave-tooling/skills/skill-router/SKILL.md +0 -479
  51. package/plugins/specweave-ui/.claude-plugin/plugin.json +0 -26
  52. package/plugins/specweave-ui/.mcp.json +0 -10
  53. package/plugins/specweave-ui/README.md +0 -492
  54. package/plugins/specweave-ui/skills/browser-automation/SKILL.md +0 -676
@@ -1,457 +0,0 @@
1
- ---
2
- name: e2e-playwright
3
- description: End-to-end browser automation and testing expert using Playwright. Tests web applications, validates user flows, captures screenshots, checks accessibility, and verifies functionality. SpecWeave-aware for increment testing. Activates for E2E testing, browser automation, web testing, Playwright, UI testing, integration testing, user flow validation, screenshot testing, accessibility testing, headless browser, test web app, browser test, automated testing, web automation, check website, validate UI, test increment.
4
- allowed-tools: Bash, Read, Write, Glob, Grep
5
- ---
6
-
7
- # E2E Playwright - Browser Automation & Testing Skill
8
-
9
- ## Purpose
10
-
11
- Autonomous end-to-end testing and browser automation using Playwright. This skill enables comprehensive web application testing, user flow validation, visual regression testing, and accessibility checks.
12
-
13
- **SpecWeave Integration**: Automatically detects SpecWeave increments and can generate test reports in `.specweave/increments/{id}/reports/`.
14
-
15
- ## Core Capabilities
16
-
17
- ### 1. User Flow Testing
18
- - Login/logout flows with session management
19
- - Multi-step form submissions and validation
20
- - Shopping cart and checkout processes
21
- - User registration and onboarding
22
- - Password reset and account recovery
23
-
24
- ### 2. Visual Testing
25
- - Full-page and element-specific screenshots
26
- - Multi-viewport testing (mobile, tablet, desktop)
27
- - Visual regression detection
28
- - Responsive design validation
29
-
30
- ### 3. Functional Testing
31
- - Link validation (detect broken links)
32
- - Form field validation and error handling
33
- - Button click responses and navigation
34
- - API interaction validation
35
- - Cookie and local storage management
36
-
37
- ### 4. Accessibility Testing
38
- - ARIA attribute validation
39
- - Keyboard navigation testing
40
- - Screen reader compatibility checks
41
- - Color contrast validation
42
- - Focus management
43
-
44
- ## SpecWeave-Aware Features
45
-
46
- **Increment Detection**: Automatically detects if running in a SpecWeave project and adapts behavior:
47
-
48
- ```javascript
49
- // Auto-detected context
50
- const specweaveContext = {
51
- isSpecweaveProject: true,
52
- activeIncrement: "0003-user-authentication",
53
- reportPath: ".specweave/increments/0003-user-authentication/reports/"
54
- }
55
- ```
56
-
57
- **Test Report Generation**: Creates structured test reports in increment folders:
58
- - Test results with pass/fail status
59
- - Screenshots organized by test case
60
- - Performance metrics (page load, interaction timing)
61
- - Accessibility violations summary
62
-
63
- ## Execution Workflow
64
-
65
- ### Step 1: Server Detection
66
- Before testing, detect running development servers:
67
-
68
- ```javascript
69
- const { detectServers } = require('./lib/utils.js');
70
- const servers = await detectServers();
71
- // Returns: [{ port: 3000, url: 'http://localhost:3000', name: 'Next.js' }]
72
- ```
73
-
74
- ### Step 2: Write Test Script
75
- Create test scripts in `/tmp/e2e-test-${timestamp}.js`:
76
-
77
- ```javascript
78
- const { chromium, devices } = require('playwright');
79
-
80
- (async () => {
81
- const browser = await chromium.launch({
82
- headless: false, // Visible by default
83
- slowMo: 100 // Slowed for visibility
84
- });
85
-
86
- const context = await browser.newContext({
87
- viewport: { width: 1280, height: 720 }
88
- });
89
-
90
- const page = await context.newPage();
91
-
92
- try {
93
- await page.goto('http://localhost:3000');
94
- await page.waitForLoadState('networkidle');
95
-
96
- // Test actions here
97
- const title = await page.title();
98
- console.log('Page title:', title);
99
-
100
- await page.screenshot({
101
- path: '/tmp/homepage-test.png',
102
- fullPage: true
103
- });
104
-
105
- console.log('✅ Test passed');
106
- } catch (error) {
107
- console.error('❌ Test failed:', error.message);
108
- throw error;
109
- } finally {
110
- await browser.close();
111
- }
112
- })();
113
- ```
114
-
115
- ### Step 3: Execute via Executor
116
- Run the test script through the skill's executor:
117
-
118
- ```bash
119
- cd $SKILL_DIR && node execute.js /tmp/e2e-test-${timestamp}.js
120
- ```
121
-
122
- **Important**: Execute FROM the skill directory to ensure proper module resolution.
123
-
124
- ## Helper Utilities
125
-
126
- The skill provides utilities in `lib/utils.js`:
127
-
128
- ### detectServers()
129
- Auto-detects running development servers on common ports (3000-3010, 4000, 5000, 8000-8080).
130
-
131
- ```javascript
132
- const servers = await detectServers();
133
- // [{ port: 3000, url: 'http://localhost:3000', name: 'Dev Server' }]
134
- ```
135
-
136
- ### safeClick(page, selector, options)
137
- Click with automatic wait and retry logic:
138
-
139
- ```javascript
140
- await safeClick(page, 'button[type="submit"]', { timeout: 5000 });
141
- ```
142
-
143
- ### safeType(page, selector, text, options)
144
- Type with automatic focus and validation:
145
-
146
- ```javascript
147
- await safeType(page, 'input[name="email"]', 'user@example.com');
148
- ```
149
-
150
- ### captureScreenshot(page, name, options)
151
- Timestamped screenshots with flexible naming:
152
-
153
- ```javascript
154
- await captureScreenshot(page, 'login-form', { fullPage: true });
155
- // Saves: /tmp/login-form-2025-10-27-14-30-45.png
156
- ```
157
-
158
- ### handleCookieBanner(page)
159
- Automatically dismisses common cookie consent banners:
160
-
161
- ```javascript
162
- await handleCookieBanner(page);
163
- ```
164
-
165
- ### extractTableData(page, selector)
166
- Extract structured data from HTML tables:
167
-
168
- ```javascript
169
- const data = await extractTableData(page, 'table.results');
170
- // Returns: [{ column1: 'value1', column2: 'value2' }, ...]
171
- ```
172
-
173
- ### waitForStableDOM(page, timeout)
174
- Wait for DOM to stop changing (useful after dynamic content loads):
175
-
176
- ```javascript
177
- await waitForStableDOM(page, 3000);
178
- ```
179
-
180
- ### checkAccessibility(page)
181
- Basic accessibility checks (ARIA, alt text, labels):
182
-
183
- ```javascript
184
- const issues = await checkAccessibility(page);
185
- // Returns: [{ type: 'missing-alt', element: 'img.logo' }, ...]
186
- ```
187
-
188
- ## Common Testing Patterns
189
-
190
- ### Pattern 1: Login Flow Test
191
- ```javascript
192
- // Navigate to login page
193
- await page.goto('http://localhost:3000/login');
194
-
195
- // Fill credentials
196
- await safeType(page, 'input[name="email"]', 'test@example.com');
197
- await safeType(page, 'input[name="password"]', 'password123');
198
-
199
- // Submit and wait for redirect
200
- await Promise.all([
201
- page.waitForNavigation(),
202
- safeClick(page, 'button[type="submit"]')
203
- ]);
204
-
205
- // Verify successful login
206
- const dashboardTitle = await page.title();
207
- console.log('Logged in, dashboard:', dashboardTitle);
208
- ```
209
-
210
- ### Pattern 2: Form Validation Test
211
- ```javascript
212
- // Submit empty form to trigger validation
213
- await safeClick(page, 'button[type="submit"]');
214
-
215
- // Check for error messages
216
- const errors = await page.locator('.error-message').allTextContents();
217
- console.log('Validation errors:', errors);
218
-
219
- // Verify form not submitted
220
- const url = page.url();
221
- assert(url.includes('/signup'), 'Should stay on signup page');
222
- ```
223
-
224
- ### Pattern 3: Responsive Design Test
225
- ```javascript
226
- const viewports = [
227
- { name: 'Mobile', width: 375, height: 667 },
228
- { name: 'Tablet', width: 768, height: 1024 },
229
- { name: 'Desktop', width: 1920, height: 1080 }
230
- ];
231
-
232
- for (const viewport of viewports) {
233
- await page.setViewportSize({ width: viewport.width, height: viewport.height });
234
- await page.screenshot({ path: `/tmp/responsive-${viewport.name.toLowerCase()}.png` });
235
- console.log(`✅ ${viewport.name} screenshot captured`);
236
- }
237
- ```
238
-
239
- ### Pattern 4: Link Validation
240
- ```javascript
241
- const links = await page.locator('a[href]').evaluateAll(anchors =>
242
- anchors.map(a => ({ text: a.textContent, href: a.href }))
243
- );
244
-
245
- const broken = [];
246
- for (const link of links) {
247
- try {
248
- const response = await page.request.get(link.href);
249
- if (!response.ok()) broken.push(link);
250
- } catch (e) {
251
- broken.push({ ...link, error: e.message });
252
- }
253
- }
254
-
255
- console.log('Broken links:', broken);
256
- ```
257
-
258
- ## Best Practices
259
-
260
- ### 1. Use Visible Browser by Default
261
- Set `headless: false` to observe test execution in real-time. This helps with debugging and understanding test behavior.
262
-
263
- ### 2. Add Slow Motion for Clarity
264
- Use `slowMo: 100` to slow down actions for better visibility during development.
265
-
266
- ### 3. Wait for Network Idle
267
- Always wait for network requests to complete before assertions:
268
- ```javascript
269
- await page.waitForLoadState('networkidle');
270
- ```
271
-
272
- ### 4. Clean Up Resources
273
- Always close browser instances in `finally` blocks to prevent resource leaks.
274
-
275
- ### 5. Capture Screenshots on Failure
276
- In catch blocks, capture screenshots for debugging:
277
- ```javascript
278
- catch (error) {
279
- await page.screenshot({ path: '/tmp/test-failure.png' });
280
- throw error;
281
- }
282
- ```
283
-
284
- ### 6. Use Descriptive Console Output
285
- Log clear messages for test steps and results:
286
- ```javascript
287
- console.log('✅ Login successful');
288
- console.log('❌ Form validation failed');
289
- console.log('ℹ️ Found 5 broken links');
290
- ```
291
-
292
- ## Browser Selection
293
-
294
- Playwright supports multiple browsers:
295
-
296
- ```javascript
297
- // Chromium (default, fastest)
298
- const browser = await chromium.launch();
299
-
300
- // Firefox
301
- const browser = await firefox.launch();
302
-
303
- // WebKit (Safari)
304
- const browser = await webkit.launch();
305
- ```
306
-
307
- **Recommendation**: Use Chromium for development, test all browsers before production.
308
-
309
- ## Performance Considerations
310
-
311
- - **Parallel Tests**: Run independent tests in parallel for faster execution
312
- - **Browser Reuse**: Reuse browser contexts for multiple tests
313
- - **Selective Screenshots**: Only capture screenshots when needed
314
- - **Headless Mode**: Use `headless: true` in CI/CD for faster execution
315
-
316
- ## SpecWeave Test Report Format
317
-
318
- When testing SpecWeave increments, generate reports in this format:
319
-
320
- ```markdown
321
- # E2E Test Report - Increment 0003
322
-
323
- **Date**: 2025-10-27
324
- **Duration**: 45 seconds
325
- **Status**: ✅ Passed
326
-
327
- ## Test Summary
328
-
329
- - Total Tests: 5
330
- - Passed: 5
331
- - Failed: 0
332
- - Skipped: 0
333
-
334
- ## Test Results
335
-
336
- ### TC-001: User Login Flow
337
- - **Status**: ✅ Passed
338
- - **Duration**: 8.2s
339
- - **Screenshot**: `.specweave/increments/0003/reports/screenshots/login-flow.png`
340
-
341
- ### TC-002: Form Validation
342
- - **Status**: ✅ Passed
343
- - **Duration**: 5.1s
344
- - **Assertions**: 3/3 passed
345
-
346
- ## Performance Metrics
347
-
348
- - Average Page Load: 1.2s
349
- - Total Interactions: 12
350
- - Network Requests: 45
351
-
352
- ## Accessibility Issues
353
-
354
- - Missing alt text: 2 instances (non-critical)
355
- - Low contrast: 0 instances
356
-
357
- ## Recommendations
358
-
359
- 1. Add loading indicators for async operations
360
- 2. Improve error message visibility
361
- 3. Consider lazy loading for images
362
- ```
363
-
364
- ## Installation & Setup
365
-
366
- **Initial Setup**:
367
- ```bash
368
- cd $SKILL_DIR
369
- npm install
370
- npx playwright install chromium
371
- ```
372
-
373
- **Verify Installation**:
374
- ```bash
375
- node execute.js --version
376
- ```
377
-
378
- ## Troubleshooting
379
-
380
- ### Issue: "Cannot find module 'playwright'"
381
- **Solution**: Run `npm install` in the skill directory
382
-
383
- ### Issue: "Browser not found"
384
- **Solution**: Run `npx playwright install chromium`
385
-
386
- ### Issue: "Tests timeout"
387
- **Solution**: Increase timeout in test scripts or check network connectivity
388
-
389
- ### Issue: "Screenshots not saving"
390
- **Solution**: Ensure `/tmp/` directory is writable
391
-
392
- ## Advanced Features
393
-
394
- ### Context Persistence
395
- Save browser state between tests:
396
-
397
- ```javascript
398
- await context.storageState({ path: '/tmp/auth-state.json' });
399
-
400
- // Later, restore state
401
- const context = await browser.newContext({
402
- storageState: '/tmp/auth-state.json'
403
- });
404
- ```
405
-
406
- ### Network Interception
407
- Mock API responses for testing:
408
-
409
- ```javascript
410
- await page.route('**/api/users', route => {
411
- route.fulfill({
412
- status: 200,
413
- body: JSON.stringify([{ id: 1, name: 'Test User' }])
414
- });
415
- });
416
- ```
417
-
418
- ### Video Recording
419
- Record test execution:
420
-
421
- ```javascript
422
- const context = await browser.newContext({
423
- recordVideo: { dir: '/tmp/videos/' }
424
- });
425
- ```
426
-
427
- ## Integration with CI/CD
428
-
429
- For automated testing in CI/CD pipelines:
430
-
431
- ```bash
432
- # Run headless with JUnit reporter
433
- HEADLESS=true node execute.js test-suite.js --reporter=junit
434
- ```
435
-
436
- ## API Reference
437
-
438
- For complete Playwright API documentation, refer to the official docs:
439
- - https://playwright.dev/docs/api/class-page
440
- - https://playwright.dev/docs/api/class-browser
441
-
442
- ## Notes
443
-
444
- - **No MCP Required**: This skill is standalone and does not require MCP Playwright
445
- - **Temp File Strategy**: All test scripts written to `/tmp/` to avoid project pollution
446
- - **SpecWeave-First**: Designed to integrate seamlessly with SpecWeave workflow
447
- - **Visible by Default**: Tests run with visible browser for better debugging
448
-
449
- ## Activation Keywords
450
-
451
- This skill activates when you mention:
452
- - E2E test, end-to-end test, browser test
453
- - Playwright, web automation, UI test
454
- - Test web app, validate website, check UI
455
- - Screenshot, visual test, responsive test
456
- - Login flow, user journey, test increment
457
- - Accessibility test, broken link check