@codihaus/claude-skills 1.6.15 → 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/dev-coding/SKILL.md +116 -26
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dev-coding
|
|
3
3
|
description: Implement features as a Principal Engineering Developer
|
|
4
|
-
version: 2.1.
|
|
4
|
+
version: 2.1.1
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# /dev-coding - Implementation Skill
|
|
@@ -58,6 +58,21 @@ You have three layers of knowledge to apply:
|
|
|
58
58
|
2. `plans/brd/tech-context.md` exists → patterns known
|
|
59
59
|
3. `plans/features/{feature}/codebase-context.md` exists (optional, helpful)
|
|
60
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
|
+
|
|
61
76
|
## Expected Outcome
|
|
62
77
|
|
|
63
78
|
Implemented feature that meets all acceptance criteria from spec.
|
|
@@ -75,12 +90,24 @@ Implemented feature that meets all acceptance criteria from spec.
|
|
|
75
90
|
## Implementation Approach
|
|
76
91
|
|
|
77
92
|
**1. Load Context (once):**
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
-
|
|
93
|
+
|
|
94
|
+
**Step 1: Read spec**
|
|
95
|
+
- Get requirements, acceptance criteria, work area
|
|
96
|
+
|
|
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
|
|
106
|
+
|
|
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
|
|
84
111
|
|
|
85
112
|
**2. Plan Work:**
|
|
86
113
|
- If feature name given (not specific UC): Ask implementation mode
|
|
@@ -135,14 +162,34 @@ Layer 3: Project Specifics (tech-context.md)
|
|
|
135
162
|
Implementation
|
|
136
163
|
```
|
|
137
164
|
|
|
138
|
-
**How to detect stack:**
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
**
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
|
146
193
|
- Full-stack? → Apply all three layers across concerns
|
|
147
194
|
|
|
148
195
|
## After Implementation
|
|
@@ -161,21 +208,64 @@ Implementation
|
|
|
161
208
|
|
|
162
209
|
**Requirement:** "Add password reset endpoint" (Next.js project)
|
|
163
210
|
|
|
164
|
-
1.
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
211
|
+
**1. Load Knowledge:**
|
|
212
|
+
|
|
213
|
+
```
|
|
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
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
**2. Discover:**
|
|
234
|
+
```
|
|
235
|
+
Glob: lib/actions/*.ts
|
|
236
|
+
Read: lib/actions/auth.ts (see existing login pattern)
|
|
237
|
+
```
|
|
168
238
|
|
|
169
|
-
|
|
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
|
|
170
243
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
244
|
+
**4. Implement:**
|
|
245
|
+
```typescript
|
|
246
|
+
// lib/actions/auth.ts
|
|
247
|
+
"use server"
|
|
175
248
|
|
|
176
|
-
|
|
249
|
+
export async function resetPassword(email: string) {
|
|
250
|
+
// Universal: Validation
|
|
251
|
+
const schema = z.string().email()
|
|
252
|
+
const validated = schema.parse(email)
|
|
253
|
+
|
|
254
|
+
// Universal: Generate secure token
|
|
255
|
+
const token = crypto.randomBytes(32).toString('hex')
|
|
256
|
+
|
|
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
|
+
```
|
|
177
267
|
|
|
178
|
-
5.
|
|
268
|
+
**5. Validate:** Check acceptance criteria
|
|
179
269
|
|
|
180
270
|
## Quality
|
|
181
271
|
|