@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,577 @@
1
+ ---
2
+ name: dev-specs
3
+ description: Generate implementation specifications from BRD use cases
4
+ version: 1.4.0
5
+ ---
6
+
7
+ # /dev-specs - Implementation Specifications
8
+
9
+ > **Skill Awareness**: See `skills/_registry.md` for all available skills.
10
+ > - **Before**: Ensure `/debrief` completed (BRD exists)
11
+ > - **Auto**: Runs `/dev-scout` if scout.md missing
12
+ > - **During**: Calls `/dev-arch` for patterns and architecture decisions
13
+ > - **Reads**: `_quality-attributes.md` (Specification Level)
14
+ > - **After**: Use `/dev-coding` for implementation
15
+
16
+ Generate precise implementation plans from BRD use cases. Creates per-UC specs with shared components.
17
+
18
+ ## When to Use
19
+
20
+ - After `/debrief` created BRD use cases
21
+ - After `/dev-scout {feature}` analyzed codebase
22
+ - Before starting implementation
23
+ - When onboarding engineers to a feature
24
+
25
+ ## Usage
26
+
27
+ ```
28
+ /dev-specs auth # Generate specs for auth feature
29
+ /dev-specs auth UC-AUTH-001 # Single use case only
30
+ /dev-specs billing --api=swagger.json # With API spec file
31
+ /dev-specs payments --schema=schema.prisma # With DB schema
32
+ ```
33
+
34
+ ## Prerequisites
35
+
36
+ Before running, ensure:
37
+ 1. `plans/brd/` exists with use cases
38
+ 2. `plans/features/{feature}/` exists
39
+
40
+ **Note**: Scout is auto-triggered if missing (see Phase 0).
41
+
42
+ ## Input Files
43
+
44
+ The skill can accept additional context files:
45
+
46
+ | Input | Flag | Purpose |
47
+ |-------|------|---------|
48
+ | API Spec | `--api=` | OpenAPI, Swagger, GraphQL schema |
49
+ | DB Schema | `--schema=` | Prisma, SQL, TypeORM entities |
50
+ | Design | `--design=` | Figma link, screenshots path |
51
+ | Docs | `--docs=` | External docs, wikis, READMEs |
52
+ | Env | `--env=` | Credentials for live API testing |
53
+
54
+ ## Output Structure
55
+
56
+ ```
57
+ plans/features/{feature}/
58
+ ├── README.md # Feature overview
59
+ ├── scout.md # From /dev-scout
60
+
61
+ └── specs/
62
+ ├── README.md # Index, implementation order, dependencies
63
+
64
+ ├── shared/ # Shared across all UCs
65
+ │ ├── data-model.md # Schema changes, entities
66
+ │ ├── patterns.md # Code patterns, conventions
67
+ │ └── security.md # Auth, validation, permissions
68
+
69
+ ├── UC-XXX-001-{slug}/ # Per use case
70
+ │ ├── README.md # Implementation plan
71
+ │ ├── changes.md # Files to create/modify
72
+ │ └── tests.md # Test cases
73
+
74
+ └── UC-XXX-002-{slug}/
75
+ └── ...
76
+ ```
77
+
78
+ ## Workflow
79
+
80
+ ### Phase 0: Check Dependencies & Graph Context
81
+
82
+ Before generating specs, verify prerequisites and gather context:
83
+
84
+ ```
85
+ 1. Check: plans/brd/ exists?
86
+ → No: Error "Run /debrief first"
87
+
88
+ 2. Check: plans/features/{feature}/ exists?
89
+ → No: Error "Feature not found in BRD"
90
+
91
+ 3. Check: plans/features/{feature}/scout.md exists?
92
+ → No: Auto-run scout (see below)
93
+
94
+ 4. Read: plans/docs-graph.json
95
+ → Get related nodes and dependencies
96
+ ```
97
+
98
+ **Auto-Scout Logic:**
99
+
100
+ If scout.md doesn't exist:
101
+ 1. Notify user: "No scout found for {feature}, running analysis..."
102
+ 2. Execute scout workflow (medium mode) for the feature
103
+ 3. Save to `plans/features/{feature}/scout.md`
104
+ 4. Continue to Phase 1
105
+
106
+ **Docs-Graph Integration:**
107
+
108
+ Read `plans/docs-graph.json` to understand:
109
+
110
+ | What to Find | How It Helps |
111
+ |--------------|--------------|
112
+ | Use cases for feature | Know exactly which UCs to spec (`[[uc-auth-001]]`) |
113
+ | Existing specs | Avoid duplicates, find patterns |
114
+ | Dependencies | UCs that link to each other need coordinated specs |
115
+ | Related features | Cross-feature impacts (`[[feature-billing]]` links) |
116
+
117
+ **Example graph query for `/dev-specs auth`:**
118
+ ```json
119
+ {
120
+ "feature": "auth",
121
+ "use_cases": ["uc-auth-001", "uc-auth-002", "uc-auth-003"],
122
+ "existing_specs": [],
123
+ "dependencies": {
124
+ "uc-auth-002": ["uc-auth-001"], // Signup depends on Login
125
+ "uc-auth-003": ["uc-auth-001"] // Forgot depends on Login
126
+ },
127
+ "cross_feature": ["feature-billing"] // Auth linked from billing
128
+ }
129
+ ```
130
+
131
+ This informs:
132
+ - Implementation order (Login first, then Signup/Forgot)
133
+ - Shared components (auth patterns used by billing)
134
+ - What specs are already done vs. needed
135
+
136
+ ### Phase 0.5: Load Quality Attributes
137
+
138
+ Read specification-level quality checklists:
139
+
140
+ ```
141
+ 1. Read skills/_quality-attributes.md
142
+ 2. Extract "Specification Level" sections for:
143
+ - Scalability (pagination, batch ops, indexes)
144
+ - Maintainability (API design, data model)
145
+ - Performance (eager/lazy loading, caching)
146
+ - Security (auth rules, validation)
147
+ - Reliability (error handling, timeouts)
148
+ - Testability (test cases, coverage)
149
+ ```
150
+
151
+ These checklists inform spec generation.
152
+
153
+ ### Phase 0.6: Get Architecture Decisions
154
+
155
+ Call `/dev-arch` for patterns to use:
156
+
157
+ ```
158
+ 1. Check: plans/features/{feature}/architecture.md exists?
159
+ → Yes: Read and use those decisions
160
+ → No: Call dev-arch to generate
161
+
162
+ 2. dev-arch provides:
163
+ → API patterns (REST conventions, response format)
164
+ → Data patterns (ORM, schema conventions)
165
+ → Component patterns (structure, state management)
166
+ → Auth patterns (how to secure endpoints)
167
+
168
+ 3. Use these patterns in spec generation
169
+ ```
170
+
171
+ **Example from architecture.md:**
172
+
173
+ ```markdown
174
+ ## Patterns to Follow
175
+
176
+ ### API Patterns
177
+ - RESTful: `/{resource}` and `/{resource}/:id`
178
+ - Response: `{ data, error, meta }`
179
+ - Auth: Bearer token in header
180
+
181
+ ### Data Patterns
182
+ - ORM: Prisma
183
+ - Soft deletes: deletedAt field
184
+ - Timestamps: createdAt, updatedAt
185
+ ```
186
+
187
+ Specs will use these patterns for consistency.
188
+
189
+ ### Phase 1: Gather Context
190
+
191
+ 1. **Read BRD use cases** for the feature
192
+ - `plans/brd/use-cases/UC-{GROUP}-*.md`
193
+ - Extract acceptance criteria, business rules
194
+
195
+ 2. **Read feature scout** (if exists)
196
+ - `plans/features/{feature}/scout.md`
197
+ - Understand existing implementation
198
+
199
+ 3. **Read architecture decisions** (from Phase 0.6)
200
+ - `plans/features/{feature}/architecture.md`
201
+ - Use established patterns
202
+
203
+ 4. **Read additional inputs** (if provided)
204
+ - API specs → Extract endpoints, contracts
205
+ - DB schema → Understand data model
206
+ - Design docs → UI requirements
207
+
208
+ 5. **Ask clarifying questions** using `AskUserQuestion`:
209
+
210
+ **Q1: Implementation Scope**
211
+ - Backend only
212
+ - Frontend only
213
+ - Full-stack
214
+ - API/Service only
215
+ - Mobile app
216
+
217
+ **Q2: Additional Context** (multi-select)
218
+ - Have API specs (Swagger/OpenAPI/GraphQL)
219
+ - Have DB schema file
220
+ - Have design files/links
221
+ - Have existing documentation
222
+ - None
223
+
224
+ **Q3: Testing Approach**
225
+ - Unit tests only
226
+ - Unit + Integration
227
+ - Unit + Integration + E2E
228
+ - No tests (docs only)
229
+
230
+ ### Phase 2: Analyze Impact
231
+
232
+ For each use case:
233
+
234
+ 1. **What's new?** - Files/components to create
235
+ 2. **What changes?** - Existing files to modify
236
+ 3. **What's shared?** - Reusable across UCs
237
+ 4. **Dependencies?** - What must exist first
238
+
239
+ Create impact summary:
240
+ ```markdown
241
+ ## Impact Analysis
242
+
243
+ | UC | New Files | Modified | Dependencies |
244
+ |----|-----------|----------|--------------|
245
+ | UC-AUTH-001 | 5 | 2 | shared/data-model |
246
+ | UC-AUTH-002 | 3 | 1 | UC-AUTH-001 |
247
+ ```
248
+
249
+ ### Phase 3: Generate Shared Specs
250
+
251
+ Create `specs/shared/` files:
252
+
253
+ **data-model.md:**
254
+ ```markdown
255
+ # Data Model
256
+
257
+ ## New Entities
258
+
259
+ ### User
260
+ | Field | Type | Notes |
261
+ |-------|------|-------|
262
+ | id | uuid | PK |
263
+ | email | string | Unique |
264
+ | passwordHash | string | bcrypt |
265
+
266
+ ## Schema Changes
267
+
268
+ ```sql
269
+ -- Migration: add_users_table
270
+ CREATE TABLE users (
271
+ id UUID PRIMARY KEY,
272
+ email VARCHAR(255) UNIQUE NOT NULL,
273
+ ...
274
+ );
275
+ ```
276
+
277
+ ## Relationships
278
+ {Describe entity relationships}
279
+ ```
280
+
281
+ **patterns.md:**
282
+ ```markdown
283
+ # Implementation Patterns
284
+
285
+ ## Code Style
286
+ - Follow existing patterns from scout
287
+ - {Specific conventions}
288
+
289
+ ## Error Handling
290
+ - {How to handle errors}
291
+ - {User feedback patterns}
292
+
293
+ ## API Patterns (if applicable)
294
+ - {Request/response format}
295
+ - {Authentication headers}
296
+
297
+ ## State Management (if applicable)
298
+ - {State patterns}
299
+ - {Data fetching}
300
+ ```
301
+
302
+ **security.md:**
303
+ ```markdown
304
+ # Security Considerations
305
+
306
+ ## Authentication
307
+ - {How auth works}
308
+
309
+ ## Authorization
310
+ - {Permission model}
311
+
312
+ ## Data Validation
313
+ - {Input validation rules}
314
+
315
+ ## Sensitive Data
316
+ - {What to protect, how}
317
+ ```
318
+
319
+ ### Phase 4: Generate UC Specs
320
+
321
+ For each use case, create folder with:
322
+
323
+ **README.md** (Implementation Plan):
324
+ ```markdown
325
+ # UC-{GROUP}-{NNN}: {Title}
326
+
327
+ > **Feature**: [[feature-{feature}]]
328
+ > **BRD**: [[uc-{group}-{nnn}]]
329
+ > **Status**: Draft
330
+
331
+ ## Overview
332
+ {What this UC implements}
333
+
334
+ ## Business Requirements
335
+ {From BRD - acceptance criteria}
336
+
337
+ ## Current State
338
+ {From scout - what exists}
339
+
340
+ ## Implementation Plan
341
+
342
+ ### 1. {Step 1}
343
+ - {Detail}
344
+ - {Detail}
345
+
346
+ ### 2. {Step 2}
347
+ - {Detail}
348
+
349
+ ## API Contract (if applicable)
350
+
351
+ ### {Method} {Endpoint}
352
+
353
+ **Request:**
354
+ ```json
355
+ {
356
+ "field": "type"
357
+ }
358
+ ```
359
+
360
+ **Response:**
361
+ ```json
362
+ {
363
+ "field": "type"
364
+ }
365
+ ```
366
+
367
+ **Errors:**
368
+ | Code | Reason |
369
+ |------|--------|
370
+ | 400 | Invalid input |
371
+ | 401 | Unauthorized |
372
+
373
+ ## UI Components (if applicable)
374
+
375
+ | Component | Purpose | Props |
376
+ |-----------|---------|-------|
377
+ | {Name} | {Purpose} | {Key props} |
378
+
379
+ ## Edge Cases
380
+ - {Edge case 1}
381
+ - {Edge case 2}
382
+
383
+ ## Dependencies
384
+ - [ ] {What must exist first}
385
+
386
+ ## Acceptance Mapping
387
+ | BRD Criteria | Implementation |
388
+ |--------------|----------------|
389
+ | Given X, When Y, Then Z | {How implemented} |
390
+ ```
391
+
392
+ **changes.md:**
393
+ ```markdown
394
+ # File Changes
395
+
396
+ ## New Files
397
+
398
+ | File | Purpose |
399
+ |------|---------|
400
+ | `src/api/auth/login.ts` | Login endpoint |
401
+ | `src/components/LoginForm.tsx` | Login form UI |
402
+
403
+ ## Modified Files
404
+
405
+ | File | Change |
406
+ |------|--------|
407
+ | `src/lib/auth.ts` | Add login function |
408
+ | `prisma/schema.prisma` | Add User model |
409
+
410
+ ## File Tree Preview
411
+ ```
412
+ src/
413
+ ├── api/
414
+ │ └── auth/
415
+ │ └── login.ts # NEW
416
+ ├── components/
417
+ │ └── auth/
418
+ │ └── LoginForm.tsx # NEW
419
+ └── lib/
420
+ └── auth.ts # MODIFIED
421
+ ```
422
+ ```
423
+
424
+ **tests.md:**
425
+ ```markdown
426
+ # Test Plan
427
+
428
+ ## Unit Tests
429
+
430
+ | Test | File | Description |
431
+ |------|------|-------------|
432
+ | Login validation | `login.test.ts` | Validate email/password |
433
+ | Token generation | `auth.test.ts` | JWT token creation |
434
+
435
+ ## Integration Tests
436
+
437
+ | Test | Description |
438
+ |------|-------------|
439
+ | Login flow | POST /api/auth/login with valid creds |
440
+ | Invalid login | POST /api/auth/login with wrong password |
441
+
442
+ ## E2E Tests (if applicable)
443
+
444
+ | Scenario | Steps |
445
+ |----------|-------|
446
+ | User login | Navigate to /login, enter creds, verify redirect |
447
+
448
+ ## Test Data
449
+
450
+ ```json
451
+ {
452
+ "validUser": {
453
+ "email": "test@example.com",
454
+ "password": "TestPass123!"
455
+ }
456
+ }
457
+ ```
458
+
459
+ ## Coverage Target
460
+ - Unit: 80%+
461
+ - Integration: Key paths
462
+ - E2E: Happy path + critical errors
463
+ ```
464
+
465
+ ### Phase 5: Generate Specs Index
466
+
467
+ Create `specs/README.md`:
468
+
469
+ ```markdown
470
+ # {Feature} - Implementation Specs
471
+
472
+ > **Feature**: [[feature-{feature}]]
473
+ > **Generated**: {date}
474
+ > **Use Cases**: {count}
475
+
476
+ ## Overview
477
+ {Brief description of the feature implementation}
478
+
479
+ ## Implementation Order
480
+
481
+ | Order | UC | Title | Depends On | Estimate |
482
+ |-------|-----|-------|------------|----------|
483
+ | 1 | [[uc-auth-001]] | Login | shared/* | - |
484
+ | 2 | [[uc-auth-002]] | Signup | [[uc-auth-001]] | - |
485
+ | 3 | [[uc-auth-003]] | Forgot Password | [[uc-auth-001]] | - |
486
+
487
+ ## Shared Specs
488
+ - [Data Model](./shared/data-model.md)
489
+ - [Patterns](./shared/patterns.md)
490
+ - [Security](./shared/security.md)
491
+
492
+ ## Dependencies Graph
493
+
494
+ ```mermaid
495
+ flowchart TD
496
+ shared[shared/*] --> UC001[UC-AUTH-001]
497
+ UC001 --> UC002[UC-AUTH-002]
498
+ UC001 --> UC003[UC-AUTH-003]
499
+ ```
500
+
501
+ ## Summary
502
+
503
+ | Metric | Count |
504
+ |--------|-------|
505
+ | Total Use Cases | {n} |
506
+ | New Files | {n} |
507
+ | Modified Files | {n} |
508
+ | Tests | {n} |
509
+
510
+ ## Notes
511
+ {Any implementation notes, risks, considerations}
512
+ ```
513
+
514
+ ### Phase 6: Summary
515
+
516
+ Output:
517
+ - Specs created
518
+ - Use cases covered
519
+ - Files that will change
520
+ - Dependencies identified
521
+ - Next steps
522
+
523
+ ## Tools Used
524
+
525
+ | Tool | Purpose |
526
+ |------|---------|
527
+ | `Read` | BRD, scout, input files |
528
+ | `Glob` | Find related files |
529
+ | `Write` | Create spec files |
530
+ | `AskUserQuestion` | Clarify scope |
531
+ | `WebFetch` | Fetch external docs (if URL) |
532
+ | `Context7` | Look up API/library patterns |
533
+
534
+ ### Context7 for Spec Accuracy
535
+
536
+ When writing specs, use Context7 to verify API patterns:
537
+
538
+ ```
539
+ 1. Look up framework patterns
540
+ → mcp__context7__resolve-library-id({
541
+ libraryName: "next.js",
542
+ query: "API routes patterns"
543
+ })
544
+
545
+ 2. Get specific documentation
546
+ → mcp__context7__query-docs({
547
+ libraryId: "/vercel/next.js",
548
+ query: "server actions form handling"
549
+ })
550
+ ```
551
+
552
+ **Use for:**
553
+ - API route conventions (Next.js, Express, NestJS)
554
+ - Form validation patterns (Zod, Yup)
555
+ - Database query patterns (Prisma, Drizzle)
556
+ - Authentication flows (NextAuth, Lucia)
557
+
558
+ ## Integration with Other Skills
559
+
560
+ | Skill | Relationship |
561
+ |-------|--------------|
562
+ | `/debrief` | Provides use cases (input) |
563
+ | `/dev-scout` | Provides codebase context (input) |
564
+ | `/dev-arch` | Provides architecture patterns (input) |
565
+ | `/utils/diagram` | Validates mermaid in specs |
566
+
567
+ ## Tips
568
+
569
+ - Run `/dev-scout {feature}` first for better context
570
+ - Provide API specs when available for accurate contracts
571
+ - Keep each UC spec focused - one job per UC
572
+ - Estimates are left blank for team to fill
573
+
574
+ ## References
575
+
576
+ - `references/spec-templates.md` - Template structures
577
+ - `references/checklist.md` - Spec completeness checklist