@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.
- package/knowledge/domains/_index.md +105 -0
- package/knowledge/domains/ecommerce/_index.md +499 -0
- package/knowledge/domains/saas/_index.md +371 -0
- package/knowledge/stacks/_index.md +101 -0
- package/knowledge/stacks/directus/_index.md +349 -0
- package/knowledge/stacks/nextjs/_index.md +654 -0
- package/knowledge/stacks/nuxt/_index.md +469 -0
- package/package.json +3 -1
- package/project-scripts/graph.py +330 -0
- package/skills/_registry.md +61 -0
- package/skills/dev-coding/SKILL.md +16 -5
- package/skills/dev-coding-backend/SKILL.md +116 -251
- package/skills/dev-coding-frontend/SKILL.md +134 -388
- package/skills/dev-review/SKILL.md +13 -2
- package/skills/dev-scout/SKILL.md +180 -2
- package/skills/dev-scout/references/stack-patterns.md +371 -0
- package/skills/dev-specs/SKILL.md +74 -2
- package/src/commands/init.js +89 -12
- package/src/utils/project-setup.js +444 -0
- package/src/utils/skills.js +87 -1
- /package/{skills/dev-coding-frontend/references/nextjs.md → knowledge/stacks/nextjs/references/performance.md} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dev-scout
|
|
3
3
|
description: Explore and document existing codebases at various depths
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.8.0
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# /dev-scout - Codebase Explorer
|
|
@@ -40,6 +40,7 @@ plans/
|
|
|
40
40
|
│ ├── README.md # Current summary
|
|
41
41
|
│ ├── structure.md # File tree, tech stack
|
|
42
42
|
│ ├── features.md # Existing features
|
|
43
|
+
│ ├── stack.md # HOW the project works (API, data, patterns)
|
|
43
44
|
│ └── history/ # Previous snapshots
|
|
44
45
|
│ └── {date}.md
|
|
45
46
|
│
|
|
@@ -49,6 +50,12 @@ plans/
|
|
|
49
50
|
└── ...
|
|
50
51
|
```
|
|
51
52
|
|
|
53
|
+
**stack.md is critical** - it tells `/dev-specs` HOW to write specs that fit the project:
|
|
54
|
+
- Use the right SDK (not raw fetch)
|
|
55
|
+
- Follow existing patterns (composables, hooks, services)
|
|
56
|
+
- Respect data access method (BaaS vs direct DB)
|
|
57
|
+
- Use correct validation/form libraries
|
|
58
|
+
|
|
52
59
|
## Modes
|
|
53
60
|
|
|
54
61
|
| Mode | What It Does | When to Use |
|
|
@@ -389,7 +396,177 @@ Document:
|
|
|
389
396
|
- PR/commit requirements
|
|
390
397
|
```
|
|
391
398
|
|
|
392
|
-
### Step 5:
|
|
399
|
+
### Step 5: Stack Analysis (CRITICAL)
|
|
400
|
+
|
|
401
|
+
Generate `stack.md` - tells downstream skills HOW to work with this project.
|
|
402
|
+
|
|
403
|
+
See `references/stack-patterns.md` for detection patterns.
|
|
404
|
+
|
|
405
|
+
#### 5.1 Detect API Layer Type
|
|
406
|
+
|
|
407
|
+
```
|
|
408
|
+
Check for BaaS first (higher priority):
|
|
409
|
+
1. .env vars: DIRECTUS_URL, STRAPI_URL, SUPABASE_URL, etc.
|
|
410
|
+
2. package.json: @directus/sdk, @supabase/supabase-js, etc.
|
|
411
|
+
|
|
412
|
+
If no BaaS:
|
|
413
|
+
3. Check for API framework: express, fastify, hono
|
|
414
|
+
4. Check for GraphQL: @apollo/client, urql, graphql
|
|
415
|
+
5. Check for tRPC: @trpc/server
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
#### 5.2 Detect Data Access Pattern
|
|
419
|
+
|
|
420
|
+
```
|
|
421
|
+
If BaaS detected:
|
|
422
|
+
- Data managed by BaaS (don't suggest raw SQL)
|
|
423
|
+
- Note which collections/content types exist
|
|
424
|
+
|
|
425
|
+
If no BaaS:
|
|
426
|
+
- Check for ORM: prisma/, drizzle.config.*
|
|
427
|
+
- Check schema files for models
|
|
428
|
+
- Direct DB access pattern
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
#### 5.3 Detect API Client Pattern
|
|
432
|
+
|
|
433
|
+
```
|
|
434
|
+
Search for how the project calls APIs:
|
|
435
|
+
|
|
436
|
+
React projects:
|
|
437
|
+
- hooks/use*.ts → Custom hooks pattern
|
|
438
|
+
- services/*.ts → Service layer pattern
|
|
439
|
+
- @tanstack/react-query → React Query pattern
|
|
440
|
+
|
|
441
|
+
Vue projects:
|
|
442
|
+
- composables/use*.ts → Composables pattern
|
|
443
|
+
- stores/*.ts → Pinia stores
|
|
444
|
+
- @tanstack/vue-query → Vue Query pattern
|
|
445
|
+
|
|
446
|
+
Next.js:
|
|
447
|
+
- actions/*.ts → Server Actions
|
|
448
|
+
- app/api/** → API Routes
|
|
449
|
+
- Server components with direct calls
|
|
450
|
+
|
|
451
|
+
Identify the PRIMARY pattern used (not all).
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
#### 5.4 Detect Validation & Forms
|
|
455
|
+
|
|
456
|
+
```
|
|
457
|
+
Validation:
|
|
458
|
+
- zod in package.json → Zod schemas
|
|
459
|
+
- yup → Yup schemas
|
|
460
|
+
- Find: schemas/, validators/, *.schema.ts
|
|
461
|
+
|
|
462
|
+
Forms:
|
|
463
|
+
- react-hook-form → useForm pattern
|
|
464
|
+
- vee-validate → VeeValidate
|
|
465
|
+
- formik → Formik pattern
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
#### 5.5 Detect External Services
|
|
469
|
+
|
|
470
|
+
```
|
|
471
|
+
Parse .env.example or .env:
|
|
472
|
+
- STRIPE_* → Payment (Stripe)
|
|
473
|
+
- RESEND_* → Email (Resend)
|
|
474
|
+
- AWS_S3_* → Storage (S3)
|
|
475
|
+
- SENTRY_* → Monitoring (Sentry)
|
|
476
|
+
|
|
477
|
+
Match with package.json to confirm SDK.
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
#### 5.6 Detect Local Services
|
|
481
|
+
|
|
482
|
+
```
|
|
483
|
+
Parse docker-compose.yml or compose.yml:
|
|
484
|
+
- postgres → PostgreSQL
|
|
485
|
+
- redis → Redis
|
|
486
|
+
- minio → S3-compatible storage
|
|
487
|
+
- directus → Directus CMS
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
#### 5.7 Detect Available MCPs
|
|
491
|
+
|
|
492
|
+
```
|
|
493
|
+
Check .claude/settings.local.json or mcp.json:
|
|
494
|
+
- context7 → Library docs lookup
|
|
495
|
+
- playwright → Browser automation
|
|
496
|
+
- shadcn → UI components
|
|
497
|
+
- Custom MCPs → Project-specific tools
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
#### 5.8 Generate stack.md
|
|
501
|
+
|
|
502
|
+
Output `plans/scout/stack.md`:
|
|
503
|
+
|
|
504
|
+
```markdown
|
|
505
|
+
# Project Stack
|
|
506
|
+
|
|
507
|
+
> Auto-detected by /dev-scout. Verify and update as needed.
|
|
508
|
+
|
|
509
|
+
## API Layer
|
|
510
|
+
| Aspect | Value |
|
|
511
|
+
|--------|-------|
|
|
512
|
+
| Type | {REST/GraphQL/tRPC/BaaS} |
|
|
513
|
+
| Service | {Directus/Supabase/Custom/etc.} |
|
|
514
|
+
| SDK | {package name if applicable} |
|
|
515
|
+
|
|
516
|
+
## Data Access
|
|
517
|
+
| Aspect | Value |
|
|
518
|
+
|--------|-------|
|
|
519
|
+
| Method | {BaaS-managed/ORM/Direct SQL} |
|
|
520
|
+
| ORM | {Prisma/Drizzle/none} |
|
|
521
|
+
| Models | {list key models} |
|
|
522
|
+
|
|
523
|
+
## API Client Pattern
|
|
524
|
+
| Aspect | Value |
|
|
525
|
+
|--------|-------|
|
|
526
|
+
| Pattern | {hooks/composables/services/direct} |
|
|
527
|
+
| Location | {folder path} |
|
|
528
|
+
| Example | {primary function used} |
|
|
529
|
+
|
|
530
|
+
## Validation & Forms
|
|
531
|
+
| Aspect | Value |
|
|
532
|
+
|--------|-------|
|
|
533
|
+
| Validation | {Zod/Yup/none} |
|
|
534
|
+
| Schemas | {folder path} |
|
|
535
|
+
| Forms | {react-hook-form/vee-validate/native} |
|
|
536
|
+
|
|
537
|
+
## External Services
|
|
538
|
+
| Service | Provider | Env Var |
|
|
539
|
+
|---------|----------|---------|
|
|
540
|
+
| {type} | {provider} | {var} |
|
|
541
|
+
|
|
542
|
+
## Local Services (docker-compose)
|
|
543
|
+
| Service | Purpose | Port |
|
|
544
|
+
|---------|---------|------|
|
|
545
|
+
| {name} | {purpose} | {port} |
|
|
546
|
+
|
|
547
|
+
## Available MCPs
|
|
548
|
+
| MCP | Capability |
|
|
549
|
+
|-----|------------|
|
|
550
|
+
| {name} | {what it provides} |
|
|
551
|
+
|
|
552
|
+
## Specs Guidelines
|
|
553
|
+
|
|
554
|
+
Based on this stack, implementation should:
|
|
555
|
+
1. {guideline based on API layer}
|
|
556
|
+
2. {guideline based on data access}
|
|
557
|
+
3. {guideline based on patterns}
|
|
558
|
+
4. {guideline based on validation}
|
|
559
|
+
|
|
560
|
+
## Stack Knowledge References
|
|
561
|
+
|
|
562
|
+
For best practices and patterns, downstream skills should read:
|
|
563
|
+
{list only those that apply to this project}
|
|
564
|
+
- `knowledge/stacks/directus/_index.md` - Directus SDK patterns, queries, auth
|
|
565
|
+
- `knowledge/stacks/nuxt/_index.md` - Nuxt composables, SSR, server routes
|
|
566
|
+
- `knowledge/stacks/nextjs/_index.md` - Server Components, Actions, App Router
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
### Step 6: Generate Output
|
|
393
570
|
|
|
394
571
|
#### Project-Level Output
|
|
395
572
|
|
|
@@ -721,3 +898,4 @@ Quick codebase analysis with optional tool installation:
|
|
|
721
898
|
- `references/file-patterns.md` - Search patterns
|
|
722
899
|
- `references/feature-patterns.md` - Feature inference
|
|
723
900
|
- `references/tech-detection.md` - Tech stack detection
|
|
901
|
+
- `references/stack-patterns.md` - Deep stack analysis (API, data, patterns)
|
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
# Stack Patterns Detection
|
|
2
|
+
|
|
3
|
+
Detect HOW the project works, not just what frameworks are used.
|
|
4
|
+
|
|
5
|
+
## BaaS / Headless CMS
|
|
6
|
+
|
|
7
|
+
Projects using Backend-as-a-Service or Headless CMS have different patterns than custom backends.
|
|
8
|
+
|
|
9
|
+
### Detection
|
|
10
|
+
|
|
11
|
+
| Evidence | Service | SDK |
|
|
12
|
+
|----------|---------|-----|
|
|
13
|
+
| `DIRECTUS_URL` in .env | Directus | `@directus/sdk` |
|
|
14
|
+
| `STRAPI_URL` in .env | Strapi | `@strapi/strapi` |
|
|
15
|
+
| `SANITY_PROJECT_ID` in .env | Sanity | `@sanity/client` |
|
|
16
|
+
| `CONTENTFUL_SPACE_ID` in .env | Contentful | `contentful` |
|
|
17
|
+
| `SUPABASE_URL` in .env | Supabase | `@supabase/supabase-js` |
|
|
18
|
+
| `FIREBASE_*` in .env | Firebase | `firebase` |
|
|
19
|
+
| `APPWRITE_*` in .env | Appwrite | `appwrite` |
|
|
20
|
+
| `POCKETBASE_URL` in .env | PocketBase | `pocketbase` |
|
|
21
|
+
| `PAYLOAD_*` in .env | Payload CMS | `payload` |
|
|
22
|
+
|
|
23
|
+
### Implications
|
|
24
|
+
|
|
25
|
+
When BaaS detected:
|
|
26
|
+
- **Don't suggest**: Custom REST endpoints, direct DB queries
|
|
27
|
+
- **Do suggest**: Use SDK methods, follow BaaS patterns
|
|
28
|
+
- **Data model**: Managed by BaaS (collections, content types)
|
|
29
|
+
- **Auth**: Usually provider-managed
|
|
30
|
+
|
|
31
|
+
## API Layer Type
|
|
32
|
+
|
|
33
|
+
### REST (Custom)
|
|
34
|
+
|
|
35
|
+
**Detection**:
|
|
36
|
+
- `/api/**` routes with HTTP method handlers
|
|
37
|
+
- `express`, `fastify`, `hono` in dependencies
|
|
38
|
+
- `routes/`, `controllers/` folders
|
|
39
|
+
|
|
40
|
+
**Pattern**: Custom endpoints, direct DB access
|
|
41
|
+
|
|
42
|
+
### REST (BaaS)
|
|
43
|
+
|
|
44
|
+
**Detection**:
|
|
45
|
+
- BaaS SDK in dependencies
|
|
46
|
+
- No `/api/` routes (or minimal proxy routes)
|
|
47
|
+
- Env vars for BaaS URL
|
|
48
|
+
|
|
49
|
+
**Pattern**: SDK calls, managed endpoints
|
|
50
|
+
|
|
51
|
+
### GraphQL
|
|
52
|
+
|
|
53
|
+
**Detection**:
|
|
54
|
+
- `graphql`, `@apollo/client`, `urql` in dependencies
|
|
55
|
+
- `.graphql` files, `gql` template literals
|
|
56
|
+
- `/api/graphql` endpoint
|
|
57
|
+
|
|
58
|
+
**Pattern**: Queries, mutations, fragments
|
|
59
|
+
|
|
60
|
+
### tRPC
|
|
61
|
+
|
|
62
|
+
**Detection**:
|
|
63
|
+
- `@trpc/server`, `@trpc/client` in dependencies
|
|
64
|
+
- `trpc/` folder with routers
|
|
65
|
+
- Type-safe procedure calls
|
|
66
|
+
|
|
67
|
+
**Pattern**: Procedures, type inference
|
|
68
|
+
|
|
69
|
+
## Data Access Patterns
|
|
70
|
+
|
|
71
|
+
### Direct Database
|
|
72
|
+
|
|
73
|
+
**Detection**:
|
|
74
|
+
- ORM/Query builder (Prisma, Drizzle, Knex)
|
|
75
|
+
- `prisma/schema.prisma`, `drizzle/` folder
|
|
76
|
+
- Direct SQL files
|
|
77
|
+
|
|
78
|
+
**Implications**:
|
|
79
|
+
- Can modify schema
|
|
80
|
+
- Write migrations
|
|
81
|
+
- Direct queries
|
|
82
|
+
|
|
83
|
+
### Managed by BaaS
|
|
84
|
+
|
|
85
|
+
**Detection**:
|
|
86
|
+
- BaaS SDK, no ORM
|
|
87
|
+
- No `prisma/`, no migrations
|
|
88
|
+
- Content types managed in BaaS admin
|
|
89
|
+
|
|
90
|
+
**Implications**:
|
|
91
|
+
- Don't create tables, use BaaS admin
|
|
92
|
+
- Query via SDK
|
|
93
|
+
- Schema changes via BaaS dashboard
|
|
94
|
+
|
|
95
|
+
### Hybrid
|
|
96
|
+
|
|
97
|
+
**Detection**:
|
|
98
|
+
- BaaS for content + local DB for app data
|
|
99
|
+
- Multiple data sources
|
|
100
|
+
|
|
101
|
+
**Implications**:
|
|
102
|
+
- Identify which data goes where
|
|
103
|
+
- Document boundary
|
|
104
|
+
|
|
105
|
+
## API Client Patterns
|
|
106
|
+
|
|
107
|
+
Where and how the project calls APIs.
|
|
108
|
+
|
|
109
|
+
### React Patterns
|
|
110
|
+
|
|
111
|
+
| Pattern | Location | Example |
|
|
112
|
+
|---------|----------|---------|
|
|
113
|
+
| Custom hooks | `hooks/use*.ts` | `useUsers()`, `useApi()` |
|
|
114
|
+
| React Query | `hooks/` + `@tanstack/react-query` | `useQuery()` wrapper |
|
|
115
|
+
| SWR | `hooks/` + `swr` | `useSWR()` wrapper |
|
|
116
|
+
| Services | `services/*.ts` | `userService.getAll()` |
|
|
117
|
+
| Direct fetch | In components | `fetch('/api/...')` |
|
|
118
|
+
|
|
119
|
+
### Vue Patterns
|
|
120
|
+
|
|
121
|
+
| Pattern | Location | Example |
|
|
122
|
+
|---------|----------|---------|
|
|
123
|
+
| Composables | `composables/use*.ts` | `useDirectus()`, `useApi()` |
|
|
124
|
+
| Pinia stores | `stores/*.ts` | `useUserStore()` |
|
|
125
|
+
| Services | `services/*.ts` | `userService.getAll()` |
|
|
126
|
+
| Vue Query | `composables/` + `@tanstack/vue-query` | `useQuery()` |
|
|
127
|
+
|
|
128
|
+
### Next.js Patterns
|
|
129
|
+
|
|
130
|
+
| Pattern | Location | Example |
|
|
131
|
+
|---------|----------|---------|
|
|
132
|
+
| Server Actions | `actions/*.ts` or inline | `'use server'` functions |
|
|
133
|
+
| API Routes | `app/api/**` | Route handlers |
|
|
134
|
+
| Server Components | `app/**/page.tsx` | Direct DB/API calls |
|
|
135
|
+
| Client hooks | `hooks/` | Client-side fetching |
|
|
136
|
+
|
|
137
|
+
### Nuxt Patterns
|
|
138
|
+
|
|
139
|
+
| Pattern | Location | Example |
|
|
140
|
+
|---------|----------|---------|
|
|
141
|
+
| Composables | `composables/use*.ts` | Auto-imported |
|
|
142
|
+
| useFetch | In components | Built-in `useFetch()` |
|
|
143
|
+
| useAsyncData | In components | SSR data fetching |
|
|
144
|
+
| Server routes | `server/api/**` | Nitro API routes |
|
|
145
|
+
|
|
146
|
+
### Detection Strategy
|
|
147
|
+
|
|
148
|
+
1. Check for hooks/composables folder
|
|
149
|
+
2. Search for `use` prefix functions
|
|
150
|
+
3. Check for services folder
|
|
151
|
+
4. Look at import patterns in components
|
|
152
|
+
5. Identify the PRIMARY pattern (not all)
|
|
153
|
+
|
|
154
|
+
## Validation Libraries
|
|
155
|
+
|
|
156
|
+
| Dependency | Library | Usage |
|
|
157
|
+
|------------|---------|-------|
|
|
158
|
+
| `zod` | Zod | Schema-first, TypeScript inference |
|
|
159
|
+
| `yup` | Yup | Schema builder, common with Formik |
|
|
160
|
+
| `joi` | Joi | Enterprise, detailed validation |
|
|
161
|
+
| `valibot` | Valibot | Lightweight Zod alternative |
|
|
162
|
+
| `@sinclair/typebox` | TypeBox | JSON Schema compatible |
|
|
163
|
+
|
|
164
|
+
**Pattern detection**:
|
|
165
|
+
```
|
|
166
|
+
Search for:
|
|
167
|
+
- schemas/, validators/ folders
|
|
168
|
+
- *.schema.ts, *.validator.ts files
|
|
169
|
+
- z.object, yup.object, Joi.object imports
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Form Handling
|
|
173
|
+
|
|
174
|
+
| Dependency | Library | Framework |
|
|
175
|
+
|------------|---------|-----------|
|
|
176
|
+
| `react-hook-form` | React Hook Form | React |
|
|
177
|
+
| `formik` | Formik | React |
|
|
178
|
+
| `vee-validate` | VeeValidate | Vue |
|
|
179
|
+
| `@tanstack/react-form` | TanStack Form | React |
|
|
180
|
+
| `formsnap` | Formsnap | Svelte |
|
|
181
|
+
|
|
182
|
+
**Pattern detection**:
|
|
183
|
+
```
|
|
184
|
+
Search for:
|
|
185
|
+
- useForm, useFormik imports
|
|
186
|
+
- <Form>, <Field> components
|
|
187
|
+
- form/, forms/ folders
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## External Services
|
|
191
|
+
|
|
192
|
+
### Payment
|
|
193
|
+
|
|
194
|
+
| Env Var | Service | SDK |
|
|
195
|
+
|---------|---------|-----|
|
|
196
|
+
| `STRIPE_*` | Stripe | `stripe`, `@stripe/stripe-js` |
|
|
197
|
+
| `PAYPAL_*` | PayPal | `@paypal/checkout-server-sdk` |
|
|
198
|
+
| `LEMON_SQUEEZY_*` | Lemon Squeezy | `@lemonsqueezy/lemonsqueezy.js` |
|
|
199
|
+
| `PADDLE_*` | Paddle | `@paddle/paddle-js` |
|
|
200
|
+
|
|
201
|
+
### Email
|
|
202
|
+
|
|
203
|
+
| Env Var | Service | SDK |
|
|
204
|
+
|---------|---------|-----|
|
|
205
|
+
| `RESEND_*` | Resend | `resend` |
|
|
206
|
+
| `SENDGRID_*` | SendGrid | `@sendgrid/mail` |
|
|
207
|
+
| `POSTMARK_*` | Postmark | `postmark` |
|
|
208
|
+
| `MAILGUN_*` | Mailgun | `mailgun.js` |
|
|
209
|
+
| `AWS_SES_*` | AWS SES | `@aws-sdk/client-ses` |
|
|
210
|
+
|
|
211
|
+
### Storage
|
|
212
|
+
|
|
213
|
+
| Env Var | Service | SDK |
|
|
214
|
+
|---------|---------|-----|
|
|
215
|
+
| `AWS_S3_*`, `S3_*` | AWS S3 | `@aws-sdk/client-s3` |
|
|
216
|
+
| `CLOUDFLARE_R2_*` | Cloudflare R2 | `@aws-sdk/client-s3` (S3 compatible) |
|
|
217
|
+
| `UPLOADTHING_*` | UploadThing | `uploadthing` |
|
|
218
|
+
| `CLOUDINARY_*` | Cloudinary | `cloudinary` |
|
|
219
|
+
|
|
220
|
+
### Search
|
|
221
|
+
|
|
222
|
+
| Env Var | Service | SDK |
|
|
223
|
+
|---------|---------|-----|
|
|
224
|
+
| `ALGOLIA_*` | Algolia | `algoliasearch` |
|
|
225
|
+
| `MEILISEARCH_*` | Meilisearch | `meilisearch` |
|
|
226
|
+
| `TYPESENSE_*` | Typesense | `typesense` |
|
|
227
|
+
|
|
228
|
+
### Analytics
|
|
229
|
+
|
|
230
|
+
| Env Var | Service |
|
|
231
|
+
|---------|---------|
|
|
232
|
+
| `NEXT_PUBLIC_GA_*`, `GA_*` | Google Analytics |
|
|
233
|
+
| `NEXT_PUBLIC_POSTHOG_*` | PostHog |
|
|
234
|
+
| `MIXPANEL_*` | Mixpanel |
|
|
235
|
+
| `SEGMENT_*` | Segment |
|
|
236
|
+
|
|
237
|
+
### Monitoring
|
|
238
|
+
|
|
239
|
+
| Env Var | Service |
|
|
240
|
+
|---------|---------|
|
|
241
|
+
| `SENTRY_*` | Sentry |
|
|
242
|
+
| `DATADOG_*` | Datadog |
|
|
243
|
+
| `LOGROCKET_*` | LogRocket |
|
|
244
|
+
|
|
245
|
+
## Docker Compose Services
|
|
246
|
+
|
|
247
|
+
Parse `docker-compose.yml` or `compose.yml`:
|
|
248
|
+
|
|
249
|
+
| Service Image | Purpose |
|
|
250
|
+
|---------------|---------|
|
|
251
|
+
| `postgres:*` | PostgreSQL database |
|
|
252
|
+
| `mysql:*` | MySQL database |
|
|
253
|
+
| `mongo:*` | MongoDB |
|
|
254
|
+
| `redis:*` | Redis cache/queue |
|
|
255
|
+
| `minio:*` | S3-compatible storage |
|
|
256
|
+
| `mailhog:*`, `mailpit:*` | Local email testing |
|
|
257
|
+
| `directus:*` | Directus CMS |
|
|
258
|
+
| `strapi:*` | Strapi CMS |
|
|
259
|
+
|
|
260
|
+
## MCP Tools Detection
|
|
261
|
+
|
|
262
|
+
Check `.claude/settings.local.json` or `mcp.json`:
|
|
263
|
+
|
|
264
|
+
```json
|
|
265
|
+
{
|
|
266
|
+
"mcpServers": {
|
|
267
|
+
"context7": { ... },
|
|
268
|
+
"playwright": { ... },
|
|
269
|
+
"shadcn": { ... }
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
**Available MCPs provide capabilities:**
|
|
275
|
+
|
|
276
|
+
| MCP | Capability |
|
|
277
|
+
|-----|------------|
|
|
278
|
+
| `context7` | Library documentation lookup |
|
|
279
|
+
| `playwright` | Browser automation, screenshots |
|
|
280
|
+
| `shadcn` | UI component source code |
|
|
281
|
+
| Custom MCPs | Project-specific tools |
|
|
282
|
+
|
|
283
|
+
## Output: stack.md
|
|
284
|
+
|
|
285
|
+
```markdown
|
|
286
|
+
# Project Stack
|
|
287
|
+
|
|
288
|
+
> Auto-detected by /dev-scout. Verify and update as needed.
|
|
289
|
+
|
|
290
|
+
## API Layer
|
|
291
|
+
|
|
292
|
+
| Aspect | Value |
|
|
293
|
+
|--------|-------|
|
|
294
|
+
| Type | BaaS (Directus) |
|
|
295
|
+
| SDK | @directus/sdk |
|
|
296
|
+
| Pattern | composables/useDirectus.ts |
|
|
297
|
+
|
|
298
|
+
## Data Access
|
|
299
|
+
|
|
300
|
+
| Aspect | Value |
|
|
301
|
+
|--------|-------|
|
|
302
|
+
| Access | Managed by Directus |
|
|
303
|
+
| Collections | users, posts, media |
|
|
304
|
+
| Direct DB | No (use SDK) |
|
|
305
|
+
|
|
306
|
+
## Auth
|
|
307
|
+
|
|
308
|
+
| Aspect | Value |
|
|
309
|
+
|--------|-------|
|
|
310
|
+
| Provider | Directus Auth |
|
|
311
|
+
| Pattern | middleware/auth.ts |
|
|
312
|
+
| Storage | Directus handles sessions |
|
|
313
|
+
|
|
314
|
+
## API Client
|
|
315
|
+
|
|
316
|
+
| Aspect | Value |
|
|
317
|
+
|--------|-------|
|
|
318
|
+
| Pattern | Vue composables |
|
|
319
|
+
| Location | composables/use*.ts |
|
|
320
|
+
| Primary | useDirectus(), useApi() |
|
|
321
|
+
|
|
322
|
+
## Validation & Forms
|
|
323
|
+
|
|
324
|
+
| Aspect | Value |
|
|
325
|
+
|--------|-------|
|
|
326
|
+
| Validation | Zod (shared/schemas/) |
|
|
327
|
+
| Forms | VeeValidate |
|
|
328
|
+
|
|
329
|
+
## External Services
|
|
330
|
+
|
|
331
|
+
| Service | Provider | Env Var |
|
|
332
|
+
|---------|----------|---------|
|
|
333
|
+
| Email | Resend | RESEND_API_KEY |
|
|
334
|
+
| Storage | S3 via Directus | (managed) |
|
|
335
|
+
| Payment | Stripe | STRIPE_SECRET_KEY |
|
|
336
|
+
|
|
337
|
+
## Local Development
|
|
338
|
+
|
|
339
|
+
| Service | Purpose | Port |
|
|
340
|
+
|---------|---------|------|
|
|
341
|
+
| postgres | Database | 5432 |
|
|
342
|
+
| redis | Cache | 6379 |
|
|
343
|
+
| directus | CMS | 8055 |
|
|
344
|
+
|
|
345
|
+
## Available MCPs
|
|
346
|
+
|
|
347
|
+
| MCP | Use For |
|
|
348
|
+
|-----|---------|
|
|
349
|
+
| context7 | Library docs |
|
|
350
|
+
| playwright | UI testing |
|
|
351
|
+
|
|
352
|
+
## Specs Guidelines
|
|
353
|
+
|
|
354
|
+
Based on this stack, specs should:
|
|
355
|
+
|
|
356
|
+
1. **API calls**: Use `useDirectus()` composable, not fetch
|
|
357
|
+
2. **Data**: Use Directus collections, not raw SQL
|
|
358
|
+
3. **Auth**: Use Directus auth middleware
|
|
359
|
+
4. **Validation**: Add Zod schemas to shared/schemas/
|
|
360
|
+
5. **Forms**: Use VeeValidate with Zod resolver
|
|
361
|
+
6. **New features**: Follow composables pattern
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
## Detection Priority
|
|
365
|
+
|
|
366
|
+
1. **Environment variables** - Most reliable for services
|
|
367
|
+
2. **package.json** - SDKs and libraries
|
|
368
|
+
3. **Config files** - Framework/tool configs
|
|
369
|
+
4. **Code patterns** - How things are actually used
|
|
370
|
+
5. **Docker compose** - Local services
|
|
371
|
+
6. **MCP config** - Available tools
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dev-specs
|
|
3
3
|
description: Generate implementation specifications from BRD use cases
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.5.0
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# /dev-specs - Implementation Specifications
|
|
@@ -11,6 +11,7 @@ version: 1.4.0
|
|
|
11
11
|
> - **Auto**: Runs `/dev-scout` if scout.md missing
|
|
12
12
|
> - **During**: Calls `/dev-arch` for patterns and architecture decisions
|
|
13
13
|
> - **Reads**: `_quality-attributes.md` (Specification Level)
|
|
14
|
+
> - **Critical**: Reads `stack.md` to use correct SDK, patterns, validation
|
|
14
15
|
> - **After**: Use `/dev-coding` for implementation
|
|
15
16
|
|
|
16
17
|
Generate precise implementation plans from BRD use cases. Creates per-UC specs with shared components.
|
|
@@ -186,6 +187,71 @@ Call `/dev-arch` for patterns to use:
|
|
|
186
187
|
|
|
187
188
|
Specs will use these patterns for consistency.
|
|
188
189
|
|
|
190
|
+
### Phase 0.7: Read Stack Configuration (CRITICAL)
|
|
191
|
+
|
|
192
|
+
Read `plans/scout/stack.md` to understand HOW to implement:
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
1. Check: plans/scout/stack.md exists?
|
|
196
|
+
→ No: Warn "Run /dev-scout for better specs"
|
|
197
|
+
|
|
198
|
+
2. Extract key information:
|
|
199
|
+
→ API Layer: BaaS, REST, GraphQL, tRPC
|
|
200
|
+
→ SDK to use: @directus/sdk, @supabase/supabase-js, etc.
|
|
201
|
+
→ Data access: BaaS-managed, ORM, direct SQL
|
|
202
|
+
→ API client pattern: hooks, composables, services
|
|
203
|
+
→ Validation: Zod, Yup, native
|
|
204
|
+
→ Forms: react-hook-form, vee-validate
|
|
205
|
+
→ External services: What's already configured
|
|
206
|
+
|
|
207
|
+
3. Load stack knowledge files (IMPORTANT):
|
|
208
|
+
→ Check "Stack Knowledge References" section in stack.md
|
|
209
|
+
→ Read each referenced knowledge/stacks/*.md file
|
|
210
|
+
→ Use "For /dev-specs" sections for patterns
|
|
211
|
+
|
|
212
|
+
Examples:
|
|
213
|
+
- Directus project → Read knowledge/stacks/directus/_index.md
|
|
214
|
+
- Nuxt project → Read knowledge/stacks/nuxt/_index.md
|
|
215
|
+
- Next.js project → Read knowledge/stacks/nextjs/_index.md
|
|
216
|
+
|
|
217
|
+
4. Use this to write specs that FIT the project
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
**Why this matters:**
|
|
221
|
+
|
|
222
|
+
| Without stack.md | With stack.md |
|
|
223
|
+
|------------------|---------------|
|
|
224
|
+
| "Create REST endpoint" | "Use Directus collection via SDK" |
|
|
225
|
+
| "Create fetch wrapper" | "Use existing `useApi()` composable" |
|
|
226
|
+
| "Add validation" | "Add Zod schema to shared/schemas/" |
|
|
227
|
+
| "Handle auth" | "Use Directus auth middleware" |
|
|
228
|
+
|
|
229
|
+
**Stack-aware spec generation:**
|
|
230
|
+
|
|
231
|
+
| Stack Aspect | Spec Impact |
|
|
232
|
+
|--------------|-------------|
|
|
233
|
+
| BaaS (Directus) | Don't create tables, use collections |
|
|
234
|
+
| Composables pattern | New features use composables, not services |
|
|
235
|
+
| Zod validation | Schema in shared/schemas/*.ts |
|
|
236
|
+
| Server Actions (Next.js) | Use 'use server' not API routes |
|
|
237
|
+
| React Query | Wrap in useQuery, not raw fetch |
|
|
238
|
+
|
|
239
|
+
**Example: spec for "Add user profile"**
|
|
240
|
+
|
|
241
|
+
Without stack.md:
|
|
242
|
+
```markdown
|
|
243
|
+
1. Create POST /api/users/profile endpoint
|
|
244
|
+
2. Add Prisma User model
|
|
245
|
+
3. Create ProfileForm with useState
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
With stack.md (Directus + Vue composables):
|
|
249
|
+
```markdown
|
|
250
|
+
1. Add profile fields to Directus users collection (via admin)
|
|
251
|
+
2. Create useUserProfile composable using useDirectus()
|
|
252
|
+
3. Create ProfileForm using VeeValidate + Zod schema
|
|
253
|
+
```
|
|
254
|
+
|
|
189
255
|
### Phase 1: Gather Context
|
|
190
256
|
|
|
191
257
|
1. **Read BRD use cases** for the feature
|
|
@@ -560,10 +626,16 @@ When writing specs, use Context7 to verify API patterns:
|
|
|
560
626
|
| Skill | Relationship |
|
|
561
627
|
|-------|--------------|
|
|
562
628
|
| `/debrief` | Provides use cases (input) |
|
|
563
|
-
| `/dev-scout` | Provides codebase context (input) |
|
|
629
|
+
| `/dev-scout` | Provides codebase context + stack.md (input) |
|
|
564
630
|
| `/dev-arch` | Provides architecture patterns (input) |
|
|
565
631
|
| `/utils/diagram` | Validates mermaid in specs |
|
|
566
632
|
|
|
633
|
+
**Key dependency**: `stack.md` from `/dev-scout` tells specs HOW to implement:
|
|
634
|
+
- Which SDK to use (not raw fetch)
|
|
635
|
+
- Which patterns to follow (hooks vs services vs composables)
|
|
636
|
+
- Which validation library (Zod vs Yup)
|
|
637
|
+
- Whether to use BaaS or direct DB
|
|
638
|
+
|
|
567
639
|
## Tips
|
|
568
640
|
|
|
569
641
|
- Run `/dev-scout {feature}` first for better context
|