@codihaus/claude-skills 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,127 +1,106 @@
1
1
  ---
2
2
  name: dev-coding-frontend
3
3
  description: Frontend implementation patterns and workflows
4
- version: 1.3.0
4
+ version: 2.0.0
5
5
  ---
6
6
 
7
7
  # /dev-coding-frontend - Frontend Implementation
8
8
 
9
- > **Skill Awareness**: See `skills/_registry.md` for all available skills.
10
- > - **Loaded by**: `/dev-coding` when UI work needed
11
- > - **Tools**: shadcn MCP (components), Playwright (visual), Context7 (docs)
12
- > - **References**: Load tech-specific from `references/` (nextjs.md, vue.md, etc.)
13
- > - **Before**: Backend API contract should be documented
14
- > - **After**: `/dev-test` auto-runs to verify UI works
9
+ > **Loaded by**: `/dev-coding` when UI work needed
10
+ > **Tools**: shadcn MCP, Playwright, Context7
11
+ > **Before**: Backend API contract should be documented
15
12
 
16
- Frontend-specific patterns for UI components, pages, and client-side logic.
13
+ Frontend-specific workflow for UI components, pages, and client-side logic.
17
14
 
18
- ## When Loaded
15
+ ## Knowledge Loading (CRITICAL)
19
16
 
20
- This skill is loaded by `/dev-coding` when:
21
- - Spec requires UI components
22
- - Spec requires pages/routes
23
- - Spec requires client-side logic
17
+ Before implementing, load relevant knowledge:
24
18
 
25
- ## Workflow
19
+ ```
20
+ 1. Read stack.md → plans/scout/stack.md
21
+ → Identify: Framework, UI library, state management
26
22
 
27
- ### Step 1: Understand Frontend Requirements
23
+ 2. Load stack knowledge based on detected tech:
24
+ | If using... | Read... | Section |
25
+ |--------------|-----------------------------------|-------------------|
26
+ | Nuxt.js | knowledge/stacks/nuxt/_index.md | "For /dev-coding" |
27
+ | Next.js | knowledge/stacks/nextjs/_index.md | "For /dev-coding" |
28
+ | Directus | knowledge/stacks/directus/_index.md | "SDK Integration" |
28
29
 
29
- From the UC spec, extract:
30
+ 3. Load domain knowledge (if applicable):
31
+ | If domain... | Read... | Section |
32
+ |--------------|-----------------------------------|-------------------|
33
+ | SaaS | knowledge/domains/saas/_index.md | UI patterns |
34
+ | E-commerce | knowledge/domains/ecommerce/_index.md | Checkout flows |
30
35
 
31
- ```markdown
32
- ## Frontend Requirements Checklist
36
+ 4. Use loaded knowledge for:
37
+ Correct data fetching (useFetch vs useEffect vs Server Component)
38
+ → Framework-specific patterns (composables vs hooks)
39
+ → Domain-specific UI flows
40
+ ```
33
41
 
34
- [ ] Pages/Routes needed?
35
- - Path
36
- - Layout
37
- - Auth required?
42
+ ## Workflow
43
+
44
+ ### Step 1: Extract Frontend Requirements
38
45
 
39
- [ ] Components needed?
40
- - New components
41
- - Modify existing
42
- - Shared vs feature-specific
46
+ From UC spec, identify:
47
+
48
+ ```
49
+ [ ] Pages/Routes?
50
+ → Path, layout, auth required?
51
+
52
+ [ ] Components?
53
+ → New, modify existing, shared vs feature-specific
43
54
 
44
55
  [ ] State management?
45
- - Local state
46
- - Global state
47
- - Server state (API data)
56
+ Local, global, server state
48
57
 
49
58
  [ ] Forms?
50
- - Fields
51
- - Validation rules
52
- - Submit handling
59
+ Fields, validation, submit handling
53
60
 
54
61
  [ ] API integration?
55
- - Endpoints to call
56
- - Request/response handling
57
- - Loading/error states
62
+ Endpoints, loading/error states
58
63
  ```
59
64
 
60
65
  ### Step 2: Review API Contract
61
66
 
62
- If backend was just implemented (or exists), review:
67
+ From backend implementation:
63
68
 
64
69
  ```markdown
65
- ## Available API
66
-
67
- From backend implementation notes:
68
-
69
70
  ### POST /api/auth/login
70
71
  - Request: `{ email, password }`
71
72
  - Response: `{ token, user }`
72
73
  - Errors: 400 (validation), 401 (credentials)
73
74
  ```
74
75
 
75
- Know this BEFORE building UI to match shapes.
76
+ Match component shapes to API.
76
77
 
77
78
  ### Step 3: Component Architecture
78
79
 
79
- **Decide component structure:**
80
+ **Order:** Base components → Feature components → Pages
80
81
 
81
82
  ```
82
- Feature component structure:
83
83
  src/
84
84
  ├── components/
85
- │ ├── ui/ # Shared/base components
86
- │ │ ├── Button.tsx
87
- │ │ └── Input.tsx
85
+ │ ├── ui/ # Shared (Button, Input)
88
86
  │ └── features/
89
- │ └── auth/ # Feature-specific
90
- │ ├── LoginForm.tsx
91
- │ └── SignupForm.tsx
87
+ │ └── auth/ # Feature-specific (LoginForm)
92
88
  ├── app/ (or pages/)
93
- │ └── login/
94
- │ └── page.tsx # Page that uses LoginForm
89
+ │ └── login/page.tsx
95
90
  ```
96
91
 
97
- **Follow project conventions** (from scout):
98
- - Where components live
99
- - Naming pattern
100
- - Export style
92
+ **Follow project conventions** from scout.
101
93
 
102
94
  ### Step 4: Build Components
103
95
 
104
- **Order:** Base components → Feature components → Pages
105
-
106
- ```
107
- 1. Check if base components exist (Button, Input, etc.)
108
- 2. Create feature components
109
- 3. Create/modify pages
110
- 4. Wire up routing
111
- ```
112
-
113
- **Component Pattern:**
96
+ Essential component pattern:
114
97
 
115
98
  ```tsx
116
- // Follow project conventions
117
- // This is a common pattern, adapt to project
118
-
119
- interface LoginFormProps {
120
- onSuccess?: (user: User) => void;
121
- redirectTo?: string;
99
+ interface Props {
100
+ onSuccess?: (data: Data) => void;
122
101
  }
123
102
 
124
- export function LoginForm({ onSuccess, redirectTo = '/' }: LoginFormProps) {
103
+ export function FeatureForm({ onSuccess }: Props) {
125
104
  const [isLoading, setIsLoading] = useState(false);
126
105
  const [error, setError] = useState<string | null>(null);
127
106
 
@@ -131,9 +110,8 @@ export function LoginForm({ onSuccess, redirectTo = '/' }: LoginFormProps) {
131
110
  setError(null);
132
111
 
133
112
  try {
134
- const result = await login(formData);
135
- onSuccess?.(result.user);
136
- router.push(redirectTo);
113
+ const result = await apiCall(formData);
114
+ onSuccess?.(result);
137
115
  } catch (err) {
138
116
  setError(err.message);
139
117
  } finally {
@@ -146,389 +124,157 @@ export function LoginForm({ onSuccess, redirectTo = '/' }: LoginFormProps) {
146
124
  {error && <Alert variant="error">{error}</Alert>}
147
125
  {/* Form fields */}
148
126
  <Button type="submit" disabled={isLoading}>
149
- {isLoading ? 'Loading...' : 'Login'}
127
+ {isLoading ? 'Loading...' : 'Submit'}
150
128
  </Button>
151
129
  </form>
152
130
  );
153
131
  }
154
132
  ```
155
133
 
156
- ### Step 5: API Integration
157
-
158
- **Create API client functions:**
159
-
160
- ```typescript
161
- // lib/api/auth.ts
162
- export async function login(credentials: LoginCredentials) {
163
- const response = await fetch('/api/auth/login', {
164
- method: 'POST',
165
- headers: { 'Content-Type': 'application/json' },
166
- body: JSON.stringify(credentials),
167
- });
168
-
169
- if (!response.ok) {
170
- const error = await response.json();
171
- throw new Error(error.message || 'Login failed');
172
- }
173
-
174
- return response.json();
175
- }
176
- ```
177
-
178
- **Handle states:**
134
+ ### Step 5: Handle States
179
135
 
180
136
  ```tsx
181
- // Loading state
137
+ // Loading
182
138
  {isLoading && <Spinner />}
183
139
 
184
- // Error state
140
+ // Error
185
141
  {error && <Alert variant="error">{error}</Alert>}
186
142
 
187
- // Empty state
188
- {items.length === 0 && <EmptyState message="No items found" />}
189
-
190
- // Success state
191
- {items.map(item => <ItemCard key={item.id} item={item} />)}
192
- ```
193
-
194
- ### Step 6: Form Handling
143
+ // Empty
144
+ {items.length === 0 && <EmptyState />}
195
145
 
196
- **Validation Pattern:**
197
-
198
- ```tsx
199
- // Client-side validation
200
- const validateForm = (data: FormData) => {
201
- const errors: Record<string, string> = {};
202
-
203
- if (!data.email) {
204
- errors.email = 'Email is required';
205
- } else if (!isValidEmail(data.email)) {
206
- errors.email = 'Invalid email format';
207
- }
208
-
209
- if (!data.password) {
210
- errors.password = 'Password is required';
211
- } else if (data.password.length < 8) {
212
- errors.password = 'Password must be at least 8 characters';
213
- }
214
-
215
- return errors;
216
- };
217
-
218
- // Show errors
219
- {errors.email && <span className="error">{errors.email}</span>}
146
+ // Success
147
+ {items.map(item => <Card key={item.id} {...item} />)}
220
148
  ```
221
149
 
222
- **Form Libraries** (use if project has them):
223
- - react-hook-form
224
- - formik
225
- - native form handling
150
+ ### Step 6: Verify
226
151
 
227
- ### Step 7: Quick Verification
228
-
229
- Before `/dev-test` auto-runs, do quick sanity checks:
230
-
231
- **Visual verification:**
152
+ Quick sanity check before `/dev-test`:
232
153
 
233
154
  ```typescript
234
- // Option 1: Playwright snapshot
235
- await mcp__playwright__browser_navigate({ url: 'http://localhost:3000/login' });
155
+ // Visual snapshot
156
+ await mcp__playwright__browser_navigate({ url: 'http://localhost:3000/page' });
236
157
  await mcp__playwright__browser_snapshot({});
237
-
238
- // Option 2: Manual check
239
- // Navigate to page in browser, verify appearance
240
158
  ```
241
159
 
242
- **Quick checklist:**
243
160
  ```
244
161
  [ ] Page renders without console errors
245
162
  [ ] Components display correctly
246
163
  [ ] Forms accept input
247
164
  ```
248
165
 
249
- ### Step 8: Hand Off to Testing
250
-
251
- After frontend complete, `/dev-coding` auto-triggers `/dev-test` which:
252
-
253
- ```
254
- 1. Navigate to implemented page
255
- 2. Execute user flow from spec
256
- 3. Capture console errors
257
- 4. Capture network failures
258
- 5. Report issues or confirm pass
259
- ```
260
-
261
- **What /dev-test catches:**
262
- - Console errors (React errors, JS exceptions)
263
- - Network failures (API 4xx/5xx, CORS, timeouts)
264
- - Missing elements (render failures)
265
- - Broken interactions (form submit, navigation)
266
-
267
- **Verification checklist (covered by /dev-test):**
268
- ```
269
- [auto] Page renders without errors
270
- [auto] Console clean (no errors/warnings)
271
- [auto] API calls succeed (2xx responses)
272
- [auto] User flow completes
273
- [ ] Mobile responsive (manual if required)
274
- ```
275
-
276
- ## Common Patterns
277
-
278
- ### Conditional Rendering
279
-
280
- ```tsx
281
- // Auth guard
282
- {isAuthenticated ? <Dashboard /> : <Redirect to="/login" />}
283
-
284
- // Loading
285
- {isLoading ? <Spinner /> : <Content />}
286
-
287
- // Permission
288
- {user.canEdit && <EditButton />}
289
- ```
290
-
291
- ### Data Fetching
292
-
293
- ```tsx
294
- // Server component (Next.js App Router)
295
- async function PostsPage() {
296
- const posts = await getPosts(); // Fetches on server
297
- return <PostList posts={posts} />;
298
- }
299
-
300
- // Client component with useEffect
301
- function PostsPage() {
302
- const [posts, setPosts] = useState([]);
303
- const [isLoading, setIsLoading] = useState(true);
304
-
305
- useEffect(() => {
306
- getPosts().then(setPosts).finally(() => setIsLoading(false));
307
- }, []);
308
-
309
- if (isLoading) return <Spinner />;
310
- return <PostList posts={posts} />;
311
- }
312
-
313
- // With SWR/React Query
314
- function PostsPage() {
315
- const { data: posts, error, isLoading } = useSWR('/api/posts', fetcher);
316
-
317
- if (isLoading) return <Spinner />;
318
- if (error) return <Error message={error.message} />;
319
- return <PostList posts={posts} />;
320
- }
321
- ```
322
-
323
- ### Navigation
324
-
325
- ```tsx
326
- // Next.js
327
- import { useRouter } from 'next/navigation';
328
- const router = useRouter();
329
- router.push('/dashboard');
330
-
331
- // React Router
332
- import { useNavigate } from 'react-router-dom';
333
- const navigate = useNavigate();
334
- navigate('/dashboard');
335
- ```
336
-
337
- ### Toast/Notifications
338
-
339
- ```tsx
340
- // Success feedback
341
- toast.success('Saved successfully');
342
-
343
- // Error feedback
344
- toast.error('Failed to save. Please try again.');
345
-
346
- // Use project's toast library (sonner, react-hot-toast, etc.)
347
- ```
348
-
349
- ## Accessibility Checklist
166
+ ## Essential Checklists
350
167
 
168
+ ### Accessibility
351
169
  ```
352
170
  [ ] Images have alt text
353
171
  [ ] Form inputs have labels
354
172
  [ ] Buttons have accessible names
355
- [ ] Color contrast sufficient
356
173
  [ ] Keyboard navigation works
357
174
  [ ] Focus states visible
358
- [ ] Screen reader tested (if critical)
359
175
  ```
360
176
 
361
- ## Responsive Checklist
362
-
177
+ ### Responsive
363
178
  ```
364
- [ ] Mobile layout (< 768px)
365
- [ ] Tablet layout (768px - 1024px)
366
- [ ] Desktop layout (> 1024px)
367
- [ ] Touch targets large enough (44px minimum)
368
- [ ] No horizontal scroll on mobile
179
+ [ ] Mobile (< 768px)
180
+ [ ] Tablet (768px - 1024px)
181
+ [ ] Desktop (> 1024px)
182
+ [ ] Touch targets 44px minimum
369
183
  ```
370
184
 
371
- ## Debugging
372
-
373
- ### Component Not Rendering
185
+ ## Quick Debugging
374
186
 
375
187
  ```bash
376
- # Check console for errors
377
- # Browser DevToolsConsole
378
-
379
- # Check if component imported correctly
380
- # Check if props passed correctly
381
- # Check conditional rendering logic
188
+ # Console errors Browser DevTools
189
+ # Network failuresNetwork tab, check CORS
190
+ # Styling issues → Elements panel, check classes
382
191
  ```
383
192
 
384
- ### API Call Failing
385
-
386
- ```bash
387
- # Check Network tab in DevTools
388
- # Verify URL, method, headers
389
- # Check CORS if cross-origin
390
- # Verify backend is running
391
- ```
392
-
393
- ### Styling Issues
394
-
395
- ```bash
396
- # Check if styles imported
397
- # Check class names (typos)
398
- # Check CSS specificity
399
- # Check for conflicting styles
400
- # Use DevTools Elements panel
401
- ```
402
-
403
- ### Using Playwright for Debug
404
-
405
193
  ```typescript
406
- // Take screenshot of current state
407
- await mcp__playwright__browser_take_screenshot({
408
- filename: 'debug-screenshot.png'
409
- });
410
-
411
- // Check console messages
412
- await mcp__playwright__browser_console_messages({
413
- level: 'error'
414
- });
415
-
416
- // Check network requests
194
+ // Playwright debugging
195
+ await mcp__playwright__browser_console_messages({ level: 'error' });
417
196
  await mcp__playwright__browser_network_requests({});
197
+ await mcp__playwright__browser_take_screenshot({ filename: 'debug.png' });
418
198
  ```
419
199
 
420
- ## Tech-Specific References
421
-
422
- Load additional patterns based on detected tech:
423
-
424
- | Tech | Reference File |
425
- |------|---------------|
426
- | Next.js | `references/nextjs.md` |
427
- | Vue | `references/vue.md` |
428
- | React | `references/react.md` |
429
- | shadcn/ui | `references/shadcn.md` |
430
- | Tailwind | `references/tailwind.md` |
431
-
432
- These files contain tech-specific patterns, gotchas, and best practices. Add them as your projects use different stacks.
433
-
434
- ## Tools
200
+ ## Stack-Specific Patterns
435
201
 
436
- ### shadcn/ui Components (MCP)
202
+ **Do not implement generic patterns. Load from stacks/:**
437
203
 
438
- When project uses shadcn/ui, use these tools to get components:
204
+ | Stack | What to load | Key patterns |
205
+ |-------|--------------|--------------|
206
+ | Nuxt.js | `stacks/nuxt/` | Composables, useFetch, SSR |
207
+ | Next.js | `stacks/nextjs/` | Server Components, Actions |
208
+ | Vue | `stacks/vue/` (future) | Composition API, reactivity |
209
+ | React | `stacks/react/` (future) | Hooks, state patterns |
439
210
 
211
+ **Example - if using Nuxt:**
212
+ ```
213
+ 1. Read knowledge/stacks/nuxt/_index.md
214
+ 2. Use useFetch (not raw fetch)
215
+ 3. Use composables pattern
216
+ 4. Handle SSR hydration
440
217
  ```
441
- 1. Check available components
442
- → mcp__shadcn__list_components
443
-
444
- 2. Get component source code
445
- → mcp__shadcn__get_component("button")
446
- → mcp__shadcn__get_component("dialog")
447
-
448
- 3. Get usage examples
449
- → mcp__shadcn__get_component_demo("button")
450
- → mcp__shadcn__get_component_demo("form")
451
218
 
452
- 4. Get component metadata
453
- → mcp__shadcn__get_component_metadata("card")
219
+ ## Domain-Specific UI
454
220
 
455
- 5. Get pre-built blocks (dashboard, login, etc.)
456
- → mcp__shadcn__list_blocks
457
- → mcp__shadcn__get_block("login-01")
458
- → mcp__shadcn__get_block("dashboard-01")
459
- ```
221
+ **Load from domains/ when applicable:**
460
222
 
461
- **Workflow with shadcn:**
223
+ | Domain | What to load | Key patterns |
224
+ |--------|--------------|--------------|
225
+ | SaaS | `domains/saas/_index.md` | Pricing tables, subscription UI |
226
+ | E-commerce | `domains/ecommerce/_index.md` | Cart, checkout, product cards |
462
227
 
463
- ```
464
- 1. Check if project uses shadcn/ui
465
- → Look for components.json
466
- → Look for @/components/ui/
467
-
468
- 2. If yes, use shadcn tools:
469
- → List available components
470
- → Get source for needed components
471
- → Get demos for usage patterns
472
- → Get blocks for complex layouts
473
-
474
- 3. Adapt to project's style
475
- → Check existing component customizations
476
- → Follow project's variant patterns
477
- ```
228
+ ## Tools
478
229
 
479
- **Example:**
230
+ ### shadcn/ui Components
480
231
 
481
232
  ```
482
- Need: Login form with validation
233
+ # List components
234
+ mcp__shadcn__list_components
483
235
 
484
- 1. mcp__shadcn__get_block("login-01")
485
- → Get full login block
236
+ # Get component source
237
+ mcp__shadcn__get_component("button")
486
238
 
487
- 2. mcp__shadcn__get_component_demo("form")
488
- → See form validation patterns
239
+ # Get usage demo
240
+ mcp__shadcn__get_component_demo("form")
489
241
 
490
- 3. Adapt to project's API endpoints
491
- → Change form action
492
- → Match project's auth flow
242
+ # Get pre-built blocks
243
+ mcp__shadcn__list_blocks
244
+ mcp__shadcn__get_block("login-01")
245
+ mcp__shadcn__get_block("dashboard-01")
493
246
  ```
494
247
 
495
- ### Playwright (Visual Testing)
248
+ **Workflow:**
249
+ 1. Check if project uses shadcn (look for `components.json`)
250
+ 2. List available components
251
+ 3. Get demos for patterns
252
+ 4. Adapt to project's API
496
253
 
497
- Use Playwright for visual verification during development:
254
+ ### Playwright (Visual Verification)
498
255
 
499
256
  ```
500
- # Take screenshot to verify UI
501
- mcp__playwright__browser_take_screenshot
502
-
503
- # Get accessibility snapshot
504
- mcp__playwright__browser_snapshot
505
-
506
- # Check for console errors
257
+ mcp__playwright__browser_navigate({ url })
258
+ mcp__playwright__browser_snapshot({})
259
+ mcp__playwright__browser_take_screenshot({ filename })
507
260
  mcp__playwright__browser_console_messages({ level: "error" })
508
-
509
- # Verify network requests
510
- mcp__playwright__browser_network_requests
261
+ mcp__playwright__browser_network_requests({})
511
262
  ```
512
263
 
513
- ### Context7 (Documentation Lookup)
264
+ ### Context7 (Documentation)
514
265
 
515
- Look up framework/library documentation:
266
+ ```typescript
267
+ // Find library
268
+ mcp__context7__resolve-library-id({
269
+ libraryName: "react-hook-form",
270
+ query: "form validation"
271
+ })
516
272
 
517
- ```
518
- 1. Find library ID
519
- mcp__context7__resolve-library-id({
520
- libraryName: "react-hook-form",
521
- query: "form validation"
522
- })
523
-
524
- 2. Query documentation
525
- → mcp__context7__query-docs({
526
- libraryId: "/react-hook-form/react-hook-form",
527
- query: "how to validate email field"
528
- })
273
+ // Query docs
274
+ mcp__context7__query-docs({
275
+ libraryId: "/react-hook-form/react-hook-form",
276
+ query: "validate email field"
277
+ })
529
278
  ```
530
279
 
531
- **Use Context7 for:**
532
- - Framework-specific patterns (Next.js, Vue, etc.)
533
- - Library APIs (React Query, Zustand, etc.)
534
- - CSS framework docs (Tailwind, etc.)
280
+ Use for: Framework patterns, library APIs, CSS framework docs.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: dev-review
3
3
  description: Code review with focus on quality, security, and best practices
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  ---
6
6
 
7
7
  # /dev-review - Code Review
@@ -84,7 +84,18 @@ Reviews can be based on:
84
84
  → CLAUDE.md
85
85
  → .eslintrc, tsconfig.json
86
86
 
87
- 3. Read related spec (if UC provided)
87
+ 3. Read stack.md and stack knowledge
88
+ → plans/scout/stack.md
89
+ → Check "Stack Knowledge References" section
90
+ → Read each referenced knowledge/stacks/*.md file
91
+ → Use "For /dev-review" sections for review checklists
92
+
93
+ Examples:
94
+ - Directus project → Read knowledge/stacks/directus/_index.md
95
+ - Nuxt project → Read knowledge/stacks/nuxt/_index.md
96
+ - Next.js project → Read knowledge/stacks/nextjs/_index.md
97
+
98
+ 4. Read related spec (if UC provided)
88
99
  → plans/features/{feature}/specs/{UC}/README.md
89
100
  ```
90
101