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
|
@@ -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,39 +75,9 @@ npx vitest run --passWithNoTests
|
|
|
92
75
|
```
|
|
93
76
|
|
|
94
77
|
### 2. Pattern Checks
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
grep -rn "class.*extends.*Component" src/modules/ --include="*.tsx" 2>/dev/null && echo "VIOLATION: class component"
|
|
99
|
-
grep -rn "PropTypes\." src/modules/ --include="*.tsx" --include="*.ts" 2>/dev/null && echo "VIOLATION: PropTypes (use TypeScript)"
|
|
100
|
-
grep -rn "connect(" src/modules/ --include="*.tsx" --include="*.ts" 2>/dev/null && echo "VIOLATION: Redux connect (use Zustand)"
|
|
101
|
-
grep -rn "useSelector\|useDispatch\|createSlice\|createStore" src/ --include="*.ts" --include="*.tsx" 2>/dev/null && echo "VIOLATION: Redux (use Zustand)"
|
|
102
|
-
grep -rn "style={{" src/modules/ --include="*.tsx" 2>/dev/null && echo "ATTENTION: inline style object in JSX (re-creates on render)"
|
|
103
|
-
grep -rn "useEffect.*\[\]" src/modules/ --include="*.ts" --include="*.tsx" 2>/dev/null && echo "ATTENTION: empty dependency array in useEffect (verify intent)"
|
|
104
|
-
grep -rn ": any\|as any" src/modules/ --include="*.ts" --include="*.tsx" 2>/dev/null && echo "ATTENTION: any types"
|
|
105
|
-
grep -rn "console\.\|debugger" src/modules/ --include="*.ts" --include="*.tsx" 2>/dev/null && echo "ATTENTION: debug artifacts"
|
|
106
|
-
grep -rn "dangerouslySetInnerHTML" src/ --include="*.tsx" 2>/dev/null && echo "VIOLATION: dangerouslySetInnerHTML"
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### 3. React-Specific Checks
|
|
110
|
-
```bash
|
|
111
|
-
# Missing useCallback for handlers passed to children
|
|
112
|
-
grep -rn "function handle" src/modules/ --include="*.tsx" 2>/dev/null && echo "CHECK: handlers may need useCallback"
|
|
113
|
-
|
|
114
|
-
# Inline objects in JSX (re-creates on render)
|
|
115
|
-
grep -rn "={{" src/modules/ --include="*.tsx" 2>/dev/null && echo "CHECK: inline objects in JSX props"
|
|
116
|
-
|
|
117
|
-
# useEffect without cleanup
|
|
118
|
-
grep -rn "useEffect" src/modules/ --include="*.ts" --include="*.tsx" 2>/dev/null && echo "CHECK: verify useEffect cleanup"
|
|
119
|
-
|
|
120
|
-
# Missing staleTime
|
|
121
|
-
grep -rn "useQuery" src/ --include="*.ts" -l 2>/dev/null | while read f; do
|
|
122
|
-
grep -L "staleTime" "$f" 2>/dev/null
|
|
123
|
-
done
|
|
124
|
-
|
|
125
|
-
# Full store destructure (causes re-renders)
|
|
126
|
-
grep -rn "} = use.*Store()" src/ --include="*.tsx" 2>/dev/null && echo "CHECK: full Zustand destructure (use selectors)"
|
|
127
|
-
```
|
|
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.
|
|
128
81
|
|
|
129
82
|
### 4. Manual Review
|
|
130
83
|
- Services: HTTP only, no try/catch, no transformation
|
|
@@ -203,6 +156,20 @@ grep -rn "} = use.*Store()" src/ --include="*.tsx" 2>/dev/null && echo "CHECK: f
|
|
|
203
156
|
5. Re-renders: look for full Zustand store destructures instead of selectors
|
|
204
157
|
6. Report bottlenecks sorted by user impact
|
|
205
158
|
|
|
159
|
+
## Automatic Fail Triggers
|
|
160
|
+
|
|
161
|
+
The following conditions result in an **AUTOMATIC FAIL** verdict -- no exceptions:
|
|
162
|
+
|
|
163
|
+
| Trigger | Why |
|
|
164
|
+
|---------|-----|
|
|
165
|
+
| "Zero issues found" | Every codebase has improvement areas. Zero findings = insufficient review. |
|
|
166
|
+
| "LGTM" or "Looks good to me" without specifics | Lazy. Explain what you verified and how. |
|
|
167
|
+
| Approval without running `tsc`, `eslint`, `build`, or `tests` | No automated check output = no review. |
|
|
168
|
+
| "Minor issues only" when violations exist | A violation is blocking. Do not minimize. |
|
|
169
|
+
| Praising code that violates ARCHITECTURE.md | Architecture compliance is non-negotiable. |
|
|
170
|
+
| Reviewing without reading ARCHITECTURE.md first | Context-free review is worthless. |
|
|
171
|
+
| Approving code with `any` types in business logic | Type safety is not optional. |
|
|
172
|
+
|
|
206
173
|
## Anti-Sycophancy Protocol
|
|
207
174
|
|
|
208
175
|
### For the Reviewer (Giving Feedback)
|
|
@@ -16,25 +16,25 @@ 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. Class components ==="
|
|
25
|
-
grep -rn "class.*extends.*Component" src/modules/ --include="*.tsx" 2>/dev/null || echo "
|
|
25
|
+
grep -rn "class.*extends.*Component" src/modules/ --include="*.tsx" 2>/dev/null || echo "PASS: None"
|
|
26
26
|
|
|
27
27
|
echo "=== 4. PropTypes usage ==="
|
|
28
|
-
grep -rn "PropTypes\." src/modules/ --include="*.tsx" --include="*.ts" 2>/dev/null || echo "
|
|
28
|
+
grep -rn "PropTypes\." src/modules/ --include="*.tsx" --include="*.ts" 2>/dev/null || echo "PASS: None"
|
|
29
29
|
|
|
30
30
|
echo "=== 5. Redux usage ==="
|
|
31
|
-
grep -rn "useSelector\|useDispatch\|createSlice\|createStore\|connect(" src/modules/ --include="*.ts" --include="*.tsx" 2>/dev/null || echo "
|
|
31
|
+
grep -rn "useSelector\|useDispatch\|createSlice\|createStore\|connect(" src/modules/ --include="*.ts" --include="*.tsx" 2>/dev/null || echo "PASS: None"
|
|
32
32
|
|
|
33
33
|
echo "=== 6. Server state in Zustand ==="
|
|
34
|
-
grep -rn "async.*fetch\|axios\|api\.\|\.get(\|\.post(" src/modules/*/stores/ --include="*.ts" 2>/dev/null || echo "
|
|
34
|
+
grep -rn "async.*fetch\|axios\|api\.\|\.get(\|\.post(" src/modules/*/stores/ --include="*.ts" 2>/dev/null || echo "PASS: None"
|
|
35
35
|
|
|
36
36
|
echo "=== 7. Full Zustand destructure (should use selectors) ==="
|
|
37
|
-
grep -rn "} = use.*Store()" src/ --include="*.tsx" 2>/dev/null || echo "
|
|
37
|
+
grep -rn "} = use.*Store()" src/ --include="*.tsx" 2>/dev/null || echo "PASS: None"
|
|
38
38
|
|
|
39
39
|
echo "=== 8. any types ==="
|
|
40
40
|
grep -rn ": any\| any;\|as any\|<any>" src/modules/ --include="*.ts" --include="*.tsx" 2>/dev/null | wc -l
|
|
@@ -46,7 +46,7 @@ for module in src/modules/*/; do
|
|
|
46
46
|
done
|
|
47
47
|
|
|
48
48
|
echo "=== 10. dangerouslySetInnerHTML ==="
|
|
49
|
-
grep -rn "dangerouslySetInnerHTML" src/ --include="*.tsx" 2>/dev/null || echo "
|
|
49
|
+
grep -rn "dangerouslySetInnerHTML" src/ --include="*.tsx" 2>/dev/null || echo "PASS: None"
|
|
50
50
|
|
|
51
51
|
echo "=== 11. Debug artifacts ==="
|
|
52
52
|
grep -rn "console\.\|debugger" src/modules/ --include="*.ts" --include="*.tsx" 2>/dev/null | wc -l
|
|
@@ -60,14 +60,14 @@ echo "=== 13. Components > 200 lines ==="
|
|
|
60
60
|
find src/modules -name "*.tsx" -exec sh -c 'lines=$(wc -l < "$1"); [ "$lines" -gt 200 ] && echo "$1: $lines lines"' _ {} \;
|
|
61
61
|
|
|
62
62
|
echo "=== 14. Inline style objects in JSX ==="
|
|
63
|
-
grep -rn "style={{" src/modules/ --include="*.tsx" 2>/dev/null || echo "
|
|
63
|
+
grep -rn "style={{" src/modules/ --include="*.tsx" 2>/dev/null || echo "PASS: None"
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
Produce a summary table:
|
|
67
67
|
|
|
68
68
|
| Check | Status | Occurrences |
|
|
69
69
|
|-------|--------|-------------|
|
|
70
|
-
| Services without try/catch |
|
|
70
|
+
| Services without try/catch | PASS/FAIL | X |
|
|
71
71
|
| ... | ... | ... |
|
|
72
72
|
|
|
73
73
|
Overall score: X/14 checks passing.
|
|
@@ -24,6 +24,7 @@ npx eslint --ext .ts,.tsx src/ --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,26 +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
|
-
- Use SvelteKit load functions for server state caching
|
|
28
|
-
- Implement proper loading states with +loading.svelte
|
|
29
|
-
- Use proper cache invalidation (`invalidateAll`) - stale UI is a bug
|
|
30
|
-
- Lazy load routes, components, and heavy dependencies
|
|
31
|
-
- Avoid N+1 queries - batch requests, use proper data loading patterns
|
|
32
|
-
|
|
33
|
-
### Code Language (Mandatory)
|
|
34
|
-
- ALWAYS write code (variables, functions, comments, commits) in English
|
|
35
|
-
- Only use other languages if explicitly requested by the user
|
|
36
|
-
- 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
|
|
37
22
|
|
|
38
23
|
## Scope Detection
|
|
39
24
|
- **Module**: user wants a full feature (CRUD, page, multiple endpoints) -> Module mode
|
|
@@ -45,52 +30,19 @@ Read `docs/ARCHITECTURE.md`.
|
|
|
45
30
|
---
|
|
46
31
|
|
|
47
32
|
## Module Mode
|
|
48
|
-
|
|
49
|
-
2. Scaffold `src/lib/modules/[kebab-name]/` with: components/, stores/, services/, adapters/, types/, __tests__/, index.ts
|
|
50
|
-
3. Create bottom-up:
|
|
51
|
-
- `types/[name].types.ts` -- exact API response (snake_case)
|
|
52
|
-
- `types/[name].contracts.ts` -- app contract (camelCase, Date objects)
|
|
53
|
-
- `adapters/[name]-adapter.ts` -- pure functions: inbound (API->App) + outbound (App->API)
|
|
54
|
-
- `services/[name]-service.ts` -- HTTP only: `{ list, getById, create, update, delete }`. No try/catch, no transformation
|
|
55
|
-
- `stores/[name]-store.ts` -- client state only (filters, UI). writable/readable or rune-based class
|
|
56
|
-
- Components -- Svelte 5 runes ($state, $derived, $props), typed props, < 200 lines
|
|
57
|
-
4. Create SvelteKit route files:
|
|
58
|
-
- `src/routes/[name]/+page.ts` -- load function: service -> adapter -> typed return
|
|
59
|
-
- `src/routes/[name]/+page.svelte` -- page component consuming load data
|
|
60
|
-
- `src/routes/[name]/+error.svelte` -- error page
|
|
61
|
-
5. Create barrel export (index.ts): components + contracts only
|
|
62
|
-
6. Validate: `npx svelte-check --tsconfig ./tsconfig.json`
|
|
33
|
+
Run `/dev-create-module $NAME`. This skill contains the full scaffold workflow -- do NOT duplicate it here.
|
|
63
34
|
|
|
64
35
|
## Component Mode
|
|
65
|
-
|
|
66
|
-
2. Use Svelte 5 runes template: imports -> `$props()` with interface -> stores -> local `$state` -> `$derived` -> `$effect` -> handlers
|
|
67
|
-
3. Rules: < 200 lines, PascalCase.svelte, no prop drilling (use snippets + setContext/getContext), handle loading/error/empty states
|
|
68
|
-
4. Extract logic > 20 lines to a store or shared function
|
|
69
|
-
5. Use callback props (`onselect`, `ondelete`) instead of event dispatchers
|
|
36
|
+
Run `/dev-create-component $NAME`. This skill contains the full scaffold workflow -- do NOT duplicate it here.
|
|
70
37
|
|
|
71
38
|
## Service Mode
|
|
72
|
-
|
|
73
|
-
2. Create 4 files:
|
|
74
|
-
- `types/[name].types.ts` -- exact API (snake_case, string dates)
|
|
75
|
-
- `types/[name].contracts.ts` -- app contract (camelCase, Date, computed booleans)
|
|
76
|
-
- `adapters/[name]-adapter.ts` -- pure functions, bidirectional. Rename snake->camel, convert string->Date, cents->currency
|
|
77
|
-
- `services/[name]-service.ts` -- HTTP only. No try/catch, no transformation, no logic. Export as object with methods. Use native `fetch`
|
|
78
|
-
3. Validate: `npx svelte-check --tsconfig ./tsconfig.json`
|
|
39
|
+
Run `/dev-create-service $NAME`. This skill contains the full scaffold workflow -- do NOT duplicate it here.
|
|
79
40
|
|
|
80
41
|
## Store Mode
|
|
81
|
-
|
|
82
|
-
2. Choose pattern:
|
|
83
|
-
- **writable/readable store** -- for simple state (filters, toggles)
|
|
84
|
-
- **Rune-based class** -- for state with derived values and methods
|
|
85
|
-
3. Rules: only client state, factory function or class pattern, read-only exposure where possible
|
|
86
|
-
4. Create in `stores/[name]-store.ts`
|
|
87
|
-
5. Validate: `npx svelte-check --tsconfig ./tsconfig.json`
|
|
42
|
+
Run `/dev-create-store $NAME`. This skill contains the full scaffold workflow -- do NOT duplicate it here.
|
|
88
43
|
|
|
89
44
|
## Test Mode
|
|
90
|
-
|
|
91
|
-
2. Priority: adapters (pure functions, easy) > stores (test state logic) > components (@testing-library/svelte)
|
|
92
|
-
3. Create in `__tests__/[OriginalName].spec.ts`
|
|
93
|
-
4. Run: `npx vitest run [file]`
|
|
45
|
+
Run `/dev-create-test $NAME`. This skill contains the full scaffold workflow -- do NOT duplicate it here.
|
|
94
46
|
|
|
95
47
|
## Verification Protocol
|
|
96
48
|
|
|
@@ -14,70 +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-side (load function) or client-side (component)?
|
|
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 rune usage ($state, $derived, $effect)
|
|
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
|
-
- Use SvelteKit load functions for server state caching
|
|
72
|
-
- Implement proper loading states with +loading.svelte
|
|
73
|
-
- Use proper cache invalidation (`invalidateAll`) - stale UI is a bug
|
|
74
|
-
- Lazy load routes, components, and heavy dependencies
|
|
75
|
-
- Avoid N+1 queries - batch requests, use proper data loading patterns
|
|
76
|
-
|
|
77
|
-
### Code Language (Mandatory)
|
|
78
|
-
- ALWAYS write code (variables, functions, comments, commits) in English
|
|
79
|
-
- Only use other languages if explicitly requested by the user
|
|
80
|
-
- 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
|
|
81
28
|
|
|
82
29
|
## Workflow
|
|
83
30
|
|
|
@@ -14,26 +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
|
-
- Use SvelteKit load functions for server state caching
|
|
28
|
-
- Implement proper loading states with +loading.svelte
|
|
29
|
-
- Use proper cache invalidation (`invalidateAll`) - stale UI is a bug
|
|
30
|
-
- Lazy load routes, components, and heavy dependencies
|
|
31
|
-
- Avoid N+1 queries - batch requests, use proper data loading patterns
|
|
32
|
-
|
|
33
|
-
### Code Language (Mandatory)
|
|
34
|
-
- ALWAYS write code (variables, functions, comments, commits) in English
|
|
35
|
-
- Only use other languages if explicitly requested by the user
|
|
36
|
-
- 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
|
|
37
22
|
|
|
38
23
|
## Scope Detection
|
|
39
24
|
- **Module**: user wants to migrate an entire module/directory -> Module mode (6 phases)
|
|
@@ -42,50 +27,7 @@ Read `docs/ARCHITECTURE.md`.
|
|
|
42
27
|
---
|
|
43
28
|
|
|
44
29
|
## Module Mode (6 Phases)
|
|
45
|
-
|
|
46
|
-
### Phase 0: Analysis
|
|
47
|
-
- Map current state: count files, identify Svelte 4 vs 5 patterns, JS vs TS, legacy patterns
|
|
48
|
-
- List API endpoints used
|
|
49
|
-
- Check for SvelteKit 1 patterns ($app/stores, throw redirect, throw error)
|
|
50
|
-
- Report to user before proceeding
|
|
51
|
-
|
|
52
|
-
### Phase 1: Structure
|
|
53
|
-
- Create target directories: components/, stores/, services/, adapters/, types/, __tests__/
|
|
54
|
-
- Create route files: +page.svelte, +page.ts, +error.svelte
|
|
55
|
-
- Move existing files to correct locations
|
|
56
|
-
- Validate: `npx vite build`
|
|
57
|
-
|
|
58
|
-
### Phase 2: Types & Adapters
|
|
59
|
-
- Create `.types.ts` (exact API response, snake_case)
|
|
60
|
-
- Create `.contracts.ts` (app contract, camelCase)
|
|
61
|
-
- Create adapter with bidirectional parsing
|
|
62
|
-
- Validate: `npx svelte-check --tsconfig ./tsconfig.json`
|
|
63
|
-
|
|
64
|
-
### Phase 3: Services
|
|
65
|
-
- Extract HTTP calls to pure service (no try/catch, no transformation)
|
|
66
|
-
- One file per resource
|
|
67
|
-
- Use native `fetch`
|
|
68
|
-
- Validate: `npx vite build`
|
|
69
|
-
|
|
70
|
-
### Phase 4: State
|
|
71
|
-
- Server state -> SvelteKit load functions (+page.ts / +page.server.ts)
|
|
72
|
-
- Client state -> Svelte stores (writable/readable or rune-based class)
|
|
73
|
-
- Remove server state from client stores
|
|
74
|
-
- Validate: `npx vite build`
|
|
75
|
-
|
|
76
|
-
### Phase 5: Components
|
|
77
|
-
- Convert each component to Svelte 5 runes (see Component Mode conversion table)
|
|
78
|
-
- Type props with `$props()` interface
|
|
79
|
-
- Replace event dispatchers with callback props
|
|
80
|
-
- Replace slots with snippets
|
|
81
|
-
- Eliminate prop drilling (snippets + setContext/getContext)
|
|
82
|
-
- Decompose if > 200 lines
|
|
83
|
-
- Validate after each component
|
|
84
|
-
|
|
85
|
-
### Phase 6: Review
|
|
86
|
-
- Run pattern checks (same as @reviewer review mode)
|
|
87
|
-
- Report remaining issues
|
|
88
|
-
- Get user approval
|
|
30
|
+
Run `/migration-migrate-module $PATH`. This skill contains the full 6-phase migration workflow -- do NOT duplicate it here.
|
|
89
31
|
|
|
90
32
|
## Verification Protocol
|
|
91
33
|
|
|
@@ -118,60 +60,7 @@ Read `docs/ARCHITECTURE.md`.
|
|
|
118
60
|
---
|
|
119
61
|
|
|
120
62
|
## Component Mode
|
|
121
|
-
|
|
122
|
-
### Svelte 4 -> 5 Conversion Table
|
|
123
|
-
| Svelte 4 (Legacy) | Svelte 5 (Modern) |
|
|
124
|
-
|--------------------|-------------------|
|
|
125
|
-
| `export let prop` | `let { prop }: Props = $props()` |
|
|
126
|
-
| `export let prop = default` | `let { prop = default }: Props = $props()` |
|
|
127
|
-
| `$$restProps` | `let { ...rest } = $props()` |
|
|
128
|
-
| `let count = 0` (reactive) | `let count = $state(0)` |
|
|
129
|
-
| `$: derived = x + y` | `let derived = $derived(x + y)` |
|
|
130
|
-
| `$: { sideEffect() }` | `$effect(() => { sideEffect() })` |
|
|
131
|
-
| `$: if (condition) { ... }` | `$effect(() => { if (condition) { ... } })` |
|
|
132
|
-
| `createEventDispatcher()` | Callback props (`onselect?: (item) => void`) |
|
|
133
|
-
| `dispatch('select', item)` | `onselect?.(item)` |
|
|
134
|
-
| `<slot>` | `{@render children()}` |
|
|
135
|
-
| `<slot name="header">` | `{@render header()}` (with snippet prop) |
|
|
136
|
-
| `$$slots.header` | `header` (check snippet prop existence) |
|
|
137
|
-
| `on:click={handler}` | `onclick={handler}` |
|
|
138
|
-
| `on:click\|preventDefault` | `onclick={(e) => { e.preventDefault(); handler(e) }}` |
|
|
139
|
-
| `onMount(() => { ... })` | `$effect(() => { ... })` with cleanup return |
|
|
140
|
-
| `beforeUpdate` / `afterUpdate` | `$effect.pre()` / `$effect()` |
|
|
141
|
-
| `<svelte:component this={comp}>` | `<comp />` (dynamic component) |
|
|
142
|
-
|
|
143
|
-
### SvelteKit 1 -> 2 Conversion Table
|
|
144
|
-
| SvelteKit 1 (Legacy) | SvelteKit 2 (Modern) |
|
|
145
|
-
|-----------------------|----------------------|
|
|
146
|
-
| `import { page } from '$app/stores'` | `import { page } from '$app/state'` |
|
|
147
|
-
| `$page.url` (with $ prefix) | `page.url` (direct access) |
|
|
148
|
-
| `throw redirect(303, '/path')` | `redirect(303, '/path')` (no throw) |
|
|
149
|
-
| `throw error(404, 'Not found')` | `error(404, 'Not found')` (no throw) |
|
|
150
|
-
|
|
151
|
-
### Workflow
|
|
152
|
-
1. Read the component and list: props (export let), reactive statements ($:), event dispatchers, slots, lifecycle hooks
|
|
153
|
-
2. Map consumers (who uses this component) -- note if prop API changes
|
|
154
|
-
3. Convert to Svelte 5 runes:
|
|
155
|
-
- `export let` -> `$props()` with typed interface
|
|
156
|
-
- `let x = 0` -> `let x = $state(0)`
|
|
157
|
-
- `$: derived` -> `let derived = $derived(...)`
|
|
158
|
-
- `$: { ... }` -> `$effect(() => { ... })`
|
|
159
|
-
- `createEventDispatcher` -> callback props
|
|
160
|
-
- `<slot>` -> `{@render children()}`
|
|
161
|
-
- `<slot name="x">` -> `{@render x()}`
|
|
162
|
-
4. Type all props via interface
|
|
163
|
-
5. Replace event dispatchers with callback props
|
|
164
|
-
6. Replace slots with snippets
|
|
165
|
-
7. Decompose if > 200 lines
|
|
166
|
-
8. Validate: `npx svelte-check --tsconfig ./tsconfig.json`
|
|
167
|
-
9. Update consumers if API changed
|
|
168
|
-
|
|
169
|
-
### Rules
|
|
170
|
-
- Keep public API (props/snippets) stable when possible
|
|
171
|
-
- If API changes, update all consumers
|
|
172
|
-
- One component per commit
|
|
173
|
-
- Report bugs found during migration (don't silently fix)
|
|
174
|
-
- **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.
|
|
175
64
|
|
|
176
65
|
## Output
|
|
177
66
|
|
|
@@ -51,26 +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
|
-
- Use SvelteKit load functions for server state caching
|
|
65
|
-
- Implement proper loading states with +loading.svelte
|
|
66
|
-
- Use proper cache invalidation (`invalidateAll`) - stale UI is a bug
|
|
67
|
-
- Lazy load routes, components, and heavy dependencies
|
|
68
|
-
- Avoid N+1 queries - batch requests, use proper data loading patterns
|
|
69
|
-
|
|
70
|
-
### Code Language (Mandatory)
|
|
71
|
-
- ALWAYS write code (variables, functions, comments, commits) in English
|
|
72
|
-
- Only use other languages if explicitly requested by the user
|
|
73
|
-
- 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
|
|
74
59
|
|
|
75
60
|
## Scope Detection
|
|
76
61
|
- **Review**: user wants code review, PR validation, or violation fixing -> Review mode
|
|
@@ -90,28 +75,9 @@ npx vitest run --passWithNoTests
|
|
|
90
75
|
```
|
|
91
76
|
|
|
92
77
|
### 2. Pattern Checks
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
grep -rn "\$:" src/lib/modules/ --include="*.svelte" 2>/dev/null && echo "VIOLATION: Svelte 4 $: reactive (use $derived/$effect)"
|
|
97
|
-
grep -rn "createEventDispatcher" src/lib/modules/ --include="*.svelte" --include="*.ts" 2>/dev/null && echo "VIOLATION: Svelte 4 event dispatcher (use callback props)"
|
|
98
|
-
grep -rn "<slot" src/lib/modules/ --include="*.svelte" 2>/dev/null && echo "VIOLATION: Svelte 4 slot (use {@render} + snippets)"
|
|
99
|
-
grep -rn "on:" src/lib/modules/ --include="*.svelte" 2>/dev/null | grep -v "onclick\|onsubmit\|onchange\|oninput\|onkeydown\|onkeyup\|onfocus\|onblur\|onmouseenter\|onmouseleave" && echo "VIOLATION: Svelte 4 on: directive"
|
|
100
|
-
|
|
101
|
-
# Architecture violations
|
|
102
|
-
grep -rn "try {" src/lib/modules/*/services/ --include="*.ts" 2>/dev/null && echo "VIOLATION: try/catch in service"
|
|
103
|
-
grep -rn "\.map(\|new Date" src/lib/modules/*/services/ --include="*.ts" 2>/dev/null && echo "VIOLATION: transformation in service"
|
|
104
|
-
grep -rn ": any\|as any" src/lib/modules/ --include="*.ts" --include="*.svelte" 2>/dev/null && echo "ATTENTION: any types"
|
|
105
|
-
grep -rn "console\.\|debugger" src/lib/modules/ --include="*.ts" --include="*.svelte" 2>/dev/null && echo "ATTENTION: debug artifacts"
|
|
106
|
-
grep -rn "{@html" src/ --include="*.svelte" 2>/dev/null && echo "VIOLATION: {@html} usage"
|
|
107
|
-
|
|
108
|
-
# SvelteKit 1 legacy patterns
|
|
109
|
-
grep -rn "\$app/stores" src/ --include="*.svelte" --include="*.ts" 2>/dev/null && echo "VIOLATION: SvelteKit 1 $app/stores (use $app/state)"
|
|
110
|
-
grep -rn "throw redirect\|throw error" src/ --include="*.ts" 2>/dev/null && echo "VIOLATION: SvelteKit 1 throw redirect/error"
|
|
111
|
-
|
|
112
|
-
# Missing $state rune (plain let in reactive context)
|
|
113
|
-
grep -rn "let .* = \(null\|false\|true\|0\|''\|{}\|\[\]\)" src/lib/modules/ --include="*.svelte" 2>/dev/null | grep -v "\$state\|\$derived\|\$props\|const\|import" && echo "ATTENTION: possible missing $state rune"
|
|
114
|
-
```
|
|
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.
|
|
115
81
|
|
|
116
82
|
### 3. Manual Review
|
|
117
83
|
- Services: HTTP only, no try/catch, no transformation, native fetch
|
|
@@ -176,6 +142,20 @@ grep -rn "let .* = \(null\|false\|true\|0\|''\|{}\|\[\]\)" src/lib/modules/ --in
|
|
|
176
142
|
4. Rendering: find unnecessary $effect usage, large {#each} without keyed blocks, expensive $derived computations
|
|
177
143
|
5. Report bottlenecks sorted by user impact
|
|
178
144
|
|
|
145
|
+
## Automatic Fail Triggers
|
|
146
|
+
|
|
147
|
+
The following conditions result in an **AUTOMATIC FAIL** verdict -- no exceptions:
|
|
148
|
+
|
|
149
|
+
| Trigger | Why |
|
|
150
|
+
|---------|-----|
|
|
151
|
+
| "Zero issues found" | Every codebase has improvement areas. Zero findings = insufficient review. |
|
|
152
|
+
| "LGTM" or "Looks good to me" without specifics | Lazy. Explain what you verified and how. |
|
|
153
|
+
| Approval without running `tsc`, `eslint`, `build`, or `tests` | No automated check output = no review. |
|
|
154
|
+
| "Minor issues only" when violations exist | A violation is blocking. Do not minimize. |
|
|
155
|
+
| Praising code that violates ARCHITECTURE.md | Architecture compliance is non-negotiable. |
|
|
156
|
+
| Reviewing without reading ARCHITECTURE.md first | Context-free review is worthless. |
|
|
157
|
+
| Approving code with `any` types in business logic | Type safety is not optional. |
|
|
158
|
+
|
|
179
159
|
## Anti-Sycophancy Protocol
|
|
180
160
|
|
|
181
161
|
### For the Reviewer (Giving Feedback)
|
|
@@ -16,31 +16,31 @@ 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/lib/modules/*/services/ --include="*.ts" 2>/dev/null || echo "
|
|
19
|
+
grep -rn "try {" src/lib/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/lib/modules/*/services/ --include="*.ts" 2>/dev/null || echo "
|
|
22
|
+
grep -rn "\.map(\|\.filter(\|new Date\|\.reduce(" src/lib/modules/*/services/ --include="*.ts" 2>/dev/null || echo "PASS: None"
|
|
23
23
|
|
|
24
24
|
echo "=== 3. Svelte 4: export let (should use $props) ==="
|
|
25
|
-
grep -rn "export let " src/lib/modules/ --include="*.svelte" 2>/dev/null || echo "
|
|
25
|
+
grep -rn "export let " src/lib/modules/ --include="*.svelte" 2>/dev/null || echo "PASS: None"
|
|
26
26
|
|
|
27
27
|
echo "=== 4. Svelte 4: $: reactive (should use $derived/$effect) ==="
|
|
28
|
-
grep -rn "^\s*\$:" src/lib/modules/ --include="*.svelte" 2>/dev/null || echo "
|
|
28
|
+
grep -rn "^\s*\$:" src/lib/modules/ --include="*.svelte" 2>/dev/null || echo "PASS: None"
|
|
29
29
|
|
|
30
30
|
echo "=== 5. Svelte 4: createEventDispatcher ==="
|
|
31
|
-
grep -rn "createEventDispatcher" src/lib/modules/ --include="*.svelte" --include="*.ts" 2>/dev/null || echo "
|
|
31
|
+
grep -rn "createEventDispatcher" src/lib/modules/ --include="*.svelte" --include="*.ts" 2>/dev/null || echo "PASS: None"
|
|
32
32
|
|
|
33
33
|
echo "=== 6. Svelte 4: <slot> (should use {@render} + snippets) ==="
|
|
34
|
-
grep -rn "<slot" src/lib/modules/ --include="*.svelte" 2>/dev/null || echo "
|
|
34
|
+
grep -rn "<slot" src/lib/modules/ --include="*.svelte" 2>/dev/null || echo "PASS: None"
|
|
35
35
|
|
|
36
36
|
echo "=== 7. SvelteKit 1: $app/stores ==="
|
|
37
|
-
grep -rn "\$app/stores" src/ --include="*.svelte" --include="*.ts" 2>/dev/null || echo "
|
|
37
|
+
grep -rn "\$app/stores" src/ --include="*.svelte" --include="*.ts" 2>/dev/null || echo "PASS: None"
|
|
38
38
|
|
|
39
39
|
echo "=== 8. SvelteKit 1: throw redirect/error ==="
|
|
40
|
-
grep -rn "throw redirect\|throw error" src/ --include="*.ts" 2>/dev/null || echo "
|
|
40
|
+
grep -rn "throw redirect\|throw error" src/ --include="*.ts" 2>/dev/null || echo "PASS: None"
|
|
41
41
|
|
|
42
42
|
echo "=== 9. Server state in client stores ==="
|
|
43
|
-
grep -rn "async.*fetch\|await fetch\|\.json()" src/lib/modules/*/stores/ --include="*.ts" 2>/dev/null || echo "
|
|
43
|
+
grep -rn "async.*fetch\|await fetch\|\.json()" src/lib/modules/*/stores/ --include="*.ts" 2>/dev/null || echo "PASS: None"
|
|
44
44
|
|
|
45
45
|
echo "=== 10. any types ==="
|
|
46
46
|
grep -rn ": any\| any;\|as any\|<any>" src/lib/modules/ --include="*.ts" --include="*.svelte" 2>/dev/null | wc -l
|
|
@@ -52,7 +52,7 @@ for module in src/lib/modules/*/; do
|
|
|
52
52
|
done
|
|
53
53
|
|
|
54
54
|
echo "=== 12. {@html} usage ==="
|
|
55
|
-
grep -rn "{@html" src/ --include="*.svelte" 2>/dev/null || echo "
|
|
55
|
+
grep -rn "{@html" src/ --include="*.svelte" 2>/dev/null || echo "PASS: None"
|
|
56
56
|
|
|
57
57
|
echo "=== 13. Debug artifacts ==="
|
|
58
58
|
grep -rn "console\.\|debugger" src/lib/modules/ --include="*.ts" --include="*.svelte" 2>/dev/null | wc -l
|
|
@@ -61,7 +61,7 @@ echo "=== 14. Components > 200 lines ==="
|
|
|
61
61
|
find src/lib/modules -name "*.svelte" -exec sh -c 'lines=$(wc -l < "$1"); [ "$lines" -gt 200 ] && echo "$1: $lines lines"' _ {} \;
|
|
62
62
|
|
|
63
63
|
echo "=== 15. Missing $state rune (reactive let without rune) ==="
|
|
64
|
-
grep -rn "^\s*let .* = \(null\|false\|true\|0\|''\)" src/lib/modules/ --include="*.svelte" 2>/dev/null | grep -v "\$state\|\$derived\|\$props\|import\|const" || echo "
|
|
64
|
+
grep -rn "^\s*let .* = \(null\|false\|true\|0\|''\)" src/lib/modules/ --include="*.svelte" 2>/dev/null | grep -v "\$state\|\$derived\|\$props\|import\|const" || echo "PASS: None"
|
|
65
65
|
|
|
66
66
|
echo "=== 16. Load functions without error handling ==="
|
|
67
67
|
for f in $(find src/routes -name "+page.ts" -o -name "+page.server.ts" 2>/dev/null); do
|
|
@@ -73,7 +73,7 @@ Produce a summary table:
|
|
|
73
73
|
|
|
74
74
|
| Check | Status | Occurrences |
|
|
75
75
|
|-------|--------|-------------|
|
|
76
|
-
| Services without try/catch |
|
|
76
|
+
| Services without try/catch | PASS/FAIL | X |
|
|
77
77
|
| ... | ... | ... |
|
|
78
78
|
|
|
79
79
|
Overall score: X/16 checks passing.
|