@codihaus/claude-skills 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +167 -0
  2. package/bin/cli.js +58 -0
  3. package/package.json +46 -0
  4. package/skills/_quality-attributes.md +392 -0
  5. package/skills/_registry.md +189 -0
  6. package/skills/debrief/SKILL.md +647 -0
  7. package/skills/debrief/references/change-request-template.md +124 -0
  8. package/skills/debrief/references/file-patterns.md +173 -0
  9. package/skills/debrief/references/group-codes.md +72 -0
  10. package/skills/debrief/references/research-queries.md +106 -0
  11. package/skills/debrief/references/use-case-template.md +141 -0
  12. package/skills/debrief/scripts/generate_questionnaire.py +195 -0
  13. package/skills/dev-arch/SKILL.md +747 -0
  14. package/skills/dev-changelog/SKILL.md +378 -0
  15. package/skills/dev-coding/SKILL.md +470 -0
  16. package/skills/dev-coding-backend/SKILL.md +361 -0
  17. package/skills/dev-coding-frontend/SKILL.md +534 -0
  18. package/skills/dev-coding-frontend/references/nextjs.md +477 -0
  19. package/skills/dev-review/SKILL.md +548 -0
  20. package/skills/dev-scout/SKILL.md +723 -0
  21. package/skills/dev-scout/references/feature-patterns.md +210 -0
  22. package/skills/dev-scout/references/file-patterns.md +252 -0
  23. package/skills/dev-scout/references/tech-detection.md +211 -0
  24. package/skills/dev-scout/scripts/scout-analyze.sh +280 -0
  25. package/skills/dev-specs/SKILL.md +577 -0
  26. package/skills/dev-specs/references/checklist.md +176 -0
  27. package/skills/dev-specs/references/spec-templates.md +460 -0
  28. package/skills/dev-test/SKILL.md +364 -0
  29. package/skills/utils/diagram/SKILL.md +205 -0
  30. package/skills/utils/diagram/references/common-errors.md +305 -0
  31. package/skills/utils/diagram/references/diagram-types.md +636 -0
  32. package/skills/utils/docs-graph/SKILL.md +204 -0
  33. package/skills/utils/gemini/SKILL.md +292 -0
  34. package/skills/utils/gemini/scripts/gemini-scan.py +340 -0
  35. package/skills/utils/gemini/scripts/setup.sh +169 -0
  36. package/src/commands/add.js +64 -0
  37. package/src/commands/doctor.js +179 -0
  38. package/src/commands/init.js +251 -0
  39. package/src/commands/list.js +88 -0
  40. package/src/commands/remove.js +60 -0
  41. package/src/commands/update.js +72 -0
  42. package/src/index.js +26 -0
  43. package/src/utils/config.js +272 -0
  44. package/src/utils/deps.js +599 -0
  45. package/src/utils/skills.js +253 -0
  46. package/templates/CLAUDE.md.template +58 -0
@@ -0,0 +1,364 @@
1
+ ---
2
+ name: dev-test
3
+ description: Automated testing after implementation using Playwright
4
+ version: 1.0.0
5
+ ---
6
+
7
+ # /dev-test - Implementation Testing
8
+
9
+ > **Skill Awareness**: See `skills/_registry.md` for all available skills.
10
+ > - **After**: `/dev-coding` implementation complete
11
+ > - **Auto-triggered**: By `/dev-coding` after implementation
12
+ > - **If fails**: Loop back to fix, then re-test
13
+
14
+ Automated testing using Playwright to verify implementation works correctly.
15
+
16
+ ## When to Use
17
+
18
+ - After completing feature implementation
19
+ - After fixing bugs
20
+ - Before code review
21
+ - Before committing changes
22
+
23
+ ## Usage
24
+
25
+ ```
26
+ /dev-test # Test current implementation
27
+ /dev-test UC-AUTH-001 # Test specific use case
28
+ /dev-test --url http://... # Test specific URL
29
+ /dev-test --fix # Auto-fix issues found
30
+ ```
31
+
32
+ ## What It Tests
33
+
34
+ | Check | Method | Catches |
35
+ |-------|--------|---------|
36
+ | Console Errors | `browser_console_messages` | JS errors, React errors, warnings |
37
+ | Network Failures | `browser_network_requests` | API 4xx/5xx, failed fetches, timeouts |
38
+ | Visual State | `browser_snapshot` | Render errors, missing elements |
39
+ | Interactions | `browser_click`, `browser_type` | Form failures, broken buttons |
40
+
41
+ ## Workflow
42
+
43
+ ### Phase 1: Prepare Test Context
44
+
45
+ ```
46
+ 1. Identify what to test
47
+ → From UC spec: expected flows, inputs, outputs
48
+ → From recent changes: modified components/endpoints
49
+
50
+ 2. Determine test URL
51
+ → From spec or project config
52
+ → Default: http://localhost:3000
53
+
54
+ 3. Check if dev server running
55
+ → Look for existing process on port
56
+ → If not, prompt user to start it
57
+ ```
58
+
59
+ ### Phase 2: Navigate and Capture Initial State
60
+
61
+ ```typescript
62
+ // Navigate to the page
63
+ await mcp__playwright__browser_navigate({
64
+ url: 'http://localhost:3000/login'
65
+ });
66
+
67
+ // Wait for page to stabilize
68
+ await mcp__playwright__browser_wait_for({ time: 2 });
69
+
70
+ // Capture accessibility snapshot (better than screenshot for analysis)
71
+ await mcp__playwright__browser_snapshot({});
72
+ ```
73
+
74
+ **Check for immediate errors:**
75
+ - Page loads without errors
76
+ - Expected elements present
77
+ - No console errors on load
78
+
79
+ ### Phase 3: Test User Flows
80
+
81
+ From the UC spec, execute the happy path:
82
+
83
+ ```typescript
84
+ // Example: Login flow
85
+ // Step 1: Fill form
86
+ await mcp__playwright__browser_type({
87
+ element: 'email input',
88
+ ref: 'input-email', // From snapshot
89
+ text: 'test@example.com'
90
+ });
91
+
92
+ await mcp__playwright__browser_type({
93
+ element: 'password input',
94
+ ref: 'input-password',
95
+ text: 'password123'
96
+ });
97
+
98
+ // Step 2: Submit
99
+ await mcp__playwright__browser_click({
100
+ element: 'login button',
101
+ ref: 'btn-login'
102
+ });
103
+
104
+ // Step 3: Wait for response
105
+ await mcp__playwright__browser_wait_for({
106
+ text: 'Dashboard' // Expected after login
107
+ });
108
+
109
+ // Step 4: Verify result
110
+ await mcp__playwright__browser_snapshot({});
111
+ ```
112
+
113
+ ### Phase 4: Collect Errors
114
+
115
+ ```typescript
116
+ // Get console messages (errors, warnings)
117
+ const console = await mcp__playwright__browser_console_messages({
118
+ level: 'error'
119
+ });
120
+
121
+ // Get network requests (find failures)
122
+ const network = await mcp__playwright__browser_network_requests({});
123
+
124
+ // Filter for issues:
125
+ // - Console: Any error level messages
126
+ // - Network: Status >= 400, or failed requests
127
+ ```
128
+
129
+ **Error Categories:**
130
+
131
+ | Category | Source | Examples |
132
+ |----------|--------|----------|
133
+ | JS Errors | Console | TypeError, ReferenceError, unhandled promise |
134
+ | React Errors | Console | Component errors, hooks violations |
135
+ | API Errors | Network | 400 Bad Request, 401 Unauthorized, 500 Server Error |
136
+ | Network Errors | Network | Failed to fetch, CORS, timeout |
137
+ | Render Errors | Snapshot | Missing elements, wrong state |
138
+
139
+ ### Phase 5: Generate Report
140
+
141
+ ```markdown
142
+ ## Test Report
143
+
144
+ **Target**: UC-AUTH-001 Login
145
+ **URL**: http://localhost:3000/login
146
+ **Status**: ❌ Failed (3 issues)
147
+
148
+ ### Issues Found
149
+
150
+ #### 🔴 Critical
151
+
152
+ 1. **API Error**: POST /api/auth/login returned 500
153
+ - Response: `{"error":"Internal server error"}`
154
+ - Likely cause: Database connection or missing env var
155
+ - File: Check `src/app/api/auth/login/route.ts`
156
+
157
+ 2. **Console Error**: Unhandled promise rejection
158
+ - Message: `Cannot read property 'id' of undefined`
159
+ - Stack: `LoginForm.tsx:45`
160
+ - Cause: API response handling when login fails
161
+
162
+ #### 🟡 Warning
163
+
164
+ 3. **Console Warning**: Missing key prop in list
165
+ - Component: `ErrorMessages.tsx`
166
+ - Not critical but should fix
167
+
168
+ ### Test Steps Executed
169
+
170
+ | Step | Action | Result |
171
+ |------|--------|--------|
172
+ | 1 | Navigate to /login | ✓ Page loaded |
173
+ | 2 | Fill email | ✓ Input accepted |
174
+ | 3 | Fill password | ✓ Input accepted |
175
+ | 4 | Click login | ✗ Error occurred |
176
+ | 5 | Verify dashboard | ⏭ Skipped |
177
+
178
+ ### Suggested Fixes
179
+
180
+ 1. Check database connection in backend
181
+ 2. Add error handling in LoginForm.tsx:45
182
+ 3. Add key prop to ErrorMessages.tsx list items
183
+ ```
184
+
185
+ ### Phase 6: Fix Loop (if --fix)
186
+
187
+ ```
188
+ 1. For each issue:
189
+ a. Read the problematic file
190
+ b. Identify the fix
191
+ c. Apply the fix
192
+ d. Re-run failed test step
193
+
194
+ 2. Continue until:
195
+ - All issues fixed, OR
196
+ - Max iterations reached (3), OR
197
+ - Issue requires user input
198
+
199
+ 3. Re-run full test to verify
200
+ ```
201
+
202
+ ## Test Patterns
203
+
204
+ ### Form Submission
205
+
206
+ ```typescript
207
+ // 1. Fill form
208
+ await browser_fill_form({
209
+ fields: [
210
+ { name: 'Email', type: 'textbox', ref: 'input-email', value: 'test@test.com' },
211
+ { name: 'Password', type: 'textbox', ref: 'input-password', value: 'password123' }
212
+ ]
213
+ });
214
+
215
+ // 2. Submit and wait
216
+ await browser_click({ element: 'Submit button', ref: 'btn-submit' });
217
+ await browser_wait_for({ text: 'Success' });
218
+
219
+ // 3. Check for errors
220
+ const errors = await browser_console_messages({ level: 'error' });
221
+ ```
222
+
223
+ ### Navigation Flow
224
+
225
+ ```typescript
226
+ // 1. Start at page A
227
+ await browser_navigate({ url: '/dashboard' });
228
+
229
+ // 2. Click to page B
230
+ await browser_click({ element: 'Settings link', ref: 'nav-settings' });
231
+ await browser_wait_for({ text: 'Settings' });
232
+
233
+ // 3. Verify correct page
234
+ const snapshot = await browser_snapshot({});
235
+ // Check snapshot contains expected elements
236
+ ```
237
+
238
+ ### API Response Validation
239
+
240
+ ```typescript
241
+ // 1. Trigger API call (via form submit or button)
242
+ await browser_click({ element: 'Load data', ref: 'btn-load' });
243
+ await browser_wait_for({ time: 2 });
244
+
245
+ // 2. Check network requests
246
+ const requests = await browser_network_requests({});
247
+
248
+ // 3. Find the API call
249
+ const apiCall = requests.find(r => r.url.includes('/api/data'));
250
+
251
+ // 4. Validate
252
+ if (apiCall.status >= 400) {
253
+ // Report error
254
+ }
255
+ ```
256
+
257
+ ### Error State Testing
258
+
259
+ ```typescript
260
+ // Test error handling by submitting invalid data
261
+ await browser_type({
262
+ element: 'email',
263
+ ref: 'input-email',
264
+ text: 'invalid-email' // No @ symbol
265
+ });
266
+
267
+ await browser_click({ element: 'Submit', ref: 'btn-submit' });
268
+
269
+ // Verify error message appears
270
+ const snapshot = await browser_snapshot({});
271
+ // Check for validation error in snapshot
272
+ ```
273
+
274
+ ## Test Data
275
+
276
+ Use predictable test data:
277
+
278
+ ```typescript
279
+ const TEST_DATA = {
280
+ validEmail: 'test@example.com',
281
+ validPassword: 'Test123!@#',
282
+ invalidEmail: 'not-an-email',
283
+ shortPassword: '123',
284
+ };
285
+ ```
286
+
287
+ For existing data, check spec or use API to fetch valid IDs.
288
+
289
+ ## Common Issues & Solutions
290
+
291
+ ### Issue: Page Not Loading
292
+
293
+ ```
294
+ Symptom: Navigation fails or times out
295
+ Check:
296
+ 1. Is dev server running? (npm run dev)
297
+ 2. Correct port? (3000, 3001, etc.)
298
+ 3. Any build errors?
299
+ ```
300
+
301
+ ### Issue: Element Not Found
302
+
303
+ ```
304
+ Symptom: Click/type fails with "element not found"
305
+ Check:
306
+ 1. Take snapshot to see current state
307
+ 2. Is element conditionally rendered?
308
+ 3. Has ref changed since snapshot?
309
+ 4. Is page still loading?
310
+ ```
311
+
312
+ ### Issue: Intermittent Failures
313
+
314
+ ```
315
+ Symptom: Test passes sometimes, fails sometimes
316
+ Check:
317
+ 1. Add wait_for before interactions
318
+ 2. Check for race conditions
319
+ 3. Increase timeout for slow APIs
320
+ ```
321
+
322
+ ## Integration with /dev-coding
323
+
324
+ When `/dev-coding` completes:
325
+
326
+ ```markdown
327
+ ## Implementation Complete
328
+
329
+ Backend: ✓ API endpoints created
330
+ Frontend: ✓ Components built
331
+
332
+ **Next Step**: Running /dev-test to verify...
333
+
334
+ [Auto-triggers /dev-test]
335
+ ```
336
+
337
+ If tests fail, `/dev-test` can:
338
+ 1. Report issues for manual fix
339
+ 2. Auto-fix with `--fix` flag
340
+ 3. Re-run until passing
341
+
342
+ ## Tools Used
343
+
344
+ | Tool | Purpose |
345
+ |------|---------|
346
+ | `mcp__playwright__browser_navigate` | Go to test URL |
347
+ | `mcp__playwright__browser_snapshot` | Capture page state |
348
+ | `mcp__playwright__browser_type` | Fill form inputs |
349
+ | `mcp__playwright__browser_click` | Click buttons/links |
350
+ | `mcp__playwright__browser_wait_for` | Wait for elements/time |
351
+ | `mcp__playwright__browser_console_messages` | Get JS errors |
352
+ | `mcp__playwright__browser_network_requests` | Get API responses |
353
+ | `Read` | Read spec for expected behavior |
354
+ | `Edit` | Fix issues (with --fix) |
355
+
356
+ ## Output Locations
357
+
358
+ Test reports are informational and displayed inline. No files created unless requested.
359
+
360
+ For saved reports:
361
+ ```
362
+ plans/features/{feature}/test-reports/
363
+ └── {date}-{UC-ID}.md
364
+ ```
@@ -0,0 +1,205 @@
1
+ ---
2
+ name: utils/diagram
3
+ description: Create and validate Mermaid diagrams in markdown files
4
+ version: 1.3.0
5
+ ---
6
+
7
+ # /utils/diagram - Mermaid Diagram Utility
8
+
9
+ > **Skill Awareness**: See `skills/_registry.md` for all available skills.
10
+ > - **Called by**: `/dev-scout`, `/dev-specs`, `/dev-arch` for diagrams
11
+ > - **Related**: `/utils/docs-graph` for document relationships
12
+ > - **Note**: Utility skill, typically called by other skills
13
+
14
+ Create, validate, and fix Mermaid diagrams in markdown files.
15
+
16
+ ## Prerequisites
17
+
18
+ ```bash
19
+ npm install -g @mermaid-js/mermaid-cli
20
+ ```
21
+
22
+ Verify: `mmdc --version`
23
+
24
+ ## Usage
25
+
26
+ ```
27
+ /utils/diagram validate path/to/file.md # Validate diagrams in file
28
+ /utils/diagram validate # Validate file from context
29
+ /utils/diagram fix path/to/file.md # Validate and auto-fix
30
+ ```
31
+
32
+ ## Workflow
33
+
34
+ ### Validate Mode
35
+
36
+ 1. Read the markdown file
37
+ 2. Extract all mermaid code blocks
38
+ 3. For each diagram, run: `mmdc -i <temp-file> -o /tmp/mermaid-out.svg 2>&1`
39
+ 4. Report results:
40
+ - Valid: Confirm with checkmark
41
+ - Invalid: Show error, location, and what's wrong
42
+
43
+ ### Fix Mode
44
+
45
+ 1. Validate first
46
+ 2. For invalid diagrams:
47
+ - Identify the error type (see `references/common-errors.md`)
48
+ - Apply fix
49
+ - Re-validate
50
+ 3. Repeat until all diagrams pass
51
+ 4. Update the file with fixes
52
+
53
+ ## Supported Diagram Types
54
+
55
+ ### Core Diagrams
56
+
57
+ | Type | Keyword | Use For |
58
+ |------|---------|---------|
59
+ | Flowchart | `flowchart` | Process flows, decisions |
60
+ | Sequence | `sequenceDiagram` | API flows, interactions |
61
+ | State | `stateDiagram-v2` | Status lifecycle |
62
+ | ER Diagram | `erDiagram` | Database schema |
63
+ | Class | `classDiagram` | Object structures |
64
+
65
+ ### Charts & Visualization
66
+
67
+ | Type | Keyword | Use For |
68
+ |------|---------|---------|
69
+ | Pie | `pie` | Distribution |
70
+ | XY Chart | `xychart-beta` | Line/bar charts, trends |
71
+ | Quadrant | `quadrantChart` | Priority matrix, effort/impact |
72
+ | Sankey | `sankey-beta` | Flow visualization, funnels |
73
+
74
+ ### Architecture & Systems
75
+
76
+ | Type | Keyword | Use For |
77
+ |------|---------|---------|
78
+ | **Architecture** | `architecture-beta` | **AWS/Cloud diagrams, CI/CD** |
79
+ | Block | `block-beta` | System blocks, layouts |
80
+ | C4 | `C4Context` / `C4Container` | Software architecture levels |
81
+ | Packet | `packet-beta` | Network protocols |
82
+
83
+ ### Planning & Documentation
84
+
85
+ | Type | Keyword | Use For |
86
+ |------|---------|---------|
87
+ | Gantt | `gantt` | Project timelines |
88
+ | Timeline | `timeline` | Milestones, phases |
89
+ | Journey | `journey` | User experience mapping |
90
+ | Mindmap | `mindmap` | Feature breakdown |
91
+ | Git Graph | `gitGraph` | Branch strategies |
92
+ | Requirement | `requirementDiagram` | Requirements tracking |
93
+ | Kanban | `kanban` | Task boards |
94
+
95
+ See `references/diagram-types.md` for complete syntax and examples.
96
+
97
+ ## Architecture Diagrams (AWS/Cloud)
98
+
99
+ The `architecture-beta` type is specifically designed for cloud infrastructure diagrams.
100
+
101
+ ### Basic Components
102
+
103
+ ```mermaid
104
+ architecture-beta
105
+ group aws(cloud)[AWS Region]
106
+
107
+ group vpc(cloud)[VPC] in aws
108
+ service alb(server)[Load Balancer] in vpc
109
+ service ec2(server)[EC2] in vpc
110
+ service rds(database)[RDS] in vpc
111
+ service s3(disk)[S3] in aws
112
+
113
+ alb:R --> L:ec2
114
+ ec2:R --> L:rds
115
+ ec2:B --> T:s3
116
+ ```
117
+
118
+ ### Syntax Quick Reference
119
+
120
+ | Element | Syntax |
121
+ |---------|--------|
122
+ | Group | `group id(icon)[Label]` |
123
+ | Nested group | `group id(icon)[Label] in parent` |
124
+ | Service | `service id(icon)[Label]` |
125
+ | Service in group | `service id(icon)[Label] in group` |
126
+ | Edge | `svc1:R --> L:svc2` |
127
+ | Junction | `junction id` |
128
+
129
+ ### Default Icons
130
+
131
+ `cloud`, `database`, `disk`, `internet`, `server`
132
+
133
+ ### Edge Directions
134
+
135
+ `L` (left), `R` (right), `T` (top), `B` (bottom)
136
+
137
+ ### Custom AWS Icons
138
+
139
+ For actual AWS icons, use Iconify integration:
140
+ ```
141
+ service lambda(logos:aws-lambda)[Lambda]
142
+ service s3(logos:aws-s3)[S3]
143
+ ```
144
+
145
+ Note: Custom icons require registering icon packs in the Mermaid config.
146
+
147
+ ## Validation Script
148
+
149
+ ```bash
150
+ # Extract and validate mermaid blocks
151
+ # Save mermaid content to temp file, then:
152
+ mmdc -i /tmp/mermaid-temp.mmd -o /tmp/mermaid-out.svg 2>&1
153
+
154
+ # Exit code 0 = valid, non-zero = error
155
+ # Stderr contains error details
156
+ ```
157
+
158
+ ## Error Handling
159
+
160
+ When validation fails, the error message indicates:
161
+ - Line number in the diagram
162
+ - Error type (syntax, unknown keyword, etc.)
163
+ - Suggestion for fix
164
+
165
+ Load `references/common-errors.md` for fix patterns.
166
+
167
+ ## Integration
168
+
169
+ Other skills can use diagram validation:
170
+
171
+ ```markdown
172
+ <!-- After creating mermaid diagram -->
173
+ 1. Write the diagram to file
174
+ 2. Run: mmdc -i <file> -o /tmp/validate.svg 2>&1
175
+ 3. If error, fix and retry
176
+ 4. Continue with skill workflow
177
+ ```
178
+
179
+ ## Example
180
+
181
+ ```
182
+ User: /utils/diagram validate plans/billing/brd/flows/FL-MAIN-001-overview.md
183
+
184
+ Claude: Validating mermaid diagrams in FL-MAIN-001-overview.md...
185
+
186
+ Found 2 diagrams:
187
+
188
+ 1. Line 5-15: flowchart LR
189
+ ✓ Valid
190
+
191
+ 2. Line 20-35: sequenceDiagram
192
+ ✗ Error: Parse error on line 8
193
+ → "End" is a reserved word, wrap in quotes: "End"
194
+
195
+ Fixing diagram 2...
196
+ Applied fix: End → "End"
197
+ Re-validating... ✓ Valid
198
+
199
+ Updated file. All diagrams now valid.
200
+ ```
201
+
202
+ ## References
203
+
204
+ - `references/diagram-types.md` - Syntax for each diagram type
205
+ - `references/common-errors.md` - Error patterns and fixes