@codihaus/claude-skills 1.6.14 → 1.6.16
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/_registry.md +9 -5
- package/skills/dev-coding/SKILL.md +185 -71
package/package.json
CHANGED
package/skills/_registry.md
CHANGED
|
@@ -115,7 +115,10 @@ During each skill, consider suggesting:
|
|
|
115
115
|
|
|
116
116
|
### /dev-coding
|
|
117
117
|
- Before: Ensure `/dev-specs` completed
|
|
118
|
-
-
|
|
118
|
+
- Reads (Three Layers):
|
|
119
|
+
1. Universal principles: `references/backend-principles.md`, `frontend-principles.md`
|
|
120
|
+
2. Framework patterns: `knowledge/stacks/{stack}/_index.md` (detected from tech-context.md)
|
|
121
|
+
3. Project specifics: `tech-context.md`, `codebase-context.md`
|
|
119
122
|
- Reads: `_quality-attributes.md` for implementation-level checklists
|
|
120
123
|
- After: Auto-triggers `/dev-test` to verify implementation
|
|
121
124
|
- After test: "Use `/dev-review` to review changes"
|
|
@@ -190,10 +193,11 @@ stacks/{name}/
|
|
|
190
193
|
```
|
|
191
194
|
|
|
192
195
|
**How it works:**
|
|
193
|
-
1. `/dev-scout` detects stack → writes `
|
|
194
|
-
2. `/dev-specs` reads
|
|
195
|
-
3.
|
|
196
|
-
4.
|
|
196
|
+
1. `/dev-scout` detects stack → writes `tech-context.md` with stack info
|
|
197
|
+
2. `/dev-specs` reads tech-context.md → loads `stacks/{name}/_index.md` → uses "For /dev-specs" section
|
|
198
|
+
3. `/dev-coding` reads tech-context.md → loads `stacks/{name}/_index.md` → uses "For /dev-coding" section
|
|
199
|
+
4. `/dev-review` reads tech-context.md → loads `stacks/{name}/_index.md` → uses "For /dev-review" section
|
|
200
|
+
5. Deep patterns in `references/`, templates in `assets/`
|
|
197
201
|
|
|
198
202
|
### Domain Knowledge (`knowledge/domains/`)
|
|
199
203
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dev-coding
|
|
3
3
|
description: Implement features as a Principal Engineering Developer
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.1.1
|
|
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
10
|
> - **Before**: Ensure `/dev-specs` completed
|
|
11
|
-
> - **Reads**:
|
|
11
|
+
> - **Reads**: Universal principles (references/), framework patterns (knowledge/stacks/), project specifics (tech-context.md), requirements (specs)
|
|
12
12
|
> - **After**: Auto-triggers `/dev-test` to verify implementation
|
|
13
13
|
> - **Review**: Suggest `/dev-review` for code review
|
|
14
14
|
|
|
15
|
-
Work as a **Principal Engineering Developer**: apply universal
|
|
15
|
+
Work as a **Principal Engineering Developer**: apply three-layer knowledge (universal + framework + project-specific).
|
|
16
16
|
|
|
17
17
|
## When to Use
|
|
18
18
|
|
|
@@ -29,25 +29,50 @@ Work as a **Principal Engineering Developer**: apply universal principles with p
|
|
|
29
29
|
|
|
30
30
|
## Role: Principal Engineering Developer
|
|
31
31
|
|
|
32
|
-
You have
|
|
32
|
+
You have three layers of knowledge to apply:
|
|
33
|
+
|
|
34
|
+
**1. Universal Principles** (references/)
|
|
35
|
+
- General software engineering wisdom
|
|
36
|
+
- `backend-principles.md` - API, data, security
|
|
37
|
+
- `frontend-principles.md` - UI, component, state
|
|
38
|
+
|
|
39
|
+
**2. Framework-Specific Patterns** (knowledge/stacks/)
|
|
40
|
+
- Best practices for detected stack (Next.js, Nuxt, Directus, etc.)
|
|
41
|
+
- Framework conventions and patterns
|
|
42
|
+
- Anti-patterns to avoid
|
|
43
|
+
|
|
44
|
+
**3. Project-Specific Implementation** (tech-context.md)
|
|
45
|
+
- How THIS project implements the patterns
|
|
46
|
+
- Project conventions and standards
|
|
47
|
+
- Existing code patterns
|
|
33
48
|
|
|
34
49
|
**Workflow:**
|
|
35
|
-
1. Load
|
|
50
|
+
1. Load three layers of knowledge
|
|
36
51
|
2. Discover details just-in-time (Glob/Grep/Read as needed)
|
|
37
|
-
3. Apply
|
|
52
|
+
3. Apply all layers based on what requirement needs
|
|
38
53
|
4. Validate against acceptance criteria
|
|
39
54
|
|
|
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
|
|
44
|
-
|
|
45
55
|
## Prerequisites
|
|
46
56
|
|
|
47
57
|
1. `/dev-specs {feature}` completed → specs exist
|
|
48
58
|
2. `plans/brd/tech-context.md` exists → patterns known
|
|
49
59
|
3. `plans/features/{feature}/codebase-context.md` exists (optional, helpful)
|
|
50
60
|
|
|
61
|
+
## CRITICAL: Always Load Stack Knowledge
|
|
62
|
+
|
|
63
|
+
**BEFORE implementing any feature:**
|
|
64
|
+
|
|
65
|
+
1. **Read `plans/brd/tech-context.md`** → Identify stack(s)
|
|
66
|
+
2. **Read `knowledge/stacks/{stack}/_index.md`** → Load framework patterns
|
|
67
|
+
3. **Focus on "For /dev-coding" section** → Note best practices
|
|
68
|
+
|
|
69
|
+
**Stack file mapping:**
|
|
70
|
+
- "Next.js" → `knowledge/stacks/nextjs/_index.md`
|
|
71
|
+
- "Nuxt" → `knowledge/stacks/nuxt/_index.md`
|
|
72
|
+
- "Directus" → `knowledge/stacks/directus/_index.md`
|
|
73
|
+
|
|
74
|
+
**If you skip this step**, you'll implement using generic patterns instead of framework-specific best practices (e.g., using fetch instead of Server Actions in Next.js).
|
|
75
|
+
|
|
51
76
|
## Expected Outcome
|
|
52
77
|
|
|
53
78
|
Implemented feature that meets all acceptance criteria from spec.
|
|
@@ -55,36 +80,34 @@ Implemented feature that meets all acceptance criteria from spec.
|
|
|
55
80
|
**What "done" looks like:**
|
|
56
81
|
- All requirements from spec completed
|
|
57
82
|
- All acceptance criteria pass
|
|
58
|
-
-
|
|
59
|
-
-
|
|
83
|
+
- Framework patterns (from knowledge/stacks/) followed
|
|
84
|
+
- Project patterns (from tech-context.md) followed
|
|
85
|
+
- Universal principles (from references/) applied
|
|
60
86
|
- No security vulnerabilities
|
|
61
87
|
- Tests passing (if applicable)
|
|
62
88
|
- Code quality maintained
|
|
63
89
|
|
|
64
|
-
##
|
|
90
|
+
## Implementation Approach
|
|
65
91
|
|
|
66
|
-
|
|
92
|
+
**1. Load Context (once):**
|
|
67
93
|
|
|
68
|
-
**
|
|
69
|
-
-
|
|
70
|
-
- Project-specific patterns (tech-context.md)
|
|
71
|
-
- Business requirements (specs/*.md)
|
|
72
|
-
- How to verify success (acceptance criteria)
|
|
94
|
+
**Step 1: Read spec**
|
|
95
|
+
- Get requirements, acceptance criteria, work area
|
|
73
96
|
|
|
74
|
-
**
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
97
|
+
**Step 2: Detect and load stack knowledge**
|
|
98
|
+
- Read `plans/brd/tech-context.md`
|
|
99
|
+
- Look for "Primary Stack", "Tech Stack", or "Stack" section
|
|
100
|
+
- Extract stack names (e.g., "Next.js", "Nuxt", "Directus")
|
|
101
|
+
- For each detected stack:
|
|
102
|
+
- Read `knowledge/stacks/{stack-lowercase}/_index.md` (e.g., `nextjs`, `nuxt`, `directus`)
|
|
103
|
+
- Focus on "For /dev-coding" section
|
|
104
|
+
- Note best practices, patterns, anti-patterns
|
|
105
|
+
- If stack knowledge file doesn't exist, note it and continue
|
|
79
106
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
-
|
|
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
|
|
107
|
+
**Step 3: Load universal and project specifics**
|
|
108
|
+
- Read `plans/features/{feature}/codebase-context.md` → Feature-specific implementation
|
|
109
|
+
- Read `plans/features/{feature}/architecture.md` (if exists) → Architecture decisions
|
|
110
|
+
- Load `references/backend-principles.md` and/or `frontend-principles.md` as needed
|
|
88
111
|
|
|
89
112
|
**2. Plan Work:**
|
|
90
113
|
- If feature name given (not specific UC): Ask implementation mode
|
|
@@ -95,13 +118,13 @@ You have universal engineering knowledge and apply it to this specific project.
|
|
|
95
118
|
|
|
96
119
|
**3. Implement (for each requirement):**
|
|
97
120
|
- **Understand:** What to build, where to build it, success criteria
|
|
98
|
-
- **Apply
|
|
99
|
-
- API work? →
|
|
100
|
-
- UI work? →
|
|
101
|
-
- Data work? →
|
|
102
|
-
- Full-stack? → Apply
|
|
121
|
+
- **Apply three layers:** Universal → Framework → Project-specific
|
|
122
|
+
- API work? → Universal API principles + Framework API patterns (e.g., Server Actions for Next.js) + Project's API pattern
|
|
123
|
+
- UI work? → Universal component principles + Framework UI patterns (e.g., Server Components) + Project's UI pattern
|
|
124
|
+
- Data work? → Universal data principles + Framework data patterns (e.g., Prisma, Directus) + Project's data pattern
|
|
125
|
+
- Full-stack? → Apply all three layers across multiple concerns
|
|
103
126
|
- **Discover:** Find details just-in-time (Glob/Grep/Read)
|
|
104
|
-
- **Build:** Create/modify files following
|
|
127
|
+
- **Build:** Create/modify files following all three layers
|
|
105
128
|
- **Validate:** Check acceptance criteria, fix if needed
|
|
106
129
|
- **Test:** Write/run tests if applicable
|
|
107
130
|
|
|
@@ -127,21 +150,47 @@ Don't pre-load everything. Discover when needed:
|
|
|
127
150
|
- ❌ List all components upfront
|
|
128
151
|
- ❌ Memorize function names (look up when needed)
|
|
129
152
|
|
|
130
|
-
##
|
|
153
|
+
## Three-Layer Knowledge System
|
|
131
154
|
|
|
132
155
|
```
|
|
133
|
-
Universal Principles (references/)
|
|
156
|
+
Layer 1: Universal Principles (references/)
|
|
157
|
+
+
|
|
158
|
+
Layer 2: Framework Patterns (knowledge/stacks/{stack}/)
|
|
134
159
|
+
|
|
135
|
-
Project Specifics (tech-context.md)
|
|
160
|
+
Layer 3: Project Specifics (tech-context.md)
|
|
136
161
|
=
|
|
137
162
|
Implementation
|
|
138
163
|
```
|
|
139
164
|
|
|
140
|
-
**
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
165
|
+
**How to detect and load stack knowledge:**
|
|
166
|
+
|
|
167
|
+
1. **Read tech-context.md** and look for stack indicators:
|
|
168
|
+
```markdown
|
|
169
|
+
**Primary Stack**: Next.js + Directus
|
|
170
|
+
```
|
|
171
|
+
or
|
|
172
|
+
```markdown
|
|
173
|
+
## Tech Stack
|
|
174
|
+
- Frontend: Nuxt.js 3
|
|
175
|
+
- Backend: Directus
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
2. **Load stack knowledge files:**
|
|
179
|
+
- If "Next.js" detected → Read `knowledge/stacks/nextjs/_index.md`
|
|
180
|
+
- If "Nuxt" detected → Read `knowledge/stacks/nuxt/_index.md`
|
|
181
|
+
- If "Directus" detected → Read `knowledge/stacks/directus/_index.md`
|
|
182
|
+
|
|
183
|
+
3. **Focus on "For /dev-coding" section** in each stack file for:
|
|
184
|
+
- Framework-specific patterns
|
|
185
|
+
- Best practices
|
|
186
|
+
- Anti-patterns to avoid
|
|
187
|
+
- Common gotchas
|
|
188
|
+
|
|
189
|
+
**Apply all three layers based on requirement:**
|
|
190
|
+
- API endpoint? → Universal API principles + Framework API patterns (Server Actions vs API routes vs composables) + Project's API pattern
|
|
191
|
+
- UI component? → Universal component principles + Framework UI patterns (Server vs Client Components, SFC, etc.) + Project's UI pattern
|
|
192
|
+
- Data access? → Universal data principles + Framework data patterns (ORM, collections, SDK) + Project's data pattern
|
|
193
|
+
- Full-stack? → Apply all three layers across concerns
|
|
145
194
|
|
|
146
195
|
## After Implementation
|
|
147
196
|
|
|
@@ -155,29 +204,68 @@ Implementation
|
|
|
155
204
|
- Commit if requested (follow git conventions from tech-context.md)
|
|
156
205
|
- Continue to next UC (based on implementation mode)
|
|
157
206
|
|
|
158
|
-
##
|
|
207
|
+
## Example Flow
|
|
208
|
+
|
|
209
|
+
**Requirement:** "Add password reset endpoint" (Next.js project)
|
|
210
|
+
|
|
211
|
+
**1. Load Knowledge:**
|
|
159
212
|
|
|
160
213
|
```
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
214
|
+
Step 1: Read plans/brd/tech-context.md
|
|
215
|
+
→ Found: "Primary Stack: Next.js 14 (App Router)"
|
|
216
|
+
|
|
217
|
+
Step 2: Read knowledge/stacks/nextjs/_index.md
|
|
218
|
+
→ Section "For /dev-coding":
|
|
219
|
+
- Use Server Actions for mutations (not Route Handlers)
|
|
220
|
+
- Server Actions = "use server" directive
|
|
221
|
+
- Place in lib/actions/
|
|
222
|
+
- Return structured response {success, error, data}
|
|
223
|
+
|
|
224
|
+
Step 3: Read references/backend-principles.md
|
|
225
|
+
→ API security: validate input, rate limit, secure tokens
|
|
226
|
+
|
|
227
|
+
Step 4: Read tech-context.md patterns
|
|
228
|
+
→ Project uses Zod for validation
|
|
229
|
+
→ Project uses nodemailer for emails
|
|
230
|
+
→ Auth actions in lib/actions/auth.ts
|
|
166
231
|
```
|
|
167
232
|
|
|
168
|
-
**
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
233
|
+
**2. Discover:**
|
|
234
|
+
```
|
|
235
|
+
Glob: lib/actions/*.ts
|
|
236
|
+
Read: lib/actions/auth.ts (see existing login pattern)
|
|
237
|
+
```
|
|
172
238
|
|
|
173
|
-
|
|
239
|
+
**3. Apply Three Layers:**
|
|
240
|
+
- **Universal**: Input validation, secure token (crypto.randomBytes), rate limiting, expiry time
|
|
241
|
+
- **Framework**: Server Action with "use server", structured response, error handling
|
|
242
|
+
- **Project**: Zod schema validation, nodemailer email sending, follows auth.ts pattern
|
|
243
|
+
|
|
244
|
+
**4. Implement:**
|
|
245
|
+
```typescript
|
|
246
|
+
// lib/actions/auth.ts
|
|
247
|
+
"use server"
|
|
248
|
+
|
|
249
|
+
export async function resetPassword(email: string) {
|
|
250
|
+
// Universal: Validation
|
|
251
|
+
const schema = z.string().email()
|
|
252
|
+
const validated = schema.parse(email)
|
|
174
253
|
|
|
175
|
-
|
|
254
|
+
// Universal: Generate secure token
|
|
255
|
+
const token = crypto.randomBytes(32).toString('hex')
|
|
176
256
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
257
|
+
// Project: Store token in DB (project pattern)
|
|
258
|
+
await db.passwordReset.create({...})
|
|
259
|
+
|
|
260
|
+
// Project: Send email (project uses nodemailer)
|
|
261
|
+
await sendEmail({...})
|
|
262
|
+
|
|
263
|
+
// Framework: Server Action response pattern
|
|
264
|
+
return { success: true, data: { sent: true } }
|
|
265
|
+
}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
**5. Validate:** Check acceptance criteria
|
|
181
269
|
|
|
182
270
|
## Quality
|
|
183
271
|
|
|
@@ -198,9 +286,10 @@ Apply principles from references/ during implementation. See `_quality-attribute
|
|
|
198
286
|
## Anti-Patterns
|
|
199
287
|
|
|
200
288
|
❌ Reading every file upfront (discover as needed)
|
|
201
|
-
❌
|
|
289
|
+
❌ Ignoring framework patterns (using fetch when should use Server Actions)
|
|
290
|
+
❌ Skipping any knowledge layer (need all three: universal + framework + project)
|
|
291
|
+
❌ Applying patterns from wrong framework (React patterns in Vue project)
|
|
202
292
|
❌ Memorizing function names (look them up when needed)
|
|
203
|
-
❌ Ignoring principles (universal + project-specific)
|
|
204
293
|
❌ Not validating against acceptance criteria (that's success)
|
|
205
294
|
❌ Pre-loading all components (wasteful, discover when needed)
|
|
206
295
|
|
|
@@ -212,24 +301,49 @@ Apply principles from references/ during implementation. See `_quality-attribute
|
|
|
212
301
|
**No spec:**
|
|
213
302
|
- Error: "Run /dev-specs {feature} first to create implementation plan"
|
|
214
303
|
|
|
304
|
+
**Stack not detected:**
|
|
305
|
+
- Load only universal principles + project specifics
|
|
306
|
+
- Note: "No framework-specific patterns loaded"
|
|
307
|
+
|
|
308
|
+
**Stack knowledge not available:**
|
|
309
|
+
- If `knowledge/stacks/{stack}/` doesn't exist
|
|
310
|
+
- Load only universal principles + project specifics
|
|
311
|
+
- Follow general best practices for that framework
|
|
312
|
+
- Note: "Framework patterns applied from general knowledge"
|
|
313
|
+
|
|
215
314
|
**Spec references non-existent pattern:**
|
|
216
315
|
- Discover pattern via Grep/Glob
|
|
217
|
-
- If truly doesn't exist, implement following
|
|
316
|
+
- If truly doesn't exist, implement following three-layer approach
|
|
218
317
|
- Note deviation in implementation notes
|
|
219
318
|
|
|
220
319
|
## Success Criteria
|
|
221
320
|
|
|
222
321
|
Implementation successful when:
|
|
223
322
|
- ✅ All acceptance criteria met
|
|
224
|
-
- ✅
|
|
225
|
-
- ✅
|
|
323
|
+
- ✅ Universal principles applied (security, validation, performance)
|
|
324
|
+
- ✅ Framework patterns followed (Server Actions, composables, etc.)
|
|
325
|
+
- ✅ Project patterns followed (conventions from tech-context.md)
|
|
226
326
|
- ✅ Tests passing (if applicable)
|
|
227
327
|
- ✅ Code quality checks passed
|
|
228
328
|
- ✅ No security vulnerabilities
|
|
229
329
|
|
|
230
330
|
## References
|
|
231
331
|
|
|
232
|
-
|
|
233
|
-
- `references/
|
|
332
|
+
**Layer 1 - Universal:**
|
|
333
|
+
- `references/backend-principles.md` - General API, data, security principles
|
|
334
|
+
- `references/frontend-principles.md` - General UI, component, state principles
|
|
335
|
+
|
|
336
|
+
**Layer 2 - Framework:**
|
|
337
|
+
- `knowledge/stacks/nextjs/_index.md` - Next.js patterns (Server Actions, App Router, RSC)
|
|
338
|
+
- `knowledge/stacks/nuxt/_index.md` - Nuxt patterns (composables, Nuxt UI, SSR)
|
|
339
|
+
- `knowledge/stacks/directus/_index.md` - Directus patterns (collections, flows, extensions)
|
|
340
|
+
- See `knowledge/stacks/_index.md` for all available stacks
|
|
341
|
+
|
|
342
|
+
**Layer 3 - Project:**
|
|
343
|
+
- `tech-context.md` - How THIS project implements patterns
|
|
344
|
+
- `codebase-context.md` - Feature-specific implementation details
|
|
234
345
|
|
|
235
|
-
|
|
346
|
+
**Three-layer approach ensures:**
|
|
347
|
+
- ✅ Solid engineering fundamentals (Layer 1)
|
|
348
|
+
- ✅ Framework best practices (Layer 2)
|
|
349
|
+
- ✅ Project consistency (Layer 3)
|