@codihaus/claude-skills 1.6.6 → 1.6.7

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