@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,761 +1,235 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dev-coding
|
|
3
|
-
description: Implement features
|
|
4
|
-
version:
|
|
3
|
+
description: Implement features as a Principal Engineering Developer
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# /dev-coding - Implementation Skill
|
|
8
8
|
|
|
9
9
|
> **Skill Awareness**: See `skills/_registry.md` for all available skills.
|
|
10
|
-
> - **Before**: Ensure `/dev-specs` completed
|
|
11
|
-
> - **
|
|
12
|
-
> - **Reads**: `_quality-attributes.md` (Implementation Level)
|
|
10
|
+
> - **Before**: Ensure `/dev-specs` completed
|
|
11
|
+
> - **Reads**: Principles (references/), project specifics (tech-context.md), requirements (specs)
|
|
13
12
|
> - **After**: Auto-triggers `/dev-test` to verify implementation
|
|
14
|
-
> - **
|
|
13
|
+
> - **Review**: Suggest `/dev-review` for code review
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
Work as a **Principal Engineering Developer**: apply universal principles with project-specific implementation.
|
|
17
16
|
|
|
18
17
|
## When to Use
|
|
19
18
|
|
|
20
|
-
- Implement
|
|
21
|
-
- Build feature
|
|
22
|
-
-
|
|
19
|
+
- Implement use case from specs
|
|
20
|
+
- Build feature (backend, frontend, or both)
|
|
21
|
+
- Apply project patterns to new code
|
|
23
22
|
|
|
24
23
|
## Usage
|
|
25
24
|
|
|
26
25
|
```
|
|
26
|
+
/dev-coding auth # Implement feature (will ask which UCs)
|
|
27
27
|
/dev-coding UC-AUTH-001 # Implement specific UC
|
|
28
|
-
/dev-coding auth # Implement all UCs for feature
|
|
29
|
-
/dev-coding UC-AUTH-001 --backend # Backend only
|
|
30
|
-
/dev-coding UC-AUTH-001 --frontend # Frontend only
|
|
31
28
|
```
|
|
32
29
|
|
|
33
|
-
##
|
|
34
|
-
|
|
35
|
-
Before using, ensure:
|
|
36
|
-
1. `/debrief` completed → BRD exists
|
|
37
|
-
2. `/dev-specs` completed → Implementation plan exists
|
|
38
|
-
3. `/dev-scout` completed → Codebase patterns known
|
|
39
|
-
|
|
40
|
-
## Output
|
|
41
|
-
|
|
42
|
-
Updates to codebase:
|
|
43
|
-
- New/modified files
|
|
44
|
-
- Tests (if required)
|
|
45
|
-
- Updated docs-graph
|
|
46
|
-
|
|
47
|
-
Updates to specs:
|
|
48
|
-
- Task status in `plans/features/{feature}/specs/`
|
|
49
|
-
- Implementation notes
|
|
50
|
-
|
|
51
|
-
## Workflow
|
|
52
|
-
|
|
53
|
-
### Phase 0: Determine Scope & Select UCs
|
|
54
|
-
|
|
55
|
-
**Before starting, determine which use cases to implement.**
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
Parse user input:
|
|
59
|
-
- /dev-coding UC-AUTH-001 → Specific UC (skip to Phase 1)
|
|
60
|
-
- /dev-coding auth → Feature-level (need UC selection)
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
**If user specified feature name (not specific UC), show UC selection:**
|
|
64
|
-
|
|
65
|
-
1. **List available UCs:**
|
|
66
|
-
```
|
|
67
|
-
Available Use Cases for auth:
|
|
68
|
-
1. UC-AUTH-001: User Login
|
|
69
|
-
2. UC-AUTH-002: User Signup
|
|
70
|
-
3. UC-AUTH-003: Password Reset
|
|
71
|
-
4. UC-AUTH-004: Email Verification
|
|
72
|
-
5. UC-AUTH-005: Two-Factor Authentication
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
2. **Ask implementation mode** (use AskUserQuestion):
|
|
76
|
-
- **One by one (Recommended)**: Implement 1 UC, test, then ask for next
|
|
77
|
-
- **Multiple (custom selection)**: Select specific UCs (e.g., "1,3-5,7")
|
|
78
|
-
- **All at once**: Implement all UCs in sequence
|
|
79
|
-
|
|
80
|
-
3. **Process selection:**
|
|
81
|
-
- **One by one**: Implement → Test → Ask to continue (safest, recommended)
|
|
82
|
-
- **Multiple**: Implement → Test each UC → Auto-continue (no prompts between)
|
|
83
|
-
- **All at once**: Implement → Test each UC → Auto-continue (no prompts)
|
|
84
|
-
|
|
85
|
-
**Parsing examples:**
|
|
86
|
-
| Input | Result |
|
|
87
|
-
|-------|--------|
|
|
88
|
-
| `1,3,5` | UCs 1, 3, 5 |
|
|
89
|
-
| `1-3` | UCs 1, 2, 3 |
|
|
90
|
-
| `1,3-5,7` | UCs 1, 3, 4, 5, 7 |
|
|
91
|
-
| `all` | All UCs |
|
|
92
|
-
|
|
93
|
-
**After selection, store plan:**
|
|
94
|
-
```
|
|
95
|
-
implementationPlan = {
|
|
96
|
-
mode: "one-by-one" | "multiple" | "all",
|
|
97
|
-
ucs: [UC-AUTH-001, UC-AUTH-003, ...],
|
|
98
|
-
currentIndex: 0
|
|
99
|
-
}
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
**Flow Visualization:**
|
|
103
|
-
|
|
104
|
-
```
|
|
105
|
-
Mode: ONE BY ONE (Recommended)
|
|
106
|
-
─────────────────────────────
|
|
107
|
-
UC #1: Implement → Test → ✓ Pass → [ASK USER: Continue?]
|
|
108
|
-
↓ Yes
|
|
109
|
-
UC #2: Implement → Test → ✓ Pass → [ASK USER: Continue?]
|
|
110
|
-
↓ Yes
|
|
111
|
-
UC #3: Implement → Test → ✓ Pass → Done
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
Mode: MULTIPLE / ALL AT ONCE
|
|
115
|
-
────────────────────────────
|
|
116
|
-
UC #1: Implement → Test → ✓ Pass → [Auto-continue]
|
|
117
|
-
↓
|
|
118
|
-
UC #2: Implement → Test → ✓ Pass → [Auto-continue]
|
|
119
|
-
↓
|
|
120
|
-
UC #3: Implement → Test → ✓ Pass → Done
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
**Key Point:** Testing (Phase 7) is a checkpoint after each UC in ALL modes.
|
|
124
|
-
- "One by one": Test passes → Ask user before next UC
|
|
125
|
-
- "Multiple/All": Test passes → Automatically start next UC
|
|
126
|
-
|
|
127
|
-
### Phase 1: Load Context
|
|
128
|
-
|
|
129
|
-
```
|
|
130
|
-
1. Read UC spec
|
|
131
|
-
→ plans/features/{feature}/specs/{UC-ID}/README.md
|
|
132
|
-
|
|
133
|
-
2. Read scout for patterns
|
|
134
|
-
→ plans/features/{feature}/scout.md OR plans/scout/README.md
|
|
135
|
-
|
|
136
|
-
3. Read stack.md and stack knowledge (CRITICAL)
|
|
137
|
-
→ plans/scout/stack.md
|
|
138
|
-
→ Check "Stack Knowledge References" section
|
|
139
|
-
→ Read each referenced knowledge/stacks/*.md file
|
|
140
|
-
→ Use "For /dev-coding" sections for implementation patterns
|
|
141
|
-
|
|
142
|
-
Examples:
|
|
143
|
-
- Directus project → Read knowledge/stacks/directus/_index.md
|
|
144
|
-
- Nuxt project → Read knowledge/stacks/nuxt/_index.md
|
|
145
|
-
- Next.js project → Read knowledge/stacks/nextjs/_index.md
|
|
146
|
-
|
|
147
|
-
4. Read architecture decisions
|
|
148
|
-
→ plans/features/{feature}/architecture.md
|
|
149
|
-
|
|
150
|
-
5. Read quality attributes (Implementation Level)
|
|
151
|
-
→ skills/_quality-attributes.md
|
|
152
|
-
→ Focus on: query efficiency, memory, concurrency, error handling
|
|
153
|
-
|
|
154
|
-
6. Read docs-graph for dependencies
|
|
155
|
-
→ plans/docs-graph.json
|
|
156
|
-
|
|
157
|
-
7. Check: Are dependencies complete?
|
|
158
|
-
→ If UC depends on another UC, verify it's done
|
|
159
|
-
→ Warn if not, let user decide to proceed
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
### Phase 2: Determine Work Type
|
|
163
|
-
|
|
164
|
-
Based on spec, determine what's needed:
|
|
165
|
-
|
|
166
|
-
| Spec Contains | Work Type | Skill to Load |
|
|
167
|
-
|---------------|-----------|---------------|
|
|
168
|
-
| API endpoints, schema | Backend | dev-coding-backend |
|
|
169
|
-
| UI components, pages | Frontend | dev-coding-frontend |
|
|
170
|
-
| Both | Full-stack | Backend first, then Frontend |
|
|
171
|
-
|
|
172
|
-
```
|
|
173
|
-
Read spec → Extract:
|
|
174
|
-
- API changes needed?
|
|
175
|
-
- Schema/DB changes needed?
|
|
176
|
-
- UI components needed?
|
|
177
|
-
- Pages/routes needed?
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
### Phase 3: Load Sub-Skills
|
|
181
|
-
|
|
182
|
-
**If backend work needed:**
|
|
183
|
-
```
|
|
184
|
-
Read: skills/dev-coding-backend/SKILL.md
|
|
185
|
-
Read: skills/dev-coding-backend/references/{tech}.md (if exists)
|
|
186
|
-
|
|
187
|
-
Tech detected from scout:
|
|
188
|
-
- directus → directus.md
|
|
189
|
-
- node → node.md
|
|
190
|
-
- prisma → prisma.md
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
**If frontend work needed:**
|
|
194
|
-
```
|
|
195
|
-
Read: skills/dev-coding-frontend/SKILL.md
|
|
196
|
-
Read: skills/dev-coding-frontend/references/{tech}.md (if exists)
|
|
197
|
-
|
|
198
|
-
Tech detected from scout:
|
|
199
|
-
- nextjs → nextjs.md
|
|
200
|
-
- vue → vue.md
|
|
201
|
-
- react → react.md
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
### Phase 4: Execute Backend (if needed)
|
|
205
|
-
|
|
206
|
-
Follow dev-coding-backend workflow:
|
|
30
|
+
## Role: Principal Engineering Developer
|
|
207
31
|
|
|
208
|
-
|
|
209
|
-
- Create/modify collections, tables, models
|
|
210
|
-
- Run migrations
|
|
211
|
-
- Verify schema
|
|
32
|
+
You have universal engineering principles and apply them to this specific project.
|
|
212
33
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
34
|
+
**Workflow:**
|
|
35
|
+
1. Load principles (references/) + project specifics (tech-context.md)
|
|
36
|
+
2. Discover details just-in-time (Glob/Grep/Read as needed)
|
|
37
|
+
3. Apply principles based on what requirement needs
|
|
38
|
+
4. Validate against acceptance criteria
|
|
217
39
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
-H "Content-Type: application/json" \
|
|
223
|
-
-d '{"email":"test@test.com","password":"test"}'
|
|
224
|
-
```
|
|
40
|
+
**Principles:**
|
|
41
|
+
- See `references/backend-principles.md` for API, data, security principles
|
|
42
|
+
- See `references/frontend-principles.md` for UI, component, state principles
|
|
43
|
+
- See `tech-context.md` for how THIS project implements them
|
|
225
44
|
|
|
226
|
-
|
|
227
|
-
- Endpoints available
|
|
228
|
-
- Request/response shapes
|
|
229
|
-
- Auth requirements
|
|
230
|
-
|
|
231
|
-
### Phase 5: Execute Frontend (if needed)
|
|
232
|
-
|
|
233
|
-
Follow dev-coding-frontend workflow:
|
|
234
|
-
|
|
235
|
-
1. **Components** (if needed)
|
|
236
|
-
- Create/modify UI components
|
|
237
|
-
- Follow project conventions from scout
|
|
238
|
-
|
|
239
|
-
2. **Pages/Routes** (if needed)
|
|
240
|
-
- Create page files
|
|
241
|
-
- Set up routing
|
|
242
|
-
|
|
243
|
-
3. **API Integration**
|
|
244
|
-
- Connect to backend (use info from Phase 3)
|
|
245
|
-
- Handle loading, error states
|
|
45
|
+
## Prerequisites
|
|
246
46
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
47
|
+
1. `/dev-specs {feature}` completed → specs exist
|
|
48
|
+
2. `plans/brd/tech-context.md` exists → patterns known
|
|
49
|
+
3. `plans/features/{feature}/codebase-context.md` exists (optional, helpful)
|
|
50
|
+
|
|
51
|
+
## Expected Outcome
|
|
52
|
+
|
|
53
|
+
Implemented feature that meets all acceptance criteria from spec.
|
|
54
|
+
|
|
55
|
+
**What "done" looks like:**
|
|
56
|
+
- All requirements from spec completed
|
|
57
|
+
- All acceptance criteria pass
|
|
58
|
+
- Patterns from tech-context.md followed
|
|
59
|
+
- Files from spec checklist created/modified
|
|
60
|
+
- No security vulnerabilities
|
|
61
|
+
- Tests passing (if applicable)
|
|
62
|
+
- Code quality maintained
|
|
63
|
+
|
|
64
|
+
## Role: Principal Engineering Developer
|
|
65
|
+
|
|
66
|
+
You have universal engineering knowledge and apply it to this specific project.
|
|
250
67
|
|
|
251
|
-
|
|
68
|
+
**You know:**
|
|
69
|
+
- Universal principles (references/backend-principles.md, frontend-principles.md)
|
|
70
|
+
- Project-specific patterns (tech-context.md)
|
|
71
|
+
- Business requirements (specs/*.md)
|
|
72
|
+
- How to verify success (acceptance criteria)
|
|
73
|
+
|
|
74
|
+
**You can:**
|
|
75
|
+
- Discover details just-in-time (Glob/Grep/Read as needed)
|
|
76
|
+
- Apply principles based on what requirement needs
|
|
77
|
+
- Validate against acceptance criteria
|
|
78
|
+
- Fix and iterate until passing
|
|
252
79
|
|
|
253
|
-
|
|
80
|
+
## Implementation Approach
|
|
254
81
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
```
|
|
82
|
+
**1. Load Context (once):**
|
|
83
|
+
- Read spec → Get requirements, acceptance criteria, files to modify
|
|
84
|
+
- Read tech-context.md → Get project patterns (API, data, UI, validation, etc.)
|
|
85
|
+
- Read codebase-context.md → Get feature-specific implementation
|
|
86
|
+
- Read architecture.md (if exists) → Get architecture decisions
|
|
87
|
+
- Load universal principles (references/) as needed
|
|
262
88
|
|
|
263
|
-
**
|
|
264
|
-
-
|
|
265
|
-
-
|
|
266
|
-
-
|
|
89
|
+
**2. Plan Work:**
|
|
90
|
+
- If feature name given (not specific UC): Ask implementation mode
|
|
91
|
+
- One by one: Implement → Test → Ask next (Recommended)
|
|
92
|
+
- Multiple: Select UCs → Implement all
|
|
93
|
+
- All at once: Implement all UCs
|
|
94
|
+
- Create TODO list from spec requirements
|
|
267
95
|
|
|
268
|
-
|
|
96
|
+
**3. Implement (for each requirement):**
|
|
97
|
+
- **Understand:** What to build, where to build it, success criteria
|
|
98
|
+
- **Apply:** Use principles + project patterns based on what requirement needs
|
|
99
|
+
- API work? → Apply API principles + project's API pattern
|
|
100
|
+
- UI work? → Apply component principles + project's UI pattern
|
|
101
|
+
- Data work? → Apply data access principles + project's data pattern
|
|
102
|
+
- Full-stack? → Apply multiple principles as needed
|
|
103
|
+
- **Discover:** Find details just-in-time (Glob/Grep/Read)
|
|
104
|
+
- **Build:** Create/modify files following patterns and conventions
|
|
105
|
+
- **Validate:** Check acceptance criteria, fix if needed
|
|
106
|
+
- **Test:** Write/run tests if applicable
|
|
269
107
|
|
|
270
|
-
|
|
108
|
+
**4. Complete:**
|
|
109
|
+
- Verify all acceptance criteria met
|
|
110
|
+
- Verify all files from checklist done
|
|
111
|
+
- Update spec with status
|
|
112
|
+
- Git commit (if requested)
|
|
113
|
+
- Move to next UC or trigger `/dev-test`
|
|
271
114
|
|
|
272
|
-
|
|
273
|
-
```
|
|
274
|
-
[ ] Scalability
|
|
275
|
-
- No N+1 queries (use joins/includes)
|
|
276
|
-
- Select only needed fields
|
|
277
|
-
- Limit result sets
|
|
278
|
-
- Connection pooling used
|
|
279
|
-
|
|
280
|
-
[ ] Maintainability
|
|
281
|
-
- Functions do one thing
|
|
282
|
-
- Names describe intent
|
|
283
|
-
- No magic numbers/strings
|
|
284
|
-
|
|
285
|
-
[ ] Performance
|
|
286
|
-
- Database queries optimized
|
|
287
|
-
- Heavy computation cached or async
|
|
288
|
-
- No unnecessary re-renders (frontend)
|
|
289
|
-
|
|
290
|
-
[ ] Security
|
|
291
|
-
- All input validated
|
|
292
|
-
- SQL injection prevented
|
|
293
|
-
- XSS prevented
|
|
294
|
-
- No hardcoded secrets
|
|
295
|
-
|
|
296
|
-
[ ] Reliability
|
|
297
|
-
- Errors caught and handled
|
|
298
|
-
- User-friendly error messages
|
|
299
|
-
- Timeouts on external calls
|
|
300
|
-
|
|
301
|
-
[ ] Testability
|
|
302
|
-
- Pure functions where possible
|
|
303
|
-
- Dependencies injected
|
|
304
|
-
```
|
|
115
|
+
## Just-in-Time Discovery
|
|
305
116
|
|
|
306
|
-
|
|
307
|
-
```
|
|
308
|
-
[ ] Code follows project conventions (from scout)
|
|
309
|
-
[ ] No linting errors
|
|
310
|
-
[ ] No type errors
|
|
311
|
-
[ ] Tests pass (if project has tests)
|
|
312
|
-
[ ] No console.log / debug code left
|
|
313
|
-
```
|
|
117
|
+
Don't pre-load everything. Discover when needed:
|
|
314
118
|
|
|
315
|
-
|
|
119
|
+
**Examples:**
|
|
120
|
+
- Need API wrapper location? → Glob: `**/api.*`, `**/request.*`
|
|
121
|
+
- Need schema location? → Check tech-context.md or Glob: `**/schemas/*`
|
|
122
|
+
- Need validation example? → Read existing validation file
|
|
123
|
+
- Need composable location? → Glob: `composables/use-*.{ts,js}`
|
|
316
124
|
|
|
317
|
-
**
|
|
125
|
+
**Don't:**
|
|
126
|
+
- ❌ Pre-read all files
|
|
127
|
+
- ❌ List all components upfront
|
|
128
|
+
- ❌ Memorize function names (look up when needed)
|
|
318
129
|
|
|
319
|
-
|
|
130
|
+
## How Principles Work
|
|
320
131
|
|
|
321
132
|
```
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
→ Default: http://localhost:3000/{path}
|
|
328
|
-
|
|
329
|
-
3. Run E2E test for CURRENT UC
|
|
330
|
-
→ Navigate to page
|
|
331
|
-
→ Execute user flow from spec
|
|
332
|
-
→ Capture errors
|
|
333
|
-
|
|
334
|
-
4. Run regression tests (if previous UCs exist)
|
|
335
|
-
→ Quick smoke test of previously completed UCs
|
|
336
|
-
→ Ensures new UC didn't break existing functionality
|
|
337
|
-
→ Example: UC-AUTH-002 (Signup) shouldn't break UC-AUTH-001 (Login)
|
|
338
|
-
|
|
339
|
-
Regression approach:
|
|
340
|
-
- If only 1-2 previous UCs: Full test
|
|
341
|
-
- If 3+ previous UCs: Critical path only (login flow, main actions)
|
|
342
|
-
- Skip if UCs are completely independent
|
|
343
|
-
|
|
344
|
-
5. Analyze results
|
|
345
|
-
→ Console errors?
|
|
346
|
-
→ Network failures?
|
|
347
|
-
→ Visual issues?
|
|
348
|
-
→ Regression failures?
|
|
349
|
-
|
|
350
|
-
6. Handle results:
|
|
351
|
-
- All pass (current + regression) → Proceed to Phase 8 (Complete)
|
|
352
|
-
- Current UC fails → Fix current UC and re-test
|
|
353
|
-
- Regression fails → Fix regression issue (may need to update previous UC)
|
|
354
|
-
|
|
355
|
-
IMPORTANT: Do NOT proceed to next UC until:
|
|
356
|
-
- Current UC passes all tests
|
|
357
|
-
- Previous UCs still work (regression pass)
|
|
358
|
-
This ensures quality and prevents cascading failures.
|
|
133
|
+
Universal Principles (references/)
|
|
134
|
+
+
|
|
135
|
+
Project Specifics (tech-context.md)
|
|
136
|
+
=
|
|
137
|
+
Implementation
|
|
359
138
|
```
|
|
360
139
|
|
|
361
|
-
**
|
|
140
|
+
**Apply what the requirement needs:**
|
|
141
|
+
- API endpoint? → backend-principles.md + tech-context.md (API patterns)
|
|
142
|
+
- UI component? → frontend-principles.md + tech-context.md (component patterns)
|
|
143
|
+
- Form validation? → Both + tech-context.md (validation pattern)
|
|
144
|
+
- Full-stack feature? → Use all as needed
|
|
362
145
|
|
|
363
|
-
|
|
364
|
-
// 1. Navigate
|
|
365
|
-
await mcp__playwright__browser_navigate({ url: testUrl });
|
|
146
|
+
## After Implementation
|
|
366
147
|
|
|
367
|
-
|
|
368
|
-
|
|
148
|
+
**When all UCs complete:**
|
|
149
|
+
- Auto-trigger `/dev-test` (if available)
|
|
150
|
+
- If tests fail: Fix issues, re-run
|
|
151
|
+
- If tests pass: Suggest `/dev-review`
|
|
369
152
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
const networkRequests = await mcp__playwright__browser_network_requests({});
|
|
153
|
+
**For each UC complete:**
|
|
154
|
+
- Update spec status
|
|
155
|
+
- Commit if requested (follow git conventions from tech-context.md)
|
|
156
|
+
- Continue to next UC (based on implementation mode)
|
|
375
157
|
|
|
376
|
-
|
|
377
|
-
if (hasErrors) {
|
|
378
|
-
// Fix and re-test (max 3 iterations)
|
|
379
|
-
}
|
|
380
|
-
```
|
|
381
|
-
|
|
382
|
-
**On Test Failure:**
|
|
383
|
-
|
|
384
|
-
```markdown
|
|
385
|
-
⚠️ **Testing found issues:**
|
|
158
|
+
## How Principles Work
|
|
386
159
|
|
|
387
|
-
1. [Console] TypeError in LoginForm.tsx:45
|
|
388
|
-
2. [Network] POST /api/auth/login returned 500
|
|
389
|
-
|
|
390
|
-
**Auto-fixing...** (if straightforward)
|
|
391
|
-
**Or reporting for manual fix** (if complex)
|
|
392
160
|
```
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
1. **Update spec status**
|
|
399
|
-
```markdown
|
|
400
|
-
<!-- In specs/{UC-ID}/README.md -->
|
|
401
|
-
> **Status**: Complete
|
|
402
|
-
> **Completed**: {date}
|
|
403
|
-
> **Tested**: ✓ Pass (Phase 7)
|
|
404
|
-
```
|
|
405
|
-
|
|
406
|
-
2. **Document changes**
|
|
407
|
-
```markdown
|
|
408
|
-
## Implementation Notes
|
|
409
|
-
|
|
410
|
-
### Files Changed
|
|
411
|
-
- `src/api/auth/login.ts` - Created login endpoint
|
|
412
|
-
- `src/components/LoginForm.tsx` - Created form component
|
|
413
|
-
|
|
414
|
-
### Deviations from Spec
|
|
415
|
-
- Added rate limiting (not in spec, but security best practice)
|
|
416
|
-
|
|
417
|
-
### Test Results
|
|
418
|
-
- E2E flow: ✓ Pass
|
|
419
|
-
- Console errors: None
|
|
420
|
-
- API responses: All 2xx
|
|
421
|
-
|
|
422
|
-
### Next Steps
|
|
423
|
-
- UC-AUTH-002 can now proceed (depends on this)
|
|
424
|
-
```
|
|
425
|
-
|
|
426
|
-
3. **Update docs-graph** (automatic via hook)
|
|
427
|
-
|
|
428
|
-
4. **Continue with next UC (if applicable)**
|
|
429
|
-
```
|
|
430
|
-
IMPORTANT: This step only runs if Phase 7 (Testing) passed.
|
|
431
|
-
If tests fail, fix issues and re-test before continuing.
|
|
432
|
-
|
|
433
|
-
Check implementationPlan from Phase 0:
|
|
434
|
-
|
|
435
|
-
If more UCs remaining:
|
|
436
|
-
Mode "one-by-one":
|
|
437
|
-
→ Show: "✓ UC-AUTH-001 implemented and tested successfully!"
|
|
438
|
-
→ Show: "Remaining: UC-AUTH-002, UC-AUTH-003, UC-AUTH-004"
|
|
439
|
-
→ Ask (AskUserQuestion): "Continue with UC-AUTH-002?"
|
|
440
|
-
Options:
|
|
441
|
-
- Yes (continue with next UC)
|
|
442
|
-
- No (stop here, can resume later)
|
|
443
|
-
- Select different UCs (return to Phase 0)
|
|
444
|
-
→ Yes: currentIndex++, restart from Phase 1
|
|
445
|
-
→ No: Show summary, stop
|
|
446
|
-
→ Select: Return to Phase 0 for new selection
|
|
447
|
-
|
|
448
|
-
Mode "multiple" or "all":
|
|
449
|
-
→ Show: "✓ UC-AUTH-001 implemented and tested successfully!"
|
|
450
|
-
→ Automatically: currentIndex++
|
|
451
|
-
→ Restart from Phase 1 with next UC
|
|
452
|
-
→ No user prompt until all selected UCs complete
|
|
453
|
-
|
|
454
|
-
If all UCs complete:
|
|
455
|
-
→ Show summary (see below)
|
|
456
|
-
→ Suggest /dev-review {feature}
|
|
457
|
-
```
|
|
458
|
-
|
|
459
|
-
**Summary Output (all UCs complete):**
|
|
460
|
-
```markdown
|
|
461
|
-
✅ All Use Cases Implemented
|
|
462
|
-
|
|
463
|
-
**Completed:**
|
|
464
|
-
- UC-AUTH-001: User Login ✓
|
|
465
|
-
- UC-AUTH-003: Password Reset ✓
|
|
466
|
-
- UC-AUTH-004: Email Verification ✓
|
|
467
|
-
|
|
468
|
-
**Stats:**
|
|
469
|
-
- Files changed: 12
|
|
470
|
-
- Tests: All passing
|
|
471
|
-
- Duration: ~45 minutes
|
|
472
|
-
|
|
473
|
-
**Next Steps:**
|
|
474
|
-
- Run `/dev-review auth` for code review
|
|
475
|
-
- Create PR when ready
|
|
161
|
+
Universal Principles (references/)
|
|
162
|
+
+
|
|
163
|
+
Project Specifics (tech-context.md)
|
|
164
|
+
=
|
|
165
|
+
Implementation
|
|
476
166
|
```
|
|
477
167
|
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
168
|
+
**Apply what the requirement needs:**
|
|
169
|
+
- API work → backend-principles.md + tech-context.md
|
|
170
|
+
- UI work → frontend-principles.md + tech-context.md
|
|
171
|
+
- Both → use both references + tech-context.md
|
|
481
172
|
|
|
482
|
-
|
|
483
|
-
|-----------|--------|
|
|
484
|
-
| Spec unclear | Ask for clarification |
|
|
485
|
-
| Multiple valid approaches | Present options, ask preference |
|
|
486
|
-
| Stuck > 15 min | Document attempts, ask for help |
|
|
487
|
-
| Spec seems wrong | Flag it, propose alternative |
|
|
488
|
-
| Scope creep detected | Stop, suggest CR |
|
|
173
|
+
## Example Flow
|
|
489
174
|
|
|
490
|
-
|
|
175
|
+
**Requirement:** "Add password reset endpoint"
|
|
491
176
|
|
|
492
|
-
|
|
493
|
-
**
|
|
177
|
+
1. **Think:** API work → backend-principles.md (validation, security) + tech-context.md (how we do APIs)
|
|
178
|
+
2. **Discover:** Where are endpoints? → Glob, Read similar endpoint
|
|
179
|
+
3. **Implement:** Follow pattern + apply principles
|
|
180
|
+
4. **Validate:** Check acceptance criteria
|
|
494
181
|
|
|
495
|
-
|
|
496
|
-
1. {Attempt 1} → {Result}
|
|
497
|
-
2. {Attempt 2} → {Result}
|
|
182
|
+
## Quality
|
|
498
183
|
|
|
499
|
-
|
|
500
|
-
A) {Option A} - {Tradeoff}
|
|
501
|
-
B) {Option B} - {Tradeoff}
|
|
184
|
+
Apply principles from references/ during implementation. See `_quality-attributes.md` for project-specific quality checklists.
|
|
502
185
|
|
|
503
|
-
|
|
504
|
-
```
|
|
505
|
-
|
|
506
|
-
### Scope Creep Protocol
|
|
186
|
+
## Tools
|
|
507
187
|
|
|
508
|
-
|
|
|
509
|
-
|
|
510
|
-
|
|
|
511
|
-
|
|
|
512
|
-
|
|
|
513
|
-
|
|
|
188
|
+
| Tool | Purpose | When |
|
|
189
|
+
|------|---------|------|
|
|
190
|
+
| `Read` | Load spec, tech-context.md, files | Phase 1, as needed |
|
|
191
|
+
| `Glob` | Find files by pattern | Just-in-time discovery |
|
|
192
|
+
| `Grep` | Search for code patterns | Just-in-time discovery |
|
|
193
|
+
| `Edit` | Modify existing files | Implementation |
|
|
194
|
+
| `Write` | Create new files | Implementation |
|
|
195
|
+
| `Bash` | Run tests, git commands | Testing, committing |
|
|
196
|
+
| `TodoWrite` | Track implementation progress | Throughout |
|
|
514
197
|
|
|
515
|
-
##
|
|
198
|
+
## Anti-Patterns
|
|
516
199
|
|
|
517
|
-
|
|
200
|
+
❌ Reading every file upfront (discover as needed)
|
|
201
|
+
❌ Categorizing work as "backend" or "frontend" (just apply what's needed)
|
|
202
|
+
❌ Memorizing function names (look them up when needed)
|
|
203
|
+
❌ Ignoring principles (universal + project-specific)
|
|
204
|
+
❌ Not validating against acceptance criteria (that's success)
|
|
205
|
+
❌ Pre-loading all components (wasteful, discover when needed)
|
|
518
206
|
|
|
519
|
-
|
|
520
|
-
1. Check docs-graph for dependencies
|
|
521
|
-
2. For each dependency:
|
|
522
|
-
- Is UC marked complete? → OK
|
|
523
|
-
- Is code actually there? → Check (more reliable)
|
|
524
|
-
3. If dependency missing:
|
|
525
|
-
- Warn user
|
|
526
|
-
- Ask: Proceed anyway? / Do dependency first?
|
|
527
|
-
```
|
|
207
|
+
## Edge Cases
|
|
528
208
|
|
|
529
|
-
|
|
209
|
+
**No tech-context.md:**
|
|
210
|
+
- Error: "Run /dev-scout first to document patterns"
|
|
530
211
|
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
| `Read` | Load specs, scout, sub-skills |
|
|
534
|
-
| `Write` | Create new files |
|
|
535
|
-
| `Edit` | Modify existing files |
|
|
536
|
-
| `Bash` | Run commands, curl tests |
|
|
537
|
-
| `Glob` | Find files |
|
|
538
|
-
| `Grep` | Search code |
|
|
539
|
-
| `mcp__playwright__*` | UI verification |
|
|
540
|
-
| `Context7` | Look up library documentation |
|
|
212
|
+
**No spec:**
|
|
213
|
+
- Error: "Run /dev-specs {feature} first to create implementation plan"
|
|
541
214
|
|
|
542
|
-
|
|
215
|
+
**Spec references non-existent pattern:**
|
|
216
|
+
- Discover pattern via Grep/Glob
|
|
217
|
+
- If truly doesn't exist, implement following best practices
|
|
218
|
+
- Note deviation in implementation notes
|
|
543
219
|
|
|
544
|
-
|
|
220
|
+
## Success Criteria
|
|
545
221
|
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
2. Query specific API
|
|
554
|
-
→ mcp__context7__query-docs({
|
|
555
|
-
libraryId: "/colinhacks/zod",
|
|
556
|
-
query: "custom error messages"
|
|
557
|
-
})
|
|
558
|
-
```
|
|
222
|
+
Implementation successful when:
|
|
223
|
+
- ✅ All acceptance criteria met
|
|
224
|
+
- ✅ All files from checklist created/modified
|
|
225
|
+
- ✅ Patterns from tech-context.md followed
|
|
226
|
+
- ✅ Tests passing (if applicable)
|
|
227
|
+
- ✅ Code quality checks passed
|
|
228
|
+
- ✅ No security vulnerabilities
|
|
559
229
|
|
|
560
|
-
|
|
561
|
-
- Library APIs you're less familiar with
|
|
562
|
-
- Framework-specific patterns
|
|
563
|
-
- Error handling approaches
|
|
564
|
-
- Best practices
|
|
230
|
+
## References
|
|
565
231
|
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
| Skill | Relationship |
|
|
569
|
-
|-------|--------------|
|
|
570
|
-
| `/dev-specs` | Reads implementation plan from |
|
|
571
|
-
| `/dev-scout` | Reads patterns/conventions from |
|
|
572
|
-
| `/dev-coding-backend` | Loads for API/schema work |
|
|
573
|
-
| `/dev-coding-frontend` | Loads for UI work |
|
|
574
|
-
| `/dev-test` | Auto-triggers after implementation |
|
|
575
|
-
| `/utils/docs-graph` | Auto-updates on file changes |
|
|
576
|
-
| `/dev-review` | Review after testing passes |
|
|
577
|
-
|
|
578
|
-
## Example Flows
|
|
579
|
-
|
|
580
|
-
### Example 1: Specific UC (Skip Selection)
|
|
581
|
-
```
|
|
582
|
-
User: /dev-coding UC-AUTH-001
|
|
583
|
-
|
|
584
|
-
1. Load UC-AUTH-001 spec
|
|
585
|
-
→ Backend: POST /api/auth/login
|
|
586
|
-
→ Frontend: LoginForm component, /login page
|
|
587
|
-
|
|
588
|
-
2. Check dependencies
|
|
589
|
-
→ None for UC-AUTH-001 (it's first)
|
|
590
|
-
|
|
591
|
-
3. Load dev-coding-backend
|
|
592
|
-
→ Create login endpoint
|
|
593
|
-
→ Test with curl ✓
|
|
594
|
-
|
|
595
|
-
4. Load dev-coding-frontend
|
|
596
|
-
→ Create LoginForm component
|
|
597
|
-
→ Create /login page
|
|
598
|
-
→ Connect to API
|
|
599
|
-
|
|
600
|
-
5. Integration test
|
|
601
|
-
→ Fill form → Submit → Verify redirect ✓
|
|
602
|
-
|
|
603
|
-
6. Quality checks
|
|
604
|
-
→ Lint ✓, Types ✓, No debug code ✓
|
|
605
|
-
|
|
606
|
-
7. Auto-test (dev-test)
|
|
607
|
-
→ Navigate to /login
|
|
608
|
-
→ Fill form, submit
|
|
609
|
-
→ Check console: No errors ✓
|
|
610
|
-
→ Check network: All 2xx ✓
|
|
611
|
-
→ Visual check: Form renders ✓
|
|
612
|
-
|
|
613
|
-
8. Complete
|
|
614
|
-
→ Update spec status (with test results)
|
|
615
|
-
→ Document changes
|
|
616
|
-
→ Suggest: "Run /dev-review before committing"
|
|
617
|
-
→ Note: "UC-AUTH-002 (Signup) is now unblocked"
|
|
618
|
-
```
|
|
619
|
-
|
|
620
|
-
### Example 2: One by One Mode (Recommended)
|
|
621
|
-
```
|
|
622
|
-
User: /dev-coding auth
|
|
623
|
-
|
|
624
|
-
📋 Available Use Cases for auth:
|
|
625
|
-
1. UC-AUTH-001: User Login
|
|
626
|
-
2. UC-AUTH-002: User Signup
|
|
627
|
-
3. UC-AUTH-003: Password Reset
|
|
628
|
-
|
|
629
|
-
? Which use cases would you like to implement?
|
|
630
|
-
◉ One by one (Recommended) ← User selects this
|
|
631
|
-
○ Multiple (custom selection)
|
|
632
|
-
○ All at once
|
|
633
|
-
|
|
634
|
-
───────────────────────────────────────────────
|
|
635
|
-
🔨 UC-AUTH-001: User Login
|
|
636
|
-
───────────────────────────────────────────────
|
|
637
|
-
|
|
638
|
-
Phase 1-6: Implement backend + frontend
|
|
639
|
-
Phase 7: Auto-test
|
|
640
|
-
✓ Navigate to /login
|
|
641
|
-
✓ Fill form and submit
|
|
642
|
-
✓ No console errors
|
|
643
|
-
✓ API returns 200
|
|
644
|
-
✓ Redirect to /dashboard works
|
|
645
|
-
|
|
646
|
-
Phase 8: Complete
|
|
647
|
-
✓ UC-AUTH-001 implemented and tested successfully!
|
|
648
|
-
|
|
649
|
-
Remaining: UC-AUTH-002, UC-AUTH-003
|
|
650
|
-
|
|
651
|
-
? Continue with UC-AUTH-002? ← Prompt after testing passes
|
|
652
|
-
◉ Yes (continue)
|
|
653
|
-
○ No (stop here)
|
|
654
|
-
○ Select different UCs
|
|
655
|
-
|
|
656
|
-
User selects: Yes
|
|
657
|
-
|
|
658
|
-
───────────────────────────────────────────────
|
|
659
|
-
🔨 UC-AUTH-002: User Signup
|
|
660
|
-
───────────────────────────────────────────────
|
|
661
|
-
|
|
662
|
-
Phase 1-6: Implement backend + frontend
|
|
663
|
-
Phase 7: Auto-test
|
|
664
|
-
✓ Navigate to /signup
|
|
665
|
-
✓ Fill registration form
|
|
666
|
-
✓ Submit and verify
|
|
667
|
-
✗ Console error: "Email validation failed"
|
|
668
|
-
|
|
669
|
-
⚠️ Tests failed. Fixing...
|
|
670
|
-
→ Updated validation logic
|
|
671
|
-
→ Re-testing...
|
|
672
|
-
✓ All tests pass
|
|
673
|
-
|
|
674
|
-
Phase 8: Complete
|
|
675
|
-
✓ UC-AUTH-002 implemented and tested successfully!
|
|
676
|
-
|
|
677
|
-
Remaining: UC-AUTH-003
|
|
678
|
-
|
|
679
|
-
? Continue with UC-AUTH-003?
|
|
680
|
-
◉ Yes
|
|
681
|
-
○ No (stop here)
|
|
682
|
-
○ Select different UCs
|
|
683
|
-
|
|
684
|
-
User selects: No
|
|
685
|
-
|
|
686
|
-
───────────────────────────────────────────────
|
|
687
|
-
Summary
|
|
688
|
-
───────────────────────────────────────────────
|
|
689
|
-
✅ Completed:
|
|
690
|
-
- UC-AUTH-001: User Login ✓
|
|
691
|
-
- UC-AUTH-002: User Signup ✓
|
|
692
|
-
|
|
693
|
-
⏸️ Pending:
|
|
694
|
-
- UC-AUTH-003: Password Reset
|
|
695
|
-
|
|
696
|
-
💡 Next steps:
|
|
697
|
-
- Run /dev-review auth
|
|
698
|
-
- Resume later with: /dev-coding UC-AUTH-003
|
|
699
|
-
```
|
|
700
|
-
|
|
701
|
-
**Key Points in "One by One" Mode:**
|
|
702
|
-
1. Each UC is **fully implemented** (Phases 1-6)
|
|
703
|
-
2. Each UC is **fully tested** (Phase 7) before prompting
|
|
704
|
-
3. User gets a **checkpoint** to review/test manually if desired
|
|
705
|
-
4. User **chooses** whether to continue or stop
|
|
706
|
-
5. If tests fail, they're **fixed before** asking to continue
|
|
707
|
-
6. Can **resume later** from any UC
|
|
708
|
-
|
|
709
|
-
### Potential Issues with "One by One" Testing
|
|
710
|
-
|
|
711
|
-
While "one by one" is the safest mode, be aware of these considerations:
|
|
712
|
-
|
|
713
|
-
| Issue | Description | Mitigation |
|
|
714
|
-
|-------|-------------|------------|
|
|
715
|
-
| **Integration gaps** | UCs tested individually might miss cross-UC interactions | After all UCs complete, run full integration test |
|
|
716
|
-
| **Shared state** | Later UCs might depend on state from earlier UCs | Use cumulative testing (don't reset DB between UCs) |
|
|
717
|
-
| **Conflicting changes** | UC #3 might need different approach than UC #1 implemented | May need to refactor earlier UCs (acceptable tradeoff) |
|
|
718
|
-
| **Performance at scale** | Individual UCs work, but all together cause issues | Final integration test should include load testing |
|
|
719
|
-
| **Git commit strategy** | Should each UC be committed separately? | Depends on team workflow (see below) |
|
|
720
|
-
|
|
721
|
-
**Best Practice - Cumulative Testing:**
|
|
722
|
-
```
|
|
723
|
-
UC #1: Test in isolation ✓
|
|
724
|
-
UC #2: Test UC #2 + verify UC #1 still works ✓
|
|
725
|
-
UC #3: Test UC #3 + verify UC #1, UC #2 still work ✓
|
|
726
|
-
```
|
|
727
|
-
|
|
728
|
-
This ensures each UC works both **independently** and **together**.
|
|
729
|
-
|
|
730
|
-
**Implementation in Phase 7:**
|
|
731
|
-
```javascript
|
|
732
|
-
// For UC #2 onwards, add regression checks
|
|
733
|
-
Phase 7: Auto-Test
|
|
734
|
-
1. Test current UC (UC-AUTH-002: Signup) ✓
|
|
735
|
-
2. Regression: Quick test of previous UCs
|
|
736
|
-
→ UC-AUTH-001 (Login) still works? ✓
|
|
737
|
-
3. All pass → Continue
|
|
738
|
-
```
|
|
739
|
-
|
|
740
|
-
**Git Strategy for "One by One":**
|
|
741
|
-
|
|
742
|
-
| Strategy | When to Use | Commits |
|
|
743
|
-
|----------|-------------|---------|
|
|
744
|
-
| **Commit each UC** | When UCs are independent, team reviews incrementally | 1 commit per UC |
|
|
745
|
-
| **Commit all together** | When UCs are tightly coupled, want atomic feature | 1 commit after all UCs |
|
|
746
|
-
| **Hybrid** | Mix of both - commit stable UCs, batch dependent ones | Flexible |
|
|
747
|
-
|
|
748
|
-
**Recommended Git Flow:**
|
|
749
|
-
```
|
|
750
|
-
One by One Mode:
|
|
751
|
-
UC #1 complete → Commit → Continue?
|
|
752
|
-
UC #2 complete → Commit → Continue?
|
|
753
|
-
UC #3 complete → Commit → Done
|
|
754
|
-
|
|
755
|
-
Multiple/All Mode:
|
|
756
|
-
UC #1 complete → Auto-continue (no commit)
|
|
757
|
-
UC #2 complete → Auto-continue (no commit)
|
|
758
|
-
UC #3 complete → Single commit for all → Done
|
|
759
|
-
```
|
|
232
|
+
- `references/backend-principles.md` - Universal API, data, security principles
|
|
233
|
+
- `references/frontend-principles.md` - Universal UI, component, state principles
|
|
760
234
|
|
|
761
|
-
|
|
235
|
+
These provide general software engineering wisdom. Combine with tech-context.md for project-specific implementation.
|