specialist-agent 2.9.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/.opencode/INSTALL.md +74 -79
- package/.opencode/opencode.json +141 -0
- 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 +29 -20
- 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/architectures.mjs +713 -0
- package/cli/detect-architecture.mjs +752 -0
- package/cli/generate-architecture.mjs +1096 -0
- package/cli/index.mjs +681 -179
- package/cli/recommend-architecture.mjs +870 -0
- package/hooks/native/auto-dispatch.mjs +22 -23
- package/hooks/native/auto-format.mjs +5 -25
- package/hooks/native/mcp-discovery.mjs +168 -0
- package/hooks/native/security-config.json +7 -0
- package/hooks/native/security-guard.mjs +77 -27
- 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
- package/skills/migrate-architecture/SKILL.md +242 -0
|
@@ -14,28 +14,11 @@ Read `docs/ARCHITECTURE.md`.
|
|
|
14
14
|
|
|
15
15
|
## Core Principles
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
- NEVER trust user input - validate and sanitize ALL inputs on server side
|
|
19
|
-
- ALWAYS use parameterized queries - never string concatenation for SQL/NoSQL
|
|
20
|
-
- NEVER expose sensitive data (tokens, passwords, PII) in logs, URLs, or error messages
|
|
21
|
-
- ALWAYS implement rate limiting on public endpoints
|
|
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
|
|
17
|
+
Refer to the pack CLAUDE.md for full stack details and key patterns.
|
|
25
18
|
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
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
|
|
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,68 +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 Pages Router vs App Router, JS vs TS, class components, cross-module imports
|
|
50
|
-
- List API endpoints used (search for fetch, axios, api calls)
|
|
51
|
-
- Identify `getServerSideProps`, `getStaticProps`, `getStaticPaths` usage
|
|
52
|
-
- Identify `_app.tsx`, `_document.tsx` customizations
|
|
53
|
-
- List pages in `pages/` directory
|
|
54
|
-
- Report to user before proceeding
|
|
55
|
-
|
|
56
|
-
### Phase 1: Structure
|
|
57
|
-
- Create target directories in `src/modules/[name]/`: components/, hooks/, services/, adapters/, stores/, actions/, types/, __tests__/
|
|
58
|
-
- Create target directories in `app/[name]/`: page.tsx, layout.tsx, loading.tsx, error.tsx
|
|
59
|
-
- Map old files to new locations
|
|
60
|
-
- Validate: `npx next build`
|
|
61
|
-
|
|
62
|
-
### Phase 2: Types & Adapters
|
|
63
|
-
- Create `.types.ts` (exact API response, snake_case)
|
|
64
|
-
- Create `.contracts.ts` (app contract, camelCase)
|
|
65
|
-
- Create adapter with bidirectional parsing
|
|
66
|
-
- Validate: `npx tsc --noEmit`
|
|
67
|
-
|
|
68
|
-
### Phase 3: Services
|
|
69
|
-
- Extract HTTP calls to pure service (no try/catch, no transformation)
|
|
70
|
-
- Remove data fetching from components
|
|
71
|
-
- One file per resource
|
|
72
|
-
- Validate: `npx next build`
|
|
73
|
-
|
|
74
|
-
### Phase 4: State & Data Fetching
|
|
75
|
-
- `getServerSideProps` data -> async Server Component (direct service + adapter calls)
|
|
76
|
-
- `getStaticProps` data -> async Server Component with `revalidate` or `generateStaticParams`
|
|
77
|
-
- Client-side data fetching -> React Query hooks with staleTime
|
|
78
|
-
- Client state (useState scattered) -> Zustand stores
|
|
79
|
-
- Remove `getServerSideProps`, `getStaticProps`, `getStaticPaths` functions
|
|
80
|
-
- Create Server Actions for mutations (replace API route handlers for forms)
|
|
81
|
-
- Validate: `npx next build`
|
|
82
|
-
|
|
83
|
-
### Phase 5: Components & Pages
|
|
84
|
-
- Convert pages from `pages/` to `app/` (App Router):
|
|
85
|
-
- `pages/xxx.tsx` -> `app/xxx/page.tsx` (Server Component)
|
|
86
|
-
- `pages/xxx/[id].tsx` -> `app/xxx/[id]/page.tsx`
|
|
87
|
-
- `pages/api/xxx.ts` -> `app/api/xxx/route.ts` (if external) or Server Actions (if internal)
|
|
88
|
-
- Convert `_app.tsx` logic to root `app/layout.tsx`
|
|
89
|
-
- Convert `_document.tsx` to root `app/layout.tsx` (html, body tags)
|
|
90
|
-
- For each component:
|
|
91
|
-
- Determine Server vs Client using the decision tree
|
|
92
|
-
- Server Components: remove hooks, make async, fetch data directly
|
|
93
|
-
- Client Components: add `'use client'`, keep/add hooks
|
|
94
|
-
- Type all props
|
|
95
|
-
- Decompose if > 200 lines
|
|
96
|
-
- Create `loading.tsx` and `error.tsx` for each route
|
|
97
|
-
- Validate after each component
|
|
98
|
-
|
|
99
|
-
### Phase 6: Review
|
|
100
|
-
- Run pattern checks (same as @reviewer review mode)
|
|
101
|
-
- Verify no Pages Router remnants:
|
|
102
|
-
```bash
|
|
103
|
-
ls pages/ 2>/dev/null && echo "WARN: pages/ directory still exists"
|
|
104
|
-
grep -rn "getServerSideProps\|getStaticProps\|getStaticPaths" src/ app/ --include="*.ts" --include="*.tsx" 2>/dev/null
|
|
105
|
-
grep -rn "useRouter.*from.*next/router" src/ app/ --include="*.ts" --include="*.tsx" 2>/dev/null
|
|
106
|
-
```
|
|
107
|
-
- Report remaining issues
|
|
108
|
-
- Get user approval
|
|
30
|
+
Run `/migration-migrate-module $PATH`. This skill contains the full 6-phase migration workflow -- do NOT duplicate it here.
|
|
109
31
|
|
|
110
32
|
## Verification Protocol
|
|
111
33
|
|
|
@@ -138,117 +60,7 @@ Read `docs/ARCHITECTURE.md`.
|
|
|
138
60
|
---
|
|
139
61
|
|
|
140
62
|
## Component Mode
|
|
141
|
-
|
|
142
|
-
### Conversion Table (Pages Router -> App Router)
|
|
143
|
-
|
|
144
|
-
| Pages Router | App Router |
|
|
145
|
-
|-------------|------------|
|
|
146
|
-
| `pages/index.tsx` | `app/page.tsx` |
|
|
147
|
-
| `pages/about.tsx` | `app/about/page.tsx` |
|
|
148
|
-
| `pages/posts/[id].tsx` | `app/posts/[id]/page.tsx` |
|
|
149
|
-
| `pages/posts/[...slug].tsx` | `app/posts/[...slug]/page.tsx` |
|
|
150
|
-
| `pages/_app.tsx` | `app/layout.tsx` |
|
|
151
|
-
| `pages/_document.tsx` | `app/layout.tsx` |
|
|
152
|
-
| `pages/api/xxx.ts` | `app/api/xxx/route.ts` |
|
|
153
|
-
| `getServerSideProps` | async Server Component |
|
|
154
|
-
| `getStaticProps` | async Server Component + revalidate |
|
|
155
|
-
| `getStaticPaths` | `generateStaticParams()` |
|
|
156
|
-
| `useRouter()` (next/router) | `useRouter()` + `usePathname()` + `useSearchParams()` (next/navigation) |
|
|
157
|
-
| `router.query` | `params` (dynamic) + `useSearchParams()` (query) |
|
|
158
|
-
| `router.push()` | `useRouter().push()` (next/navigation) |
|
|
159
|
-
| `Head` component | `metadata` export / `generateMetadata()` |
|
|
160
|
-
| `Image` (next/image) | `Image` (next/image) -- same but check props |
|
|
161
|
-
| `Link` (next/link) | `Link` (next/link) -- no `<a>` child needed |
|
|
162
|
-
|
|
163
|
-
### Data Fetching Conversion
|
|
164
|
-
|
|
165
|
-
**getServerSideProps -> async Server Component:**
|
|
166
|
-
```tsx
|
|
167
|
-
// BEFORE (Pages Router)
|
|
168
|
-
export async function getServerSideProps() {
|
|
169
|
-
const res = await fetch('https://api.example.com/data')
|
|
170
|
-
const data = await res.json()
|
|
171
|
-
return { props: { data } }
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
export default function Page({ data }) {
|
|
175
|
-
return <div>{data.title}</div>
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
// AFTER (App Router)
|
|
179
|
-
export default async function Page() {
|
|
180
|
-
const response = await marketplaceService.list({ page: 1, pageSize: 20 })
|
|
181
|
-
const data = marketplaceAdapter.toMarketplaceList(response.data)
|
|
182
|
-
return <div>{data.items[0]?.name}</div>
|
|
183
|
-
}
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
**getStaticProps + getStaticPaths -> Server Component + generateStaticParams:**
|
|
187
|
-
```tsx
|
|
188
|
-
// BEFORE (Pages Router)
|
|
189
|
-
export async function getStaticPaths() {
|
|
190
|
-
const posts = await getAllPosts()
|
|
191
|
-
return {
|
|
192
|
-
paths: posts.map(p => ({ params: { id: p.id } })),
|
|
193
|
-
fallback: false,
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
export async function getStaticProps({ params }) {
|
|
197
|
-
const post = await getPost(params.id)
|
|
198
|
-
return { props: { post }, revalidate: 60 }
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
// AFTER (App Router)
|
|
202
|
-
export async function generateStaticParams() {
|
|
203
|
-
const posts = await getAllPosts()
|
|
204
|
-
return posts.map(p => ({ id: p.id }))
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
export default async function PostPage({ params }: { params: Promise<{ id: string }> }) {
|
|
208
|
-
const { id } = await params
|
|
209
|
-
const post = await getPost(id)
|
|
210
|
-
return <PostDetail post={post} />
|
|
211
|
-
}
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
**Client-side data fetching -> React Query hook:**
|
|
215
|
-
```tsx
|
|
216
|
-
// BEFORE (raw useEffect)
|
|
217
|
-
const [data, setData] = useState(null)
|
|
218
|
-
const [loading, setLoading] = useState(true)
|
|
219
|
-
useEffect(() => {
|
|
220
|
-
fetch('/api/items').then(r => r.json()).then(setData).finally(() => setLoading(false))
|
|
221
|
-
}, [])
|
|
222
|
-
|
|
223
|
-
// AFTER (React Query hook)
|
|
224
|
-
const { items, isLoading, error } = useMarketplaceList({ page: 1 })
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
### Workflow
|
|
228
|
-
1. Read the component/page and list: props, state, effects, data fetching, routing
|
|
229
|
-
2. Map consumers (who uses this component)
|
|
230
|
-
3. Determine Server vs Client:
|
|
231
|
-
- Has `getServerSideProps`/`getStaticProps`? -> Server Component (data fetching inline)
|
|
232
|
-
- Has hooks, event handlers, browser APIs? -> Client Component
|
|
233
|
-
- Mixed? -> Split into Server page + Client component
|
|
234
|
-
4. Convert routing from `pages/` to `app/`
|
|
235
|
-
5. Convert data fetching (see conversion table above)
|
|
236
|
-
6. Convert `useRouter()` from `next/router` to `next/navigation`
|
|
237
|
-
7. Add `metadata` export (replace `Head` component)
|
|
238
|
-
8. Create `loading.tsx` and `error.tsx` siblings
|
|
239
|
-
9. Type all props
|
|
240
|
-
10. Decompose if > 200 lines
|
|
241
|
-
11. Validate: `npx tsc --noEmit`
|
|
242
|
-
12. Update consumers/imports if paths changed
|
|
243
|
-
|
|
244
|
-
### Rules
|
|
245
|
-
- Keep public API (props/children) stable when possible
|
|
246
|
-
- If API changes, update all consumers
|
|
247
|
-
- One component per commit
|
|
248
|
-
- Report bugs found during migration (don't silently fix)
|
|
249
|
-
- Always check for hydration mismatches after conversion
|
|
250
|
-
- Remove `pages/` files only after `app/` equivalents are verified working
|
|
251
|
-
- **Verify each phase** - Partial migration is worse than none
|
|
63
|
+
Run `/migration-migrate-component $FILE`. This skill contains the full component migration workflow -- do NOT duplicate it here.
|
|
252
64
|
|
|
253
65
|
## Output
|
|
254
66
|
|
|
@@ -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 TanStack Query (React Query) for server state caching
|
|
65
|
-
- Set appropriate `staleTime` and `gcTime` for each query based on data freshness needs
|
|
66
|
-
- Use `keepPreviousData` for pagination to avoid loading flickers
|
|
67
|
-
- Implement optimistic updates for mutations when UX benefits
|
|
68
|
-
- Use proper cache invalidation (`invalidateQueries`) - stale UI is a bug
|
|
69
|
-
- Lazy load routes, components, and heavy dependencies
|
|
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,60 +75,9 @@ npx vitest run --passWithNoTests
|
|
|
92
75
|
```
|
|
93
76
|
|
|
94
77
|
### 2. Pattern Checks
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
# Transformation in services
|
|
100
|
-
grep -rn "\.map(\|new Date" src/modules/*/services/ --include="*.ts" 2>/dev/null && echo "VIOLATION: transformation in service"
|
|
101
|
-
|
|
102
|
-
# Hooks in Server Components (pages/layouts without 'use client')
|
|
103
|
-
for f in $(find app/ -name "page.tsx" -o -name "layout.tsx" 2>/dev/null); do
|
|
104
|
-
grep -L "'use client'" "$f" 2>/dev/null | xargs grep -l "useState\|useEffect\|useRef\|useQuery\|useStore" 2>/dev/null && echo "VIOLATION: hooks in Server Component: $f"
|
|
105
|
-
done
|
|
106
|
-
|
|
107
|
-
# Missing 'use client' in components that use hooks
|
|
108
|
-
grep -rn "useState\|useEffect\|useRef\|useCallback\|useMemo\|useQuery\|useMutation\|useStore" src/modules/*/components/ --include="*.tsx" -l 2>/dev/null | while read f; do
|
|
109
|
-
grep -L "'use client'" "$f" 2>/dev/null && echo "VIOLATION: missing 'use client' in $f"
|
|
110
|
-
done
|
|
111
|
-
|
|
112
|
-
# Missing 'use server' in actions
|
|
113
|
-
grep -rL "'use server'" src/modules/*/actions/ --include="*.ts" 2>/dev/null && echo "VIOLATION: missing 'use server' in actions"
|
|
114
|
-
|
|
115
|
-
# Data fetching in client components that should be server
|
|
116
|
-
grep -rn "fetch(\|axios\|api\." src/modules/*/components/ --include="*.tsx" 2>/dev/null | while read line; do
|
|
117
|
-
file=$(echo "$line" | cut -d: -f1)
|
|
118
|
-
grep -q "'use client'" "$file" 2>/dev/null && echo "ATTENTION: direct API call in Client Component: $line"
|
|
119
|
-
done
|
|
120
|
-
|
|
121
|
-
# Missing loading.tsx for pages
|
|
122
|
-
for dir in $(find app/ -name "page.tsx" -exec dirname {} \;); do
|
|
123
|
-
[ ! -f "$dir/loading.tsx" ] && echo "ATTENTION: missing loading.tsx in $dir"
|
|
124
|
-
done
|
|
125
|
-
|
|
126
|
-
# Missing error.tsx for pages
|
|
127
|
-
for dir in $(find app/ -name "page.tsx" -exec dirname {} \;); do
|
|
128
|
-
[ ! -f "$dir/error.tsx" ] && echo "ATTENTION: missing error.tsx in $dir"
|
|
129
|
-
done
|
|
130
|
-
|
|
131
|
-
# error.tsx without 'use client'
|
|
132
|
-
grep -rL "'use client'" app/**/error.tsx 2>/dev/null && echo "VIOLATION: error.tsx must have 'use client'"
|
|
133
|
-
|
|
134
|
-
# any types
|
|
135
|
-
grep -rn ": any\|as any" src/modules/ --include="*.ts" --include="*.tsx" 2>/dev/null && echo "ATTENTION: any types"
|
|
136
|
-
|
|
137
|
-
# console.log / debugger
|
|
138
|
-
grep -rn "console\.\|debugger" src/modules/ --include="*.ts" --include="*.tsx" 2>/dev/null && echo "ATTENTION: debug artifacts"
|
|
139
|
-
|
|
140
|
-
# dangerouslySetInnerHTML
|
|
141
|
-
grep -rn "dangerouslySetInnerHTML" src/ --include="*.tsx" 2>/dev/null && echo "VIOLATION: dangerouslySetInnerHTML"
|
|
142
|
-
|
|
143
|
-
# Cross-module imports
|
|
144
|
-
for module in src/modules/*/; do
|
|
145
|
-
name=$(basename "$module")
|
|
146
|
-
grep -rn "from.*modules/" "$module" --include="*.ts" --include="*.tsx" 2>/dev/null | grep -v "modules/${name}" || true
|
|
147
|
-
done
|
|
148
|
-
```
|
|
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.
|
|
149
81
|
|
|
150
82
|
### 3. Manual Review
|
|
151
83
|
- Services: HTTP only, no try/catch, no transformation
|
|
@@ -215,6 +147,20 @@ done
|
|
|
215
147
|
6. Rendering: find unnecessary re-renders (missing useMemo/useCallback in Client Components)
|
|
216
148
|
7. Report bottlenecks sorted by user impact
|
|
217
149
|
|
|
150
|
+
## Automatic Fail Triggers
|
|
151
|
+
|
|
152
|
+
The following conditions result in an **AUTOMATIC FAIL** verdict -- no exceptions:
|
|
153
|
+
|
|
154
|
+
| Trigger | Why |
|
|
155
|
+
|---------|-----|
|
|
156
|
+
| "Zero issues found" | Every codebase has improvement areas. Zero findings = insufficient review. |
|
|
157
|
+
| "LGTM" or "Looks good to me" without specifics | Lazy. Explain what you verified and how. |
|
|
158
|
+
| Approval without running `tsc`, `eslint`, `build`, or `tests` | No automated check output = no review. |
|
|
159
|
+
| "Minor issues only" when violations exist | A violation is blocking. Do not minimize. |
|
|
160
|
+
| Praising code that violates ARCHITECTURE.md | Architecture compliance is non-negotiable. |
|
|
161
|
+
| Reviewing without reading ARCHITECTURE.md first | Context-free review is worthless. |
|
|
162
|
+
| Approving code with `any` types in business logic | Type safety is not optional. |
|
|
163
|
+
|
|
218
164
|
## Anti-Sycophancy Protocol
|
|
219
165
|
|
|
220
166
|
### For the Reviewer (Giving Feedback)
|
|
@@ -16,43 +16,43 @@ 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. Hooks in Server Components (pages without 'use client') ==="
|
|
25
25
|
for f in $(find app/ -name "page.tsx" -o -name "layout.tsx" 2>/dev/null); do
|
|
26
26
|
if ! grep -q "'use client'" "$f" 2>/dev/null; then
|
|
27
27
|
grep -l "useState\|useEffect\|useRef\|useQuery\|useStore" "$f" 2>/dev/null
|
|
28
28
|
fi
|
|
29
|
-
done || echo "
|
|
29
|
+
done || echo "PASS: None"
|
|
30
30
|
|
|
31
31
|
echo "=== 4. Missing 'use client' in components with hooks ==="
|
|
32
32
|
grep -rn "useState\|useEffect\|useRef\|useCallback\|useMemo\|useQuery\|useMutation" src/modules/*/components/ --include="*.tsx" -l 2>/dev/null | while read f; do
|
|
33
33
|
grep -L "'use client'" "$f" 2>/dev/null
|
|
34
|
-
done || echo "
|
|
34
|
+
done || echo "PASS: None"
|
|
35
35
|
|
|
36
36
|
echo "=== 5. Missing 'use server' in actions ==="
|
|
37
|
-
grep -rL "'use server'" src/modules/*/actions/ --include="*.ts" 2>/dev/null || echo "
|
|
37
|
+
grep -rL "'use server'" src/modules/*/actions/ --include="*.ts" 2>/dev/null || echo "PASS: All have directive"
|
|
38
38
|
|
|
39
39
|
echo "=== 6. error.tsx without 'use client' ==="
|
|
40
40
|
find app/ -name "error.tsx" 2>/dev/null | while read f; do
|
|
41
41
|
grep -L "'use client'" "$f" 2>/dev/null
|
|
42
|
-
done || echo "
|
|
42
|
+
done || echo "PASS: All have directive"
|
|
43
43
|
|
|
44
44
|
echo "=== 7. Missing loading.tsx for pages ==="
|
|
45
45
|
for dir in $(find app/ -name "page.tsx" -exec dirname {} \; 2>/dev/null); do
|
|
46
46
|
[ ! -f "$dir/loading.tsx" ] && echo "Missing: $dir/loading.tsx"
|
|
47
|
-
done || echo "
|
|
47
|
+
done || echo "PASS: All present"
|
|
48
48
|
|
|
49
49
|
echo "=== 8. Missing error.tsx for pages ==="
|
|
50
50
|
for dir in $(find app/ -name "page.tsx" -exec dirname {} \; 2>/dev/null); do
|
|
51
51
|
[ ! -f "$dir/error.tsx" ] && echo "Missing: $dir/error.tsx"
|
|
52
|
-
done || echo "
|
|
52
|
+
done || echo "PASS: All present"
|
|
53
53
|
|
|
54
54
|
echo "=== 9. Server state in Zustand ==="
|
|
55
|
-
grep -rn "async\|fetch\|axios\|api\.\|\.get(\|\.post(" src/modules/*/stores/ --include="*.ts" 2>/dev/null || echo "
|
|
55
|
+
grep -rn "async\|fetch\|axios\|api\.\|\.get(\|\.post(" src/modules/*/stores/ --include="*.ts" 2>/dev/null || echo "PASS: None"
|
|
56
56
|
|
|
57
57
|
echo "=== 10. any types ==="
|
|
58
58
|
grep -rn ": any\| any;\|as any\|<any>" src/modules/ --include="*.ts" --include="*.tsx" 2>/dev/null | wc -l
|
|
@@ -64,7 +64,7 @@ for module in src/modules/*/; do
|
|
|
64
64
|
done
|
|
65
65
|
|
|
66
66
|
echo "=== 12. dangerouslySetInnerHTML ==="
|
|
67
|
-
grep -rn "dangerouslySetInnerHTML" src/ app/ --include="*.tsx" 2>/dev/null || echo "
|
|
67
|
+
grep -rn "dangerouslySetInnerHTML" src/ app/ --include="*.tsx" 2>/dev/null || echo "PASS: None"
|
|
68
68
|
|
|
69
69
|
echo "=== 13. Debug artifacts ==="
|
|
70
70
|
grep -rn "console\.\|debugger" src/modules/ --include="*.ts" --include="*.tsx" 2>/dev/null | wc -l
|
|
@@ -79,23 +79,23 @@ find src/modules -name "*.tsx" -exec sh -c 'lines=$(wc -l < "$1"); [ "$lines" -g
|
|
|
79
79
|
|
|
80
80
|
echo "=== 16. Pages Router remnants ==="
|
|
81
81
|
ls pages/ 2>/dev/null && echo "WARN: pages/ directory still exists"
|
|
82
|
-
grep -rn "getServerSideProps\|getStaticProps\|getStaticPaths" src/ app/ --include="*.ts" --include="*.tsx" 2>/dev/null || echo "
|
|
83
|
-
grep -rn "from.*next/router" src/ app/ --include="*.ts" --include="*.tsx" 2>/dev/null || echo "
|
|
82
|
+
grep -rn "getServerSideProps\|getStaticProps\|getStaticPaths" src/ app/ --include="*.ts" --include="*.tsx" 2>/dev/null || echo "PASS: None"
|
|
83
|
+
grep -rn "from.*next/router" src/ app/ --include="*.ts" --include="*.tsx" 2>/dev/null || echo "PASS: None"
|
|
84
84
|
|
|
85
85
|
echo "=== 17. <img> instead of next/image ==="
|
|
86
|
-
grep -rn "<img " src/ app/ --include="*.tsx" 2>/dev/null || echo "
|
|
86
|
+
grep -rn "<img " src/ app/ --include="*.tsx" 2>/dev/null || echo "PASS: None"
|
|
87
87
|
|
|
88
88
|
echo "=== 18. Missing metadata in pages ==="
|
|
89
89
|
for f in $(find app/ -name "page.tsx" 2>/dev/null); do
|
|
90
90
|
grep -L "metadata\|generateMetadata" "$f" 2>/dev/null
|
|
91
|
-
done || echo "
|
|
91
|
+
done || echo "PASS: All have metadata"
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
Produce a summary table:
|
|
95
95
|
|
|
96
96
|
| Check | Status | Occurrences |
|
|
97
97
|
|-------|--------|-------------|
|
|
98
|
-
| Services without try/catch |
|
|
98
|
+
| Services without try/catch | PASS/FAIL | X |
|
|
99
99
|
| ... | ... | ... |
|
|
100
100
|
|
|
101
101
|
Overall score: X/18 checks passing.
|
|
@@ -24,6 +24,7 @@ npx eslint --ext .ts,.tsx src/ app/ --max-warnings 0
|
|
|
24
24
|
npx vitest run --passWithNoTests
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
+
2b. Run `/review-check-architecture $SCOPE` for automated pattern validation.
|
|
27
28
|
3. Check ARCHITECTURE.md patterns:
|
|
28
29
|
- Services: no try/catch, no transformation
|
|
29
30
|
- 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 useFetch/useAsyncData for server state with built-in caching
|
|
28
|
-
- Set appropriate `watch` triggers and `key` for reactive data refetching
|
|
29
|
-
- Use `lazy: true` for non-critical data to avoid blocking navigation
|
|
30
|
-
- Use `getCachedData` option for custom caching strategies
|
|
31
|
-
- Use proper cache invalidation (`refreshNuxtData`) - stale UI is a bug
|
|
32
|
-
- Lazy load components with `<LazyComponent>` prefix (auto-generated by Nuxt)
|
|
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,41 +31,16 @@ Read `docs/ARCHITECTURE.md`.
|
|
|
48
31
|
---
|
|
49
32
|
|
|
50
33
|
## Module Mode
|
|
51
|
-
|
|
52
|
-
2. Scaffold `modules/[kebab-name]/` with: components/, composables/, services/, adapters/, types/, __tests__/, index.ts
|
|
53
|
-
3. Create bottom-up:
|
|
54
|
-
- `types/[name].types.ts` - exact API response (snake_case)
|
|
55
|
-
- `types/[name].contracts.ts` - app contract (camelCase, Date objects)
|
|
56
|
-
- `adapters/[name]-adapter.ts` - pure functions: inbound (API->App) + outbound (App->API)
|
|
57
|
-
- `services/[name]-service.ts` - HTTP only using $fetch: `{ list, getById, create, update, delete }`. No try/catch, no transformation
|
|
58
|
-
- `composables/useXxxList.ts` - orchestrate service->adapter->useAsyncData. Set watch triggers, reactive key
|
|
59
|
-
- Components - `<script setup lang="ts">`, auto-imported, type-based props/emits, < 200 lines
|
|
60
|
-
- Page - `pages/[name]/index.vue` with file-based routing
|
|
61
|
-
4. Create server API routes if needed (`server/api/[name]/`)
|
|
62
|
-
5. Create barrel export (index.ts): components + contracts only
|
|
63
|
-
6. Validate: `nuxi typecheck`
|
|
34
|
+
Run `/dev-create-module $NAME`. This skill contains the full scaffold workflow -- do NOT duplicate it here.
|
|
64
35
|
|
|
65
36
|
## Component Mode
|
|
66
|
-
|
|
67
|
-
2. Use `<script setup lang="ts">` template - auto-imports mean NO import statements for Vue APIs, composables, or sibling components
|
|
68
|
-
3. Template: defineProps<T>() -> defineEmits<T>() -> composables -> local state -> computed -> handlers
|
|
69
|
-
4. Rules: < 200 lines, PascalCase.vue, no prop drilling (use slots + provide/inject), handle loading/error/empty states
|
|
70
|
-
5. Extract logic > 20 lines to composable
|
|
37
|
+
Run `/dev-create-component $NAME`. This skill contains the full scaffold workflow -- do NOT duplicate it here.
|
|
71
38
|
|
|
72
39
|
## Service Mode
|
|
73
|
-
|
|
74
|
-
2. Create 4 files:
|
|
75
|
-
- `types/[name].types.ts` - exact API (snake_case, string dates)
|
|
76
|
-
- `types/[name].contracts.ts` - app contract (camelCase, Date, computed booleans)
|
|
77
|
-
- `adapters/[name]-adapter.ts` - pure functions, bidirectional. Rename snake->camel, convert string->Date, cents->currency
|
|
78
|
-
- `services/[name]-service.ts` - HTTP only using $fetch. No try/catch, no transformation, no logic. Export as object with methods
|
|
79
|
-
3. Validate: `nuxi typecheck`
|
|
40
|
+
Run `/dev-create-service $NAME`. This skill contains the full scaffold workflow -- do NOT duplicate it here.
|
|
80
41
|
|
|
81
42
|
## Composable Mode
|
|
82
|
-
|
|
83
|
-
2. **Mutation** (writing): function calling service, then `refreshNuxtData` for cache invalidation. Return { execute, isPending, error }
|
|
84
|
-
3. **Shared logic** (no API): ref/computed with lifecycle hooks, use `useState` for SSR-safe state
|
|
85
|
-
4. Rules: prefix `use`, return refs/computed never raw, use service (never direct API), use adapter (never inline transform), composables/ dir for auto-import
|
|
43
|
+
Run `/dev-create-composable $NAME`. This skill contains the full scaffold workflow -- do NOT duplicate it here.
|
|
86
44
|
|
|
87
45
|
## Server API Mode
|
|
88
46
|
1. Create `server/api/[resource]/[method].ts` using Nitro conventions
|
|
@@ -91,10 +49,7 @@ Read `docs/ARCHITECTURE.md`.
|
|
|
91
49
|
4. One file per method: `index.get.ts`, `index.post.ts`, `[id].get.ts`, `[id].patch.ts`, `[id].delete.ts`
|
|
92
50
|
|
|
93
51
|
## Test Mode
|
|
94
|
-
|
|
95
|
-
2. Priority: adapters (pure functions, easy) > composables (mock service) > components (@nuxt/test-utils)
|
|
96
|
-
3. Create in `__tests__/[OriginalName].spec.ts`
|
|
97
|
-
4. Run: `npx vitest run [file]`
|
|
52
|
+
Run `/dev-create-test $NAME`. This skill contains the full scaffold workflow -- do NOT duplicate it here.
|
|
98
53
|
|
|
99
54
|
## Verification Protocol
|
|
100
55
|
|
|
@@ -14,71 +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
|
-
- Check recent changes: `git log --oneline -10`
|
|
31
|
-
- Search for related code
|
|
32
|
-
|
|
33
|
-
**BLOCKED until evidence collected.**
|
|
34
|
-
|
|
35
|
-
### Phase 2: ANALYZE PATTERNS
|
|
36
|
-
- Trace execution path: entry -> error location
|
|
37
|
-
- Compare with working code
|
|
38
|
-
- 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.
|
|
39
18
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
### Phase 3: FORMULATE HYPOTHESIS
|
|
43
|
-
- Generate MULTIPLE hypotheses (not just one)
|
|
44
|
-
- Rank by probability
|
|
45
|
-
- Design test for each
|
|
46
|
-
|
|
47
|
-
**BLOCKED until hypotheses formulated.**
|
|
48
|
-
|
|
49
|
-
### Phase 4: IMPLEMENT & PROVE
|
|
50
|
-
- Test primary hypothesis
|
|
51
|
-
- If confirmed -> Write test that reproduces bug -> Fix -> Verify
|
|
52
|
-
- If rejected -> Test next hypothesis
|
|
53
|
-
- Create checkpoint after fix
|
|
54
|
-
|
|
55
|
-
### Three-Strike Rule
|
|
56
|
-
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.
|
|
57
20
|
|
|
58
21
|
## Core Principles
|
|
59
22
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
- Use HTTPS everywhere, set secure headers (CSP, HSTS, X-Frame-Options)
|
|
66
|
-
- Follow OWASP Top 10 - prevent XSS, CSRF, injection, broken auth, etc.
|
|
67
|
-
- Secrets in environment variables only - never hardcode
|
|
68
|
-
|
|
69
|
-
### Performance First (Mandatory)
|
|
70
|
-
- ALWAYS use useFetch/useAsyncData for server state with built-in caching
|
|
71
|
-
- Set appropriate `watch` triggers and `key` for reactive data refetching
|
|
72
|
-
- Use `lazy: true` for non-critical data to avoid blocking navigation
|
|
73
|
-
- Use `getCachedData` option for custom caching strategies
|
|
74
|
-
- Use proper cache invalidation (`refreshNuxtData`) - stale UI is a bug
|
|
75
|
-
- Lazy load components with `<LazyComponent>` prefix (auto-generated by Nuxt)
|
|
76
|
-
- Avoid N+1 queries - batch requests, use proper data loading patterns
|
|
77
|
-
|
|
78
|
-
### Code Language (Mandatory)
|
|
79
|
-
- ALWAYS write code (variables, functions, comments, commits) in English
|
|
80
|
-
- Only use other languages if explicitly requested by the user
|
|
81
|
-
- 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
|
|
82
28
|
|
|
83
29
|
## Workflow
|
|
84
30
|
|