@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,548 @@
1
+ ---
2
+ name: dev-review
3
+ description: Code review with focus on quality, security, and best practices
4
+ version: 1.2.0
5
+ ---
6
+
7
+ # /dev-review - Code Review
8
+
9
+ > **Skill Awareness**: See `skills/_registry.md` for all available skills.
10
+ > - **Before**: After `/dev-coding` implementation and `/dev-test` passes
11
+ > - **Reads**: `_quality-attributes.md` (ALL Levels - verification)
12
+ > - **If issues**: Fix with `/dev-coding`, then review again
13
+ > - **If major changes**: Create CR via `/debrief`
14
+
15
+ Review code changes for quality, security, and adherence to standards.
16
+
17
+ ## When to Use
18
+
19
+ - After implementing a feature
20
+ - Before merging a PR
21
+ - To get feedback on approach
22
+ - To catch issues before production
23
+
24
+ ## Usage
25
+
26
+ ```
27
+ /dev-review # Review uncommitted changes
28
+ /dev-review --staged # Review staged changes only
29
+ /dev-review src/auth/ # Review specific directory
30
+ /dev-review UC-AUTH-001 # Review changes for specific UC
31
+ ```
32
+
33
+ ## Input
34
+
35
+ Reviews can be based on:
36
+ 1. **Git diff** - Uncommitted or staged changes
37
+ 2. **File list** - Specific files to review
38
+ 3. **UC reference** - Files changed for a use case (from spec)
39
+
40
+ ## Output
41
+
42
+ ```markdown
43
+ ## Review Summary
44
+
45
+ **Verdict**: ✅ Approve | ⚠️ Request Changes | ❓ Needs Discussion
46
+
47
+ **Stats**: X files, Y additions, Z deletions
48
+
49
+ ### Issues Found
50
+
51
+ #### 🔴 Critical (must fix)
52
+ - [security] SQL injection risk in `src/api/users.ts:45`
53
+ - [bug] Null pointer in `src/utils/parse.ts:23`
54
+
55
+ #### 🟡 Important (should fix)
56
+ - [performance] N+1 query in `src/api/posts.ts:67`
57
+ - [error-handling] Unhandled promise rejection
58
+
59
+ #### 🔵 Suggestions (nice to have)
60
+ - [style] Consider extracting to helper function
61
+ - [naming] `data` is too generic, suggest `userProfile`
62
+
63
+ ### By File
64
+ - `src/api/auth.ts` - 2 issues
65
+ - `src/components/Form.tsx` - 1 suggestion
66
+
67
+ ### Positives
68
+ - Good error handling in login flow
69
+ - Clean separation of concerns
70
+ ```
71
+
72
+ ## Workflow
73
+
74
+ ### Phase 1: Gather Context
75
+
76
+ ```
77
+ 1. Get changes to review
78
+ → git diff (uncommitted)
79
+ → git diff --staged (staged only)
80
+ → Read specific files
81
+
82
+ 2. Read project conventions
83
+ → plans/scout/README.md (Conventions section)
84
+ → CLAUDE.md
85
+ → .eslintrc, tsconfig.json
86
+
87
+ 3. Read related spec (if UC provided)
88
+ → plans/features/{feature}/specs/{UC}/README.md
89
+ ```
90
+
91
+ ### Phase 1.5: Load Quality Attributes
92
+
93
+ Load ALL levels from `_quality-attributes.md` for comprehensive verification:
94
+
95
+ ```
96
+ 1. Architecture Level
97
+ → Were architecture decisions followed?
98
+ → Any deviations from architecture.md?
99
+
100
+ 2. Specification Level
101
+ → Does implementation match spec?
102
+ → API patterns correct?
103
+
104
+ 3. Implementation Level
105
+ → Code quality checks
106
+ → Security, performance, reliability
107
+
108
+ 4. Review Level (meta)
109
+ → Can a new developer understand this?
110
+ → Would you want to maintain this?
111
+ ```
112
+
113
+ ### Phase 2: Analyze Changes
114
+
115
+ For each changed file:
116
+
117
+ ```
118
+ 1. Understand the change
119
+ - What was added/modified/removed?
120
+ - What is the intent?
121
+
122
+ 2. Check against spec (if available)
123
+ - Does implementation match spec?
124
+ - Any missing requirements?
125
+
126
+ 3. Check against architecture (if exists)
127
+ - Does it follow architecture.md patterns?
128
+ - Any undocumented architecture decisions?
129
+
130
+ 4. Run through quality attribute checklists
131
+ - Scalability
132
+ - Maintainability
133
+ - Performance
134
+ - Security
135
+ - Reliability
136
+ - Testability
137
+ ```
138
+
139
+ ### Phase 3: Security Review
140
+
141
+ ```markdown
142
+ ## Security Checklist
143
+
144
+ [ ] **Input Validation**
145
+ - User input sanitized?
146
+ - SQL/NoSQL injection prevented?
147
+ - XSS prevented (HTML escaped)?
148
+
149
+ [ ] **Authentication**
150
+ - Auth required where needed?
151
+ - Token validated correctly?
152
+ - Session handled securely?
153
+
154
+ [ ] **Authorization**
155
+ - Permissions checked?
156
+ - Can't access others' data?
157
+ - Admin functions protected?
158
+
159
+ [ ] **Data Protection**
160
+ - Passwords hashed?
161
+ - Sensitive data not logged?
162
+ - No secrets in code?
163
+
164
+ [ ] **API Security**
165
+ - Rate limiting present?
166
+ - CORS configured?
167
+ - No sensitive data in URLs?
168
+ ```
169
+
170
+ **Common Security Issues:**
171
+
172
+ ```typescript
173
+ // BAD: SQL injection
174
+ const query = `SELECT * FROM users WHERE id = ${userId}`;
175
+
176
+ // GOOD: Parameterized
177
+ const query = `SELECT * FROM users WHERE id = $1`;
178
+ await db.query(query, [userId]);
179
+
180
+ // BAD: XSS vulnerable
181
+ element.innerHTML = userInput;
182
+
183
+ // GOOD: Escaped
184
+ element.textContent = userInput;
185
+
186
+ // BAD: Hardcoded secret
187
+ const apiKey = "sk-1234567890";
188
+
189
+ // GOOD: Environment variable
190
+ const apiKey = process.env.API_KEY;
191
+ ```
192
+
193
+ ### Phase 4: Quality Review
194
+
195
+ ```markdown
196
+ ## Quality Checklist
197
+
198
+ [ ] **Error Handling**
199
+ - Errors caught and handled?
200
+ - User-friendly error messages?
201
+ - Errors logged for debugging?
202
+ - No swallowed errors?
203
+
204
+ [ ] **Performance**
205
+ - No N+1 queries?
206
+ - Large lists paginated?
207
+ - Heavy operations async?
208
+ - No memory leaks?
209
+
210
+ [ ] **Maintainability**
211
+ - Code readable?
212
+ - Functions not too long?
213
+ - No magic numbers/strings?
214
+ - DRY (no unnecessary duplication)?
215
+
216
+ [ ] **Testing**
217
+ - New code has tests?
218
+ - Edge cases covered?
219
+ - Tests actually test something?
220
+ ```
221
+
222
+ **Common Quality Issues:**
223
+
224
+ ```typescript
225
+ // BAD: N+1 query
226
+ const posts = await getPosts();
227
+ for (const post of posts) {
228
+ post.author = await getUser(post.authorId); // Query per post!
229
+ }
230
+
231
+ // GOOD: Batch query
232
+ const posts = await getPosts({ include: { author: true } });
233
+
234
+ // BAD: Swallowed error
235
+ try {
236
+ await doSomething();
237
+ } catch (e) {
238
+ // Nothing - error disappears!
239
+ }
240
+
241
+ // GOOD: Handle or rethrow
242
+ try {
243
+ await doSomething();
244
+ } catch (e) {
245
+ logger.error('Failed to do something', e);
246
+ throw new AppError('Operation failed', e);
247
+ }
248
+
249
+ // BAD: Magic number
250
+ if (retries > 3) { ... }
251
+
252
+ // GOOD: Named constant
253
+ const MAX_RETRIES = 3;
254
+ if (retries > MAX_RETRIES) { ... }
255
+ ```
256
+
257
+ ### Phase 5: Convention Review
258
+
259
+ ```markdown
260
+ ## Convention Checklist (from scout)
261
+
262
+ [ ] **Naming**
263
+ - Variables: {convention from scout}
264
+ - Files: {convention from scout}
265
+ - Components: {convention from scout}
266
+
267
+ [ ] **Structure**
268
+ - File in correct location?
269
+ - Follows project patterns?
270
+ - Imports organized?
271
+
272
+ [ ] **Style**
273
+ - Matches .prettierrc / .eslintrc?
274
+ - Consistent with codebase?
275
+ - No linting errors?
276
+
277
+ [ ] **Git**
278
+ - Commit message format correct?
279
+ - No unrelated changes?
280
+ - No debug code / console.log?
281
+ ```
282
+
283
+ ### Phase 6: Spec Compliance (if UC provided)
284
+
285
+ ```markdown
286
+ ## Spec Compliance
287
+
288
+ ### Requirements Met
289
+ - [x] Login endpoint created
290
+ - [x] Returns token on success
291
+ - [x] Returns error on invalid credentials
292
+
293
+ ### Requirements Not Met
294
+ - [ ] Rate limiting not implemented (spec said 5 attempts/min)
295
+
296
+ ### Not in Spec
297
+ - Added "remember me" checkbox (is this approved?)
298
+ ```
299
+
300
+ ### Phase 7: Generate Review
301
+
302
+ Compile findings into review output format.
303
+
304
+ **Severity Levels:**
305
+
306
+ | Level | Icon | Meaning | Action |
307
+ |-------|------|---------|--------|
308
+ | Critical | 🔴 | Security risk, bug, breaks functionality | Must fix before merge |
309
+ | Important | 🟡 | Performance, maintainability issues | Should fix |
310
+ | Suggestion | 🔵 | Style, improvements | Nice to have |
311
+ | Positive | ✅ | Good practice noted | Encouragement |
312
+
313
+ **Review Verdicts:**
314
+
315
+ | Verdict | When |
316
+ |---------|------|
317
+ | ✅ Approve | No critical/important issues |
318
+ | ⚠️ Request Changes | Has critical or multiple important issues |
319
+ | ❓ Needs Discussion | Unclear requirements, architectural concerns |
320
+
321
+ ## Review Best Practices
322
+
323
+ ### Be Constructive
324
+
325
+ ```markdown
326
+ // BAD
327
+ "This code is bad"
328
+
329
+ // GOOD
330
+ "This could cause a SQL injection. Consider using parameterized queries:
331
+ ```sql
332
+ SELECT * FROM users WHERE id = $1
333
+ ```"
334
+ ```
335
+
336
+ ### Explain Why
337
+
338
+ ```markdown
339
+ // BAD
340
+ "Don't use var"
341
+
342
+ // GOOD
343
+ "Use const/let instead of var - var has function scope which can lead to
344
+ unexpected behavior. const also signals intent that the value won't change."
345
+ ```
346
+
347
+ ### Suggest Alternatives
348
+
349
+ ```markdown
350
+ // Issue + Solution
351
+ "The N+1 query here will cause performance issues with many posts.
352
+
353
+ Consider using an include/join:
354
+ ```typescript
355
+ const posts = await db.posts.findMany({
356
+ include: { author: true }
357
+ });
358
+ ```"
359
+ ```
360
+
361
+ ### Acknowledge Good Work
362
+
363
+ ```markdown
364
+ ### Positives
365
+ - Clean separation of API and business logic
366
+ - Good error messages for users
367
+ - Comprehensive input validation
368
+ ```
369
+
370
+ ## Tools Used
371
+
372
+ | Tool | Purpose |
373
+ |------|---------|
374
+ | `Bash` | git diff, git log |
375
+ | `Read` | Read changed files |
376
+ | `Grep` | Search for patterns |
377
+ | `Glob` | Find related files |
378
+
379
+ ## Integration
380
+
381
+ | Skill | Relationship |
382
+ |-------|--------------|
383
+ | `/dev-coding` | Review after implementation |
384
+ | `/dev-scout` | Get project conventions |
385
+ | `/dev-specs` | Check spec compliance |
386
+
387
+ ## Example Review
388
+
389
+ ```
390
+ User: /dev-review UC-AUTH-001
391
+
392
+ Phase 1: Gather
393
+ - Get git diff for UC-AUTH-001 files
394
+ - Read scout conventions
395
+ - Read UC-AUTH-001 spec
396
+
397
+ Phase 2-6: Analyze
398
+ - src/api/auth/login.ts: Clean ✓
399
+ - src/components/LoginForm.tsx: 1 issue
400
+ - src/lib/api.ts: 1 suggestion
401
+
402
+ Phase 7: Output
403
+
404
+ ## Review Summary
405
+
406
+ **Verdict**: ⚠️ Request Changes
407
+
408
+ **Stats**: 3 files, +245 additions, -12 deletions
409
+
410
+ ### Issues Found
411
+
412
+ #### 🔴 Critical
413
+ None
414
+
415
+ #### 🟡 Important
416
+ - [error-handling] `src/components/LoginForm.tsx:34`
417
+ Promise rejection not handled. If API fails, user sees nothing.
418
+ ```tsx
419
+ // Add error state
420
+ .catch(err => setError(err.message))
421
+ ```
422
+
423
+ #### 🔵 Suggestions
424
+ - [naming] `src/lib/api.ts:12`
425
+ `data` is generic. Consider `credentials` for clarity.
426
+
427
+ ### Spec Compliance
428
+ - [x] POST /api/auth/login works
429
+ - [x] Returns token
430
+ - [x] Validates input
431
+ - [ ] Missing: Rate limiting (spec requirement)
432
+
433
+ ### Positives
434
+ - Good validation on both client and server
435
+ - Clean component structure
436
+ - Proper TypeScript types
437
+ ```
438
+
439
+ ## Fix Loop
440
+
441
+ When issues are found, `/dev-review` can trigger `/dev-coding` to fix them:
442
+
443
+ ```
444
+ /dev-review
445
+
446
+ Issues found?
447
+ ├── No → Pass ✅ → Suggest /dev-changelog
448
+ └── Yes → Offer to fix
449
+
450
+ "1 important issue found. Fix now?"
451
+ ├── Yes → Load /dev-coding with fix context
452
+ │ ↓
453
+ │ Fix applied
454
+ │ ↓
455
+ │ Re-run /dev-review (auto)
456
+ └── No → Output review, user fixes manually
457
+ ```
458
+
459
+ ### Fix Flow
460
+
461
+ ```markdown
462
+ **Review found issues:**
463
+
464
+ | # | Severity | File | Issue |
465
+ |---|----------|------|-------|
466
+ | 1 | 🟡 Important | LoginForm.tsx:34 | Promise rejection not handled |
467
+ | 2 | 🔵 Suggestion | api.ts:12 | Generic variable name |
468
+
469
+ **Options:**
470
+ - A: Fix important issues automatically (1 issue)
471
+ - B: Fix all issues automatically (2 issues)
472
+ - C: I'll fix manually
473
+ ```
474
+
475
+ **If user chooses A or B:**
476
+
477
+ ```
478
+ 1. Load /dev-coding skill
479
+ → Pass: files to fix, issues to address
480
+
481
+ 2. /dev-coding applies fixes
482
+ → Uses existing patterns from scout
483
+ → Follows spec requirements
484
+
485
+ 3. Auto re-run /dev-review
486
+ → Verify fixes applied correctly
487
+ → Check for new issues introduced
488
+
489
+ 4. If pass → Suggest /dev-changelog
490
+ ```
491
+
492
+ ## After Pass: Changelog
493
+
494
+ When review passes (no critical/important issues):
495
+
496
+ ```markdown
497
+ ## Review Complete ✅
498
+
499
+ **Verdict**: Approved
500
+
501
+ No critical or important issues found.
502
+
503
+ **Next Steps:**
504
+ 1. Run `/dev-changelog` to document what was built
505
+ 2. Commit and push changes
506
+ 3. Create PR
507
+
508
+ 💡 Run `/dev-changelog {feature}` to create implementation summary.
509
+ ```
510
+
511
+ ## Integration
512
+
513
+ | Skill | Relationship |
514
+ |-------|--------------|
515
+ | `/dev-coding` | Review after implementation |
516
+ | `/dev-coding` | Call to fix issues (fix loop) |
517
+ | `/dev-scout` | Get project conventions |
518
+ | `/dev-specs` | Check spec compliance |
519
+ | `/dev-changelog` | Document after pass |
520
+
521
+ ## Complete Flow
522
+
523
+ ```
524
+ /dev-coding → /dev-test → /dev-review
525
+
526
+ ┌─────────┴─────────┐
527
+ │ Issues found? │
528
+ └─────────┬─────────┘
529
+
530
+ ┌───────────────┼───────────────┐
531
+ ↓ ↓ ↓
532
+ Critical Important None
533
+ │ │ │
534
+ ↓ ↓ ↓
535
+ Must fix Offer fix Pass ✅
536
+ │ │ │
537
+ └───────┬───────┘ │
538
+ ↓ │
539
+ /dev-coding (fix) │
540
+ ↓ │
541
+ /dev-review (re-run) │
542
+ ↓ │
543
+ Pass ────────────────────→│
544
+
545
+ /dev-changelog
546
+
547
+ summary.md created
548
+ ```