specialist-agent 2.10.0 → 2.11.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/.claude-plugin/marketplace.json +5 -5
- package/.claude-plugin/plugin.json +2 -2
- package/.cursor-plugin/marketplace.json +1 -1
- package/.cursor-plugin/plugin.json +2 -2
- package/README.md +128 -250
- package/agents/analyst.md +1 -0
- package/agents/api.md +4 -4
- package/agents/architect-lite.md +2 -2
- package/agents/architect.md +6 -6
- package/agents/cloud-lite.md +1 -1
- package/agents/cloud.md +4 -4
- package/agents/data-lite.md +1 -1
- package/agents/data.md +4 -4
- package/agents/debugger.md +1 -0
- package/agents/deps.md +4 -4
- package/agents/designer-lite.md +1 -1
- package/agents/designer.md +4 -4
- package/agents/devops-lite.md +1 -1
- package/agents/devops.md +4 -4
- package/agents/docs.md +4 -4
- package/agents/executor.md +95 -0
- package/agents/explorer-lite.md +1 -1
- package/agents/explorer.md +4 -4
- package/agents/finance-lite.md +1 -1
- package/agents/finance.md +4 -4
- package/agents/i18n.md +4 -4
- package/agents/legal-lite.md +1 -1
- package/agents/legal.md +4 -4
- package/agents/marketing-lite.md +25 -0
- package/agents/marketing.md +179 -0
- package/agents/memory.md +13 -12
- package/agents/orchestrator.md +102 -0
- package/agents/pair.md +1 -0
- package/agents/perf.md +4 -4
- package/agents/planner.md +1 -0
- package/agents/product-lite.md +25 -0
- package/agents/product.md +186 -0
- package/agents/refactor.md +4 -4
- package/agents/ripple.md +1 -0
- package/agents/scout.md +1 -0
- package/agents/security-lite.md +1 -1
- package/agents/security.md +4 -4
- package/agents/sentry-triage-lite.md +54 -0
- package/agents/sentry-triage.md +214 -0
- package/agents/starter-lite.md +4 -4
- package/agents/starter.md +8 -8
- package/agents/support-lite.md +24 -0
- package/agents/support.md +190 -0
- package/agents/tdd.md +1 -0
- package/agents/tester-lite.md +1 -1
- package/agents/tester.md +43 -10
- package/cli/index.mjs +469 -324
- package/hooks/native/auto-dispatch.mjs +19 -26
- package/hooks/native/auto-format.mjs +5 -25
- package/hooks/native/mcp-discovery.mjs +168 -0
- package/hooks/native/security-config.json +4 -0
- package/hooks/native/security-guard.mjs +37 -24
- package/hooks/native/session-context.mjs +61 -18
- package/hooks/native/settings-template.json +9 -0
- package/package.json +1 -1
- package/packs/angular/agents/builder.md +10 -54
- package/packs/angular/agents/doctor.md +7 -61
- package/packs/angular/agents/migrator.md +7 -101
- package/packs/angular/agents/reviewer.md +22 -33
- package/packs/angular/skills/review-check-architecture/SKILL.md +7 -7
- package/packs/angular/skills/review-review/SKILL.md +1 -0
- package/packs/astro/agents/builder.md +10 -79
- package/packs/astro/agents/doctor.md +7 -61
- package/packs/astro/agents/migrator.md +7 -111
- package/packs/astro/agents/reviewer.md +22 -32
- package/packs/astro/skills/review-check-architecture/SKILL.md +9 -9
- package/packs/astro/skills/review-review/SKILL.md +1 -0
- package/packs/nextjs/agents/builder.md +11 -108
- package/packs/nextjs/agents/doctor.md +7 -62
- package/packs/nextjs/agents/migrator.md +6 -194
- package/packs/nextjs/agents/reviewer.md +22 -76
- package/packs/nextjs/skills/review-check-architecture/SKILL.md +15 -15
- package/packs/nextjs/skills/review-review/SKILL.md +1 -0
- package/packs/nuxt/agents/builder.md +10 -55
- package/packs/nuxt/agents/doctor.md +7 -61
- package/packs/nuxt/agents/migrator.md +7 -109
- package/packs/nuxt/agents/reviewer.md +22 -42
- package/packs/nuxt/skills/review-check-architecture/SKILL.md +11 -11
- package/packs/nuxt/skills/review-review/SKILL.md +1 -0
- package/packs/react/agents/builder.md +10 -55
- package/packs/react/agents/doctor.md +7 -61
- package/packs/react/agents/migrator.md +7 -106
- package/packs/react/agents/reviewer.md +22 -55
- package/packs/react/skills/review-check-architecture/SKILL.md +10 -10
- package/packs/react/skills/review-review/SKILL.md +1 -0
- package/packs/svelte/agents/builder.md +10 -58
- package/packs/svelte/agents/doctor.md +7 -60
- package/packs/svelte/agents/migrator.md +7 -118
- package/packs/svelte/agents/reviewer.md +22 -42
- package/packs/svelte/skills/review-check-architecture/SKILL.md +12 -12
- package/packs/svelte/skills/review-review/SKILL.md +1 -0
- package/packs/vue/agents/builder.md +10 -55
- package/packs/vue/agents/doctor.md +7 -61
- package/packs/vue/agents/migrator.md +7 -93
- package/packs/vue/agents/reviewer.md +20 -32
- package/packs/vue/skills/review-check-architecture/SKILL.md +10 -10
- package/packs/vue/skills/review-review/SKILL.md +1 -0
- package/skills/autofix/SKILL.md +166 -0
- package/skills/discovery/SKILL.md +218 -0
|
@@ -14,28 +14,11 @@ Read `docs/ARCHITECTURE.md`.
|
|
|
14
14
|
|
|
15
15
|
## Core Principles
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
- Use HTTPS everywhere, set secure headers (CSP, HSTS, X-Frame-Options)
|
|
23
|
-
- Follow OWASP Top 10 - prevent XSS, CSRF, injection, broken auth, etc.
|
|
24
|
-
- Secrets in environment variables only - never hardcode
|
|
25
|
-
|
|
26
|
-
### Performance First (Mandatory)
|
|
27
|
-
- ALWAYS use server-side data fetching in frontmatter - no unnecessary client JS
|
|
28
|
-
- Choose the LEAST aggressive hydration strategy for islands (`client:visible` > `client:idle` > `client:load`)
|
|
29
|
-
- Use Content Collections for static content - type-safe and optimized at build time
|
|
30
|
-
- Lazy load islands and heavy dependencies
|
|
31
|
-
- Avoid shipping JavaScript unless interactivity is required
|
|
32
|
-
- Use `<Image />` from `astro:assets` for optimized images
|
|
33
|
-
- Avoid N+1 queries - batch requests, use proper data loading patterns
|
|
34
|
-
|
|
35
|
-
### Code Language (Mandatory)
|
|
36
|
-
- ALWAYS write code (variables, functions, comments, commits) in English
|
|
37
|
-
- Only use other languages if explicitly requested by the user
|
|
38
|
-
- User-facing text (UI labels, messages) should match project's i18n strategy
|
|
17
|
+
Refer to the pack CLAUDE.md for full stack details and key patterns.
|
|
18
|
+
|
|
19
|
+
- **Security**: Validate all inputs server-side, parameterized queries only, no secrets in code, OWASP Top 10
|
|
20
|
+
- **Performance**: Use the framework's recommended server state caching, lazy load routes and components, no N+1 queries
|
|
21
|
+
- **Code Language**: All code in English. User-facing text follows project i18n strategy
|
|
39
22
|
|
|
40
23
|
## Scope Detection
|
|
41
24
|
- **Module**: user wants to migrate an entire module/directory -> Module mode (6 phases)
|
|
@@ -44,53 +27,7 @@ Read `docs/ARCHITECTURE.md`.
|
|
|
44
27
|
---
|
|
45
28
|
|
|
46
29
|
## Module Mode (6 Phases)
|
|
47
|
-
|
|
48
|
-
### Phase 0: Analysis
|
|
49
|
-
- Map current state: count files, identify framework (React/Vue/Svelte), JS vs TS, client-side routing, state management
|
|
50
|
-
- List API endpoints used and data fetching patterns (useEffect, useSWR, Vue Query, etc.)
|
|
51
|
-
- Identify interactive vs static parts
|
|
52
|
-
- Report to user before proceeding
|
|
53
|
-
|
|
54
|
-
### Phase 1: Structure
|
|
55
|
-
- Create target directories: `src/pages/`, `src/components/`, `src/islands/`, `src/layouts/`, `src/modules/[name]/`
|
|
56
|
-
- Set up Astro configuration (integrations, adapters)
|
|
57
|
-
- Validate: `npx astro check`
|
|
58
|
-
|
|
59
|
-
### Phase 2: Types & Adapters
|
|
60
|
-
- Create `.types.ts` (exact API response, snake_case)
|
|
61
|
-
- Create `.contracts.ts` (app contract, camelCase)
|
|
62
|
-
- Create adapter with bidirectional parsing
|
|
63
|
-
- Validate: `npx astro check`
|
|
64
|
-
|
|
65
|
-
### Phase 3: Services
|
|
66
|
-
- Extract HTTP calls to pure service (no try/catch, no transformation)
|
|
67
|
-
- Convert from axios/fetch wrappers to plain fetch
|
|
68
|
-
- One file per resource
|
|
69
|
-
- Validate: `npx astro build`
|
|
70
|
-
|
|
71
|
-
### Phase 4: Pages & Routing
|
|
72
|
-
- Convert SPA routes to file-based routing (`src/pages/`)
|
|
73
|
-
- Move client-side data fetching (useEffect, useSWR, Vue Query) to frontmatter server-side fetch
|
|
74
|
-
- Create layouts for shared page structure
|
|
75
|
-
- Set up `getStaticPaths()` for dynamic SSG routes
|
|
76
|
-
- Create API endpoints for mutations (`src/pages/api/`)
|
|
77
|
-
- Validate: `npx astro build`
|
|
78
|
-
|
|
79
|
-
### Phase 5: Components & Islands
|
|
80
|
-
- Analyze each component: does it need interactivity?
|
|
81
|
-
- **No interactivity** -> Convert to `.astro` component (zero JS)
|
|
82
|
-
- **Has interactivity** -> Keep as framework component, move to `src/islands/`, add `client:*` directive
|
|
83
|
-
- Choose hydration strategy per island (prefer `client:visible` > `client:idle` > `client:load`)
|
|
84
|
-
- Remove client-side state management where possible (data comes from server)
|
|
85
|
-
- Keep minimal island state for UI interactions only
|
|
86
|
-
- Validate after each component
|
|
87
|
-
|
|
88
|
-
### Phase 6: Review
|
|
89
|
-
- Run pattern checks (same as @reviewer review mode)
|
|
90
|
-
- Verify zero JS on pages without islands
|
|
91
|
-
- Check bundle size reduction
|
|
92
|
-
- Report remaining issues
|
|
93
|
-
- Get user approval
|
|
30
|
+
Run `/migration-migrate-module $PATH`. This skill contains the full 6-phase migration workflow -- do NOT duplicate it here.
|
|
94
31
|
|
|
95
32
|
## Verification Protocol
|
|
96
33
|
|
|
@@ -125,48 +62,7 @@ Read `docs/ARCHITECTURE.md`.
|
|
|
125
62
|
---
|
|
126
63
|
|
|
127
64
|
## Component Mode
|
|
128
|
-
|
|
129
|
-
### Conversion Table - SPA to Astro
|
|
130
|
-
|
|
131
|
-
| SPA Pattern | Astro Equivalent |
|
|
132
|
-
|-------------|-----------------|
|
|
133
|
-
| React/Vue page component | `.astro` page with layout |
|
|
134
|
-
| Client-side routing | File-based routing (`src/pages/`) |
|
|
135
|
-
| `useEffect` / `onMounted` (data fetch) | Frontmatter `await` call |
|
|
136
|
-
| `useState` / `ref()` (UI state) | Keep in island or remove |
|
|
137
|
-
| `useState` / `ref()` (server data) | Frontmatter fetch + adapter |
|
|
138
|
-
| `useContext` / `provide/inject` | Props or server-side data |
|
|
139
|
-
| CSS-in-JS (styled-components) | Scoped `<style>` in .astro |
|
|
140
|
-
| Event handlers (onClick, etc.) | Island with `client:*` directive |
|
|
141
|
-
| Static/presentational component | `.astro` component (zero JS) |
|
|
142
|
-
| Loading spinner | Remove (server-rendered, no loading state for SSG) |
|
|
143
|
-
| Error boundary | try/catch in frontmatter |
|
|
144
|
-
| Redux/Pinia store (server data) | Frontmatter fetch |
|
|
145
|
-
| Redux/Pinia store (UI state) | Island local state or `nanostores` |
|
|
146
|
-
|
|
147
|
-
### Workflow
|
|
148
|
-
1. Read the component and determine: is it interactive or presentational?
|
|
149
|
-
2. If **presentational** -> Convert to `.astro`:
|
|
150
|
-
- Props -> `Astro.props` with `Props` interface
|
|
151
|
-
- JSX -> Astro template syntax
|
|
152
|
-
- CSS-in-JS -> scoped `<style>`
|
|
153
|
-
- Remove all JavaScript that runs on client
|
|
154
|
-
3. If **interactive** -> Move to `src/islands/`:
|
|
155
|
-
- Keep framework code (React/Vue/Svelte)
|
|
156
|
-
- Remove data fetching (move to page frontmatter)
|
|
157
|
-
- Keep only UI interactivity state
|
|
158
|
-
- Choose `client:*` directive
|
|
159
|
-
4. Move data fetching to the page that uses this component
|
|
160
|
-
5. Validate: `npx astro check && npx astro build`
|
|
161
|
-
6. Update pages that reference migrated component
|
|
162
|
-
|
|
163
|
-
### Rules
|
|
164
|
-
- Default to `.astro` - prove interactivity before making an island
|
|
165
|
-
- Keep public API (props) stable when possible
|
|
166
|
-
- If API changes, update all consumers
|
|
167
|
-
- One component per commit
|
|
168
|
-
- Report bugs found during migration (don't silently fix)
|
|
169
|
-
- **Verify each phase** - Partial migration is worse than none
|
|
65
|
+
Run `/migration-migrate-component $FILE`. This skill contains the full component migration workflow -- do NOT duplicate it here.
|
|
170
66
|
|
|
171
67
|
## Output
|
|
172
68
|
|
|
@@ -51,28 +51,11 @@ Unlike competitors that use separate agents for spec review and code review (dou
|
|
|
51
51
|
|
|
52
52
|
## Core Principles
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
- Use HTTPS everywhere, set secure headers (CSP, HSTS, X-Frame-Options)
|
|
60
|
-
- Follow OWASP Top 10 - prevent XSS, CSRF, injection, broken auth, etc.
|
|
61
|
-
- Secrets in environment variables only - never hardcode
|
|
62
|
-
|
|
63
|
-
### Performance First (Mandatory)
|
|
64
|
-
- ALWAYS use server-side data fetching in frontmatter - no unnecessary client JS
|
|
65
|
-
- Choose the LEAST aggressive hydration strategy for islands (`client:visible` > `client:idle` > `client:load`)
|
|
66
|
-
- Use Content Collections for static content - type-safe and optimized at build time
|
|
67
|
-
- Lazy load islands and heavy dependencies
|
|
68
|
-
- Avoid shipping JavaScript unless interactivity is required
|
|
69
|
-
- Use `<Image />` from `astro:assets` for optimized images
|
|
70
|
-
- Avoid N+1 queries - batch requests, use proper data loading patterns
|
|
71
|
-
|
|
72
|
-
### Code Language (Mandatory)
|
|
73
|
-
- ALWAYS write code (variables, functions, comments, commits) in English
|
|
74
|
-
- Only use other languages if explicitly requested by the user
|
|
75
|
-
- User-facing text (UI labels, messages) should match project's i18n strategy
|
|
54
|
+
Refer to the pack CLAUDE.md for full stack details and key patterns.
|
|
55
|
+
|
|
56
|
+
- **Security**: Validate all inputs server-side, parameterized queries only, no secrets in code, OWASP Top 10
|
|
57
|
+
- **Performance**: Use the framework's recommended server state caching, lazy load routes and components, no N+1 queries
|
|
58
|
+
- **Code Language**: All code in English. User-facing text follows project i18n strategy
|
|
76
59
|
|
|
77
60
|
## Scope Detection
|
|
78
61
|
- **Review**: user wants code review, PR validation, or violation fixing -> Review mode
|
|
@@ -92,16 +75,9 @@ npx vitest run --passWithNoTests
|
|
|
92
75
|
```
|
|
93
76
|
|
|
94
77
|
### 2. Pattern Checks
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
grep -rn "client:load" src/ --include="*.astro" 2>/dev/null && echo "ATTENTION: client:load usage - verify necessity"
|
|
99
|
-
grep -rn "client:only" src/ --include="*.astro" 2>/dev/null && echo "ATTENTION: client:only skips SSR - verify necessity"
|
|
100
|
-
grep -rn ": any\|as any" src/modules/ --include="*.ts" --include="*.astro" 2>/dev/null && echo "ATTENTION: any types"
|
|
101
|
-
grep -rn "console\.\|debugger" src/modules/ --include="*.ts" --include="*.astro" 2>/dev/null && echo "ATTENTION: debug artifacts"
|
|
102
|
-
grep -rn "set:html" src/ --include="*.astro" 2>/dev/null && echo "VIOLATION: set:html (XSS risk)"
|
|
103
|
-
grep -rn "innerHTML" src/islands/ --include="*.tsx" --include="*.vue" --include="*.svelte" 2>/dev/null && echo "VIOLATION: innerHTML in island"
|
|
104
|
-
```
|
|
78
|
+
Run `/review-check-architecture $SCOPE` and include the results in the review.
|
|
79
|
+
This skill contains all framework-specific automated checks
|
|
80
|
+
-- do NOT duplicate them here.
|
|
105
81
|
|
|
106
82
|
### 3. Manual Review
|
|
107
83
|
- Services: fetch only, no try/catch, no transformation
|
|
@@ -181,6 +157,20 @@ grep -rn "innerHTML" src/islands/ --include="*.tsx" --include="*.vue" --include=
|
|
|
181
157
|
5. Images: verify `<Image />` from `astro:assets` is used (not raw `<img>`)
|
|
182
158
|
6. Report bottlenecks sorted by user impact
|
|
183
159
|
|
|
160
|
+
## Automatic Fail Triggers
|
|
161
|
+
|
|
162
|
+
The following conditions result in an **AUTOMATIC FAIL** verdict -- no exceptions:
|
|
163
|
+
|
|
164
|
+
| Trigger | Why |
|
|
165
|
+
|---------|-----|
|
|
166
|
+
| "Zero issues found" | Every codebase has improvement areas. Zero findings = insufficient review. |
|
|
167
|
+
| "LGTM" or "Looks good to me" without specifics | Lazy. Explain what you verified and how. |
|
|
168
|
+
| Approval without running `tsc`, `eslint`, `build`, or `tests` | No automated check output = no review. |
|
|
169
|
+
| "Minor issues only" when violations exist | A violation is blocking. Do not minimize. |
|
|
170
|
+
| Praising code that violates ARCHITECTURE.md | Architecture compliance is non-negotiable. |
|
|
171
|
+
| Reviewing without reading ARCHITECTURE.md first | Context-free review is worthless. |
|
|
172
|
+
| Approving code with `any` types in business logic | Type safety is not optional. |
|
|
173
|
+
|
|
184
174
|
## Anti-Sycophancy Protocol
|
|
185
175
|
|
|
186
176
|
### For the Reviewer (Giving Feedback)
|
|
@@ -16,22 +16,22 @@ Run all checks and report a summary:
|
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
18
|
echo "=== 1. Services with try/catch ==="
|
|
19
|
-
grep -rn "try {" src/modules/*/services/ --include="*.ts" 2>/dev/null || echo "
|
|
19
|
+
grep -rn "try {" src/modules/*/services/ --include="*.ts" 2>/dev/null || echo "PASS: None"
|
|
20
20
|
|
|
21
21
|
echo "=== 2. Services with transformation ==="
|
|
22
|
-
grep -rn "\.map(\|\.filter(\|new Date\|\.reduce(" src/modules/*/services/ --include="*.ts" 2>/dev/null || echo "
|
|
22
|
+
grep -rn "\.map(\|\.filter(\|new Date\|\.reduce(" src/modules/*/services/ --include="*.ts" 2>/dev/null || echo "PASS: None"
|
|
23
23
|
|
|
24
24
|
echo "=== 3. Unnecessary client:load ==="
|
|
25
|
-
grep -rn "client:load" src/ --include="*.astro" 2>/dev/null || echo "
|
|
25
|
+
grep -rn "client:load" src/ --include="*.astro" 2>/dev/null || echo "PASS: None"
|
|
26
26
|
|
|
27
27
|
echo "=== 4. client:only usage (skips SSR) ==="
|
|
28
|
-
grep -rn "client:only" src/ --include="*.astro" 2>/dev/null || echo "
|
|
28
|
+
grep -rn "client:only" src/ --include="*.astro" 2>/dev/null || echo "PASS: None"
|
|
29
29
|
|
|
30
30
|
echo "=== 5. set:html usage (XSS risk) ==="
|
|
31
|
-
grep -rn "set:html" src/ --include="*.astro" 2>/dev/null || echo "
|
|
31
|
+
grep -rn "set:html" src/ --include="*.astro" 2>/dev/null || echo "PASS: None"
|
|
32
32
|
|
|
33
33
|
echo "=== 6. innerHTML in islands ==="
|
|
34
|
-
grep -rn "innerHTML\|dangerouslySetInnerHTML" src/islands/ --include="*.tsx" --include="*.vue" --include="*.svelte" 2>/dev/null || echo "
|
|
34
|
+
grep -rn "innerHTML\|dangerouslySetInnerHTML" src/islands/ --include="*.tsx" --include="*.vue" --include="*.svelte" 2>/dev/null || echo "PASS: None"
|
|
35
35
|
|
|
36
36
|
echo "=== 7. any types ==="
|
|
37
37
|
grep -rn ": any\| any;\|as any\|<any>" src/modules/ --include="*.ts" --include="*.astro" 2>/dev/null | wc -l
|
|
@@ -49,7 +49,7 @@ echo "=== 10. Missing Content Collection schemas ==="
|
|
|
49
49
|
ls src/content/config.ts 2>/dev/null || echo "WARNING: No content config found"
|
|
50
50
|
|
|
51
51
|
echo "=== 11. Raw img tags (should use Image component) ==="
|
|
52
|
-
grep -rn "<img " src/ --include="*.astro" 2>/dev/null | grep -v "astro:assets" || echo "
|
|
52
|
+
grep -rn "<img " src/ --include="*.astro" 2>/dev/null | grep -v "astro:assets" || echo "PASS: None"
|
|
53
53
|
|
|
54
54
|
echo "=== 12. Islands without client directive ==="
|
|
55
55
|
grep -rn "import.*from.*islands/" src/ --include="*.astro" 2>/dev/null | while read f; do
|
|
@@ -59,14 +59,14 @@ grep -rn "import.*from.*islands/" src/ --include="*.astro" 2>/dev/null | while r
|
|
|
59
59
|
done
|
|
60
60
|
|
|
61
61
|
echo "=== 13. Environment variables in client code ==="
|
|
62
|
-
grep -rn "import.meta.env" src/islands/ --include="*.tsx" --include="*.vue" --include="*.svelte" 2>/dev/null || echo "
|
|
62
|
+
grep -rn "import.meta.env" src/islands/ --include="*.tsx" --include="*.vue" --include="*.svelte" 2>/dev/null || echo "PASS: None"
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
Produce a summary table:
|
|
66
66
|
|
|
67
67
|
| Check | Status | Occurrences |
|
|
68
68
|
|-------|--------|-------------|
|
|
69
|
-
| Services without try/catch |
|
|
69
|
+
| Services without try/catch | PASS/FAIL | X |
|
|
70
70
|
| ... | ... | ... |
|
|
71
71
|
|
|
72
72
|
Overall score: X/13 checks passing.
|
|
@@ -25,6 +25,7 @@ npx astro build
|
|
|
25
25
|
npx vitest run --passWithNoTests
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
2b. Run `/review-check-architecture $SCOPE` for automated pattern validation.
|
|
28
29
|
3. Check ARCHITECTURE.md patterns:
|
|
29
30
|
- Services: no try/catch, no transformation, fetch only
|
|
30
31
|
- Adapters: pure functions
|
|
@@ -14,28 +14,11 @@ Read `docs/ARCHITECTURE.md`.
|
|
|
14
14
|
|
|
15
15
|
## Core Principles
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
- Use HTTPS everywhere, set secure headers (CSP, HSTS, X-Frame-Options)
|
|
23
|
-
- Follow OWASP Top 10 - prevent XSS, CSRF, injection, broken auth, etc.
|
|
24
|
-
- Secrets in environment variables only - never hardcode
|
|
25
|
-
|
|
26
|
-
### Performance First (Mandatory)
|
|
27
|
-
- ALWAYS use TanStack Query (React Query) for server state caching
|
|
28
|
-
- Set appropriate `staleTime` and `gcTime` for each query based on data freshness needs
|
|
29
|
-
- Use `keepPreviousData` for pagination to avoid loading flickers
|
|
30
|
-
- Implement optimistic updates for mutations when UX benefits
|
|
31
|
-
- Use proper cache invalidation (`invalidateQueries`) - stale UI is a bug
|
|
32
|
-
- Lazy load routes, components, and heavy dependencies
|
|
33
|
-
- Avoid N+1 queries - batch requests, use proper data loading patterns
|
|
34
|
-
|
|
35
|
-
### Code Language (Mandatory)
|
|
36
|
-
- ALWAYS write code (variables, functions, comments, commits) in English
|
|
37
|
-
- Only use other languages if explicitly requested by the user
|
|
38
|
-
- User-facing text (UI labels, messages) should match project's i18n strategy
|
|
17
|
+
Refer to the pack CLAUDE.md for full stack details and key patterns.
|
|
18
|
+
|
|
19
|
+
- **Security**: Validate all inputs server-side, parameterized queries only, no secrets in code, OWASP Top 10
|
|
20
|
+
- **Performance**: Use the framework's recommended server state caching, lazy load routes and components, no N+1 queries
|
|
21
|
+
- **Code Language**: All code in English. User-facing text follows project i18n strategy
|
|
39
22
|
|
|
40
23
|
## Scope Detection
|
|
41
24
|
- **Module**: user wants a full feature (CRUD, page, multiple endpoints) -> Module mode
|
|
@@ -48,91 +31,16 @@ Read `docs/ARCHITECTURE.md`.
|
|
|
48
31
|
---
|
|
49
32
|
|
|
50
33
|
## Module Mode
|
|
51
|
-
|
|
52
|
-
2. Scaffold `src/modules/[kebab-name]/` with: components/, hooks/, services/, adapters/, stores/, actions/, types/, __tests__/, index.ts
|
|
53
|
-
3. Scaffold `app/[kebab-name]/` with: page.tsx, layout.tsx, loading.tsx, error.tsx
|
|
54
|
-
4. Create bottom-up:
|
|
55
|
-
- `types/[name].types.ts` -- exact API response (snake_case)
|
|
56
|
-
- `types/[name].contracts.ts` -- app contract (camelCase, Date objects)
|
|
57
|
-
- `adapters/[name]-adapter.ts` -- pure functions: inbound (API->App) + outbound (App->API)
|
|
58
|
-
- `services/[name]-service.ts` -- HTTP only: `{ list, getById, create, update, delete }`. No try/catch, no transformation
|
|
59
|
-
- `stores/[name]-store.ts` -- Zustand, client state only (filters, UI). `create<T>()`
|
|
60
|
-
- `actions/[name]-actions.ts` -- Server Actions (`'use server'`), use service+adapter, revalidatePath
|
|
61
|
-
- `hooks/useXxxList.ts` -- orchestrate service->adapter->React Query. Set staleTime, queryKey
|
|
62
|
-
- Components -- determine Server vs Client per decision tree. Typed props, < 200 lines
|
|
63
|
-
- `app/[name]/page.tsx` -- Server Component, fetch data, compose Client Components
|
|
64
|
-
- `app/[name]/loading.tsx` -- skeleton loading UI
|
|
65
|
-
- `app/[name]/error.tsx` -- error boundary (`'use client'` required)
|
|
66
|
-
5. Create barrel export (index.ts): components + hooks + actions + contracts
|
|
67
|
-
6. Validate: `npx tsc --noEmit`
|
|
68
|
-
|
|
69
|
-
## Component Mode (Server or Client)
|
|
70
|
-
1. **Determine Server vs Client** using the decision tree:
|
|
71
|
-
- Needs hooks (useState, useEffect, useQuery, useStore)? -> Client (`'use client'`)
|
|
72
|
-
- Needs event handlers (onClick, onChange)? -> Client (`'use client'`)
|
|
73
|
-
- Needs browser APIs? -> Client (`'use client'`)
|
|
74
|
-
- Only fetches data and renders? -> Server (no directive)
|
|
75
|
-
- Only composes other components? -> Server (no directive)
|
|
76
|
-
|
|
77
|
-
2. Determine placement: feature -> `src/modules/[feature]/components/`, shared -> `src/shared/components/`
|
|
78
|
-
|
|
79
|
-
3. **Server Component template:**
|
|
80
|
-
```tsx
|
|
81
|
-
import type { XxxItem } from '../types/xxx.contracts'
|
|
82
|
-
|
|
83
|
-
interface XxxComponentProps {
|
|
84
|
-
item: XxxItem
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export function XxxComponent({ item }: XxxComponentProps) {
|
|
88
|
-
return (
|
|
89
|
-
<div>{/* render */}</div>
|
|
90
|
-
)
|
|
91
|
-
}
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
4. **Client Component template:**
|
|
95
|
-
```tsx
|
|
96
|
-
'use client'
|
|
97
|
-
|
|
98
|
-
import { useState } from 'react'
|
|
99
|
-
import type { XxxItem } from '../types/xxx.contracts'
|
|
100
|
-
|
|
101
|
-
interface XxxComponentProps {
|
|
102
|
-
items: XxxItem[]
|
|
103
|
-
onSelect?: (item: XxxItem) => void
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export function XxxComponent({ items, onSelect }: XxxComponentProps) {
|
|
107
|
-
const [selected, setSelected] = useState<string | null>(null)
|
|
108
|
-
|
|
109
|
-
function handleSelect(item: XxxItem) {
|
|
110
|
-
setSelected(item.id)
|
|
111
|
-
onSelect?.(item)
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
return (
|
|
115
|
-
<div>{/* render with event handlers */}</div>
|
|
116
|
-
)
|
|
117
|
-
}
|
|
118
|
-
```
|
|
34
|
+
Run `/dev-create-module $NAME`. This skill contains the full scaffold workflow -- do NOT duplicate it here.
|
|
119
35
|
|
|
120
|
-
|
|
36
|
+
## Component Mode
|
|
37
|
+
Run `/dev-create-component $NAME`. This skill contains the full scaffold workflow -- do NOT duplicate it here.
|
|
121
38
|
|
|
122
39
|
## Service Mode
|
|
123
|
-
|
|
124
|
-
2. Create 4 files:
|
|
125
|
-
- `types/[name].types.ts` -- exact API (snake_case, string dates)
|
|
126
|
-
- `types/[name].contracts.ts` -- app contract (camelCase, Date, computed booleans)
|
|
127
|
-
- `adapters/[name]-adapter.ts` -- pure functions, bidirectional. Rename snake->camel, convert string->Date, cents->currency
|
|
128
|
-
- `services/[name]-service.ts` -- HTTP only. No try/catch, no transformation, no logic. Export as object with methods
|
|
129
|
-
3. Validate: `npx tsc --noEmit`
|
|
40
|
+
Run `/dev-create-service $NAME`. This skill contains the full scaffold workflow -- do NOT duplicate it here.
|
|
130
41
|
|
|
131
42
|
## Hook Mode
|
|
132
|
-
|
|
133
|
-
2. **Mutation** (writing): `useMutation` with invalidateQueries on success. Use adapter for payload. Return { mutate, isPending, error }
|
|
134
|
-
3. **Shared logic** (no API): useState/useEffect with proper cleanup
|
|
135
|
-
4. Rules: prefix `use`, `'use client'` at file top (hooks are client-only), use service (never direct API), use adapter (never inline transform), always staleTime
|
|
43
|
+
Run `/dev-create-hook $NAME`. This skill contains the full scaffold workflow -- do NOT duplicate it here.
|
|
136
44
|
|
|
137
45
|
## Page/Layout Mode
|
|
138
46
|
1. **Page** (`app/[feature]/page.tsx`):
|
|
@@ -151,12 +59,7 @@ export function XxxComponent({ items, onSelect }: XxxComponentProps) {
|
|
|
151
59
|
5. Create sibling files: page + loading + error at minimum
|
|
152
60
|
|
|
153
61
|
## Test Mode
|
|
154
|
-
|
|
155
|
-
2. Priority: adapters (pure functions, easy) > hooks (mock service) > components (React Testing Library) > Server Actions
|
|
156
|
-
3. Create in `__tests__/[OriginalName].spec.ts(x)`
|
|
157
|
-
4. Component tests: use `render()` from `@testing-library/react`, `screen`, `userEvent`
|
|
158
|
-
5. Hook tests: use `renderHook()` from `@testing-library/react`
|
|
159
|
-
6. Run: `npx vitest run [file]`
|
|
62
|
+
Run `/dev-create-test $NAME`. This skill contains the full scaffold workflow -- do NOT duplicate it here.
|
|
160
63
|
|
|
161
64
|
## Verification Protocol
|
|
162
65
|
|
|
@@ -14,72 +14,17 @@ Read `docs/ARCHITECTURE.md` to understand the expected data flow.
|
|
|
14
14
|
|
|
15
15
|
## 4-Phase Methodology
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
┌──────────────────────────────────────────────────────────────────┐
|
|
19
|
-
│ Phase 1 Phase 2 Phase 3 Phase 4 │
|
|
20
|
-
│ ┌─────────┐ ┌──────────┐ ┌───────────┐ ┌───────────┐ │
|
|
21
|
-
│ │ GATHER │ ─► │ ANALYZE │ ─► │ FORMULATE │ ─► │ IMPLEMENT │ │
|
|
22
|
-
│ │ Evidence│ │ Patterns │ │ Hypothesis│ │ & Prove │ │
|
|
23
|
-
│ └─────────┘ └──────────┘ └───────────┘ └───────────┘ │
|
|
24
|
-
└──────────────────────────────────────────────────────────────────┘
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### Phase 1: GATHER EVIDENCE
|
|
28
|
-
- Read the COMPLETE error message and stack trace
|
|
29
|
-
- Reproduce consistently (document exact steps)
|
|
30
|
-
- Identify: Server error? Client error? Hydration mismatch?
|
|
31
|
-
- Check recent changes: `git log --oneline -10`
|
|
32
|
-
|
|
33
|
-
**⛔ BLOCKED** until evidence collected.
|
|
34
|
-
|
|
35
|
-
### Phase 2: ANALYZE PATTERNS
|
|
36
|
-
- Trace execution path: entry → error location
|
|
37
|
-
- Check RSC vs Client Component boundaries
|
|
38
|
-
- Compare with working code
|
|
39
|
-
- Identify: consistent or intermittent? data-dependent?
|
|
17
|
+
Follow the @debugger agent's 4-phase protocol: GATHER EVIDENCE → ANALYZE PATTERNS → FORMULATE HYPOTHESIS → IMPLEMENT & PROVE. Each phase has blocking rules -- do NOT skip phases.
|
|
40
18
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
### Phase 3: FORMULATE HYPOTHESIS
|
|
44
|
-
- Generate MULTIPLE hypotheses (not just one)
|
|
45
|
-
- Rank by probability
|
|
46
|
-
- Design test for each
|
|
47
|
-
|
|
48
|
-
**⛔ BLOCKED** until hypotheses formulated.
|
|
49
|
-
|
|
50
|
-
### Phase 4: IMPLEMENT & PROVE
|
|
51
|
-
- Test primary hypothesis
|
|
52
|
-
- If confirmed → Write test that reproduces bug → Fix → Verify
|
|
53
|
-
- If rejected → Test next hypothesis
|
|
54
|
-
- Create checkpoint after fix
|
|
55
|
-
|
|
56
|
-
### Three-Strike Rule
|
|
57
|
-
After 3 failed hypotheses → Stop and rethink understanding of the system.
|
|
19
|
+
Three-Strike Rule: After 3 failed hypotheses, stop and rethink understanding of the system.
|
|
58
20
|
|
|
59
21
|
## Core Principles
|
|
60
22
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
- Use HTTPS everywhere, set secure headers (CSP, HSTS, X-Frame-Options)
|
|
67
|
-
- Follow OWASP Top 10 - prevent XSS, CSRF, injection, broken auth, etc.
|
|
68
|
-
- Secrets in environment variables only - never hardcode
|
|
69
|
-
|
|
70
|
-
### Performance First (Mandatory)
|
|
71
|
-
- ALWAYS use TanStack Query (React Query) for server state caching
|
|
72
|
-
- Set appropriate `staleTime` and `gcTime` for each query based on data freshness needs
|
|
73
|
-
- Use `keepPreviousData` for pagination to avoid loading flickers
|
|
74
|
-
- Implement optimistic updates for mutations when UX benefits
|
|
75
|
-
- Use proper cache invalidation (`invalidateQueries`) - stale UI is a bug
|
|
76
|
-
- Lazy load routes, components, and heavy dependencies
|
|
77
|
-
- Avoid N+1 queries - batch requests, use proper data loading patterns
|
|
78
|
-
|
|
79
|
-
### Code Language (Mandatory)
|
|
80
|
-
- ALWAYS write code (variables, functions, comments, commits) in English
|
|
81
|
-
- Only use other languages if explicitly requested by the user
|
|
82
|
-
- User-facing text (UI labels, messages) should match project's i18n strategy
|
|
23
|
+
Refer to the pack CLAUDE.md for full stack details and key patterns.
|
|
24
|
+
|
|
25
|
+
- **Security**: Validate all inputs server-side, parameterized queries only, no secrets in code, OWASP Top 10
|
|
26
|
+
- **Performance**: Use the framework's recommended server state caching, lazy load routes and components, no N+1 queries
|
|
27
|
+
- **Code Language**: All code in English. User-facing text follows project i18n strategy
|
|
83
28
|
|
|
84
29
|
## Workflow
|
|
85
30
|
|