start-vibing-stacks 2.3.0 → 2.4.1

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,29 +1,13 @@
1
1
  {
2
2
  "id": "nodejs",
3
3
  "name": "Node.js / TypeScript",
4
- "icon": "\ud83d\udce6",
4
+ "icon": "📦",
5
5
  "runtime": "Bun / Node.js 20+",
6
6
  "minVersion": "20.0.0",
7
7
  "packageManager": "bun|npm|pnpm",
8
- "extensions": [
9
- ".ts",
10
- ".tsx",
11
- ".js",
12
- ".jsx",
13
- ".mjs",
14
- ".cjs"
15
- ],
16
- "testExtensions": [
17
- "*.test.ts",
18
- "*.spec.ts",
19
- "*.test.tsx"
20
- ],
21
- "detectFiles": [
22
- "package.json",
23
- "tsconfig.json",
24
- "bun.lockb",
25
- "next.config.js"
26
- ],
8
+ "extensions": [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs"],
9
+ "testExtensions": ["*.test.ts", "*.spec.ts", "*.test.tsx"],
10
+ "detectFiles": ["package.json", "tsconfig.json", "bun.lockb", "bun.lock", "next.config.js"],
27
11
  "commands": {
28
12
  "test": "bun run test",
29
13
  "lint": "bun run lint",
@@ -33,146 +17,95 @@
33
17
  "typecheck": "bun run typecheck"
34
18
  },
35
19
  "qualityGates": [
36
- {
37
- "name": "TypeCheck",
38
- "command": "bun run typecheck",
39
- "required": true,
40
- "order": 1
41
- },
42
- {
43
- "name": "Lint",
44
- "command": "bun run lint",
45
- "required": true,
46
- "order": 2
47
- },
48
- {
49
- "name": "Tests",
50
- "command": "bun run test",
51
- "required": true,
52
- "order": 3
53
- },
54
- {
55
- "name": "Build",
56
- "command": "bun run build",
57
- "required": true,
58
- "order": 4
59
- }
20
+ { "name": "TypeCheck", "command": "bun run typecheck", "required": true, "order": 1 },
21
+ { "name": "Lint", "command": "bun run lint", "required": true, "order": 2 },
22
+ { "name": "Tests", "command": "bun run test", "required": true, "order": 3 },
23
+ { "name": "Build", "command": "bun run build", "required": true, "order": 4 }
60
24
  ],
61
25
  "frameworks": [
62
26
  {
63
27
  "id": "nextjs",
64
28
  "name": "Next.js (App Router)",
65
- "icon": "\u25b2",
66
- "detectFiles": [
67
- "next.config.js",
68
- "next.config.ts",
69
- "next.config.mjs"
70
- ]
29
+ "icon": "",
30
+ "detectFiles": ["next.config.js", "next.config.ts", "next.config.mjs"],
31
+ "default": true,
32
+ "skills": ["nextjs-app-router"]
71
33
  },
72
34
  {
73
35
  "id": "nuxt",
74
36
  "name": "Nuxt",
75
- "icon": "\ud83d\udc9a",
76
- "detectFiles": [
77
- "nuxt.config.ts"
78
- ]
37
+ "icon": "💚",
38
+ "detectFiles": ["nuxt.config.ts"],
39
+ "skills": []
79
40
  },
80
41
  {
81
42
  "id": "astro",
82
43
  "name": "Astro",
83
- "icon": "\ud83d\ude80",
84
- "detectFiles": [
85
- "astro.config.mjs"
86
- ]
44
+ "icon": "🚀",
45
+ "detectFiles": ["astro.config.mjs"],
46
+ "skills": []
87
47
  },
88
48
  {
89
49
  "id": "express",
90
50
  "name": "Express",
91
- "icon": "\u26a1"
51
+ "icon": "",
52
+ "skills": ["trpc-api"]
92
53
  },
93
54
  {
94
55
  "id": "fastify",
95
56
  "name": "Fastify",
96
- "icon": "\ud83c\udfce\ufe0f"
57
+ "icon": "🏎️",
58
+ "skills": ["trpc-api"]
97
59
  },
98
60
  {
99
61
  "id": "vanilla",
100
62
  "name": "Vanilla Node.js",
101
- "icon": "\ud83d\udcc4"
63
+ "icon": "📄",
64
+ "skills": []
102
65
  }
103
66
  ],
104
67
  "databases": [
105
- {
106
- "id": "mongodb",
107
- "name": "MongoDB",
108
- "icon": "\ud83c\udf43"
109
- },
110
- {
111
- "id": "postgresql",
112
- "name": "PostgreSQL",
113
- "icon": "\ud83d\udc18"
114
- },
115
- {
116
- "id": "mysql",
117
- "name": "MySQL / MariaDB",
118
- "icon": "\ud83d\udc2c"
119
- },
120
- {
121
- "id": "sqlite",
122
- "name": "SQLite (Turso / libSQL)",
123
- "icon": "\ud83d\udcc1"
124
- },
125
- {
126
- "id": "redis",
127
- "name": "Redis (Upstash)",
128
- "icon": "\ud83d\udd34"
129
- },
130
- {
131
- "id": "none",
132
- "name": "None",
133
- "icon": "\u274c"
134
- }
68
+ { "id": "mongodb", "name": "MongoDB", "icon": "🍃" },
69
+ { "id": "postgresql", "name": "PostgreSQL", "icon": "🐘" },
70
+ { "id": "mysql", "name": "MySQL / MariaDB", "icon": "🐬" },
71
+ { "id": "sqlite", "name": "SQLite (Turso / libSQL)", "icon": "📁" },
72
+ { "id": "redis", "name": "Redis (Upstash)", "icon": "🔴" },
73
+ { "id": "none", "name": "None", "icon": "❌" }
135
74
  ],
136
75
  "frontendOptions": [
137
76
  {
138
77
  "id": "react-tailwind",
139
78
  "name": "React 19+ / TailwindCSS 4+",
140
- "icon": "\u269b\ufe0f"
79
+ "icon": "⚛️",
80
+ "skillsDir": "react",
81
+ "default": true,
82
+ "frameworks": ["nextjs", "express", "fastify", "vanilla"]
141
83
  },
142
84
  {
143
85
  "id": "vue",
144
86
  "name": "Vue.js / Nuxt",
145
- "icon": "\ud83d\udc9a"
87
+ "icon": "💚",
88
+ "frameworks": ["nuxt"]
146
89
  },
147
90
  {
148
91
  "id": "svelte",
149
92
  "name": "Svelte / SvelteKit",
150
- "icon": "\ud83d\udd25"
151
- },
152
- {
153
- "id": "shadcn",
154
- "name": "shadcn/ui + Tailwind",
155
- "icon": "\ud83c\udfa8"
93
+ "icon": "🔥",
94
+ "frameworks": ["astro", "vanilla"]
156
95
  },
157
96
  {
158
97
  "id": "none",
159
- "name": "API only \u2014 no frontend",
160
- "icon": "\u274c"
98
+ "name": "API only no frontend",
99
+ "icon": ""
161
100
  }
162
101
  ],
163
102
  "deployTargets": [
164
- {
165
- "id": "github",
166
- "name": "GitHub (git push)",
167
- "icon": "\ud83d\udc19"
168
- }
103
+ { "id": "github", "name": "GitHub (git push)", "icon": "🐙" }
169
104
  ],
170
105
  "skills": [
171
106
  "typescript-strict",
172
- "react-patterns",
173
- "nextjs-app-router",
174
- "zod-validation",
175
- "vitest-testing"
107
+ "bun-runtime",
108
+ "zod-validation"
176
109
  ],
177
110
  "requirements": [
178
111
  {
@@ -185,17 +118,6 @@
185
118
  "linux": "curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - && sudo apt install -y nodejs"
186
119
  },
187
120
  "versionRegex": "v?(\\d+\\.\\d+\\.\\d+)"
188
- },
189
- {
190
- "name": "Bun",
191
- "command": "bun",
192
- "versionFlag": "--version",
193
- "minVersion": "1.0.0",
194
- "installCommand": {
195
- "macos": "brew install oven-sh/bun/bun",
196
- "linux": "curl -fsSL https://bun.sh/install | bash"
197
- },
198
- "versionRegex": "(\\d+\\.\\d+\\.\\d+)"
199
121
  }
200
122
  ]
201
123
  }
@@ -0,0 +1,323 @@
1
+ # {{PROJECT_NAME}}
2
+
3
+ > **CHARACTER LIMIT**: Max 40,000 chars. Validate with `wc -m CLAUDE.md` before commit.
4
+
5
+ ## Last Change
6
+
7
+ **Branch:** main
8
+ **Date:** {{DATE}}
9
+ **Summary:** Initial project setup with start-vibing-stacks (Node.js)
10
+
11
+ ## 30 Seconds Overview
12
+
13
+ {{PROJECT_NAME}} is a TypeScript project using {{FRAMEWORK}}.
14
+
15
+ ## Stack
16
+
17
+ | Component | Technology |
18
+ |-----------|------------|
19
+ | Runtime | Bun / Node.js 20+ |
20
+ | Language | TypeScript **strict mode** |
21
+ | Framework | {{FRAMEWORK}} |
22
+ | Database | {{DATABASE}} |
23
+ | Validation | Zod |
24
+ | Testing | Vitest + Playwright |
25
+ | UI | React + Tailwind + shadcn |
26
+ | Data | TanStack Query + Sonner |
27
+ | Forms | react-hook-form + Zod |
28
+
29
+ ## Architecture
30
+
31
+ ```
32
+ project/
33
+ ├── CLAUDE.md # This file (40k char max)
34
+ ├── .claude/
35
+ │ ├── agents/ # 6 active subagents
36
+ │ ├── skills/ # Skill systems (auto-injected)
37
+ │ ├── hooks/ # Validation hooks
38
+ │ ├── config/ # Project configuration
39
+ │ └── commands/ # Slash commands (/feature, /fix, /research, /validate)
40
+ ├── src/
41
+ │ ├── app/ # Next.js App Router pages
42
+ │ │ ├── (marketing)/ # Route group — public pages
43
+ │ │ ├── (app)/ # Route group — authenticated
44
+ │ │ │ └── dashboard/
45
+ │ │ │ ├── page.tsx
46
+ │ │ │ └── _components/ # Page-specific components
47
+ │ │ ├── api/ # Route handlers (API endpoints)
48
+ │ │ ├── layout.tsx # Root layout with providers
49
+ │ │ └── loading.tsx # Global loading skeleton
50
+ │ ├── components/
51
+ │ │ ├── ui/ # shadcn primitives (Button, Input)
52
+ │ │ ├── layout/ # Header, Sidebar, Footer
53
+ │ │ ├── shared/ # Cross-feature components
54
+ │ │ └── providers.tsx # Context providers (client)
55
+ │ ├── lib/
56
+ │ │ ├── utils.ts # cn utility (clsx + tailwind-merge)
57
+ │ │ ├── api/ # API client instances
58
+ │ │ └── validations/ # Zod schemas
59
+ │ ├── hooks/ # Custom React hooks
60
+ │ └── styles/ # Global styles, theme tokens
61
+ ├── types/ # ALL TypeScript interfaces (MANDATORY)
62
+ ├── tests/
63
+ │ ├── unit/ # Vitest unit tests
64
+ │ └── e2e/ # Playwright E2E tests
65
+ ├── public/ # Static assets
66
+ ├── tsconfig.json # TypeScript config (strict: true)
67
+ ├── next.config.ts # Framework config
68
+ ├── tailwind.config.ts # TailwindCSS config
69
+ ├── vitest.config.ts # Test config
70
+ └── package.json # Dependencies
71
+ ```
72
+
73
+ ## Workflow
74
+
75
+ ```
76
+ 0. TODO LIST → Create detailed todo list from prompt
77
+ 1. BRANCH → Create feature/ | fix/ | refactor/ | test/
78
+ 2. RESEARCH → Run research-web agent for NEW features
79
+ 3. IMPLEMENT → Follow project rules + strict types
80
+ 4. TEST → Run tester agent (Vitest / Playwright)
81
+ 5. DOCUMENT → Run documenter agent for modified files
82
+ 6. UPDATE → Update THIS FILE (CLAUDE.md) with changes
83
+ 7. QUALITY → bun run typecheck && lint && test
84
+ 8. COMMIT → Conventional commits, merge to main
85
+ ```
86
+
87
+ ## CLAUDE.md Update Rules
88
+
89
+ > After ANY implementation, update this file to reflect the current state.
90
+
91
+ | Change Type | Sections to Update |
92
+ |-------------|-------------------|
93
+ | Any file change | Last Change (branch, date, summary) |
94
+ | API/routes | Critical Rules, Architecture |
95
+ | UI components | Architecture, Component Organization |
96
+ | New feature | 30s Overview, Architecture |
97
+ | New gotcha | FORBIDDEN or NRY |
98
+ | New dependency | Stack |
99
+ | Workflow change | Workflow section |
100
+
101
+ 1. **Last Change** documents WHAT was done
102
+ 2. **Other sections** document HOW things work NOW
103
+ 3. **Both must be current** — updating only Last Change is insufficient
104
+ 4. Keep only the LATEST Last Change entry (no stacking)
105
+
106
+ ## Agent System
107
+
108
+ ### Subagents (6)
109
+
110
+ | Agent | Purpose |
111
+ |-------|---------|
112
+ | **research-web** | Researches best practices before new features |
113
+ | **documenter** | Maps files to domains, creates/updates domain docs |
114
+ | **domain-updater** | Records problems, solutions, learnings |
115
+ | **commit-manager** | Manages git commits, conventional format |
116
+ | **claude-md-compactor** | Compacts CLAUDE.md when > 40k chars |
117
+ | **tester** | Creates tests with Vitest/Playwright |
118
+
119
+ ### Skills
120
+
121
+ | Category | Skills |
122
+ |----------|--------|
123
+ | **Development** | typescript-strict, react-patterns, nextjs-app-router, zod-validation, shadcn-ui, tailwind-patterns |
124
+ | **Quality** | quality-gate, security-scan, test-coverage, final-check |
125
+ | **Infrastructure** | docker-patterns, git-workflow, performance-patterns, debugging-patterns |
126
+ | **Documentation** | codebase-knowledge, docs-tracker, research-cache, ui-ux-audit |
127
+
128
+ ## Critical Rules
129
+
130
+ - **TypeScript strict mode** — `strict: true` in tsconfig.json
131
+ - **Bracket notation** for env vars: `process.env['VARIABLE']`
132
+ - **Zod validation** for ALL external input (forms, API, env)
133
+ - **Server Components by default** — push `'use client'` to leaf components
134
+ - **Parallel data fetching** — `Promise.all()` over waterfall
135
+ - **Type everything** — no `any`, use `unknown` for truly unknown data
136
+ - **Loading states** — every data page must have `loading.tsx`
137
+ - **Error boundaries** — every route should handle errors gracefully
138
+ - **Conventional commits** — `feat:`, `fix:`, `refactor:`, `docs:`, `chore:`
139
+
140
+ ### Environment Variables Security (MANDATORY)
141
+
142
+ > **NEVER expose secrets to the browser.** `NEXT_PUBLIC_*` vars are embedded in the JS bundle and visible to anyone.
143
+
144
+ | Prefix | Where it runs | Safe for |
145
+ |--------|--------------|----------|
146
+ | `NEXT_PUBLIC_*` | Browser + Server | Public URLs, analytics IDs, Stripe **publishable** key (`pk_`) |
147
+ | No prefix | Server ONLY | API keys, secrets, tokens, database URLs, private keys |
148
+
149
+ ```typescript
150
+ // .env.local
151
+ OPENAI_KEY=sk-abc123 // Server only — SAFE
152
+ STRIPE_SECRET_KEY=sk_live_abc // Server only — SAFE
153
+ NEXT_PUBLIC_APP_URL=https://myapp.com // Public — OK (no secret)
154
+ NEXT_PUBLIC_STRIPE_KEY=pk_live_abc // Public — OK (publishable key)
155
+
156
+ // NEXT_PUBLIC_OPENAI_KEY=sk-abc123 // FORBIDDEN — exposed in browser bundle!
157
+ ```
158
+
159
+ ### API Proxy Pattern (MANDATORY for external APIs)
160
+
161
+ > **ALL calls to external APIs with secrets MUST go through server-side Route Handlers or Server Actions. NEVER call external APIs directly from client components.**
162
+
163
+ ```typescript
164
+ // app/api/chat/route.ts — Server-side proxy (token NEVER leaves server)
165
+ import { NextRequest, NextResponse } from 'next/server';
166
+
167
+ export async function POST(req: NextRequest) {
168
+ const { message } = await req.json();
169
+ const response = await fetch('https://api.openai.com/v1/chat/completions', {
170
+ headers: { Authorization: `Bearer ${process.env['OPENAI_KEY']}` },
171
+ method: 'POST',
172
+ body: JSON.stringify({ model: 'gpt-4', messages: [{ role: 'user', content: message }] }),
173
+ });
174
+ return NextResponse.json(await response.json());
175
+ }
176
+
177
+ // components/chat.tsx — Client calls YOUR API, not the external one
178
+ 'use client';
179
+ const response = await fetch('/api/chat', {
180
+ method: 'POST',
181
+ body: JSON.stringify({ message }),
182
+ });
183
+ ```
184
+
185
+ ### Types Location
186
+
187
+ - **ALL** interfaces/types MUST be in `types/` folder
188
+ - **NEVER** define types in `src/` files
189
+ - **EXCEPTION:** Zod inferred types (`z.infer<typeof Schema>`)
190
+
191
+ ### TypeScript Strict
192
+
193
+ ```typescript
194
+ process.env['VARIABLE']; // CORRECT (bracket notation)
195
+ source: 'listed' as const; // CORRECT (literal type)
196
+ ```
197
+
198
+ ### Component Organization
199
+
200
+ | Question | Location |
201
+ |----------|----------|
202
+ | Used in ONE page only? | `app/[page]/_components/` |
203
+ | Used across 2+ features? | `components/shared/` |
204
+ | UI primitive (Button, Input)? | `components/ui/` |
205
+ | Layout element (Header)? | `components/layout/` |
206
+
207
+ | Lines | Action |
208
+ |-------|--------|
209
+ | < 200 | Keep in single file |
210
+ | 200-400 | Consider splitting |
211
+ | > 400 | **MUST split** into smaller components |
212
+
213
+ ## FORBIDDEN
214
+
215
+ ### Security (CRITICAL)
216
+
217
+ | Action | Reason |
218
+ |--------|--------|
219
+ | `NEXT_PUBLIC_` with API keys/secrets/tokens | Exposes credentials in browser JS bundle — use server-side proxy |
220
+ | Call external APIs from client components | Leaks tokens — route through `app/api/` Route Handlers |
221
+ | `process.env['SECRET']` in `'use client'` files | Only `NEXT_PUBLIC_*` vars reach the browser — use Server Actions |
222
+ | Hardcode API keys in source code | Use `.env.local` + server-side access only |
223
+ | Commit `.env.local` / `.env` to git | Add to `.gitignore` — use `.env.example` with empty values |
224
+
225
+ ### Code Quality
226
+
227
+ | Action | Reason |
228
+ |--------|--------|
229
+ | `any` type | Defeats strict mode — use `unknown` |
230
+ | Skip typecheck | TypeScript errors become runtime bugs |
231
+ | Relative imports (shared) | Breaks when files move — use `@/` alias |
232
+ | Define types in `src/` | Must be in `types/` folder |
233
+ | `'use client'` at top-level layouts | Breaks server rendering, push to leaves |
234
+ | Waterfall data fetching | Use `Promise.all()` for parallel |
235
+ | Skip `loading.tsx` on data pages | Flash of empty content |
236
+ | Files > 400 lines | MUST split into smaller components |
237
+ | Wildcard icon imports | Use named: `import { X } from 'lucide-react'` |
238
+ | `var` keyword | Use `const` or `let` |
239
+ | Raw `console.log` in production | Use structured logging |
240
+
241
+ ### Workflow
242
+
243
+ | Action | Reason |
244
+ |--------|--------|
245
+ | Commit directly to main | Create feature/fix branches |
246
+ | Skip research for new features | Leads to outdated patterns |
247
+ | Skip todo list creation | Loses track of tasks |
248
+ | Skip documenter agent | Documentation is mandatory |
249
+ | Skip domain documentation | MUST update domains/*.md |
250
+ | Stack Last Change entries | Keep only the LATEST |
251
+ | Use MUI/Chakra | Use shadcn/ui + Radix |
252
+ | Skip CLAUDE.md update | MUST update after implementations |
253
+
254
+ ## UI Architecture
255
+
256
+ > Web apps MUST have **separate UIs** for each platform, NOT just "responsive design".
257
+
258
+ | Platform | Layout |
259
+ |----------|--------|
260
+ | Mobile (375px) | Full-screen modals, bottom nav, touch-first |
261
+ | Tablet (768px) | Condensed dropdowns, hybrid nav |
262
+ | Desktop (1280px+) | Sidebar left, top navbar with search |
263
+
264
+ ## Quality Gates
265
+
266
+ ```bash
267
+ bun run typecheck # MUST pass
268
+ bun run lint # MUST pass
269
+ bun run test # MUST pass
270
+ bun run build # MUST pass
271
+ ```
272
+
273
+ ## Domain Documentation
274
+
275
+ > Domain docs prevent Claude from re-exploring the codebase every session.
276
+
277
+ ```
278
+ .claude/skills/codebase-knowledge/domains/
279
+ ├── authentication.md
280
+ ├── api.md
281
+ ├── database.md
282
+ ├── ui-components.md
283
+ └── [domain-name].md
284
+ ```
285
+
286
+ Each domain file tracks: Files, Connections, Recent Commits, Attention Points, Problems & Solutions.
287
+
288
+ ## Commit Format
289
+
290
+ ```
291
+ [type]: [description]
292
+
293
+ - Detail 1
294
+ - Detail 2
295
+
296
+ Generated with Claude Code
297
+ Co-Authored-By: Claude <noreply@anthropic.com>
298
+ ```
299
+
300
+ Types: `feat`, `fix`, `refactor`, `docs`, `chore`
301
+
302
+ ## NRY (Never Repeat Yourself)
303
+
304
+ - Multi-line bash with `\` continuations (breaks permissions)
305
+ - Relative paths in permission patterns
306
+ - Using bash for file operations (use Read/Write/Edit tools)
307
+ - Ignoring context size (use `/compact`)
308
+
309
+ ## Configuration
310
+
311
+ Project settings in `.claude/config/`:
312
+
313
+ - `active-project.json` — Stack, framework, database, skills
314
+ - `domain-mapping.json` — File-to-domain mapping
315
+ - `quality-gates.json` — Quality check commands
316
+ - `testing-config.json` — Test framework config
317
+ - `security-rules.json` — Security audit rules
318
+ - `standards-review.json` — Imported project standards
319
+
320
+ ## Setup by start-vibing-stacks
321
+
322
+ This project was set up with `npx start-vibing-stacks`.
323
+ For updates: `npx start-vibing-stacks --force`