@codihaus/claude-skills 1.6.6 → 1.6.8
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.
- package/package.json +1 -1
- package/skills/debrief/SKILL.md +139 -421
- package/skills/dev-arch/SKILL.md +120 -403
- package/skills/dev-changelog/SKILL.md +67 -221
- package/skills/dev-coding/SKILL.md +170 -696
- package/skills/dev-coding/references/backend-principles.md +130 -0
- package/skills/dev-coding/references/frontend-principles.md +212 -0
- package/skills/dev-review/SKILL.md +63 -238
- package/skills/dev-scout/SKILL.md +140 -864
- package/skills/dev-scout/references/output-template.md +231 -0
- package/skills/dev-specs/SKILL.md +136 -586
- package/skills/dev-specs/references/spec-template.md +146 -0
- package/skills/dev-test/SKILL.md +79 -157
- package/src/utils/config.js +1 -1
- package/templates/scripts/safe-graph-update.sh +3 -1
- package/skills/dev-coding-backend/SKILL.md +0 -240
- package/skills/dev-coding-backend/references/fundamentals.md +0 -428
- package/skills/dev-coding-frontend/SKILL.md +0 -296
- package/skills/dev-coding-frontend/references/fundamentals.md +0 -577
- package/skills/dev-scout/references/feature-patterns.md +0 -210
- package/skills/dev-scout/references/file-patterns.md +0 -252
- package/skills/dev-scout/references/stack-patterns.md +0 -371
- package/skills/dev-scout/references/tech-detection.md +0 -211
- package/skills/dev-specs/references/checklist.md +0 -176
- package/skills/dev-specs/references/spec-templates.md +0 -460
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dev-specs
|
|
3
|
-
description: Generate implementation specifications from BRD use cases
|
|
4
|
-
version:
|
|
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
|
|
12
|
-
> - **During**: Calls `/dev-arch` for patterns
|
|
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
|
|
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,189 @@ 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
|
-
##
|
|
33
|
+
## Core Rule: WHAT, Not HOW
|
|
36
34
|
|
|
37
|
-
|
|
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
|
-
**
|
|
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
|
-
|
|
43
|
+
**Exclude:**
|
|
44
|
+
- Pseudocode (gets stale)
|
|
45
|
+
- Detailed implementation (discovered during coding)
|
|
46
|
+
- Code examples (reference existing patterns instead)
|
|
44
47
|
|
|
45
|
-
|
|
48
|
+
## Prerequisites
|
|
46
49
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
├──
|
|
60
|
-
├── scout.md # From /dev-scout
|
|
61
|
-
│
|
|
58
|
+
├── codebase-context.md # From /dev-scout
|
|
62
59
|
└── specs/
|
|
63
|
-
├── README.md
|
|
64
|
-
|
|
65
|
-
├──
|
|
66
|
-
│ ├──
|
|
67
|
-
│
|
|
68
|
-
|
|
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
|
-
##
|
|
80
|
-
|
|
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"
|
|
68
|
+
## Expected Outcome
|
|
88
69
|
|
|
89
|
-
|
|
90
|
-
→ No: Error "Feature not found in BRD"
|
|
70
|
+
**Lean specs** (~150 lines per UC) that define **WHAT to build**, not HOW.
|
|
91
71
|
|
|
92
|
-
|
|
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)
|
|
72
|
+
**Output structure:**
|
|
168
73
|
```
|
|
74
|
+
plans/features/{feature}/
|
|
75
|
+
├── codebase-context.md # From /dev-scout
|
|
76
|
+
└── specs/
|
|
77
|
+
├── README.md # Index, implementation order
|
|
78
|
+
├── shared/ # Shared across UCs
|
|
79
|
+
│ ├── data-model.md
|
|
80
|
+
│ ├── patterns.md
|
|
81
|
+
│ └── security.md
|
|
82
|
+
└── UC-XXX-001-slug.md # Lean spec per UC
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Each UC spec includes:**
|
|
86
|
+
- Requirements (bulleted, testable)
|
|
87
|
+
- Technical constraints (stack-aware from tech-context.md)
|
|
88
|
+
- Acceptance criteria (testable outcomes)
|
|
89
|
+
- Files to modify (where to work)
|
|
90
|
+
- API contract (if applicable)
|
|
91
|
+
- Dependencies (what must exist first)
|
|
92
|
+
- Implementation notes (DO/DON'T)
|
|
93
|
+
|
|
94
|
+
**Each UC spec does NOT include:**
|
|
95
|
+
- Pseudocode (gets stale)
|
|
96
|
+
- Detailed implementation steps
|
|
97
|
+
- Code examples (reference existing patterns instead)
|
|
98
|
+
|
|
99
|
+
## Success Criteria
|
|
100
|
+
|
|
101
|
+
- Engineer knows WHAT to build
|
|
102
|
+
- Engineer knows WHERE to build it (file checklist)
|
|
103
|
+
- Engineer can verify success (acceptance criteria)
|
|
104
|
+
- Specs reference existing patterns, don't rewrite them
|
|
105
|
+
- Stack-aware (uses tech-context.md patterns)
|
|
106
|
+
- ~150 lines per UC spec max
|
|
169
107
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
### Phase 0.6: Get Architecture Decisions
|
|
173
|
-
|
|
174
|
-
Call `/dev-arch` for patterns to use:
|
|
108
|
+
## Prerequisites
|
|
175
109
|
|
|
176
|
-
|
|
177
|
-
1.
|
|
178
|
-
|
|
179
|
-
|
|
110
|
+
Auto-checked and resolved:
|
|
111
|
+
1. `plans/brd/` exists with use cases
|
|
112
|
+
2. `plans/features/{feature}/` exists
|
|
113
|
+
3. `plans/brd/tech-context.md` exists (auto-runs project scout if missing)
|
|
114
|
+
4. `plans/features/{feature}/codebase-context.md` exists (auto-runs feature scout if missing)
|
|
180
115
|
|
|
181
|
-
|
|
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)
|
|
116
|
+
## Context Sources
|
|
186
117
|
|
|
187
|
-
|
|
188
|
-
|
|
118
|
+
**Read these to understand HOW:**
|
|
119
|
+
- `tech-context.md` - Project patterns (API, data, structure)
|
|
120
|
+
- `codebase-context.md` - Feature-specific implementation
|
|
121
|
+
- `architecture.md` - Architecture decisions (call `/dev-arch` if missing)
|
|
122
|
+
- `_quality-attributes.md` - Specification Level checklist
|
|
189
123
|
|
|
190
|
-
**
|
|
124
|
+
**Read these to understand WHAT:**
|
|
125
|
+
- `plans/brd/use-cases/{feature}/*.md` - Business requirements
|
|
126
|
+
- `plans/docs-graph.json` - Dependencies between UCs
|
|
191
127
|
|
|
192
|
-
|
|
193
|
-
## Patterns to Follow
|
|
128
|
+
## User Questions
|
|
194
129
|
|
|
195
|
-
|
|
196
|
-
-
|
|
197
|
-
|
|
198
|
-
|
|
130
|
+
Ask via `AskUserQuestion`:
|
|
131
|
+
1. **Scope:** Backend only | Frontend only | Full-stack | API/Service | Mobile
|
|
132
|
+
2. **Additional Context:** API specs | DB schema | Design files | Docs
|
|
133
|
+
3. **Testing:** Unit only | Unit + Integration | Unit + Integration + E2E | No tests
|
|
199
134
|
|
|
200
|
-
|
|
201
|
-
- ORM: Prisma
|
|
202
|
-
- Soft deletes: deletedAt field
|
|
203
|
-
- Timestamps: createdAt, updatedAt
|
|
204
|
-
```
|
|
135
|
+
## Impact Analysis
|
|
205
136
|
|
|
206
|
-
|
|
137
|
+
For each UC, identify:
|
|
138
|
+
- What's new? (files to create)
|
|
139
|
+
- What changes? (files to modify)
|
|
140
|
+
- What's shared? (reusable across UCs → specs/shared/)
|
|
141
|
+
- Dependencies? (what must exist first)
|
|
207
142
|
|
|
208
|
-
|
|
143
|
+
## Shared Specs
|
|
209
144
|
|
|
210
|
-
|
|
145
|
+
Create `specs/shared/` for cross-UC concerns:
|
|
146
|
+
- `data-model.md` - Schema changes, entities, relationships
|
|
147
|
+
- `patterns.md` - Pattern references (not pseudocode)
|
|
148
|
+
- `security.md` - Auth, permissions, validation rules
|
|
211
149
|
|
|
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
|
-
```
|
|
150
|
+
## Index Generation
|
|
238
151
|
|
|
239
|
-
|
|
152
|
+
Create `specs/README.md` with:
|
|
153
|
+
- Implementation order
|
|
154
|
+
- Dependencies between specs
|
|
155
|
+
- Quick reference to all UCs
|
|
240
156
|
|
|
241
|
-
|
|
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" |
|
|
157
|
+
## Stack Awareness
|
|
247
158
|
|
|
248
|
-
**
|
|
159
|
+
Specs **must** read `tech-context.md` to know the right approach:
|
|
249
160
|
|
|
250
161
|
| Stack Aspect | Spec Impact |
|
|
251
162
|
|--------------|-------------|
|
|
252
|
-
| BaaS (Directus) |
|
|
253
|
-
| Composables
|
|
254
|
-
| Zod
|
|
255
|
-
| Server Actions
|
|
256
|
-
| React Query | Wrap in useQuery, not raw fetch |
|
|
257
|
-
|
|
258
|
-
**Example: spec for "Add user profile"**
|
|
163
|
+
| BaaS (Directus) | Use collections, not tables |
|
|
164
|
+
| Composables | New API calls in composables/ |
|
|
165
|
+
| Zod | Schemas in shared/schemas/ |
|
|
166
|
+
| Server Actions | Use 'use server', not API routes |
|
|
259
167
|
|
|
260
|
-
|
|
168
|
+
**Example:**
|
|
261
169
|
```markdown
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
170
|
+
## Technical Constraints
|
|
171
|
+
- Use existing `useUserProfile` composable
|
|
172
|
+
- Follow VeeValidate + Zod pattern from auth forms
|
|
173
|
+
- Profile fields exist in Directus users collection
|
|
265
174
|
```
|
|
266
175
|
|
|
267
|
-
|
|
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
|
-
```
|
|
176
|
+
## Spec Format
|
|
273
177
|
|
|
274
|
-
|
|
178
|
+
See `references/spec-template.md` for structure.
|
|
275
179
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
180
|
+
**Max:** ~150 lines per UC
|
|
181
|
+
**Focus:** Requirements + acceptance criteria
|
|
182
|
+
**No:** Pseudocode or detailed HOW
|
|
279
183
|
|
|
280
|
-
|
|
281
|
-
- `plans/features/{feature}/scout.md`
|
|
282
|
-
- Understand existing implementation
|
|
184
|
+
## Quality Questions
|
|
283
185
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
186
|
+
Ask user for:
|
|
187
|
+
1. **Scope:** Backend only | Frontend only | Full-stack | API/Service | Mobile
|
|
188
|
+
2. **Additional Context:** API specs | DB schema | Design files | Docs
|
|
189
|
+
3. **Testing:** Unit only | Unit + Integration | Unit + Integration + E2E | No tests
|
|
287
190
|
|
|
288
|
-
|
|
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)
|
|
314
|
-
|
|
315
|
-
### 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
|
-
```
|
|
333
|
-
|
|
334
|
-
### Phase 3: Generate Shared Specs
|
|
335
|
-
|
|
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`:
|
|
553
|
-
|
|
554
|
-
```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]
|
|
584
|
-
```
|
|
585
|
-
|
|
586
|
-
## Summary
|
|
587
|
-
|
|
588
|
-
| Metric | Count |
|
|
589
|
-
|--------|-------|
|
|
590
|
-
| Total Use Cases | {n} |
|
|
591
|
-
| New Files | {n} |
|
|
592
|
-
| Modified Files | {n} |
|
|
593
|
-
| Tests | {n} |
|
|
594
|
-
|
|
595
|
-
## Notes
|
|
596
|
-
{Any implementation notes, risks, considerations}
|
|
597
|
-
```
|
|
598
|
-
|
|
599
|
-
### Phase 6: Summary
|
|
600
|
-
|
|
601
|
-
Output:
|
|
602
|
-
- Specs created
|
|
603
|
-
- Use cases covered
|
|
604
|
-
- Files that will change
|
|
605
|
-
- Dependencies identified
|
|
606
|
-
- Next steps
|
|
607
|
-
|
|
608
|
-
## Tools Used
|
|
191
|
+
## Tools
|
|
609
192
|
|
|
610
193
|
| Tool | Purpose |
|
|
611
194
|
|------|---------|
|
|
612
|
-
| `Read` | BRD,
|
|
195
|
+
| `Read` | BRD, tech-context, codebase-context, architecture |
|
|
613
196
|
| `Glob` | Find related files |
|
|
614
197
|
| `Write` | Create spec files |
|
|
615
198
|
| `AskUserQuestion` | Clarify scope |
|
|
616
|
-
| `WebFetch` | Fetch external docs (if URL) |
|
|
617
199
|
| `Context7` | Look up API/library patterns |
|
|
618
200
|
|
|
619
|
-
|
|
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 |
|
|
201
|
+
## Philosophy
|
|
651
202
|
|
|
652
|
-
|
|
653
|
-
-
|
|
654
|
-
-
|
|
655
|
-
-
|
|
656
|
-
- Whether to use BaaS or direct DB
|
|
203
|
+
Specs are **contracts**, not **pseudocode**.
|
|
204
|
+
- Define WHAT (requirements)
|
|
205
|
+
- Reference HOW (existing patterns)
|
|
206
|
+
- Implementation discovers details fresh during `/dev-coding`
|
|
657
207
|
|
|
658
|
-
##
|
|
208
|
+
## Anti-Patterns
|
|
659
209
|
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
-
|
|
210
|
+
❌ Writing 500+ line implementation plans
|
|
211
|
+
❌ Including pseudocode that gets stale
|
|
212
|
+
❌ Rewriting existing patterns
|
|
213
|
+
❌ Over-specifying implementation details
|
|
214
|
+
❌ Ignoring tech-context.md (suggests wrong approach)
|
|
664
215
|
|
|
665
|
-
##
|
|
216
|
+
## Reference
|
|
666
217
|
|
|
667
|
-
|
|
668
|
-
- `references/checklist.md` - Spec completeness checklist
|
|
218
|
+
See `references/spec-template.md` for output structure (principle + empty template).
|