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
|
@@ -24,6 +24,7 @@ npx eslint 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, native fetch
|
|
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 TanStack Query (Vue 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
|
|
@@ -47,47 +30,19 @@ Read `docs/ARCHITECTURE.md`.
|
|
|
47
30
|
---
|
|
48
31
|
|
|
49
32
|
## Module Mode
|
|
50
|
-
|
|
51
|
-
2. Scaffold `src/modules/[kebab-name]/` with: components/, composables/, services/, adapters/, stores/, types/, views/, __tests__/, index.ts
|
|
52
|
-
3. Create bottom-up:
|
|
53
|
-
- `types/[name].types.ts` - exact API response (snake_case)
|
|
54
|
-
- `types/[name].contracts.ts` - app contract (camelCase, Date objects)
|
|
55
|
-
- `adapters/[name]-adapter.ts` - pure functions: inbound (API→App) + outbound (App→API)
|
|
56
|
-
- `services/[name]-service.ts` - HTTP only: `{ list, getById, create, update, delete }`. No try/catch, no transformation
|
|
57
|
-
- `stores/[name]-store.ts` - client state only (filters, UI). Setup syntax, readonly()
|
|
58
|
-
- `composables/useXxxList.ts` - orchestrate service→adapter→Vue Query. Set staleTime, reactive queryKey
|
|
59
|
-
- Components - `<script setup lang="ts">`, type-based props/emits, < 200 lines
|
|
60
|
-
- View - compose components with slots, provide context
|
|
61
|
-
4. Register lazy route in router
|
|
62
|
-
5. Create barrel export (index.ts): views + contracts only
|
|
63
|
-
6. Validate: `npx tsc --noEmit`
|
|
33
|
+
Run `/dev-create-module $NAME`. This skill contains the full scaffold workflow -- do NOT duplicate it here.
|
|
64
34
|
|
|
65
35
|
## Component Mode
|
|
66
|
-
|
|
67
|
-
2. Use `<script setup lang="ts">` template: imports → defineProps<T>() → defineEmits<T>() → stores (storeToRefs) → composables → local state → computed → handlers
|
|
68
|
-
3. Rules: < 200 lines, PascalCase.vue, no prop drilling (use slots + provide/inject), handle loading/error/empty states
|
|
69
|
-
4. Extract logic > 20 lines to composable
|
|
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
|
|
78
|
-
3. Validate: `npx tsc --noEmit`
|
|
39
|
+
Run `/dev-create-service $NAME`. This skill contains the full scaffold workflow -- do NOT duplicate it here.
|
|
79
40
|
|
|
80
41
|
## Composable Mode
|
|
81
|
-
|
|
82
|
-
2. **Mutation** (writing): `useMutation` with invalidateQueries on success. Use adapter for payload. Return { mutate, isPending, error }
|
|
83
|
-
3. **Shared logic** (no API): ref/computed with lifecycle hooks
|
|
84
|
-
4. Rules: prefix `use`, return refs/computed never raw, use service (never direct API), use adapter (never inline transform), always staleTime
|
|
42
|
+
Run `/dev-create-composable $NAME`. This skill contains the full scaffold workflow -- do NOT duplicate it here.
|
|
85
43
|
|
|
86
44
|
## Test Mode
|
|
87
|
-
|
|
88
|
-
2. Priority: adapters (pure functions, easy) > composables (mock service) > components (@vue/test-utils)
|
|
89
|
-
3. Create in `__tests__/[OriginalName].spec.ts`
|
|
90
|
-
4. Run: `npx vitest run [file]`
|
|
45
|
+
Run `/dev-create-test $NAME`. This skill contains the full scaffold workflow -- do NOT duplicate it here.
|
|
91
46
|
|
|
92
47
|
## Verification Protocol
|
|
93
48
|
|
|
@@ -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 TanStack Query (Vue Query) for server state caching
|
|
71
|
-
- Set appropriate `staleTime` and `gcTime` for each query based on data freshness needs
|
|
72
|
-
- Use `keepPreviousData` for pagination to avoid loading flickers
|
|
73
|
-
- Implement optimistic updates for mutations when UX benefits
|
|
74
|
-
- Use proper cache invalidation (`invalidateQueries`) - stale UI is a bug
|
|
75
|
-
- Lazy load routes, components, and heavy dependencies
|
|
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
|
|
|
@@ -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 (Vue 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 to migrate an entire module/directory → Module mode (6 phases)
|
|
@@ -44,46 +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 Options vs setup, JS vs TS, mixins, cross-module imports
|
|
50
|
-
- List API endpoints used
|
|
51
|
-
- Report to user before proceeding
|
|
52
|
-
|
|
53
|
-
### Phase 1: Structure
|
|
54
|
-
- Create target directories: components/, composables/, services/, adapters/, stores/, types/, views/, __tests__/
|
|
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 tsc --noEmit`
|
|
63
|
-
|
|
64
|
-
### Phase 3: Services
|
|
65
|
-
- Extract HTTP calls to pure service (no try/catch, no transformation)
|
|
66
|
-
- One file per resource
|
|
67
|
-
- Validate: `npx vite build`
|
|
68
|
-
|
|
69
|
-
### Phase 4: State
|
|
70
|
-
- Server state → Vue Query (composables with staleTime)
|
|
71
|
-
- Client state → Pinia (setup syntax, readonly, storeToRefs)
|
|
72
|
-
- Remove server state from Pinia stores
|
|
73
|
-
- Validate: `npx vite build`
|
|
74
|
-
|
|
75
|
-
### Phase 5: Components
|
|
76
|
-
- Convert each component to `<script setup lang="ts">`
|
|
77
|
-
- Type props with defineProps<T>(), emits with defineEmits<T>()
|
|
78
|
-
- Extract mixins to composables
|
|
79
|
-
- Eliminate prop drilling (slots + provide/inject)
|
|
80
|
-
- Decompose if > 200 lines
|
|
81
|
-
- Validate after each component
|
|
82
|
-
|
|
83
|
-
### Phase 6: Review
|
|
84
|
-
- Run pattern checks (same as @reviewer review mode)
|
|
85
|
-
- Report remaining issues
|
|
86
|
-
- Get user approval
|
|
30
|
+
Run `/migration-migrate-module $PATH`. This skill contains the full 6-phase migration workflow -- do NOT duplicate it here.
|
|
87
31
|
|
|
88
32
|
## Verification Protocol
|
|
89
33
|
|
|
@@ -116,37 +60,7 @@ Read `docs/ARCHITECTURE.md`.
|
|
|
116
60
|
---
|
|
117
61
|
|
|
118
62
|
## Component Mode
|
|
119
|
-
|
|
120
|
-
### Conversion Table
|
|
121
|
-
| Options API | Script Setup |
|
|
122
|
-
|------------|--------------|
|
|
123
|
-
| `props` | `defineProps<T>()` |
|
|
124
|
-
| `emits` | `defineEmits<T>()` |
|
|
125
|
-
| `data()` | `ref()` / `reactive()` |
|
|
126
|
-
| `computed` | `computed()` |
|
|
127
|
-
| `methods` | functions |
|
|
128
|
-
| `watch` | `watch()` / `watchEffect()` |
|
|
129
|
-
| mixins | composables |
|
|
130
|
-
| `this.$emit` | `emit()` |
|
|
131
|
-
| `this.$refs` | `useTemplateRef()` |
|
|
132
|
-
|
|
133
|
-
### Workflow
|
|
134
|
-
1. Read the component and list: props, emits, data, computed, methods, watchers, mixins, lifecycle hooks
|
|
135
|
-
2. Map consumers (who uses this component) - note if props/emits API changes
|
|
136
|
-
3. Convert to `<script setup lang="ts">`
|
|
137
|
-
4. Type all props and emits
|
|
138
|
-
5. Extract mixins to composables in same module
|
|
139
|
-
6. Eliminate prop drilling if found
|
|
140
|
-
7. Decompose if > 200 lines
|
|
141
|
-
8. Validate: `npx tsc --noEmit`
|
|
142
|
-
9. Update consumers if API changed
|
|
143
|
-
|
|
144
|
-
### Rules
|
|
145
|
-
- Keep public API (props/emits/slots) stable when possible
|
|
146
|
-
- If API changes, update all consumers
|
|
147
|
-
- One component per commit
|
|
148
|
-
- Report bugs found during migration (don't silently fix)
|
|
149
|
-
- **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.
|
|
150
64
|
|
|
151
65
|
## Output
|
|
152
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 (Vue 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,16 +75,7 @@ npx vitest run --passWithNoTests
|
|
|
92
75
|
```
|
|
93
76
|
|
|
94
77
|
### 2. Pattern Checks
|
|
95
|
-
|
|
96
|
-
grep -rn "try {" src/modules/*/services/ --include="*.ts" 2>/dev/null && echo "🔴 try/catch in service"
|
|
97
|
-
grep -rn "\.map(\|new Date" src/modules/*/services/ --include="*.ts" 2>/dev/null && echo "🔴 transformation in service"
|
|
98
|
-
grep -rL "script setup" src/modules/*/components/*.vue src/modules/*/views/*.vue 2>/dev/null && echo "🔴 missing script setup"
|
|
99
|
-
grep -rn "defineComponent\|export default {" src/modules/ --include="*.vue" 2>/dev/null && echo "🔴 Options API"
|
|
100
|
-
grep -rn "mixins:" src/ --include="*.vue" 2>/dev/null && echo "🔴 Mixins"
|
|
101
|
-
grep -rn ": any\|as any" src/modules/ --include="*.ts" --include="*.vue" 2>/dev/null && echo "🟡 any types"
|
|
102
|
-
grep -rn "console\.\|debugger" src/modules/ --include="*.ts" --include="*.vue" 2>/dev/null && echo "🟡 debug artifacts"
|
|
103
|
-
grep -rn "v-html" src/ --include="*.vue" 2>/dev/null && echo "🔴 v-html"
|
|
104
|
-
```
|
|
78
|
+
Run `/review-check-architecture $SCOPE` and include the results in the review. This skill contains all framework-specific automated checks -- do NOT duplicate them here.
|
|
105
79
|
|
|
106
80
|
### 3. Manual Review
|
|
107
81
|
- Services: HTTP only, no try/catch, no transformation
|
|
@@ -179,6 +153,20 @@ grep -rn "v-html" src/ --include="*.vue" 2>/dev/null && echo "🔴 v-html"
|
|
|
179
153
|
4. Rendering: find deep watchers (`{ deep: true }`), inline objects in templates, heavy computed
|
|
180
154
|
5. Report bottlenecks sorted by user impact
|
|
181
155
|
|
|
156
|
+
## Automatic Fail Triggers
|
|
157
|
+
|
|
158
|
+
The following conditions result in an **AUTOMATIC FAIL** verdict -- no exceptions:
|
|
159
|
+
|
|
160
|
+
| Trigger | Why |
|
|
161
|
+
|---------|-----|
|
|
162
|
+
| "Zero issues found" | Every codebase has improvement areas. Zero findings = insufficient review. |
|
|
163
|
+
| "LGTM" or "Looks good to me" without specifics | Lazy. Explain what you verified and how. |
|
|
164
|
+
| Approval without running `tsc`, `eslint`, `build`, or `tests` | No automated check output = no review. |
|
|
165
|
+
| "Minor issues only" when violations exist | A violation is blocking. Do not minimize. |
|
|
166
|
+
| Praising code that violates ARCHITECTURE.md | Architecture compliance is non-negotiable. |
|
|
167
|
+
| Reviewing without reading ARCHITECTURE.md first | Context-free review is worthless. |
|
|
168
|
+
| Approving code with `any` types in business logic | Type safety is not optional. |
|
|
169
|
+
|
|
182
170
|
## Anti-Sycophancy Protocol
|
|
183
171
|
|
|
184
172
|
### For the Reviewer (Giving Feedback)
|
|
@@ -16,28 +16,28 @@ 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. Components without script setup ==="
|
|
25
|
-
grep -rL "script setup" src/modules/*/components/*.vue src/modules/*/views/*.vue 2>/dev/null || echo "
|
|
25
|
+
grep -rL "script setup" src/modules/*/components/*.vue src/modules/*/views/*.vue 2>/dev/null || echo "PASS: All ok"
|
|
26
26
|
|
|
27
27
|
echo "=== 4. Components without TypeScript ==="
|
|
28
|
-
grep -rL 'lang="ts"' src/modules/*/components/*.vue src/modules/*/views/*.vue 2>/dev/null || echo "
|
|
28
|
+
grep -rL 'lang="ts"' src/modules/*/components/*.vue src/modules/*/views/*.vue 2>/dev/null || echo "PASS: All ok"
|
|
29
29
|
|
|
30
30
|
echo "=== 5. Options API ==="
|
|
31
|
-
grep -rn "defineComponent\|export default {" src/modules/ --include="*.vue" 2>/dev/null || echo "
|
|
31
|
+
grep -rn "defineComponent\|export default {" src/modules/ --include="*.vue" 2>/dev/null || echo "PASS: None"
|
|
32
32
|
|
|
33
33
|
echo "=== 6. Mixins ==="
|
|
34
|
-
grep -rn "mixins:" src/ --include="*.vue" 2>/dev/null || echo "
|
|
34
|
+
grep -rn "mixins:" src/ --include="*.vue" 2>/dev/null || echo "PASS: None"
|
|
35
35
|
|
|
36
36
|
echo "=== 7. Server state in Pinia ==="
|
|
37
|
-
grep -rn "async.*fetch\|axios\|api\.\|\.get(\|\.post(" src/modules/*/stores/ --include="*.ts" 2>/dev/null || echo "
|
|
37
|
+
grep -rn "async.*fetch\|axios\|api\.\|\.get(\|\.post(" src/modules/*/stores/ --include="*.ts" 2>/dev/null || echo "PASS: None"
|
|
38
38
|
|
|
39
39
|
echo "=== 8. Missing storeToRefs ==="
|
|
40
|
-
grep -rn "const {.*} = use.*Store()" src/ --include="*.vue" 2>/dev/null | grep -v "storeToRefs" || echo "
|
|
40
|
+
grep -rn "const {.*} = use.*Store()" src/ --include="*.vue" 2>/dev/null | grep -v "storeToRefs" || echo "PASS: All ok"
|
|
41
41
|
|
|
42
42
|
echo "=== 9. any types ==="
|
|
43
43
|
grep -rn ": any\| any;\|as any\|<any>" src/modules/ --include="*.ts" --include="*.vue" 2>/dev/null | wc -l
|
|
@@ -49,7 +49,7 @@ for module in src/modules/*/; do
|
|
|
49
49
|
done
|
|
50
50
|
|
|
51
51
|
echo "=== 11. v-html ==="
|
|
52
|
-
grep -rn "v-html" src/ --include="*.vue" 2>/dev/null || echo "
|
|
52
|
+
grep -rn "v-html" src/ --include="*.vue" 2>/dev/null || echo "PASS: None"
|
|
53
53
|
|
|
54
54
|
echo "=== 12. Debug artifacts ==="
|
|
55
55
|
grep -rn "console\.\|debugger" src/modules/ --include="*.ts" --include="*.vue" 2>/dev/null | wc -l
|
|
@@ -67,7 +67,7 @@ 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,.vue 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
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: autofix
|
|
3
|
+
description: "Use when you want to automatically triage errors from Sentry (or error logs), cross-reference them against the codebase and open PRs, prioritize by severity, and optionally create fix PRs."
|
|
4
|
+
user-invocable: true
|
|
5
|
+
argument-hint: "[sentry|logs|--timeframe=24h|--auto-pr]"
|
|
6
|
+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# /autofix - Automated Error Triage & Fix
|
|
10
|
+
|
|
11
|
+
Pull production errors, check if they're already fixed, prioritize what matters, and ship fixes — all in one command.
|
|
12
|
+
|
|
13
|
+
**Target:** $ARGUMENTS
|
|
14
|
+
|
|
15
|
+
## Workflow
|
|
16
|
+
|
|
17
|
+
### Step 1: Detect Error Source
|
|
18
|
+
|
|
19
|
+
**If using Sentry**, first inform the user and verify the Sentry CLI is installed:
|
|
20
|
+
> "This workflow requires the Sentry CLI. Checking if `sentry-cli` is available..."
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
sentry-cli --version
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
If not installed, stop and instruct: `npm install -g @sentry/cli` or see https://docs.sentry.io/cli/installation/
|
|
27
|
+
|
|
28
|
+
Then check which error source is available:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Check for Sentry
|
|
32
|
+
echo $SENTRY_AUTH_TOKEN | head -c 4
|
|
33
|
+
|
|
34
|
+
# Check for error log files
|
|
35
|
+
ls logs/ error.log *.log 2>/dev/null
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
| Source | Detection |
|
|
39
|
+
|--------|-----------|
|
|
40
|
+
| **Sentry** | `$SENTRY_AUTH_TOKEN` + `$SENTRY_ORG` + `$SENTRY_PROJECT` set |
|
|
41
|
+
| **Log files** | `logs/` directory or `*.log` files present |
|
|
42
|
+
| **Manual** | User provides error text or screenshot |
|
|
43
|
+
|
|
44
|
+
If no source detected, ask user:
|
|
45
|
+
> "No error source detected. Set `SENTRY_AUTH_TOKEN`, `SENTRY_ORG`, `SENTRY_PROJECT` for Sentry, or provide error logs."
|
|
46
|
+
|
|
47
|
+
### Step 2: Fetch Errors
|
|
48
|
+
|
|
49
|
+
**Sentry mode:**
|
|
50
|
+
```bash
|
|
51
|
+
curl -s -H "Authorization: Bearer $SENTRY_AUTH_TOKEN" \
|
|
52
|
+
"https://sentry.io/api/0/projects/$SENTRY_ORG/$SENTRY_PROJECT/issues/?query=is:unresolved&statsPeriod=${TIMEFRAME:-24h}&sort=freq"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Log mode:**
|
|
56
|
+
```bash
|
|
57
|
+
# Extract unique errors from logs
|
|
58
|
+
grep -E "(Error|Exception|FATAL|CRITICAL)" logs/*.log | sort -u
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Parse each error: message, stack trace, frequency, timestamp.
|
|
62
|
+
|
|
63
|
+
### Step 3: Cross-Reference
|
|
64
|
+
|
|
65
|
+
For each error, run three checks in parallel:
|
|
66
|
+
|
|
67
|
+
1. **Git history** — `git log --since="${TIMEFRAME:-24 hours ago}" --all -- {file}` for recent fixes
|
|
68
|
+
2. **Open PRs** — `gh pr list --state open --search "{error-keyword}"` for in-progress fixes
|
|
69
|
+
3. **Codebase** — `Grep` for the exact error location to verify it still exists
|
|
70
|
+
|
|
71
|
+
Classify:
|
|
72
|
+
- `FIXED` — Recent commit addresses the error
|
|
73
|
+
- `PR_OPEN` — Open PR targets the file/error
|
|
74
|
+
- `NEEDS_FIX` — No existing fix
|
|
75
|
+
|
|
76
|
+
### Step 4: Prioritize into 3 Tiers
|
|
77
|
+
|
|
78
|
+
| Tier | Criteria | Recommended Action |
|
|
79
|
+
|------|----------|-------------------|
|
|
80
|
+
| **P0 Critical** | >100 events OR >50 users OR security/data-loss | Fix now, create PR immediately |
|
|
81
|
+
| **P1 Important** | >10 events OR >5 users OR broken UX flow | Fix this sprint |
|
|
82
|
+
| **P2 Low** | <10 events AND edge-case/cosmetic | Add to backlog |
|
|
83
|
+
|
|
84
|
+
For log-based errors without event counts, use recency and frequency in log file.
|
|
85
|
+
|
|
86
|
+
### Step 5: Present Report
|
|
87
|
+
|
|
88
|
+
Display the triage to the user:
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
## Autofix Report — {date}
|
|
92
|
+
|
|
93
|
+
Period: Last {timeframe}
|
|
94
|
+
Source: {sentry|logs}
|
|
95
|
+
|
|
96
|
+
ALREADY FIXED (3):
|
|
97
|
+
- "Connection timeout" → fixed in abc1234
|
|
98
|
+
- "Null ref in CartService" → PR #42 open
|
|
99
|
+
|
|
100
|
+
P0 CRITICAL (1):
|
|
101
|
+
1. TypeError in src/api/users.ts:45 — 342 events, 89 users
|
|
102
|
+
Root cause: Missing null check on user.profile
|
|
103
|
+
|
|
104
|
+
P1 IMPORTANT (2):
|
|
105
|
+
2. UnhandledRejection in src/services/payment.ts:112 — 28 events
|
|
106
|
+
3. RangeError in src/utils/date.ts:67 — 15 events
|
|
107
|
+
|
|
108
|
+
P2 LOW (4):
|
|
109
|
+
4-7. [listed with brief descriptions]
|
|
110
|
+
|
|
111
|
+
Select issues to fix: [1,2,3] or "all-p0" or "all"
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Step 6: Auto-Fix Selected Issues
|
|
115
|
+
|
|
116
|
+
For each selected issue:
|
|
117
|
+
|
|
118
|
+
1. Create branch: `fix/autofix-{id}-{short-desc}`
|
|
119
|
+
2. Analyze stack trace + surrounding code (read 50 lines above/below)
|
|
120
|
+
3. Implement fix with proper error handling
|
|
121
|
+
4. Run tests: `npm test` or detected test runner
|
|
122
|
+
5. If `--auto-pr` flag set, create PR automatically:
|
|
123
|
+
```bash
|
|
124
|
+
gh pr create --title "fix: {error-title}" --body "..."
|
|
125
|
+
```
|
|
126
|
+
6. Otherwise, show diff and ask user to confirm
|
|
127
|
+
|
|
128
|
+
## Output
|
|
129
|
+
|
|
130
|
+
```markdown
|
|
131
|
+
## /autofix Results
|
|
132
|
+
|
|
133
|
+
**Source:** {sentry|logs}
|
|
134
|
+
**Period:** {timeframe}
|
|
135
|
+
**Triaged:** {n} issues
|
|
136
|
+
|
|
137
|
+
| Tier | Count | Fixed | PR Created |
|
|
138
|
+
|------|-------|-------|------------|
|
|
139
|
+
| P0 | {n} | {n} | {n} |
|
|
140
|
+
| P1 | {n} | {n} | {n} |
|
|
141
|
+
| P2 | {n} | {n} | {n} |
|
|
142
|
+
|
|
143
|
+
### PRs Created
|
|
144
|
+
- `fix/autofix-123-null-check` → PR #45
|
|
145
|
+
- `fix/autofix-456-timeout-handler` → PR #46
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Anti-Rationalization
|
|
149
|
+
|
|
150
|
+
| Excuse | Reality |
|
|
151
|
+
|--------|---------|
|
|
152
|
+
| "I'll check Sentry later" | Later never comes. Errors compound. Triage now takes 2 minutes. |
|
|
153
|
+
| "Low event count = not important" | Low count can mean high severity for specific users. Check `userCount`. |
|
|
154
|
+
| "The fix might break something" | A tested fix in a PR is safer than an unhandled production error. |
|
|
155
|
+
| "It's already been reported" | Reported != fixed. Check the PR status. |
|
|
156
|
+
|
|
157
|
+
## Rules
|
|
158
|
+
|
|
159
|
+
1. Never store auth tokens in files — environment variables only
|
|
160
|
+
2. Never auto-merge — all PRs require human review
|
|
161
|
+
3. Never resolve/dismiss Sentry issues — only create fixes
|
|
162
|
+
4. Always run the existing test suite before creating a PR
|
|
163
|
+
5. Always include the error source link (Sentry URL or log reference) in PRs
|
|
164
|
+
6. Respect `--timeframe` flag (default: 24h)
|
|
165
|
+
7. If `--auto-pr` is not set, always ask before creating PRs
|
|
166
|
+
8. Group related errors (same root cause) into a single fix when possible
|