start-vibing 3.0.7 → 3.0.9
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/README.md +64 -51
- package/package.json +1 -1
- package/template/.claude/CLAUDE.md +717 -229
- package/template/.claude/agents/claude-md-compactor.md +2 -14
- package/template/.claude/agents/documenter.md +0 -7
- package/template/.claude/agents/domain-updater.md +2 -7
- package/template/.claude/config/README.md +10 -8
- package/template/.claude/config/domain-mapping.json +1 -1
- package/template/.claude/settings.json +0 -129
- package/template/.claude/skills/api-docs/SKILL.md +206 -0
- package/template/.claude/skills/claude-seo/SKILL.md +84 -0
- package/template/.claude/skills/codebase-knowledge/domains/claude-system.md +51 -416
- package/template/.claude/skills/codebase-knowledge/domains/mcp-integration.md +37 -204
- package/template/.claude/skills/mongoose-patterns/SKILL.md +141 -452
- package/template/.claude/skills/playwright-testing/SKILL.md +251 -0
- package/template/.claude/skills/skill-creator/SKILL.md +106 -0
- package/template/.claude/skills/test-infrastructure/SKILL.md +242 -0
- package/template/CLAUDE.md +65 -701
- package/template/.claude/agents/_archive/01-orchestration/agent-selector.md +0 -130
- package/template/.claude/agents/_archive/01-orchestration/checkpoint-manager.md +0 -142
- package/template/.claude/agents/_archive/01-orchestration/context-manager.md +0 -138
- package/template/.claude/agents/_archive/01-orchestration/error-recovery.md +0 -182
- package/template/.claude/agents/_archive/01-orchestration/orchestrator.md +0 -114
- package/template/.claude/agents/_archive/01-orchestration/parallel-coordinator.md +0 -141
- package/template/.claude/agents/_archive/01-orchestration/task-decomposer.md +0 -121
- package/template/.claude/agents/_archive/01-orchestration/workflow-router.md +0 -119
- package/template/.claude/agents/_archive/02-typescript/bun-runtime-expert.md +0 -197
- package/template/.claude/agents/_archive/02-typescript/esm-resolver.md +0 -193
- package/template/.claude/agents/_archive/02-typescript/import-alias-enforcer.md +0 -158
- package/template/.claude/agents/_archive/02-typescript/ts-generics-helper.md +0 -183
- package/template/.claude/agents/_archive/02-typescript/ts-migration-helper.md +0 -238
- package/template/.claude/agents/_archive/02-typescript/ts-strict-checker.md +0 -180
- package/template/.claude/agents/_archive/02-typescript/ts-types-analyzer.md +0 -199
- package/template/.claude/agents/_archive/02-typescript/type-definition-writer.md +0 -187
- package/template/.claude/agents/_archive/02-typescript/zod-schema-designer.md +0 -212
- package/template/.claude/agents/_archive/02-typescript/zod-validator.md +0 -158
- package/template/.claude/agents/_archive/03-testing/playwright-assertions.md +0 -265
- package/template/.claude/agents/_archive/03-testing/playwright-e2e.md +0 -247
- package/template/.claude/agents/_archive/03-testing/playwright-fixtures.md +0 -234
- package/template/.claude/agents/_archive/03-testing/playwright-multi-viewport.md +0 -256
- package/template/.claude/agents/_archive/03-testing/playwright-page-objects.md +0 -247
- package/template/.claude/agents/_archive/03-testing/test-cleanup-manager.md +0 -248
- package/template/.claude/agents/_archive/03-testing/test-data-generator.md +0 -254
- package/template/.claude/agents/_archive/03-testing/tester-integration.md +0 -278
- package/template/.claude/agents/_archive/03-testing/tester-unit.md +0 -207
- package/template/.claude/agents/_archive/03-testing/vitest-config.md +0 -287
- package/template/.claude/agents/_archive/04-docker/container-health.md +0 -255
- package/template/.claude/agents/_archive/04-docker/deployment-validator.md +0 -225
- package/template/.claude/agents/_archive/04-docker/docker-compose-designer.md +0 -281
- package/template/.claude/agents/_archive/04-docker/docker-env-manager.md +0 -235
- package/template/.claude/agents/_archive/04-docker/docker-multi-stage.md +0 -241
- package/template/.claude/agents/_archive/04-docker/dockerfile-optimizer.md +0 -208
- package/template/.claude/agents/_archive/05-database/database-seeder.md +0 -273
- package/template/.claude/agents/_archive/05-database/mongodb-query-optimizer.md +0 -230
- package/template/.claude/agents/_archive/05-database/mongoose-aggregation.md +0 -306
- package/template/.claude/agents/_archive/05-database/mongoose-index-optimizer.md +0 -182
- package/template/.claude/agents/_archive/05-database/mongoose-schema-designer.md +0 -267
- package/template/.claude/agents/_archive/06-security/auth-session-validator.md +0 -68
- package/template/.claude/agents/_archive/06-security/input-sanitizer.md +0 -80
- package/template/.claude/agents/_archive/06-security/owasp-checker.md +0 -97
- package/template/.claude/agents/_archive/06-security/permission-auditor.md +0 -100
- package/template/.claude/agents/_archive/06-security/security-auditor.md +0 -84
- package/template/.claude/agents/_archive/06-security/sensitive-data-scanner.md +0 -83
- package/template/.claude/agents/_archive/07-documentation/api-documenter.md +0 -136
- package/template/.claude/agents/_archive/07-documentation/changelog-manager.md +0 -105
- package/template/.claude/agents/_archive/07-documentation/claude-md-compactor.md +0 -214
- package/template/.claude/agents/_archive/07-documentation/documenter.md +0 -184
- package/template/.claude/agents/_archive/07-documentation/domain-updater.md +0 -138
- package/template/.claude/agents/_archive/07-documentation/jsdoc-generator.md +0 -114
- package/template/.claude/agents/_archive/07-documentation/readme-generator.md +0 -135
- package/template/.claude/agents/_archive/08-git/branch-manager.md +0 -58
- package/template/.claude/agents/_archive/08-git/commit-manager.md +0 -78
- package/template/.claude/agents/_archive/09-quality/code-reviewer.md +0 -71
- package/template/.claude/agents/_archive/09-quality/quality-checker.md +0 -67
- package/template/.claude/agents/_archive/10-research/best-practices-finder.md +0 -89
- package/template/.claude/agents/_archive/10-research/competitor-analyzer.md +0 -106
- package/template/.claude/agents/_archive/10-research/pattern-researcher.md +0 -93
- package/template/.claude/agents/_archive/10-research/research-cache-manager.md +0 -76
- package/template/.claude/agents/_archive/10-research/research-web.md +0 -98
- package/template/.claude/agents/_archive/10-research/tech-evaluator.md +0 -101
- package/template/.claude/agents/_archive/11-ui-ux/accessibility-auditor.md +0 -136
- package/template/.claude/agents/_archive/11-ui-ux/design-system-enforcer.md +0 -125
- package/template/.claude/agents/_archive/11-ui-ux/skeleton-generator.md +0 -118
- package/template/.claude/agents/_archive/11-ui-ux/ui-desktop.md +0 -132
- package/template/.claude/agents/_archive/11-ui-ux/ui-mobile.md +0 -125
- package/template/.claude/agents/_archive/11-ui-ux/ui-tablet.md +0 -110
- package/template/.claude/agents/_archive/12-performance/api-latency-analyzer.md +0 -156
- package/template/.claude/agents/_archive/12-performance/bundle-analyzer.md +0 -113
- package/template/.claude/agents/_archive/12-performance/memory-leak-detector.md +0 -137
- package/template/.claude/agents/_archive/12-performance/performance-profiler.md +0 -115
- package/template/.claude/agents/_archive/12-performance/query-optimizer.md +0 -124
- package/template/.claude/agents/_archive/12-performance/render-optimizer.md +0 -154
- package/template/.claude/agents/_archive/13-debugging/build-error-fixer.md +0 -207
- package/template/.claude/agents/_archive/13-debugging/debugger.md +0 -149
- package/template/.claude/agents/_archive/13-debugging/error-stack-analyzer.md +0 -141
- package/template/.claude/agents/_archive/13-debugging/network-debugger.md +0 -208
- package/template/.claude/agents/_archive/13-debugging/runtime-error-fixer.md +0 -181
- package/template/.claude/agents/_archive/13-debugging/type-error-resolver.md +0 -185
- package/template/.claude/agents/_archive/14-validation/final-validator.md +0 -93
- package/template/.claude/agents/_archive/_backup/analyzer.md +0 -134
- package/template/.claude/agents/_archive/_backup/code-reviewer.md +0 -279
- package/template/.claude/agents/_archive/_backup/commit-manager.md +0 -219
- package/template/.claude/agents/_archive/_backup/debugger.md +0 -280
- package/template/.claude/agents/_archive/_backup/documenter.md +0 -237
- package/template/.claude/agents/_archive/_backup/domain-updater.md +0 -197
- package/template/.claude/agents/_archive/_backup/final-validator.md +0 -169
- package/template/.claude/agents/_archive/_backup/orchestrator.md +0 -149
- package/template/.claude/agents/_archive/_backup/performance.md +0 -232
- package/template/.claude/agents/_archive/_backup/quality-checker.md +0 -240
- package/template/.claude/agents/_archive/_backup/research.md +0 -315
- package/template/.claude/agents/_archive/_backup/security-auditor.md +0 -192
- package/template/.claude/agents/_archive/_backup/tester.md +0 -566
- package/template/.claude/agents/_archive/_backup/ui-ux-reviewer.md +0 -247
- package/template/.claude/commands/feature.md +0 -48
- package/template/.claude/commands/fix.md +0 -80
- package/template/.claude/commands/research.md +0 -107
- package/template/.claude/commands/validate.md +0 -72
- package/template/.claude/config/mcp-config.json +0 -344
- package/template/.claude/hooks/SETUP.md +0 -126
- package/template/.claude/hooks/run-hook.cmd +0 -46
- package/template/.claude/hooks/run-hook.sh +0 -43
- package/template/.claude/hooks/run-hook.ts +0 -230
- package/template/.claude/hooks/security-check.js +0 -202
- package/template/.claude/hooks/stop-validator.ts +0 -1667
- package/template/.claude/hooks/user-prompt-submit.ts +0 -104
- package/template/.claude/scripts/mcp-quick-install.ts +0 -151
- package/template/.claude/scripts/setup-mcps.ts +0 -651
- package/template/.claude/skills/hook-development/SKILL.md +0 -343
- package/template/.claude/skills/playwright-automation/SKILL.md +0 -438
|
@@ -1,125 +1,200 @@
|
|
|
1
1
|
# Claude Development System - Agent Context
|
|
2
2
|
|
|
3
|
-
This file provides context for
|
|
3
|
+
This file provides detailed context for the development system. For user-facing project rules, see `/CLAUDE.md`.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## System Architecture
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
.claude/
|
|
11
|
+
├── agents/ # 6 active subagents (flat structure)
|
|
12
|
+
├── skills/ # 26 skill systems with cache
|
|
13
|
+
├── scripts/ # Utility scripts (validate-skills.sh)
|
|
14
|
+
├── config/ # Project-specific configuration
|
|
15
|
+
└── commands/ # Slash commands (feature, fix, research, validate)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Agents (6 Active Subagents)
|
|
21
|
+
|
|
22
|
+
| Agent | Model | Color | Purpose |
|
|
23
|
+
|-------|-------|-------|---------|
|
|
24
|
+
| **research-web** | sonnet | cyan | Researches best practices (2024-2026) before implementing new features |
|
|
25
|
+
| **documenter** | sonnet | blue | Maps files to domains, creates/updates domain documentation |
|
|
26
|
+
| **domain-updater** | haiku | purple | Records problems, solutions, gotchas in existing domain files |
|
|
27
|
+
| **commit-manager** | haiku | green | Manages git commits, conventional format, workflow completion |
|
|
28
|
+
| **claude-md-compactor** | sonnet | orange | Compacts CLAUDE.md when it exceeds 40k chars |
|
|
29
|
+
| **tester-unit** | sonnet | yellow | Creates unit tests with Vitest for new functions and utilities |
|
|
30
|
+
|
|
31
|
+
### Agent -> Skill Mapping
|
|
32
|
+
|
|
33
|
+
| Agent | Primary Skill | Secondary |
|
|
34
|
+
|-------|---------------|-----------|
|
|
35
|
+
| research-web | research-cache | codebase-knowledge |
|
|
36
|
+
| documenter | docs-tracker | codebase-knowledge |
|
|
37
|
+
| domain-updater | codebase-knowledge | docs-tracker |
|
|
38
|
+
| commit-manager | workflow-state | docs-tracker |
|
|
39
|
+
| claude-md-compactor | - | - |
|
|
40
|
+
| tester-unit | test-coverage | - |
|
|
8
41
|
|
|
9
|
-
|
|
42
|
+
### Agent Workflow Order
|
|
10
43
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
44
|
+
```
|
|
45
|
+
implement -> quality gates -> domain-updater -> commit-manager -> complete
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Skills (26 Active)
|
|
51
|
+
|
|
52
|
+
Skills are auto-injected into context when the task matches their description. All use the imperative pattern for 95%+ auto-invocation.
|
|
53
|
+
|
|
54
|
+
### Development Skills
|
|
20
55
|
|
|
21
|
-
|
|
56
|
+
| Skill | Trigger | Description |
|
|
57
|
+
|-------|---------|-------------|
|
|
58
|
+
| **bun-runtime** | Bun scripts, packages, bundling | Runtime patterns and best practices |
|
|
59
|
+
| **typescript-strict** | Writing/editing .ts/.tsx files | Strict mode: index access, null checks, generics |
|
|
60
|
+
| **react-patterns** | React components, hooks, state | React 19 patterns and best practices |
|
|
61
|
+
| **nextjs-app-router** | Next.js pages, layouts, server components | App Router patterns, data fetching |
|
|
62
|
+
| **trpc-api** | tRPC routers, procedures, middleware | Type-safe API patterns |
|
|
63
|
+
| **zod-validation** | User input, API params, form data | Zod schemas, type inference |
|
|
64
|
+
| **shadcn-ui** | shadcn/ui components | Theming, accessibility, customization |
|
|
65
|
+
| **tailwind-patterns** | Tailwind CSS classes | Responsive, dark mode, animations |
|
|
22
66
|
|
|
23
|
-
|
|
67
|
+
### Quality & Testing Skills
|
|
24
68
|
|
|
25
|
-
|
|
69
|
+
| Skill | Trigger | Description |
|
|
70
|
+
|-------|---------|-------------|
|
|
71
|
+
| **quality-gate** | Before any commit | Runs typecheck, lint, test, build in sequence |
|
|
72
|
+
| **security-scan** | API, auth, user data code | OWASP Top 10, Zod validation (HAS VETO POWER) |
|
|
73
|
+
| **test-coverage** | After implementing features | Creates Vitest unit + Playwright E2E tests |
|
|
74
|
+
| **final-check** | Before completing any task | Validates skills used, docs updated (HAS VETO POWER) |
|
|
75
|
+
| **playwright-testing** | Playwright E2E tests | Page Objects, fixtures, multi-viewport patterns |
|
|
76
|
+
| **test-infrastructure** | Test configs, data factories | Vitest config, MongoMemoryServer, cleanup |
|
|
26
77
|
|
|
27
|
-
|
|
78
|
+
### Database Skills
|
|
28
79
|
|
|
29
|
-
|
|
80
|
+
| Skill | Trigger | Description |
|
|
81
|
+
|-------|---------|-------------|
|
|
82
|
+
| **mongoose-patterns** | Mongoose models, queries, DB ops | Schema template, ESR indexes, aggregation, seeders |
|
|
30
83
|
|
|
31
|
-
|
|
32
|
-
|---------------|-----------------|
|
|
33
|
-
| API/CRUD routes | Critical Rules, HTTP Requests |
|
|
34
|
-
| UI components | UI Architecture, Component Organization |
|
|
35
|
-
| Pages/layouts | Architecture, Next.js App Router Patterns |
|
|
36
|
-
| Styling/aesthetics | UI Architecture, Design System |
|
|
37
|
-
| Auth/middleware | Critical Rules, Workflow |
|
|
38
|
-
| Database/models | Architecture, Critical Rules |
|
|
39
|
-
| Config files | Stack, Configuration |
|
|
40
|
-
| Hooks/scripts | Workflow, Stop Hook Validations |
|
|
84
|
+
### Infrastructure & DevOps Skills
|
|
41
85
|
|
|
42
|
-
|
|
86
|
+
| Skill | Trigger | Description |
|
|
87
|
+
|-------|---------|-------------|
|
|
88
|
+
| **docker-patterns** | Dockerfile, docker-compose | Multi-stage builds, security patterns |
|
|
89
|
+
| **git-workflow** | Git operations | Commit, branch, merge workflow rules |
|
|
90
|
+
| **performance-patterns** | Slow app, optimization needed | React renders, bundle size, memory leaks |
|
|
91
|
+
| **debugging-patterns** | Errors, stack traces, bugs | Runtime, build, and network error resolution |
|
|
43
92
|
|
|
44
|
-
|
|
93
|
+
### Documentation & Research Skills
|
|
94
|
+
|
|
95
|
+
| Skill | Trigger | Description |
|
|
96
|
+
|-------|---------|-------------|
|
|
97
|
+
| **codebase-knowledge** | Before implementing features | Maps files by domain, tracks connections |
|
|
98
|
+
| **docs-tracker** | After implementation | Detects modified files, creates/updates docs |
|
|
99
|
+
| **research-cache** | Before web research | Checks cached findings to avoid redundant searches |
|
|
100
|
+
| **ui-ux-audit** | Before UI features | Competitors, WCAG 2.1, responsiveness |
|
|
101
|
+
| **api-docs** | After API/function changes | API docs, JSDoc, changelog management |
|
|
102
|
+
|
|
103
|
+
### Meta & SEO Skills
|
|
104
|
+
|
|
105
|
+
| Skill | Trigger | Description |
|
|
106
|
+
|-------|---------|-------------|
|
|
107
|
+
| **skill-creator** | Creating/editing skills | Interview, draft, test, iterate loop (from anthropics/skills) |
|
|
108
|
+
| **claude-seo** | SEO analysis, audits, sitemaps | Full SEO suite with health scoring (from AgriciDaniel/claude-seo) |
|
|
45
109
|
|
|
46
110
|
---
|
|
47
111
|
|
|
48
|
-
##
|
|
112
|
+
## Plugins (5 via enabledPlugins)
|
|
49
113
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
```
|
|
114
|
+
Plugins are auto-installed via `enabledPlugins` in settings.json. They replaced archived agents.
|
|
115
|
+
|
|
116
|
+
| Plugin | Mechanism | Purpose | Replaces |
|
|
117
|
+
|--------|-----------|---------|----------|
|
|
118
|
+
| **typescript-lsp** | LSP server (auto) | Type diagnostics, go-to-def | ts-strict-checker agent |
|
|
119
|
+
| **security-guidance** | PreToolUse hook (auto) | OWASP, vulnerability scan | security-auditor agent |
|
|
120
|
+
| **code-review** | `/code-review` command | Code quality, PR analysis | code-reviewer agent |
|
|
121
|
+
| **commit-commands** | `/commit` command | Git commit, push, PR flows | commit-manager (PR part) |
|
|
122
|
+
| **frontend-design** | `/frontend-design` command | Production-grade UI design | ui-ux-reviewer agent |
|
|
60
123
|
|
|
61
124
|
---
|
|
62
125
|
|
|
63
|
-
##
|
|
126
|
+
## UI/UX Development (Mandatory Review Process)
|
|
64
127
|
|
|
65
|
-
|
|
128
|
+
Any task that touches UI code (`.tsx`, `.jsx`, components, pages, layouts) requires:
|
|
66
129
|
|
|
67
|
-
|
|
68
|
-
| --------------------- | ---------------------------------- | ---------------------------------------- |
|
|
69
|
-
| `context7` | Up-to-date library documentation | research-web agent, direct use |
|
|
70
|
-
| `sequential-thinking` | Complex problem-solving | Direct use for planning |
|
|
71
|
-
| `memory` | Persistent knowledge graph | domain-updater agent, direct use |
|
|
72
|
-
| `playwright` | Browser automation (`--user-data-dir` for persistent sessions) | Direct use for E2E testing |
|
|
73
|
-
| `nextjs-devtools` | Next.js specific development tools | Direct use in Next.js projects |
|
|
74
|
-
| `mongodb` | MongoDB database operations | Direct use for DB queries |
|
|
130
|
+
### Required Tools
|
|
75
131
|
|
|
76
|
-
|
|
132
|
+
| Tool | Purpose | When |
|
|
133
|
+
|------|---------|------|
|
|
134
|
+
| **`/frontend-design` plugin** | Production-grade UI design with high design quality | Before implementing ANY UI feature |
|
|
135
|
+
| **ui-ux-audit skill** | Competitor research, WCAG 2.1 accessibility, responsive audit | Before UI implementation |
|
|
136
|
+
| **Playwright MCP** | Visual verification across viewports (375px, 768px, 1280px+) | After UI implementation |
|
|
77
137
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
138
|
+
### UI Review Workflow
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
1. Research competitors (ui-ux-audit skill)
|
|
142
|
+
2. Design with /frontend-design plugin
|
|
143
|
+
3. Implement separate layouts for mobile/tablet/desktop
|
|
144
|
+
4. Verify with Playwright MCP (all 3 viewports)
|
|
145
|
+
5. Validate WCAG 2.1 accessibility
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Platform-Specific UIs (NOT just responsive)
|
|
149
|
+
|
|
150
|
+
| Platform | Layout |
|
|
151
|
+
| ----------------- | ------------------------------------------- |
|
|
152
|
+
| Mobile (375px) | Full-screen modals, bottom nav, touch-first |
|
|
153
|
+
| Tablet (768px) | Condensed dropdowns, hybrid nav |
|
|
154
|
+
| Desktop (1280px+) | Sidebar left, top navbar with search |
|
|
155
|
+
|
|
156
|
+
> Never use "responsive-only" design. Build separate UI layouts per platform.
|
|
82
157
|
|
|
83
158
|
---
|
|
84
159
|
|
|
85
|
-
##
|
|
160
|
+
## MCP Servers (Strict Usage Rules)
|
|
86
161
|
|
|
87
|
-
|
|
162
|
+
### Required MCPs (ALWAYS use these)
|
|
88
163
|
|
|
89
|
-
|
|
|
90
|
-
|
|
91
|
-
| `
|
|
92
|
-
| `
|
|
93
|
-
| `
|
|
94
|
-
| `testing-config.json` | Test framework and conventions |
|
|
95
|
-
| `security-rules.json` | Security audit rules |
|
|
164
|
+
| Server | Purpose | When to Use |
|
|
165
|
+
|--------|---------|-------------|
|
|
166
|
+
| `context7` | Up-to-date library documentation | **ALWAYS** before implementing with ANY library. Never assume docs -- always query. |
|
|
167
|
+
| `sequential-thinking` | Structured reasoning and planning | **ALWAYS** for multi-step tasks, architecture decisions, debugging complex issues, and planning implementations. Use before writing code for non-trivial features. |
|
|
168
|
+
| `playwright` | Browser automation and E2E testing | **ALWAYS** for UI verification, E2E tests, and visual validation. Uses `--user-data-dir` for persistent sessions. Every UI change must be tested in browser. |
|
|
96
169
|
|
|
97
|
-
**
|
|
170
|
+
> These 3 MCPs are **non-negotiable**. Skipping them leads to outdated code, poor planning, and untested UIs.
|
|
98
171
|
|
|
99
|
-
|
|
172
|
+
### Standard MCPs
|
|
100
173
|
|
|
101
|
-
|
|
174
|
+
| Server | Purpose | When to Use |
|
|
175
|
+
|--------|---------|-------------|
|
|
176
|
+
| `memory` | Persistent knowledge graph | Store/recall project patterns across sessions |
|
|
177
|
+
| `nextjs-devtools` | Next.js development tools | Next.js projects (runtime errors, routes, cache) |
|
|
178
|
+
| `mongodb` | MongoDB database operations | DB queries, schema inspection |
|
|
179
|
+
| `jira` | Issue tracking | Pull tasks, create issues, update status |
|
|
180
|
+
| `git` | Git operations | Repo search, history, diffs |
|
|
181
|
+
| `fetch` | Web page reading | Fetch URLs as markdown |
|
|
102
182
|
|
|
103
|
-
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Configuration Files
|
|
104
186
|
|
|
105
|
-
|
|
106
|
-
| ------------------ | ------------------ | ------------------ |
|
|
107
|
-
| research-web | research-cache | codebase-knowledge |
|
|
108
|
-
| documenter | docs-tracker | codebase-knowledge |
|
|
109
|
-
| domain-updater | codebase-knowledge | docs-tracker |
|
|
110
|
-
| commit-manager | workflow-state | docs-tracker |
|
|
111
|
-
| claude-md-compactor| - | - |
|
|
112
|
-
| tester-unit | test-coverage | - |
|
|
187
|
+
Project-specific settings in `.claude/config/`:
|
|
113
188
|
|
|
114
|
-
|
|
189
|
+
| File | Purpose |
|
|
190
|
+
|------|---------|
|
|
191
|
+
| `project-config.json` | Stack, structure, commands |
|
|
192
|
+
| `domain-mapping.json` | File patterns to domains |
|
|
193
|
+
| `quality-gates.json` | Quality check commands |
|
|
194
|
+
| `testing-config.json` | Test framework and conventions |
|
|
195
|
+
| `security-rules.json` | Security audit rules |
|
|
115
196
|
|
|
116
|
-
|
|
117
|
-
| ------------------ | ------------------- | ----------------- |
|
|
118
|
-
| security-guidance | security-auditor | PreToolUse hook |
|
|
119
|
-
| typescript-lsp | ts-strict-checker | LSP server |
|
|
120
|
-
| code-review | code-reviewer | /code-review cmd |
|
|
121
|
-
| frontend-design | ui-ux-reviewer | /frontend-design |
|
|
122
|
-
| commit-commands | commit-manager (PR) | /commit cmd |
|
|
197
|
+
Agents read config files before acting. Do NOT hardcode project specifics.
|
|
123
198
|
|
|
124
199
|
---
|
|
125
200
|
|
|
@@ -127,7 +202,7 @@ Project-specific settings are in `.claude/config/`:
|
|
|
127
202
|
|
|
128
203
|
### Before ANY implementation:
|
|
129
204
|
|
|
130
|
-
1.
|
|
205
|
+
1. Read config from `.claude/config/` for project specifics
|
|
131
206
|
2. Read relevant skill SKILL.md file
|
|
132
207
|
3. Check skill cache for existing data
|
|
133
208
|
4. Research if needed (research-web agent or web search)
|
|
@@ -135,10 +210,32 @@ Project-specific settings are in `.claude/config/`:
|
|
|
135
210
|
### After implementation:
|
|
136
211
|
|
|
137
212
|
1. Update skill cache with changes
|
|
138
|
-
2. Run quality gates (bun run typecheck && lint && test)
|
|
139
|
-
3. Security handled automatically by security-guidance plugin
|
|
140
|
-
4.
|
|
141
|
-
5. **
|
|
213
|
+
2. Run quality gates (`bun run typecheck && lint && test`)
|
|
214
|
+
3. Security handled automatically by security-guidance plugin
|
|
215
|
+
4. Update domains via domain-updater agent
|
|
216
|
+
5. **Update CLAUDE.md** with architecture/rule changes (see rule below)
|
|
217
|
+
6. Commit via commit-manager agent (FINAL step)
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## CLAUDE.md Update Rule (POST-IMPLEMENTATION)
|
|
222
|
+
|
|
223
|
+
After completing any implementation or change that modifies architecture, rules, or conventions:
|
|
224
|
+
|
|
225
|
+
1. **Update `/CLAUDE.md`** -- The root project CLAUDE.md must reflect current state
|
|
226
|
+
2. **What to update:**
|
|
227
|
+
- `Last Change` section with branch, date, summary
|
|
228
|
+
- Any section affected by the changes (Architecture, Rules, Stack, etc.)
|
|
229
|
+
- New patterns, gotchas, or conventions discovered
|
|
230
|
+
3. **What counts as "architecture change":**
|
|
231
|
+
- New files/folders added to the project structure
|
|
232
|
+
- New dependencies or tools added
|
|
233
|
+
- Workflow changes
|
|
234
|
+
- New API routes, pages, or components
|
|
235
|
+
- Configuration changes
|
|
236
|
+
- Any change that a future Claude session would need to know about
|
|
237
|
+
4. **Format:** Keep it concise. Tables and bullet points over prose.
|
|
238
|
+
5. **Character limit:** Max 40,000 chars. If exceeded, invoke claude-md-compactor agent.
|
|
142
239
|
|
|
143
240
|
---
|
|
144
241
|
|
|
@@ -191,40 +288,15 @@ api.interceptors.response.use(
|
|
|
191
288
|
| Type responses | `api.get<UserResponse>('/users')` |
|
|
192
289
|
| Handle errors centrally | Use interceptors, not try/catch everywhere |
|
|
193
290
|
|
|
194
|
-
### When to Create API Wrapper
|
|
195
|
-
|
|
196
|
-
```typescript
|
|
197
|
-
// If you call the same endpoint multiple times, create a wrapper:
|
|
198
|
-
// lib/api/users.ts
|
|
199
|
-
export const usersApi = {
|
|
200
|
-
getAll: () => api.get<User[]>('/users'),
|
|
201
|
-
getById: (id: string) => api.get<User>(`/users/${id}`),
|
|
202
|
-
create: (data: CreateUser) => api.post<User>('/users', data),
|
|
203
|
-
update: (id: string, data: UpdateUser) => api.patch<User>(`/users/${id}`, data),
|
|
204
|
-
delete: (id: string) => api.delete(`/users/${id}`),
|
|
205
|
-
};
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
### FORBIDDEN
|
|
209
|
-
|
|
210
|
-
| Don't | Do Instead |
|
|
211
|
-
|-------|------------|
|
|
212
|
-
| `fetch('/api/...')` | `api.get('/...')` |
|
|
213
|
-
| `axios.get(...)` | `api.get(...)` |
|
|
214
|
-
| `withCredentials: false` | Always `true` |
|
|
215
|
-
| Inline error handling | Use interceptors |
|
|
216
|
-
|
|
217
291
|
---
|
|
218
292
|
|
|
219
293
|
## Enforcement Mechanisms
|
|
220
294
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
|
224
|
-
|
|
|
225
|
-
| **
|
|
226
|
-
| **stop-validator hook** | Stop hook | Branch not main, uncommitted changes, docs missing |
|
|
227
|
-
| **quality gates** | Manual / CI | Typecheck, lint, or test failures |
|
|
295
|
+
| Mechanism | Type | Blocks When |
|
|
296
|
+
|-----------|------|-------------|
|
|
297
|
+
| **security-guidance plugin** | PreToolUse hook (auto) | Sensitive data exposure, missing validation, OWASP |
|
|
298
|
+
| **quality gates** | Manual / CI | Typecheck, lint, or test failures |
|
|
299
|
+
| **final-check skill** | Skill (manual) | Any rule violated, tests failing, docs missing |
|
|
228
300
|
|
|
229
301
|
---
|
|
230
302
|
|
|
@@ -236,178 +308,594 @@ All implementations MUST:
|
|
|
236
308
|
- [ ] Pass lint (`bun run lint`)
|
|
237
309
|
- [ ] Pass unit tests (`bun run test`)
|
|
238
310
|
- [ ] Pass build (`bun run build`)
|
|
239
|
-
- [ ] Use Playwright MCP for browser testing when needed
|
|
240
311
|
- [ ] Have documentation updated (documenter agent)
|
|
241
|
-
- [ ] Security validated by security-guidance plugin (automatic
|
|
312
|
+
- [ ] Security validated by security-guidance plugin (automatic)
|
|
242
313
|
- [ ] Be committed with conventional commits
|
|
243
314
|
- [ ] Have domains updated with session learnings (domain-updater agent)
|
|
315
|
+
- [ ] Have CLAUDE.md updated with architecture/rule changes
|
|
244
316
|
|
|
245
317
|
---
|
|
246
318
|
|
|
247
|
-
##
|
|
319
|
+
## Domain Documentation
|
|
248
320
|
|
|
249
|
-
|
|
321
|
+
Domain docs prevent Claude from re-exploring the codebase every session.
|
|
250
322
|
|
|
251
|
-
###
|
|
323
|
+
### Location
|
|
252
324
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
325
|
+
```
|
|
326
|
+
.claude/skills/codebase-knowledge/domains/
|
|
327
|
+
├── claude-system.md # This development system
|
|
328
|
+
├── authentication.md
|
|
329
|
+
├── api.md
|
|
330
|
+
├── ui-components.md
|
|
331
|
+
└── ...
|
|
332
|
+
```
|
|
258
333
|
|
|
259
|
-
###
|
|
334
|
+
### Domain Mapping
|
|
260
335
|
|
|
261
|
-
|
|
262
|
-
|-------|----------|----------|
|
|
263
|
-
| `max` | Always thinks, no limits | Complex architecture (**Opus ONLY**) |
|
|
264
|
-
| `high` | Deep thinking (DEFAULT) | Agentic tasks, complex coding |
|
|
265
|
-
| `medium` | Moderate, may skip simple | Most workloads |
|
|
266
|
-
| `low` | Minimal thinking | Subagents, teammates, high-volume |
|
|
336
|
+
Configured in `.claude/config/domain-mapping.json`:
|
|
267
337
|
|
|
268
|
-
|
|
338
|
+
| Domain | File Patterns |
|
|
339
|
+
|--------|---------------|
|
|
340
|
+
| authentication | `**/auth/**`, `**/*auth*.ts` |
|
|
341
|
+
| api | `**/api/**`, `**/routers/**` |
|
|
342
|
+
| database | `**/models/**`, `**/*.model.ts` |
|
|
343
|
+
| ui-components | `**/components/**/*.tsx` |
|
|
344
|
+
| pages | `**/app/**/page.tsx` |
|
|
269
345
|
|
|
270
|
-
###
|
|
346
|
+
### Documentation Agents
|
|
271
347
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
348
|
+
| Agent | Role | When |
|
|
349
|
+
|-------|------|------|
|
|
350
|
+
| **documenter** | Maps files to domains, creates/updates domain files | AFTER implementation |
|
|
351
|
+
| **domain-updater** | Records problems, solutions, gotchas | BEFORE commit |
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
## FORBIDDEN Actions
|
|
356
|
+
|
|
357
|
+
| Action | Reason |
|
|
358
|
+
| ------------------------------ | ---------------------------- |
|
|
359
|
+
| Write in non-English | ALL code/docs MUST be in EN |
|
|
360
|
+
| Skip typecheck | Catches runtime errors |
|
|
361
|
+
| Relative imports (shared) | Breaks when files move |
|
|
362
|
+
| Use `@types/` alias | Reserved by TypeScript |
|
|
363
|
+
| Use `any` type | Defeats strict mode |
|
|
364
|
+
| Skip docker build test | May fail in production |
|
|
365
|
+
| Define types in `src/` | Must be in `types/` |
|
|
366
|
+
| Skip research for new features | Leads to outdated patterns |
|
|
367
|
+
| Skip todo list creation | Loses track of tasks |
|
|
368
|
+
| Make responsive UI only | Must be separate UIs |
|
|
369
|
+
| Commit directly to main | Create feature/fix branches |
|
|
370
|
+
| Skip documenter agent | Documentation is mandatory |
|
|
371
|
+
| Leave files undocumented | Domain docs prevent re-exploration |
|
|
372
|
+
| Stack Last Change entries | Keep only the LATEST |
|
|
373
|
+
| Use Cards on mobile | Waste space in flex-col |
|
|
374
|
+
| Edit JSX without UI review | Use frontend-design plugin or research competitors |
|
|
375
|
+
| Skip planning for features | Use EnterPlanMode first |
|
|
376
|
+
| Skip domain documentation | MUST update domains/*.md |
|
|
377
|
+
| Only update CLAUDE.md | Domains are detail, CLAUDE.md is summary |
|
|
378
|
+
| Skip flow documentation | Document architecture changes in CLAUDE.md |
|
|
379
|
+
| Use MUI/Chakra | Use shadcn/ui + Radix for personality control |
|
|
380
|
+
| Neumorphism on forms | Accessibility issues, use Glassmorphism |
|
|
381
|
+
| Scroll animations on dashboard | Use only on landing/marketing pages |
|
|
382
|
+
| 3D elements on mobile | Performance issues, use sparingly |
|
|
383
|
+
| Masonry grid on mobile | Use vertical lists instead |
|
|
384
|
+
| Mix animation libraries | Pick one primary (Framer or GSAP) |
|
|
385
|
+
| Wildcard icon imports | Use named imports (`import { X } from 'lucide-react'`) |
|
|
386
|
+
| React Icons in production | Use Lucide + Simple Icons directly |
|
|
387
|
+
| Files > 400 lines | MUST split into smaller components |
|
|
388
|
+
| Page components in /components | Use `app/[page]/_components/` |
|
|
389
|
+
| Skip cn utility | MUST use clsx + tailwind-merge |
|
|
390
|
+
| 'use client' at top level | Push to leaf components only |
|
|
391
|
+
| Waterfall data fetching | Use Promise.all() for parallel |
|
|
392
|
+
| Skip loading.tsx | Add skeleton loaders for data pages |
|
|
393
|
+
| Skip CLAUDE.md update | MUST update after implementations |
|
|
394
|
+
|
|
395
|
+
---
|
|
396
|
+
|
|
397
|
+
## UI Architecture (MANDATORY)
|
|
398
|
+
|
|
399
|
+
> Web apps MUST have **separate UIs** for each platform, NOT just "responsive design".
|
|
400
|
+
|
|
401
|
+
| Platform | Layout |
|
|
402
|
+
| ----------------- | ------------------------------------------- |
|
|
403
|
+
| Mobile (375px) | Full-screen modals, bottom nav, touch-first |
|
|
404
|
+
| Tablet (768px) | Condensed dropdowns, hybrid nav |
|
|
405
|
+
| Desktop (1280px+) | Sidebar left, top navbar with search |
|
|
406
|
+
|
|
407
|
+
### JSX Editing = UI Review (MANDATORY)
|
|
408
|
+
|
|
409
|
+
ANY task that edits `.tsx` or `.jsx` files MUST consider all 3 viewports:
|
|
410
|
+
|
|
411
|
+
- Use `/frontend-design` plugin for production-grade UI
|
|
412
|
+
- Design separate layouts for mobile (375px), tablet (768px), desktop (1280px+)
|
|
413
|
+
- Research competitor UIs before implementing new features
|
|
414
|
+
|
|
415
|
+
---
|
|
416
|
+
|
|
417
|
+
## UI/UX Design Rules
|
|
418
|
+
|
|
419
|
+
### Mobile FORBIDDEN Patterns
|
|
420
|
+
|
|
421
|
+
| Pattern | Problem | Use Instead |
|
|
422
|
+
|---------|---------|-------------|
|
|
423
|
+
| Cards in flex-col | Waste vertical space, poor scanning | Compact lists with dividers |
|
|
424
|
+
| Card grids | Too cramped, hard to tap | Full-width list items |
|
|
425
|
+
| Nested cards | Confusing hierarchy | Flat structure |
|
|
426
|
+
| Multiple CTAs per card | Touch confusion | Single primary action |
|
|
427
|
+
|
|
428
|
+
### Design Principles
|
|
429
|
+
|
|
430
|
+
| Platform | Density | Navigation | Actions |
|
|
431
|
+
|----------|---------|------------|---------|
|
|
432
|
+
| Mobile | LOW - space for touch | Bottom tab bar | Bottom sheet |
|
|
433
|
+
| Tablet | MEDIUM - hybrid | Side + top | Context menus |
|
|
434
|
+
| Desktop | HIGH - data dense | Fixed sidebar | Inline + hover |
|
|
435
|
+
|
|
436
|
+
### Component Choices
|
|
276
437
|
|
|
277
|
-
|
|
278
|
-
|
|
438
|
+
```
|
|
439
|
+
Mobile: Lists > Cards, Sheets > Modals, Tabs > Dropdowns
|
|
440
|
+
Tablet: Collapsible cards, Split views, Floating actions
|
|
441
|
+
Desktop: Data tables, Multi-column forms, Keyboard shortcuts
|
|
279
442
|
```
|
|
280
443
|
|
|
281
|
-
|
|
444
|
+
---
|
|
282
445
|
|
|
283
|
-
|
|
446
|
+
## Design System Reference
|
|
284
447
|
|
|
285
|
-
**
|
|
286
|
-
- "CRITICAL: You MUST use..."
|
|
287
|
-
- "be thorough", "think carefully", "do not be lazy"
|
|
288
|
-
- "use the think tool to plan your approach"
|
|
448
|
+
> **Full docs in**: `.claude/skills/research-cache/cache/` (12 detailed files)
|
|
289
449
|
|
|
290
|
-
|
|
291
|
-
- "Use this tool when..." (softer language)
|
|
292
|
-
- Remove anti-laziness prompts entirely
|
|
293
|
-
- Lower effort level instead of adding constraints
|
|
450
|
+
### Required Libraries
|
|
294
451
|
|
|
295
|
-
|
|
452
|
+
```bash
|
|
453
|
+
# Core utilities (MANDATORY)
|
|
454
|
+
bun add clsx tailwind-merge class-variance-authority
|
|
455
|
+
bun add -D tailwindcss-animate
|
|
296
456
|
|
|
297
|
-
|
|
457
|
+
# Animation & feedback
|
|
458
|
+
bun add @formkit/auto-animate framer-motion sonner
|
|
298
459
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
"Can you suggest some changes?"
|
|
460
|
+
# Skeleton loaders
|
|
461
|
+
bun add react-loading-skeleton
|
|
302
462
|
|
|
303
|
-
#
|
|
304
|
-
"Change this function to improve performance."
|
|
463
|
+
# Copy-paste from: magicui.design, ui.aceternity.com, hover.dev
|
|
305
464
|
```
|
|
306
465
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
466
|
+
### The `cn` Utility (MANDATORY)
|
|
467
|
+
|
|
468
|
+
```typescript
|
|
469
|
+
// lib/utils.ts - MUST HAVE in every project
|
|
470
|
+
import { clsx, type ClassValue } from 'clsx';
|
|
471
|
+
import { twMerge } from 'tailwind-merge';
|
|
472
|
+
|
|
473
|
+
export const cn = (...inputs: ClassValue[]) => twMerge(clsx(inputs));
|
|
310
474
|
```
|
|
311
475
|
|
|
312
|
-
|
|
476
|
+
---
|
|
313
477
|
|
|
314
|
-
|
|
478
|
+
## Icon Libraries (MANDATORY)
|
|
315
479
|
|
|
316
|
-
|
|
317
|
-
|
|
480
|
+
| Library | Use For | Icons | Import |
|
|
481
|
+
|---------|---------|-------|--------|
|
|
482
|
+
| **Lucide React** | UI icons (shadcn default) | 1,600+ | `import { Camera } from 'lucide-react'` |
|
|
483
|
+
| **Simple Icons** | Brand logos ONLY | 3,150+ | `import { SiReact } from '@icons-pack/react-simple-icons'` |
|
|
318
484
|
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
|
|
485
|
+
```typescript
|
|
486
|
+
// CORRECT: Named imports (tree-shakable, ~1KB per icon)
|
|
487
|
+
import { Camera, User, Settings } from 'lucide-react';
|
|
488
|
+
|
|
489
|
+
// FORBIDDEN: Wildcard imports (bundles ALL icons, +30KB)
|
|
490
|
+
import * as Icons from 'lucide-react';
|
|
322
491
|
```
|
|
323
492
|
|
|
324
|
-
|
|
493
|
+
---
|
|
494
|
+
|
|
495
|
+
## Aesthetic Libraries
|
|
496
|
+
|
|
497
|
+
| Library | Purpose | When |
|
|
498
|
+
|---------|---------|------|
|
|
499
|
+
| **clsx + tailwind-merge** | className management | ALWAYS |
|
|
500
|
+
| **class-variance-authority** | Component variants | Reusable components |
|
|
501
|
+
| **tailwindcss-animate** | Micro-interactions | Animations |
|
|
502
|
+
| **react-loading-skeleton** | Loading states | Data fetching |
|
|
325
503
|
|
|
326
|
-
|
|
504
|
+
---
|
|
505
|
+
|
|
506
|
+
## Component Organization (MANDATORY)
|
|
507
|
+
|
|
508
|
+
### Component Location Rules
|
|
509
|
+
|
|
510
|
+
| Question | Location |
|
|
511
|
+
|----------|----------|
|
|
512
|
+
| Used in ONE page only? | `app/[page]/_components/` |
|
|
513
|
+
| Used across 2+ features? | `components/shared/` |
|
|
514
|
+
| UI primitive (Button, Input)? | `components/ui/` |
|
|
515
|
+
| Layout element (Header, Footer)? | `components/layout/` |
|
|
516
|
+
|
|
517
|
+
### File Size Rules
|
|
518
|
+
|
|
519
|
+
| Lines | Action |
|
|
520
|
+
|-------|--------|
|
|
521
|
+
| < 200 | Keep in single file |
|
|
522
|
+
| 200-400 | Consider splitting |
|
|
523
|
+
| > 400 | **MUST split** into smaller components |
|
|
524
|
+
|
|
525
|
+
---
|
|
526
|
+
|
|
527
|
+
## Next.js App Router Patterns (MANDATORY)
|
|
528
|
+
|
|
529
|
+
### Server vs Client Components
|
|
530
|
+
|
|
531
|
+
```tsx
|
|
532
|
+
// DEFAULT: Server Component (no directive needed)
|
|
533
|
+
export default async function Page({ params }) {
|
|
534
|
+
const data = await fetch('...');
|
|
535
|
+
return <ClientButton data={data} />;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
// Client Component (push to leaves)
|
|
539
|
+
'use client';
|
|
540
|
+
export function ClientButton({ data }) {
|
|
541
|
+
const [state, setState] = useState();
|
|
542
|
+
return <button onClick={() => setState(!state)}>{data}</button>;
|
|
543
|
+
}
|
|
544
|
+
```
|
|
327
545
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
546
|
+
### Layout Context Pattern
|
|
547
|
+
|
|
548
|
+
```tsx
|
|
549
|
+
// app/layout.tsx - Root layout with providers
|
|
550
|
+
import { Providers } from '@/components/providers';
|
|
551
|
+
|
|
552
|
+
export default function RootLayout({ children }) {
|
|
553
|
+
return (
|
|
554
|
+
<html lang="en">
|
|
555
|
+
<body>
|
|
556
|
+
<Providers>{children}</Providers>
|
|
557
|
+
</body>
|
|
558
|
+
</html>
|
|
559
|
+
);
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
// components/providers.tsx - Client-side providers
|
|
563
|
+
'use client';
|
|
564
|
+
export function Providers({ children }) {
|
|
565
|
+
return (
|
|
566
|
+
<QueryClientProvider client={queryClient}>
|
|
567
|
+
<ThemeProvider>
|
|
568
|
+
{children}
|
|
569
|
+
<Toaster />
|
|
570
|
+
</ThemeProvider>
|
|
571
|
+
</QueryClientProvider>
|
|
572
|
+
);
|
|
573
|
+
}
|
|
332
574
|
```
|
|
333
575
|
|
|
334
|
-
### Parallel
|
|
576
|
+
### Parallel Data Fetching
|
|
335
577
|
|
|
336
|
-
```
|
|
337
|
-
|
|
338
|
-
|
|
578
|
+
```tsx
|
|
579
|
+
// CORRECT: Parallel fetches
|
|
580
|
+
const [user, posts] = await Promise.all([getUser(), getPosts()]);
|
|
581
|
+
|
|
582
|
+
// AVOID: Waterfall (sequential)
|
|
583
|
+
const user = await getUser();
|
|
584
|
+
const posts = await getPosts(); // Waits for user
|
|
339
585
|
```
|
|
340
586
|
|
|
341
|
-
|
|
587
|
+
---
|
|
588
|
+
|
|
589
|
+
## Grid Layouts (Choose by Context)
|
|
590
|
+
|
|
591
|
+
| Grid Type | Use For | Mobile |
|
|
592
|
+
|-----------|---------|--------|
|
|
593
|
+
| **Bento Grid** | Landing, features, portfolios | Stacks vertically |
|
|
594
|
+
| **12-Column** | Dashboards, admin panels | Collapse to 1-2 cols |
|
|
595
|
+
| **Masonry** | Galleries, Pinterest-style | Use vertical list |
|
|
596
|
+
| **Card Grid** | Products, team, blog archive | Stack to single col |
|
|
597
|
+
| **Split Grid** | Hero sections, auth pages | Stack vertically |
|
|
598
|
+
| **Kanban** | Project management, tasks | Horizontal scroll |
|
|
599
|
+
|
|
600
|
+
> **Cache**: `grid-layout-patterns-2025.md`
|
|
601
|
+
|
|
602
|
+
---
|
|
603
|
+
|
|
604
|
+
## Modal/Dialog Patterns (Choose by Action)
|
|
605
|
+
|
|
606
|
+
| Modal Type | Use For | Mobile |
|
|
607
|
+
|------------|---------|--------|
|
|
608
|
+
| **Centered Dialog** | Confirmations, short forms | Full-screen |
|
|
609
|
+
| **Slide-over/Drawer** | Filters, settings, details | Bottom sheet |
|
|
610
|
+
| **Bottom Sheet** | Actions, sharing, quick forms | Native feel |
|
|
611
|
+
| **Command Palette** | CMD+K, power users | Full-screen |
|
|
612
|
+
| **Wizard/Stepper** | Multi-step forms, onboarding | Full-screen |
|
|
613
|
+
| **Lightbox** | Images, videos | Full-screen |
|
|
614
|
+
|
|
615
|
+
> **Cache**: `modal-dialog-design-patterns-2024-2025.md`
|
|
616
|
+
|
|
617
|
+
---
|
|
618
|
+
|
|
619
|
+
## List Patterns (Choose by Data)
|
|
342
620
|
|
|
343
|
-
|
|
|
344
|
-
|
|
345
|
-
|
|
|
346
|
-
|
|
|
347
|
-
|
|
|
348
|
-
|
|
|
621
|
+
| List Type | Use For | Key Feature |
|
|
622
|
+
|-----------|---------|-------------|
|
|
623
|
+
| **Simple List** | Basic items, settings | Dividers |
|
|
624
|
+
| **Avatar List** | Users, contacts | Profile images |
|
|
625
|
+
| **Expandable/Accordion** | FAQs, nested content | Collapse/expand |
|
|
626
|
+
| **Swipeable List** | Mobile actions | Left/right swipe |
|
|
627
|
+
| **Drag & Drop** | Reordering | dnd-kit (NOT react-beautiful-dnd) |
|
|
628
|
+
| **Virtualized** | 1000+ items | react-window or react-virtuoso |
|
|
629
|
+
| **Timeline** | Activity feed, history | Vertical line |
|
|
630
|
+
| **Chat/Messages** | Conversations | Bubbles left/right |
|
|
349
631
|
|
|
350
|
-
|
|
632
|
+
> **Cache**: `list-design-patterns-web-apps.md`
|
|
351
633
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
| Prefilled responses | Deprecated in 4.6 |
|
|
356
|
-
| Multiple agents editing same file | Isolate files per agent |
|
|
357
|
-
| Aggressive prompts from older models | Remove "MUST", "CRITICAL" |
|
|
634
|
+
---
|
|
635
|
+
|
|
636
|
+
## Multi-Step Forms (MANDATORY for complex forms)
|
|
358
637
|
|
|
359
|
-
|
|
638
|
+
| Pattern | Use For | Progress |
|
|
639
|
+
|---------|---------|----------|
|
|
640
|
+
| **Horizontal Stepper** | Onboarding, checkout | Numbers at top |
|
|
641
|
+
| **Card-based Steps** | Settings, profiles | Expandable cards |
|
|
642
|
+
| **Slide Animation** | Typeform-style | Left/right slide |
|
|
643
|
+
| **Accordion Steps** | Long forms | Collapsible sections |
|
|
644
|
+
|
|
645
|
+
### Form Stack (MANDATORY)
|
|
360
646
|
|
|
361
647
|
```typescript
|
|
362
|
-
//
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
648
|
+
// react-hook-form + Zod + per-step validation
|
|
649
|
+
const { trigger } = useForm<FormData>({ resolver: zodResolver(schema) });
|
|
650
|
+
|
|
651
|
+
const nextStep = async () => {
|
|
652
|
+
const isValid = await trigger(currentStepFields);
|
|
653
|
+
if (!isValid) return;
|
|
654
|
+
setStep(step + 1);
|
|
655
|
+
};
|
|
656
|
+
```
|
|
657
|
+
|
|
658
|
+
> **Cache**: `multi-step-form-patterns.md`
|
|
659
|
+
|
|
660
|
+
---
|
|
661
|
+
|
|
662
|
+
## Toast Notifications (MANDATORY: Sonner)
|
|
663
|
+
|
|
664
|
+
```typescript
|
|
665
|
+
// Install: pnpm dlx shadcn@latest add sonner
|
|
666
|
+
import { toast } from "sonner";
|
|
667
|
+
|
|
668
|
+
// Promise-based (loading -> success/error)
|
|
669
|
+
toast.promise(saveData(), {
|
|
670
|
+
loading: 'Saving...',
|
|
671
|
+
success: 'Saved!',
|
|
672
|
+
error: 'Failed to save',
|
|
369
673
|
});
|
|
370
674
|
|
|
371
|
-
//
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
max_tokens: 16000,
|
|
375
|
-
thinking: { type: "adaptive" },
|
|
376
|
-
output_config: { effort: "low" },
|
|
377
|
-
messages: [...]
|
|
675
|
+
// With action button
|
|
676
|
+
toast('File deleted', {
|
|
677
|
+
action: { label: 'Undo', onClick: () => restoreFile() },
|
|
378
678
|
});
|
|
379
679
|
```
|
|
380
680
|
|
|
681
|
+
> **Duration**: 4s info, 7s+ errors. Max 3-5 visible toasts.
|
|
682
|
+
|
|
683
|
+
> **Cache**: `react-toast-notifications.md`
|
|
684
|
+
|
|
685
|
+
---
|
|
686
|
+
|
|
687
|
+
## Optimistic UI (MANDATORY for mutations)
|
|
688
|
+
|
|
689
|
+
> Show instant feedback, rollback on error.
|
|
690
|
+
|
|
691
|
+
### Pattern 1: useOptimistic (React 19)
|
|
692
|
+
|
|
693
|
+
```typescript
|
|
694
|
+
const [optimisticItems, addOptimistic] = useOptimistic(
|
|
695
|
+
items,
|
|
696
|
+
(state, newItem) => [...state, { ...newItem, pending: true }]
|
|
697
|
+
);
|
|
698
|
+
|
|
699
|
+
async function addItem(data: ItemData) {
|
|
700
|
+
addOptimistic(data); // Instant UI update
|
|
701
|
+
try {
|
|
702
|
+
await api.post('/items', data);
|
|
703
|
+
} catch {
|
|
704
|
+
toast.error('Failed to add');
|
|
705
|
+
// State auto-reverts
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
```
|
|
709
|
+
|
|
710
|
+
### Pattern 2: TanStack Query
|
|
711
|
+
|
|
712
|
+
```typescript
|
|
713
|
+
useMutation({
|
|
714
|
+
mutationFn: updateItem,
|
|
715
|
+
onMutate: async (newData) => {
|
|
716
|
+
await queryClient.cancelQueries({ queryKey: ['items'] });
|
|
717
|
+
const previous = queryClient.getQueryData(['items']);
|
|
718
|
+
queryClient.setQueryData(['items'], (old) =>
|
|
719
|
+
old.map(item => item.id === newData.id ? { ...item, ...newData } : item)
|
|
720
|
+
);
|
|
721
|
+
return { previous };
|
|
722
|
+
},
|
|
723
|
+
onError: (err, vars, context) => {
|
|
724
|
+
queryClient.setQueryData(['items'], context.previous); // Rollback
|
|
725
|
+
toast.error('Update failed');
|
|
726
|
+
},
|
|
727
|
+
onSettled: () => queryClient.invalidateQueries({ queryKey: ['items'] }),
|
|
728
|
+
});
|
|
729
|
+
```
|
|
730
|
+
|
|
731
|
+
> **Cache**: `optimistic-ui-patterns-react.md`
|
|
732
|
+
|
|
733
|
+
---
|
|
734
|
+
|
|
735
|
+
## Data Display Patterns
|
|
736
|
+
|
|
737
|
+
### Tables
|
|
738
|
+
|
|
739
|
+
| Style | Use For |
|
|
740
|
+
|-------|---------|
|
|
741
|
+
| **Striped rows** | Long lists, scanning |
|
|
742
|
+
| **Sticky header** | Scrollable data |
|
|
743
|
+
| **Expandable rows** | Details on demand |
|
|
744
|
+
| **Sortable columns** | Data comparison |
|
|
745
|
+
| **Virtualized** | 1000+ rows (TanStack Virtual) |
|
|
746
|
+
|
|
747
|
+
### Cards
|
|
748
|
+
|
|
749
|
+
| Style | Use For |
|
|
750
|
+
|-------|---------|
|
|
751
|
+
| **Stats/KPI Card** | Metrics with trends |
|
|
752
|
+
| **Product Card** | E-commerce listings |
|
|
753
|
+
| **Profile Card** | User information |
|
|
754
|
+
| **Interactive Card** | Hover effects, animations |
|
|
755
|
+
|
|
756
|
+
> **Cache**: `data-display-patterns-2024-2025.md`
|
|
757
|
+
|
|
758
|
+
---
|
|
759
|
+
|
|
760
|
+
## Navigation Patterns
|
|
761
|
+
|
|
762
|
+
| Type | Desktop | Mobile |
|
|
763
|
+
|------|---------|--------|
|
|
764
|
+
| **Header** | Fixed top navbar | Hamburger menu |
|
|
765
|
+
| **Sidebar** | Fixed left, collapsible | Overlay drawer |
|
|
766
|
+
| **Tabs** | Horizontal tabs | Bottom tab bar |
|
|
767
|
+
| **Breadcrumbs** | Path navigation | Simplified |
|
|
768
|
+
|
|
769
|
+
> **Cache**: `navigation-header-design-patterns-2025.md`
|
|
770
|
+
|
|
771
|
+
---
|
|
772
|
+
|
|
773
|
+
## Animation Libraries
|
|
774
|
+
|
|
775
|
+
| Library | Use When | Bundle |
|
|
776
|
+
|---------|----------|--------|
|
|
777
|
+
| **AutoAnimate** | 90% of UI (lists, tabs, dropdowns) | Minimal |
|
|
778
|
+
| **Framer Motion** | Page transitions, gestures, layouts | 32KB |
|
|
779
|
+
| **GSAP** | Scroll-driven, complex timelines | 23KB |
|
|
780
|
+
| **Magic UI** | Landing pages, marketing | Copy-paste |
|
|
781
|
+
| **Aceternity UI** | Portfolios, 3D effects | Copy-paste |
|
|
782
|
+
|
|
783
|
+
---
|
|
784
|
+
|
|
785
|
+
## Design Trends (2025)
|
|
786
|
+
|
|
787
|
+
| Trend | Use For | Avoid |
|
|
788
|
+
|-------|---------|-------|
|
|
789
|
+
| **Glassmorphism** | Modals, overlays, dark mode | Light backgrounds |
|
|
790
|
+
| **Minimalism** | Mobile, SaaS, accessibility | Marketing sites |
|
|
791
|
+
| **Bold Typography** | Landing hero, brands | Data dashboards |
|
|
792
|
+
|
|
793
|
+
---
|
|
794
|
+
|
|
795
|
+
## Mandatory Planning
|
|
796
|
+
|
|
797
|
+
> Use `EnterPlanMode` for non-trivial tasks BEFORE implementing.
|
|
798
|
+
|
|
799
|
+
| Task Type | Plan Required |
|
|
800
|
+
|-----------|---------------|
|
|
801
|
+
| New feature | YES |
|
|
802
|
+
| UI changes (any JSX) | YES |
|
|
803
|
+
| Multi-file changes | YES |
|
|
804
|
+
| Bug fix (simple) | NO |
|
|
805
|
+
| Single-line fix | NO |
|
|
806
|
+
|
|
807
|
+
### Plan Format
|
|
808
|
+
|
|
809
|
+
```
|
|
810
|
+
1. Analyze current state
|
|
811
|
+
2. Identify affected files
|
|
812
|
+
3. Design approach (with alternatives)
|
|
813
|
+
4. Get user approval
|
|
814
|
+
5. THEN implement
|
|
815
|
+
```
|
|
816
|
+
|
|
381
817
|
---
|
|
382
818
|
|
|
383
|
-
##
|
|
819
|
+
## Critical Rules
|
|
384
820
|
|
|
385
|
-
|
|
821
|
+
### Path Aliases (MANDATORY)
|
|
386
822
|
|
|
387
|
-
|
|
823
|
+
| Alias | Maps To | Use For |
|
|
824
|
+
| ---------- | ------------------- | ------------- |
|
|
825
|
+
| `$types/*` | `./types/*` | Type defs |
|
|
826
|
+
| `@common` | `./common/index.ts` | Logger, utils |
|
|
827
|
+
| `@db` | `./common/db/` | DB connection |
|
|
388
828
|
|
|
389
|
-
|
|
390
|
-
- Record **solutions** applied to fix issues
|
|
391
|
-
- Add **prevention tips** for future sessions
|
|
392
|
-
- Update **attention points** with new learnings
|
|
393
|
-
- Keep domain knowledge **current and accurate**
|
|
829
|
+
> **NEVER** use `@types/` (reserved by TypeScript)
|
|
394
830
|
|
|
395
|
-
###
|
|
831
|
+
### Types Location
|
|
396
832
|
|
|
397
|
-
|
|
833
|
+
- **ALL** interfaces/types MUST be in `types/` folder
|
|
834
|
+
- **NEVER** define types in `src/` files
|
|
835
|
+
- **EXCEPTION:** Zod inferred types and Mongoose Documents
|
|
398
836
|
|
|
399
|
-
|
|
400
|
-
2. BEFORE commit-manager (so changes are included in commit)
|
|
401
|
-
3. Stop hook blocks session end until domains are updated (if source files were modified)
|
|
837
|
+
### TypeScript Strict
|
|
402
838
|
|
|
403
|
-
|
|
839
|
+
```typescript
|
|
840
|
+
process.env['VARIABLE']; // CORRECT (bracket notation)
|
|
841
|
+
source: 'listed' as const; // CORRECT (literal type)
|
|
842
|
+
```
|
|
843
|
+
|
|
844
|
+
---
|
|
845
|
+
|
|
846
|
+
## Quality Gates
|
|
404
847
|
|
|
848
|
+
```bash
|
|
849
|
+
bun run typecheck # MUST pass
|
|
850
|
+
bun run lint # MUST pass
|
|
851
|
+
bun run test # MUST pass
|
|
852
|
+
docker compose build # MUST pass
|
|
853
|
+
bash .claude/scripts/validate-skills.sh # Skills activation check
|
|
405
854
|
```
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
855
|
+
|
|
856
|
+
---
|
|
857
|
+
|
|
858
|
+
## Commit Format
|
|
859
|
+
|
|
860
|
+
```
|
|
861
|
+
[type]: [description]
|
|
862
|
+
|
|
863
|
+
- Detail 1
|
|
864
|
+
- Detail 2
|
|
865
|
+
|
|
866
|
+
Generated with Claude Code
|
|
409
867
|
```
|
|
410
868
|
|
|
411
|
-
|
|
869
|
+
Types: `feat`, `fix`, `refactor`, `docs`, `chore`
|
|
870
|
+
|
|
871
|
+
---
|
|
412
872
|
|
|
413
|
-
|
|
873
|
+
## NRY (Never Repeat Yourself)
|
|
874
|
+
|
|
875
|
+
Common Claude mistakes to avoid:
|
|
876
|
+
|
|
877
|
+
- Multi-line bash with `\` continuations (breaks permissions)
|
|
878
|
+
- Relative paths in permission patterns
|
|
879
|
+
- Executing agent logic manually (use Task tool)
|
|
880
|
+
- Using bash for file operations (use Read/Write/Edit)
|
|
881
|
+
- Ignoring context size (use `/compact`)
|
|
882
|
+
|
|
883
|
+
---
|
|
884
|
+
|
|
885
|
+
## Claude 4.6 Best Practices
|
|
886
|
+
|
|
887
|
+
### Model Selection
|
|
888
|
+
|
|
889
|
+
| Model | API ID | Best For |
|
|
890
|
+
|-------|--------|----------|
|
|
891
|
+
| **Opus 4.6** | `claude-opus-4-6` | Orchestrators, long-horizon tasks |
|
|
892
|
+
| **Sonnet 4.6** | `claude-sonnet-4-6` | Daily coding (5x cheaper) |
|
|
893
|
+
| **Haiku 4.5** | `claude-haiku-4-5-20251001` | Simple tasks |
|
|
894
|
+
|
|
895
|
+
### Key Rules
|
|
896
|
+
|
|
897
|
+
- Use adaptive thinking (`thinking: { type: "adaptive" }`)
|
|
898
|
+
- Avoid aggressive prompts ("MUST", "CRITICAL") -- causes overtriggering
|
|
899
|
+
- Lower effort level instead of adding constraints
|
|
900
|
+
- Use subagents for parallel tasks, work directly for sequential
|
|
901
|
+
- Avoid over-engineering -- only make requested changes
|