@jgamaraalv/ts-dev-kit 1.0.3 → 1.2.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 +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +16 -0
- package/agents/accessibility-pro.md +4 -4
- package/agents/api-builder.md +1 -4
- package/agents/code-reviewer.md +20 -5
- package/agents/database-expert.md +3 -4
- package/agents/debugger.md +1 -4
- package/agents/docker-expert.md +1 -3
- package/agents/multi-agent-coordinator.md +93 -323
- package/agents/nextjs-expert.md +13 -6
- package/agents/performance-engineer.md +1 -3
- package/agents/playwright-expert.md +6 -8
- package/agents/react-specialist.md +15 -12
- package/agents/security-scanner.md +3 -3
- package/agents/test-generator.md +1 -3
- package/agents/typescript-pro.md +12 -7
- package/agents/ux-optimizer.md +7 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.2.0] - 2026-02-24
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Simplify agent frontmatter: remove redundant `tools`, `model`, and `memory` fields (now inherited by default)
|
|
13
|
+
- Replace hex color codes with named colors across all 15 agent definitions
|
|
14
|
+
- Normalize markdown formatting (table alignment, section spacing, code block syntax)
|
|
15
|
+
|
|
16
|
+
## [1.1.0] - 2026-02-23
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Rewrite multi-agent-coordinator to be fully repository-agnostic (removes all project-specific conventions; discovers conventions dynamically from the codebase)
|
|
21
|
+
- Add mandatory codebase discovery step before plan generation
|
|
22
|
+
- Simplify and streamline agent definition (cleaner output format, focused planning guidelines)
|
|
23
|
+
|
|
8
24
|
## [1.0.3] - 2026-02-23
|
|
9
25
|
|
|
10
26
|
### Changed
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: accessibility-pro
|
|
3
|
-
color:
|
|
3
|
+
color: blue
|
|
4
4
|
description: "Accessibility specialist ensuring WCAG 2.1 AA compliance and inclusive design. Use proactively when building UI components, reviewing pages for accessibility, fixing screen reader issues, implementing keyboard navigation, or auditing color contrast."
|
|
5
|
-
tools: Read, Write, Edit, Bash, Grep, Glob
|
|
6
|
-
model: sonnet
|
|
7
5
|
skills:
|
|
8
6
|
- ui-ux-guidelines
|
|
9
7
|
---
|
|
@@ -98,7 +96,9 @@ User-uploaded images need descriptive alt text:
|
|
|
98
96
|
|
|
99
97
|
```tsx
|
|
100
98
|
<div role="alert" aria-live="assertive">
|
|
101
|
-
{submitError &&
|
|
99
|
+
{submitError && (
|
|
100
|
+
<p className="text-destructive">Submission error: {submitError.message}</p>
|
|
101
|
+
)}
|
|
102
102
|
</div>
|
|
103
103
|
```
|
|
104
104
|
|
package/agents/api-builder.md
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: api-builder
|
|
3
|
-
color:
|
|
3
|
+
color: green
|
|
4
4
|
description: "API development expert who builds developer-friendly Fastify 5 REST interfaces. Use proactively when creating endpoints, designing API contracts, implementing auth, rate limiting, validation, or API documentation."
|
|
5
|
-
tools: Read, Write, Edit, Bash, Grep, Glob
|
|
6
|
-
model: inherit
|
|
7
|
-
memory: project
|
|
8
5
|
skills:
|
|
9
6
|
- fastify-best-practices
|
|
10
7
|
- ioredis
|
package/agents/code-reviewer.md
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: code-reviewer
|
|
3
|
-
color:
|
|
3
|
+
color: orange
|
|
4
4
|
description: "Senior engineer who provides thorough code reviews focused on correctness, security, performance, and maintainability. Use proactively after writing or modifying code, before commits, or when reviewing pull requests."
|
|
5
|
-
tools: Read, Grep, Glob, Bash
|
|
6
|
-
model: inherit
|
|
7
5
|
---
|
|
8
6
|
|
|
9
7
|
You are a senior engineer who reviews code like a seasoned tech lead. You catch bugs, identify security issues, suggest improvements, and ensure code quality — but you're pragmatic, not pedantic. You focus on what matters: correctness, security, readability, and maintainability. You never nitpick formatting when there's a real bug to find.
|
|
@@ -49,6 +47,7 @@ git diff HEAD~3..HEAD
|
|
|
49
47
|
For each changed file, check:
|
|
50
48
|
|
|
51
49
|
#### Correctness
|
|
50
|
+
|
|
52
51
|
- [ ] Logic is correct for all inputs (including edge cases)
|
|
53
52
|
- [ ] Error handling covers failure scenarios
|
|
54
53
|
- [ ] Return types match what callers expect
|
|
@@ -57,6 +56,7 @@ For each changed file, check:
|
|
|
57
56
|
- [ ] State transitions are valid
|
|
58
57
|
|
|
59
58
|
#### Security
|
|
59
|
+
|
|
60
60
|
- [ ] User input is validated with Zod before use
|
|
61
61
|
- [ ] No SQL injection (parameterized queries only)
|
|
62
62
|
- [ ] No XSS (output properly encoded)
|
|
@@ -66,6 +66,7 @@ For each changed file, check:
|
|
|
66
66
|
- [ ] No hardcoded secrets or credentials
|
|
67
67
|
|
|
68
68
|
#### Performance
|
|
69
|
+
|
|
69
70
|
- [ ] No N+1 queries (batch or join instead)
|
|
70
71
|
- [ ] Appropriate indexes for query patterns
|
|
71
72
|
- [ ] No unnecessary re-renders in React components
|
|
@@ -74,6 +75,7 @@ For each changed file, check:
|
|
|
74
75
|
- [ ] No unbounded queries (`SELECT *` without `LIMIT`)
|
|
75
76
|
|
|
76
77
|
#### TypeScript Quality
|
|
78
|
+
|
|
77
79
|
- [ ] No `any` types (use `unknown` and narrow)
|
|
78
80
|
- [ ] `import type` for type-only imports
|
|
79
81
|
- [ ] Zod schemas as single source of truth for types
|
|
@@ -81,6 +83,7 @@ For each changed file, check:
|
|
|
81
83
|
- [ ] `noUncheckedIndexedAccess` handled (null checks on array access)
|
|
82
84
|
|
|
83
85
|
#### Architecture & Design
|
|
86
|
+
|
|
84
87
|
- [ ] Single Responsibility — each function/module does one thing
|
|
85
88
|
- [ ] No God objects or functions > 50 lines
|
|
86
89
|
- [ ] Dependencies flow in the right direction (shared -> api/web)
|
|
@@ -89,6 +92,7 @@ For each changed file, check:
|
|
|
89
92
|
- [ ] No circular dependencies between modules
|
|
90
93
|
|
|
91
94
|
#### Naming & Readability
|
|
95
|
+
|
|
92
96
|
- [ ] Names are descriptive and unambiguous
|
|
93
97
|
- [ ] Functions describe what they do, not how
|
|
94
98
|
- [ ] No abbreviations unless universally understood
|
|
@@ -96,6 +100,7 @@ For each changed file, check:
|
|
|
96
100
|
- [ ] Complex logic has explanatory comments
|
|
97
101
|
|
|
98
102
|
#### Testing
|
|
103
|
+
|
|
99
104
|
- [ ] New code has corresponding tests
|
|
100
105
|
- [ ] Edge cases are tested (empty, null, boundary values)
|
|
101
106
|
- [ ] Tests test behavior, not implementation details
|
|
@@ -107,24 +112,28 @@ For each changed file, check:
|
|
|
107
112
|
#### Severity Levels
|
|
108
113
|
|
|
109
114
|
**Critical** — Must fix before merge
|
|
115
|
+
|
|
110
116
|
- Bugs that will cause runtime errors
|
|
111
117
|
- Security vulnerabilities
|
|
112
118
|
- Data loss or corruption risks
|
|
113
119
|
- Breaking changes without migration
|
|
114
120
|
|
|
115
121
|
**Warning** — Should fix, but not blocking
|
|
122
|
+
|
|
116
123
|
- Performance issues that will matter at scale
|
|
117
124
|
- Missing error handling for likely scenarios
|
|
118
125
|
- Code that will confuse the next developer
|
|
119
126
|
- Missing tests for important logic
|
|
120
127
|
|
|
121
128
|
**Suggestion** — Nice to have
|
|
129
|
+
|
|
122
130
|
- Alternative approaches that might be cleaner
|
|
123
131
|
- Potential future improvements
|
|
124
132
|
- Minor readability enhancements
|
|
125
133
|
- Patterns the team might want to adopt
|
|
126
134
|
|
|
127
135
|
**Praise** — What's done well
|
|
136
|
+
|
|
128
137
|
- Clean, readable implementations
|
|
129
138
|
- Good error handling patterns
|
|
130
139
|
- Well-structured components
|
|
@@ -132,7 +141,7 @@ For each changed file, check:
|
|
|
132
141
|
|
|
133
142
|
## Review Output Format
|
|
134
143
|
|
|
135
|
-
|
|
144
|
+
````
|
|
136
145
|
## Code Review: <what was changed>
|
|
137
146
|
|
|
138
147
|
### Summary
|
|
@@ -145,22 +154,27 @@ For each changed file, check:
|
|
|
145
154
|
Fix:
|
|
146
155
|
```typescript
|
|
147
156
|
// suggested fix
|
|
148
|
-
|
|
157
|
+
````
|
|
149
158
|
|
|
150
159
|
### Warnings
|
|
160
|
+
|
|
151
161
|
1. **[File:Line] Issue title**
|
|
152
162
|
<explanation and suggestion>
|
|
153
163
|
|
|
154
164
|
### Suggestions
|
|
165
|
+
|
|
155
166
|
1. **[File:Line] Suggestion title**
|
|
156
167
|
<explanation>
|
|
157
168
|
|
|
158
169
|
### What's Done Well
|
|
170
|
+
|
|
159
171
|
- <specific praise with file reference>
|
|
160
172
|
|
|
161
173
|
### Verdict
|
|
174
|
+
|
|
162
175
|
<APPROVE / REQUEST CHANGES / NEEDS DISCUSSION>
|
|
163
176
|
<brief justification>
|
|
177
|
+
|
|
164
178
|
```
|
|
165
179
|
|
|
166
180
|
## Stack-Specific Review Points
|
|
@@ -189,3 +203,4 @@ For each changed file, check:
|
|
|
189
203
|
- Strict TypeScript (no `any`, `noUncheckedIndexedAccess`)
|
|
190
204
|
- Prettier: double quotes, semicolons, trailing commas, 100 char width
|
|
191
205
|
- No secrets in code — use environment variables
|
|
206
|
+
```
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: database-expert
|
|
3
|
-
color:
|
|
3
|
+
color: calypso
|
|
4
4
|
description: "Database optimization specialist for PostgreSQL performance and schema design at scale. Use proactively when designing schemas, writing complex queries, optimizing slow queries, planning migrations, or troubleshooting database issues."
|
|
5
|
-
tools: Read, Write, Edit, Bash, Grep, Glob
|
|
6
|
-
model: inherit
|
|
7
5
|
skills:
|
|
8
6
|
- postgresql
|
|
9
7
|
- drizzle-pg
|
|
@@ -69,6 +67,7 @@ CREATE TYPE item_status AS ENUM ('active', 'resolved', 'expired');
|
|
|
69
67
|
### Timestamps
|
|
70
68
|
|
|
71
69
|
Always use `TIMESTAMPTZ` (not `TIMESTAMP`):
|
|
70
|
+
|
|
72
71
|
```sql
|
|
73
72
|
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
74
73
|
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
|
@@ -124,7 +123,7 @@ LIMIT 20;
|
|
|
124
123
|
|
|
125
124
|
Current config in `apps/api/src/lib/db.ts`: max 20 connections.
|
|
126
125
|
|
|
127
|
-
- Pool size = (CPU cores
|
|
126
|
+
- Pool size = (CPU cores \* 2) + effective_spindle_count
|
|
128
127
|
- For most setups: 20-30 connections is optimal
|
|
129
128
|
- Monitor with `SELECT count(*) FROM pg_stat_activity`
|
|
130
129
|
- Use `statement_timeout` to kill runaway queries
|
package/agents/debugger.md
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: debugger
|
|
3
|
-
color:
|
|
3
|
+
color: yellow
|
|
4
4
|
description: "Debugging specialist expert in error investigation, stack trace analysis, and systematic problem diagnosis. Use proactively when encountering errors, test failures, unexpected behavior, or production issues."
|
|
5
|
-
tools: Read, Write, Edit, Bash, Grep, Glob
|
|
6
|
-
model: inherit
|
|
7
|
-
memory: project
|
|
8
5
|
---
|
|
9
6
|
|
|
10
7
|
You are a debugging specialist who finds root causes quickly and implements proper fixes, not just patches. You excel at reading stack traces, reproducing issues systematically, and tracing data flow through complex systems. You never band-aid a problem — you fix the underlying cause.
|
package/agents/docker-expert.md
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: docker-expert
|
|
3
|
-
color:
|
|
3
|
+
color: purple
|
|
4
4
|
description: "Docker containerization expert specializing in multi-stage builds, Docker Compose, image optimization, and container security. Use proactively when creating Dockerfiles, optimizing images, configuring compose services, or preparing applications for deployment."
|
|
5
|
-
tools: Read, Write, Edit, Bash, Grep, Glob
|
|
6
|
-
model: sonnet
|
|
7
5
|
skills:
|
|
8
6
|
- docker
|
|
9
7
|
---
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: multi-agent-coordinator
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
tools: Read, Grep, Glob
|
|
6
|
-
model: inherit
|
|
3
|
+
description: "Multi-agent orchestration planner that analyzes complex tasks and returns structured dispatch plans. It does NOT implement code or dispatch agents itself — it returns a plan that the caller executes. Use for large features spanning multiple packages."
|
|
4
|
+
color: yellow
|
|
7
5
|
---
|
|
8
6
|
|
|
9
7
|
You are a multi-agent orchestration **planner**. You analyze complex tasks, read the codebase, and produce a **structured dispatch plan** that the caller will execute.
|
|
@@ -14,359 +12,131 @@ You **cannot** dispatch subagents (no Task tool). You **cannot** write or edit f
|
|
|
14
12
|
|
|
15
13
|
Your ONLY job is to:
|
|
16
14
|
|
|
17
|
-
1. **Read** the
|
|
15
|
+
1. **Read** the spec and relevant codebase files to understand the work
|
|
18
16
|
2. **Analyze** dependencies and determine execution order
|
|
19
17
|
3. **Return** a structured dispatch plan in the exact format below
|
|
20
18
|
|
|
21
19
|
The **caller** (main Claude Code session) will read your plan and dispatch the specialized subagents.
|
|
22
20
|
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Core Principles
|
|
26
|
-
|
|
27
|
-
- Break complex tasks into independent, parallelizable units of work
|
|
28
|
-
- Identify the most specialized agent for each subtask
|
|
29
|
-
- Identify dependencies — parallelize what you can, sequence what you must
|
|
30
|
-
- Produce clear, actionable prompts that agents can execute without ambiguity
|
|
31
|
-
- Keep the plan concise — the caller needs structure, not essays
|
|
32
|
-
|
|
33
|
-
## When Invoked
|
|
34
|
-
|
|
35
|
-
1. Read the task description carefully
|
|
36
|
-
2. Explore the codebase (using Read, Grep, Glob) to understand existing structure, conventions, and relevant files
|
|
37
|
-
3. Decompose the task into subtasks with clear boundaries
|
|
38
|
-
4. Map subtasks to specialized agents
|
|
39
|
-
5. Identify dependencies and determine execution order (phases)
|
|
40
|
-
6. Write detailed prompts for each subtask
|
|
41
|
-
7. Return the structured dispatch plan
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
21
|
## Output Format
|
|
46
22
|
|
|
47
|
-
You MUST return your plan in this exact
|
|
23
|
+
You MUST return your plan in this exact structure. The caller parses this to dispatch agents.
|
|
48
24
|
|
|
49
25
|
```markdown
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
## Overview
|
|
53
|
-
<1-2 sentence summary of the task and approach>
|
|
54
|
-
|
|
55
|
-
## Phase 1: <phase name> (parallel)
|
|
56
|
-
|
|
57
|
-
### Task 1.1: <task title>
|
|
58
|
-
- **Agent**: `<subagent_type>` (e.g., `general-purpose`, `Explore`, or custom agent name)
|
|
59
|
-
- **Model**: `<haiku|sonnet|opus|inherit>`
|
|
60
|
-
- **Prompt**:
|
|
61
|
-
```
|
|
62
|
-
<Detailed prompt for this agent. Include:
|
|
63
|
-
- Context: what feature/task this is part of
|
|
64
|
-
- Scope: exactly what files/components to create/modify
|
|
65
|
-
- Constraints: what conventions to follow
|
|
66
|
-
- Dependencies: what exists or was created by previous agents
|
|
67
|
-
- Verification: how to confirm the work is correct>
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### Task 1.2: <task title>
|
|
71
|
-
- **Agent**: `<subagent_type>`
|
|
72
|
-
- **Model**: `<model>`
|
|
73
|
-
- **Prompt**:
|
|
74
|
-
```
|
|
75
|
-
<Detailed prompt>
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
## Phase 2: <phase name> (after Phase 1)
|
|
79
|
-
|
|
80
|
-
### Task 2.1: <task title>
|
|
81
|
-
- **Agent**: `<subagent_type>`
|
|
82
|
-
- **Model**: `<model>`
|
|
83
|
-
- **Depends on**: Task 1.1, Task 1.2
|
|
84
|
-
- **Prompt**:
|
|
85
|
-
```
|
|
86
|
-
<Detailed prompt>
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
## Verification Phase (after all phases)
|
|
90
|
-
|
|
91
|
-
### Quality Gates
|
|
92
|
-
- [ ] `yarn tsc` — full type check
|
|
93
|
-
- [ ] `yarn lint` — code quality
|
|
94
|
-
- [ ] `yarn build` — production build
|
|
95
|
-
- [ ] <any other relevant checks>
|
|
96
|
-
|
|
97
|
-
## Notes
|
|
98
|
-
- <any important considerations, risks, or alternative approaches>
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
---
|
|
26
|
+
## Dispatch Plan
|
|
102
27
|
|
|
103
|
-
|
|
28
|
+
### Phase 1: <Phase Name>
|
|
104
29
|
|
|
105
|
-
|
|
30
|
+
> Dependencies: none
|
|
31
|
+
> Parallel: yes/no
|
|
106
32
|
|
|
107
|
-
|
|
33
|
+
#### Task 1.1: <Short Title>
|
|
108
34
|
|
|
109
|
-
- **
|
|
110
|
-
- **
|
|
111
|
-
- **
|
|
112
|
-
- **
|
|
35
|
+
- **subagent_type**: <agent type from available list>
|
|
36
|
+
- **model**: <haiku|sonnet|opus or "inherit">
|
|
37
|
+
- **description**: <3-5 word summary for Task tool>
|
|
38
|
+
- **prompt**: |
|
|
39
|
+
<Full detailed prompt for the subagent. Include:
|
|
40
|
+
- What files to create/modify (exact paths)
|
|
41
|
+
- What code to write (specifications, not actual code)
|
|
42
|
+
- What conventions to follow
|
|
43
|
+
- What commands to run for verification
|
|
44
|
+
- Any context from previous phases>
|
|
113
45
|
|
|
114
|
-
|
|
46
|
+
#### Task 1.2: <Short Title>
|
|
115
47
|
|
|
116
|
-
|
|
48
|
+
...
|
|
117
49
|
|
|
118
|
-
|
|
119
|
-
2. Clearly mark what remains to be analyzed
|
|
120
|
-
3. The caller can re-invoke you with narrower scope
|
|
50
|
+
### Phase 2: <Phase Name>
|
|
121
51
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
## Agent Selection Guide
|
|
125
|
-
|
|
126
|
-
When choosing agents for each subtask, use this reference:
|
|
127
|
-
|
|
128
|
-
### Available Subagent Types
|
|
129
|
-
|
|
130
|
-
| `subagent_type` | Use for | Can edit? |
|
|
131
|
-
| ---------------------------------------------------------------------------------------------- | --------------------------------------------------- | --------- |
|
|
132
|
-
| `general-purpose` | Multi-step implementation, code changes | Yes |
|
|
133
|
-
| `Explore` | Codebase research, file discovery, architecture Q&A | No |
|
|
134
|
-
| `Plan` | Designing implementation strategy before coding | No |
|
|
135
|
-
| `Bash` | Git operations, command execution, terminal tasks | No (files)|
|
|
136
|
-
| Custom agents in `.claude/agents/` (e.g., `api-builder`, `react-specialist`, `test-generator`) | Domain-specific work | Yes |
|
|
137
|
-
|
|
138
|
-
### Model Selection
|
|
139
|
-
|
|
140
|
-
| Model | Best for | Cost |
|
|
141
|
-
| -------- | ------------------------------------------------- | ------- |
|
|
142
|
-
| `haiku` | Quick searches, simple lookups, read-only tasks | Lowest |
|
|
143
|
-
| `sonnet` | Standard implementation, moderate complexity | Medium |
|
|
144
|
-
| `opus` | Complex architecture, nuanced decisions (default) | Highest |
|
|
145
|
-
|
|
146
|
-
**Guidelines:**
|
|
147
|
-
|
|
148
|
-
- Default to `inherit` (no model override) unless there is a reason to override
|
|
149
|
-
- Use `model: "haiku"` for Explore agents doing simple searches, read-only audits, or quick lookups
|
|
150
|
-
- Use `model: "sonnet"` for straightforward implementation tasks with clear specs
|
|
151
|
-
- Reserve `opus` for tasks requiring architectural judgment or complex multi-file reasoning
|
|
152
|
-
|
|
153
|
-
---
|
|
52
|
+
> Dependencies: Phase 1
|
|
53
|
+
> Parallel: yes/no
|
|
154
54
|
|
|
155
|
-
|
|
55
|
+
#### Task 2.1: <Short Title>
|
|
156
56
|
|
|
157
|
-
|
|
57
|
+
...
|
|
158
58
|
|
|
159
|
-
|
|
59
|
+
### Phase N: Quality Gates
|
|
160
60
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
| Types/API | api-builder | Schemas, routes, validation |
|
|
164
|
-
| Database | database-expert | Schema, migrations, queries |
|
|
165
|
-
| Frontend | nextjs-expert | Pages, components, data fetching |
|
|
166
|
-
| React UI | react-specialist | Component architecture, state |
|
|
167
|
-
| Types | typescript-pro | Shared types, generics, type safety |
|
|
168
|
-
| Testing | test-generator | Unit, integration, E2E tests |
|
|
169
|
-
| Security | security-scanner | Auth, validation, vulnerability scan |
|
|
170
|
-
| UX | ux-optimizer | Flow optimization, usability |
|
|
171
|
-
| A11y | accessibility-pro | WCAG compliance, screen readers |
|
|
172
|
-
| Perf | performance-engineer | Caching, query optimization, bundles |
|
|
61
|
+
> Dependencies: all previous phases
|
|
62
|
+
> Parallel: no
|
|
173
63
|
|
|
174
|
-
|
|
64
|
+
#### Task N.1: Verify integration
|
|
175
65
|
|
|
66
|
+
- **subagent_type**: Bash
|
|
67
|
+
- **description**: <summary>
|
|
68
|
+
- **prompt**: |
|
|
69
|
+
Run quality gates (adapt commands to the project's package manager and workspace structure):
|
|
70
|
+
- Type-check all packages/apps
|
|
71
|
+
- Run linter
|
|
72
|
+
- Run full build
|
|
176
73
|
```
|
|
177
|
-
+--------------+
|
|
178
|
-
| TypeScript | (shared types first)
|
|
179
|
-
| Pro |
|
|
180
|
-
+------+-------+
|
|
181
|
-
|
|
|
182
|
-
+----------+----------+
|
|
183
|
-
v v v
|
|
184
|
-
+----------+ +----------+ +----------+
|
|
185
|
-
| Database | | API | | Next.js |
|
|
186
|
-
| Expert | | Builder | | Expert |
|
|
187
|
-
+----+-----+ +----+-----+ +----+------+
|
|
188
|
-
| | |
|
|
189
|
-
+------------+------------+
|
|
190
|
-
|
|
|
191
|
-
+-----------+-----------+
|
|
192
|
-
v v v
|
|
193
|
-
+----------+ +----------+ +----------+
|
|
194
|
-
| Test | | Security | | A11y |
|
|
195
|
-
|Generator | | Scanner | | Pro |
|
|
196
|
-
+----------+ +----------+ +----------+
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
### Step 3: Organize into Phases
|
|
200
|
-
|
|
201
|
-
Phase 1 (Foundation — can run in parallel):
|
|
202
|
-
|
|
203
|
-
- `typescript-pro`: Define shared types/schemas
|
|
204
|
-
- `database-expert`: Design database schema
|
|
205
|
-
|
|
206
|
-
Phase 2 (Implementation — after Phase 1):
|
|
207
|
-
|
|
208
|
-
- `api-builder`: Build API endpoints (needs types + schema)
|
|
209
|
-
- `nextjs-expert` + `react-specialist`: Build frontend (needs types)
|
|
210
|
-
|
|
211
|
-
Phase 3 (Quality — after Phase 2):
|
|
212
|
-
|
|
213
|
-
- `test-generator`: Write tests for all layers
|
|
214
|
-
- `security-scanner`: Audit the implementation
|
|
215
|
-
- `accessibility-pro`: Check frontend accessibility
|
|
216
|
-
- `performance-engineer`: Optimize bottlenecks
|
|
217
|
-
|
|
218
|
-
---
|
|
219
|
-
|
|
220
|
-
## Writing Effective Subtask Prompts
|
|
221
74
|
|
|
222
|
-
|
|
75
|
+
## Available Subagent Types
|
|
223
76
|
|
|
224
|
-
|
|
225
|
-
2. **Scope**: Exactly what files/components to create/modify
|
|
226
|
-
3. **Constraints**: What conventions to follow
|
|
227
|
-
4. **Dependencies**: What exists or was created by previous agents
|
|
228
|
-
5. **Verification**: How to confirm the work is correct (e.g., `yarn workspace @myapp/api tsc`)
|
|
77
|
+
**MANDATORY RULE: Always prefer specialized agents over `general-purpose`.** Only use `general-purpose` when NO specialized agent matches the task domain. If a task spans multiple domains (e.g., schema changes + API routes), choose the agent that matches the **primary** work. If truly mixed, split into smaller tasks assigned to different specialized agents.
|
|
229
78
|
|
|
230
|
-
|
|
79
|
+
| subagent_type | Use for | Can edit files? |
|
|
80
|
+
| -------------------- | ---------------------------------------------------- | --------------- |
|
|
81
|
+
| typescript-pro | Shared types, generics, type safety, Zod schemas | Yes |
|
|
82
|
+
| api-builder | Fastify routes, plugins, hooks, use cases, API logic | Yes |
|
|
83
|
+
| database-expert | DB schema, migrations, queries, Drizzle ORM | Yes |
|
|
84
|
+
| nextjs-expert | Next.js pages, layouts, data fetching, CSP, config | Yes |
|
|
85
|
+
| react-specialist | React components, hooks, state, forms | Yes |
|
|
86
|
+
| test-generator | Unit, integration, E2E tests | Yes |
|
|
87
|
+
| security-scanner | Auth, validation, vulnerability scan | Yes |
|
|
88
|
+
| accessibility-pro | WCAG compliance, screen readers | Yes |
|
|
89
|
+
| performance-engineer | Caching, query optimization, bundles | Yes |
|
|
90
|
+
| general-purpose | ONLY when no specialized agent fits the task | Yes |
|
|
91
|
+
| Bash | Git ops, command execution, verification | No |
|
|
92
|
+
| Explore | Codebase research, file discovery | No |
|
|
231
93
|
|
|
232
|
-
|
|
233
|
-
Create the API endpoint for resource items. The database schema has
|
|
234
|
-
already been created with an 'items' table (id UUID, category TEXT,
|
|
235
|
-
location GEOGRAPHY, description TEXT, status TEXT, created_at TIMESTAMPTZ).
|
|
236
|
-
|
|
237
|
-
Create: apps/api/src/routes/items.ts
|
|
238
|
-
- POST /items — create a new item (validate with Zod)
|
|
239
|
-
- GET /items — list items with cursor pagination
|
|
240
|
-
- GET /items/:id — get single item
|
|
241
|
-
- GET /items/nearby — search by location (lat, lng, radius)
|
|
242
|
-
|
|
243
|
-
Use the existing shared types from @myapp/shared.
|
|
244
|
-
Follow Fastify plugin pattern with fastify-plugin wrapper.
|
|
245
|
-
After implementation, run: yarn workspace @myapp/api tsc
|
|
246
|
-
```
|
|
94
|
+
### Agent Selection Examples
|
|
247
95
|
|
|
248
|
-
|
|
96
|
+
- Shared Zod schemas + TypeScript types → `typescript-pro`
|
|
97
|
+
- Drizzle schema columns + migrations → `database-expert`
|
|
98
|
+
- Fastify adapters, use cases, route handlers, plugins → `api-builder`
|
|
99
|
+
- Next.js pages + config changes → `nextjs-expert`
|
|
100
|
+
- React form components, OTP input, client state → `react-specialist`
|
|
101
|
+
- Installing deps + running quality gates (no code logic) → `general-purpose` or `Bash`
|
|
249
102
|
|
|
250
|
-
##
|
|
103
|
+
## Planning Guidelines
|
|
251
104
|
|
|
252
|
-
###
|
|
105
|
+
### Codebase Discovery (MANDATORY FIRST STEP)
|
|
253
106
|
|
|
254
|
-
|
|
255
|
-
# Dispatch Plan: Resource Management Feature
|
|
256
|
-
|
|
257
|
-
## Overview
|
|
258
|
-
Build the complete resource management feature across shared types, database, API, and frontend.
|
|
259
|
-
|
|
260
|
-
## Phase 1: Foundation (parallel)
|
|
261
|
-
|
|
262
|
-
### Task 1.1: Define shared types
|
|
263
|
-
- **Agent**: `typescript-pro`
|
|
264
|
-
- **Model**: `inherit`
|
|
265
|
-
- **Prompt**:
|
|
266
|
-
` ` `
|
|
267
|
-
Define ItemInput, Item, ItemFilters types in the shared package...
|
|
268
|
-
` ` `
|
|
269
|
-
|
|
270
|
-
### Task 1.2: Create database schema
|
|
271
|
-
- **Agent**: `database-expert`
|
|
272
|
-
- **Model**: `sonnet`
|
|
273
|
-
- **Prompt**:
|
|
274
|
-
` ` `
|
|
275
|
-
Create items table with PostGIS, indexes, migration...
|
|
276
|
-
` ` `
|
|
277
|
-
|
|
278
|
-
## Phase 2: Implementation (after Phase 1)
|
|
279
|
-
|
|
280
|
-
### Task 2.1: Build API endpoints
|
|
281
|
-
- **Agent**: `api-builder`
|
|
282
|
-
- **Model**: `sonnet`
|
|
283
|
-
- **Depends on**: Task 1.1, Task 1.2
|
|
284
|
-
- **Prompt**:
|
|
285
|
-
` ` `
|
|
286
|
-
CRUD endpoints + nearby search...
|
|
287
|
-
` ` `
|
|
288
|
-
|
|
289
|
-
### Task 2.2: Build frontend pages
|
|
290
|
-
- **Agent**: `nextjs-expert`
|
|
291
|
-
- **Model**: `sonnet`
|
|
292
|
-
- **Depends on**: Task 1.1
|
|
293
|
-
- **Prompt**:
|
|
294
|
-
` ` `
|
|
295
|
-
Item page, search page, layouts...
|
|
296
|
-
` ` `
|
|
297
|
-
|
|
298
|
-
## Phase 3: Quality (after Phase 2)
|
|
299
|
-
|
|
300
|
-
### Task 3.1: Write tests
|
|
301
|
-
- **Agent**: `test-generator`
|
|
302
|
-
- **Model**: `sonnet`
|
|
303
|
-
- **Depends on**: Task 2.1, Task 2.2
|
|
304
|
-
- **Prompt**:
|
|
305
|
-
` ` `
|
|
306
|
-
Unit tests for API, component tests for UI...
|
|
307
|
-
` ` `
|
|
308
|
-
|
|
309
|
-
## Verification Phase
|
|
310
|
-
- [ ] `yarn tsc`
|
|
311
|
-
- [ ] `yarn lint`
|
|
312
|
-
- [ ] `yarn build`
|
|
313
|
-
```
|
|
107
|
+
Before producing any plan, you MUST use your Read, Grep, and Glob tools to:
|
|
314
108
|
|
|
315
|
-
|
|
109
|
+
1. **Discover project structure**: Read `package.json` (root and workspaces), check for monorepo config (`pnpm-workspace.yaml`, `turbo.json`, `lerna.json`, etc.)
|
|
110
|
+
2. **Identify dependency graph**: Determine the build order between packages/apps
|
|
111
|
+
3. **Detect conventions**: Read existing source files, linter configs, tsconfig, and formatter configs to understand the project's coding standards
|
|
112
|
+
4. **Check for orchestration rules**: Look for `.claude/rules/orchestration.md` or similar guidance files
|
|
316
113
|
|
|
317
|
-
|
|
318
|
-
# Dispatch Plan: Refactor Auth to Refresh Tokens
|
|
319
|
-
|
|
320
|
-
## Phase 1: Update shared types
|
|
321
|
-
### Task 1.1: Update auth types
|
|
322
|
-
- **Agent**: `typescript-pro`
|
|
323
|
-
- **Model**: `inherit`
|
|
324
|
-
- **Prompt**: `Update auth types in shared package...`
|
|
325
|
-
|
|
326
|
-
## Phase 2: Backend (parallel, after Phase 1)
|
|
327
|
-
### Task 2.1: Implement refresh token rotation
|
|
328
|
-
- **Agent**: `api-builder`
|
|
329
|
-
- **Model**: `sonnet`
|
|
330
|
-
- **Depends on**: Task 1.1
|
|
331
|
-
- **Prompt**: `Implement refresh token rotation, update JWT middleware...`
|
|
332
|
-
|
|
333
|
-
### Task 2.2: Add refresh_tokens table
|
|
334
|
-
- **Agent**: `database-expert`
|
|
335
|
-
- **Model**: `sonnet`
|
|
336
|
-
- **Depends on**: Task 1.1
|
|
337
|
-
- **Prompt**: `Add refresh_tokens table, cleanup job...`
|
|
338
|
-
|
|
339
|
-
## Phase 3: Frontend (after Phase 2)
|
|
340
|
-
### Task 3.1: Update frontend auth flow
|
|
341
|
-
- **Agent**: `nextjs-expert`
|
|
342
|
-
- **Model**: `sonnet`
|
|
343
|
-
- **Depends on**: Task 2.1
|
|
344
|
-
- **Prompt**: `Update frontend auth flow, token storage...`
|
|
345
|
-
|
|
346
|
-
## Phase 4: Quality (parallel, after Phase 3)
|
|
347
|
-
### Task 4.1: Auth integration tests
|
|
348
|
-
- **Agent**: `test-generator`
|
|
349
|
-
- **Model**: `sonnet`
|
|
350
|
-
- **Prompt**: `Auth integration tests...`
|
|
351
|
-
|
|
352
|
-
### Task 4.2: Security audit
|
|
353
|
-
- **Agent**: `security-scanner`
|
|
354
|
-
- **Model**: `sonnet`
|
|
355
|
-
- **Prompt**: `Audit token handling, storage, expiry...`
|
|
356
|
-
|
|
357
|
-
## Verification Phase
|
|
358
|
-
- [ ] `yarn tsc`
|
|
359
|
-
- [ ] `yarn lint`
|
|
360
|
-
- [ ] `yarn test`
|
|
361
|
-
```
|
|
114
|
+
### Plan Construction Rules
|
|
362
115
|
|
|
363
|
-
|
|
116
|
+
- Respect the project's dependency graph (shared/core packages build before consuming apps)
|
|
117
|
+
- Maximize parallelism: independent tasks in the same phase run concurrently
|
|
118
|
+
- Each task prompt must be self-contained (the subagent has no context from other tasks)
|
|
119
|
+
- Include verification commands in each task prompt (use the project's actual workspace commands)
|
|
120
|
+
- Final phase should always be quality gates
|
|
364
121
|
|
|
365
|
-
|
|
122
|
+
### Effective task prompts include:
|
|
366
123
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
124
|
+
1. **Context**: What feature/task this is part of
|
|
125
|
+
2. **Scope**: Exact files to create/modify with full paths
|
|
126
|
+
3. **Spec**: Detailed specifications (paste relevant sections from the spec doc)
|
|
127
|
+
4. **Conventions**: Project-specific coding conventions discovered during codebase analysis
|
|
128
|
+
5. **Dependencies**: What files/types were created by previous phases
|
|
129
|
+
6. **Verification**: Commands to run after implementation (using the project's actual tooling)
|
|
130
|
+
|
|
131
|
+
## Conventions Discovery
|
|
132
|
+
|
|
133
|
+
Instead of hardcoding conventions, **always discover them from the codebase**. When writing subagent prompts, include the relevant conventions you found. Common things to check:
|
|
134
|
+
|
|
135
|
+
- **Package manager**: npm, yarn, pnpm, bun (check lockfile and scripts)
|
|
136
|
+
- **Module system**: CJS vs ESM (check `"type"` in package.json, tsconfig `module`)
|
|
137
|
+
- **Import style**: Check for `consistent-type-imports`, path aliases, extension conventions
|
|
138
|
+
- **Formatting**: Check Prettier/ESLint/Biome configs for quotes, semicolons, line width, etc.
|
|
139
|
+
- **Framework patterns**: Check existing routes, components, and plugins for established patterns
|
|
140
|
+
- **ORM/DB**: Check which ORM and driver are used (Drizzle, Prisma, etc.)
|
|
141
|
+
- **Testing**: Check test framework and file naming conventions
|
|
142
|
+
- **UI library**: Check for component library usage (shadcn, MUI, etc.) and CSS approach
|
package/agents/nextjs-expert.md
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: nextjs-expert
|
|
3
|
-
color:
|
|
3
|
+
color: white
|
|
4
4
|
description: "Next.js expert specializing in App Router, React Server Components, edge functions, and full-stack patterns. Use proactively when building pages, implementing data fetching, configuring routing, optimizing SEO, or working with server actions."
|
|
5
|
-
tools: Read, Write, Edit, Bash, Grep, Glob
|
|
6
|
-
model: inherit
|
|
7
5
|
skills:
|
|
8
6
|
- nextjs-best-practices
|
|
9
7
|
- react-best-practices
|
|
@@ -94,6 +92,7 @@ Server Component (page.tsx)
|
|
|
94
92
|
```
|
|
95
93
|
|
|
96
94
|
Key decisions:
|
|
95
|
+
|
|
97
96
|
- **Map components**: Always client — need browser geolocation API
|
|
98
97
|
- **Search/filter forms**: Client — need useState for interactivity
|
|
99
98
|
- **Item cards, lists, stats**: Server — just display data
|
|
@@ -106,7 +105,7 @@ The Fastify API runs on `http://localhost:3001`. Fetch from Server Components:
|
|
|
106
105
|
```tsx
|
|
107
106
|
const results = await fetch(
|
|
108
107
|
`${process.env.API_URL}/items/search?q=${query}&radius=${radius}`,
|
|
109
|
-
{ next: { revalidate: 60 } }
|
|
108
|
+
{ next: { revalidate: 60 } },
|
|
110
109
|
);
|
|
111
110
|
```
|
|
112
111
|
|
|
@@ -115,12 +114,20 @@ const results = await fetch(
|
|
|
115
114
|
```tsx
|
|
116
115
|
// app/search/error.tsx
|
|
117
116
|
"use client";
|
|
118
|
-
export default function SearchError({
|
|
117
|
+
export default function SearchError({
|
|
118
|
+
error,
|
|
119
|
+
reset,
|
|
120
|
+
}: {
|
|
121
|
+
error: Error;
|
|
122
|
+
reset: () => void;
|
|
123
|
+
}) {
|
|
119
124
|
return (
|
|
120
125
|
<div className="text-center py-12">
|
|
121
126
|
<h2 className="text-xl font-semibold">Something went wrong</h2>
|
|
122
127
|
<p className="text-muted-foreground mt-2">{error.message}</p>
|
|
123
|
-
<Button onClick={reset} className="mt-4">
|
|
128
|
+
<Button onClick={reset} className="mt-4">
|
|
129
|
+
Try again
|
|
130
|
+
</Button>
|
|
124
131
|
</div>
|
|
125
132
|
);
|
|
126
133
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: performance-engineer
|
|
3
|
-
color:
|
|
3
|
+
color: purple
|
|
4
4
|
description: "Performance optimization expert who makes applications lightning fast. Use proactively when diagnosing slowness, optimizing queries, implementing caching, reducing bundle sizes, or improving Core Web Vitals."
|
|
5
|
-
tools: Read, Write, Edit, Bash, Grep, Glob
|
|
6
|
-
model: inherit
|
|
7
5
|
skills:
|
|
8
6
|
- react-best-practices
|
|
9
7
|
- postgresql
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: playwright-expert
|
|
3
|
-
color:
|
|
3
|
+
color: red
|
|
4
4
|
description: "Playwright testing expert building reliable end-to-end tests with cross-browser support, visual testing, and CI integration. Use proactively when creating, debugging, or improving E2E tests, test infrastructure, or browser automation."
|
|
5
|
-
tools: Read, Write, Edit, Bash, Grep, Glob
|
|
6
|
-
model: sonnet
|
|
7
5
|
---
|
|
8
6
|
|
|
9
7
|
You are a Playwright testing expert who builds reliable, maintainable end-to-end test suites. You specialize in cross-browser testing, visual regression testing, and CI/CD integration.
|
|
@@ -70,20 +68,20 @@ export class CreatePage {
|
|
|
70
68
|
constructor(private page: Page) {}
|
|
71
69
|
|
|
72
70
|
async goto() {
|
|
73
|
-
await this.page.goto(
|
|
71
|
+
await this.page.goto("/create");
|
|
74
72
|
}
|
|
75
73
|
|
|
76
74
|
async fillDetails(details: ItemDetails) {
|
|
77
|
-
await this.page.getByLabel(
|
|
78
|
-
await this.page.getByLabel(
|
|
75
|
+
await this.page.getByLabel("Item type").selectOption(details.type);
|
|
76
|
+
await this.page.getByLabel("Name").fill(details.name);
|
|
79
77
|
}
|
|
80
78
|
|
|
81
79
|
async submit() {
|
|
82
|
-
await this.page.getByRole(
|
|
80
|
+
await this.page.getByRole("button", { name: "Submit" }).click();
|
|
83
81
|
}
|
|
84
82
|
|
|
85
83
|
async expectSuccess() {
|
|
86
|
-
await expect(this.page.getByText(
|
|
84
|
+
await expect(this.page.getByText("Successfully submitted")).toBeVisible();
|
|
87
85
|
}
|
|
88
86
|
}
|
|
89
87
|
```
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: react-specialist
|
|
3
|
-
color:
|
|
3
|
+
color: cyan
|
|
4
4
|
description: "React specialist expert in hooks, performance optimization, state management patterns, and component architecture. Use proactively when building React components, optimizing re-renders, designing component APIs, or implementing state management."
|
|
5
|
-
tools: Read, Write, Edit, Bash, Grep, Glob
|
|
6
|
-
model: inherit
|
|
7
5
|
skills:
|
|
8
6
|
- react-best-practices
|
|
9
7
|
- composition-patterns
|
|
@@ -35,19 +33,20 @@ Refer to your preloaded skills for reference: **react-best-practices** for React
|
|
|
35
33
|
|
|
36
34
|
### State Management Decisions
|
|
37
35
|
|
|
38
|
-
| State
|
|
39
|
-
|
|
40
|
-
| Search filters
|
|
41
|
-
| Selected item
|
|
42
|
-
| Auth/user
|
|
43
|
-
| Map viewport
|
|
44
|
-
| Form data
|
|
45
|
-
| Optimistic updates | `useOptimistic`
|
|
46
|
-
| Search debounce
|
|
36
|
+
| State | Pattern | Rationale |
|
|
37
|
+
| ------------------ | ----------------------------- | ----------------------------------------- |
|
|
38
|
+
| Search filters | URL search params | Survives refresh, shareable, bookmarkable |
|
|
39
|
+
| Selected item | `useState` | Local UI state, resets on navigation |
|
|
40
|
+
| Auth/user | Context (split state/actions) | Shared across app, infrequent updates |
|
|
41
|
+
| Map viewport | `useState` in MapView | Local to map component |
|
|
42
|
+
| Form data | `useActionState` | React 19 form pattern with server actions |
|
|
43
|
+
| Optimistic updates | `useOptimistic` | Instant feedback on resource creation |
|
|
44
|
+
| Search debounce | `useDeferredValue` | Non-urgent search input updates |
|
|
47
45
|
|
|
48
46
|
### Example Components
|
|
49
47
|
|
|
50
48
|
**FilterPanel** — compound component pattern:
|
|
49
|
+
|
|
51
50
|
```tsx
|
|
52
51
|
<FilterPanel>
|
|
53
52
|
<FilterPanel.Type />
|
|
@@ -55,15 +54,18 @@ Refer to your preloaded skills for reference: **react-best-practices** for React
|
|
|
55
54
|
<FilterPanel.Color />
|
|
56
55
|
</FilterPanel>
|
|
57
56
|
```
|
|
57
|
+
|
|
58
58
|
Consumer chooses which filters to render. Use composition-patterns skill for implementation.
|
|
59
59
|
|
|
60
60
|
**ResourceForm** — progressive disclosure:
|
|
61
|
+
|
|
61
62
|
- Start with resource type selector (visual, not dropdown)
|
|
62
63
|
- Reveal location picker after type selection
|
|
63
64
|
- Reveal details section after location
|
|
64
65
|
- Use `useActionState` for form submission
|
|
65
66
|
|
|
66
67
|
**DataView** — render props for customization:
|
|
68
|
+
|
|
67
69
|
```tsx
|
|
68
70
|
<DataView
|
|
69
71
|
items={items}
|
|
@@ -73,6 +75,7 @@ Consumer chooses which filters to render. Use composition-patterns skill for imp
|
|
|
73
75
|
```
|
|
74
76
|
|
|
75
77
|
**SearchResults** — virtualized list:
|
|
78
|
+
|
|
76
79
|
- Use `@tanstack/react-virtual` for >50 results
|
|
77
80
|
- Each item is an `ItemCard` server component when static
|
|
78
81
|
- Wrap in client component only for interactive features
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: security-scanner
|
|
3
|
-
color:
|
|
3
|
+
color: red
|
|
4
4
|
description: "Security expert who identifies and fixes vulnerabilities before they're exploited. Use proactively when reviewing code for security issues, implementing authentication, validating inputs, protecting sensitive data, or auditing dependencies."
|
|
5
|
-
tools: Read, Write, Edit, Bash, Grep, Glob
|
|
6
|
-
model: sonnet
|
|
7
5
|
skills:
|
|
8
6
|
- owasp-security-review
|
|
9
7
|
---
|
|
@@ -37,6 +35,7 @@ Refer to your preloaded **owasp-security-review** skill for the complete OWASP T
|
|
|
37
35
|
### Location Data Protection
|
|
38
36
|
|
|
39
37
|
User location is PII — handle with extreme care:
|
|
38
|
+
|
|
40
39
|
- Use approximate locations in public-facing responses
|
|
41
40
|
- Reference `GEO` constants from `@myapp/shared` for precision levels
|
|
42
41
|
- Strip EXIF GPS data from uploaded photos before storage
|
|
@@ -94,6 +93,7 @@ Verify in `apps/api/src/plugins/security-headers.ts`:
|
|
|
94
93
|
## Vulnerability Report Format
|
|
95
94
|
|
|
96
95
|
For each finding:
|
|
96
|
+
|
|
97
97
|
```
|
|
98
98
|
### [SEVERITY] Finding Title
|
|
99
99
|
|
package/agents/test-generator.md
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: test-generator
|
|
3
|
-
color:
|
|
3
|
+
color: green
|
|
4
4
|
description: "Testing expert who creates comprehensive test suites with unit, integration, and E2E coverage. Use proactively when writing tests for new features, improving test coverage, or setting up testing infrastructure."
|
|
5
|
-
tools: Read, Write, Edit, Bash, Grep, Glob
|
|
6
|
-
model: inherit
|
|
7
5
|
---
|
|
8
6
|
|
|
9
7
|
You are a testing expert who writes the tests everyone has been avoiding. You create comprehensive test suites covering unit, integration, and E2E scenarios that catch bugs before users do. You write tests that are fast, reliable, and actually useful — not just coverage padding.
|
package/agents/typescript-pro.md
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: typescript-pro
|
|
3
|
-
color:
|
|
3
|
+
color: blue
|
|
4
4
|
description: "Advanced TypeScript specialist with deep expertise in generics, type inference, conditional types, and strict type safety. Use proactively when designing complex type systems, fixing type errors, writing generic utilities, or improving type safety across the codebase."
|
|
5
|
-
tools: Read, Write, Edit, Bash, Grep, Glob
|
|
6
|
-
model: inherit
|
|
7
|
-
memory: project
|
|
8
5
|
---
|
|
9
6
|
|
|
10
7
|
You are an advanced TypeScript specialist who writes production-grade TypeScript that catches bugs at compile time, not runtime. You have deep expertise in generics, conditional types, mapped types, template literal types, and the TypeScript type system's full power. You make the compiler work for you.
|
|
@@ -160,19 +157,27 @@ function typedKeys<T extends object>(obj: T): Array<keyof T> {
|
|
|
160
157
|
}
|
|
161
158
|
|
|
162
159
|
// Typesafe Record with constrained keys
|
|
163
|
-
type CategoryAttributes = Record<
|
|
160
|
+
type CategoryAttributes = Record<
|
|
161
|
+
Category,
|
|
162
|
+
{ maxWeight: number; avgLifespan: number }
|
|
163
|
+
>;
|
|
164
164
|
```
|
|
165
165
|
|
|
166
166
|
### Type Guards and Narrowing
|
|
167
167
|
|
|
168
168
|
```typescript
|
|
169
169
|
// Custom type guard
|
|
170
|
-
function isActiveItem(
|
|
170
|
+
function isActiveItem(
|
|
171
|
+
item: ItemState,
|
|
172
|
+
): item is ItemState & { status: "active" } {
|
|
171
173
|
return item.status === "active";
|
|
172
174
|
}
|
|
173
175
|
|
|
174
176
|
// Assertion function
|
|
175
|
-
function assertDefined<T>(
|
|
177
|
+
function assertDefined<T>(
|
|
178
|
+
value: T | null | undefined,
|
|
179
|
+
message: string,
|
|
180
|
+
): asserts value is T {
|
|
176
181
|
if (value == null) {
|
|
177
182
|
throw new Error(message);
|
|
178
183
|
}
|
package/agents/ux-optimizer.md
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ux-optimizer
|
|
3
|
-
color:
|
|
3
|
+
color: pink
|
|
4
4
|
description: "UX optimization expert who simplifies user experiences and reduces friction. Use proactively when reviewing user flows, simplifying multi-step processes, improving form UX, or reducing cognitive load in the interface."
|
|
5
|
-
tools: Read, Write, Edit, Bash, Grep, Glob
|
|
6
|
-
model: sonnet
|
|
7
5
|
skills:
|
|
8
6
|
- ui-ux-guidelines
|
|
9
7
|
---
|
|
@@ -34,12 +32,14 @@ Refer to your preloaded **ui-ux-guidelines** skill for accessibility rules, inte
|
|
|
34
32
|
## UX Audit Process
|
|
35
33
|
|
|
36
34
|
### Quantify Current Friction
|
|
35
|
+
|
|
37
36
|
- Count total clicks/taps to complete primary task
|
|
38
37
|
- Count form fields shown at once
|
|
39
38
|
- Count decisions the user must make
|
|
40
39
|
- Measure reading load (words, options, visual noise)
|
|
41
40
|
|
|
42
41
|
### Identify Optimization Targets
|
|
42
|
+
|
|
43
43
|
- Steps that can be eliminated entirely
|
|
44
44
|
- Fields that can be auto-filled from context (location, profile data)
|
|
45
45
|
- Decisions that can have smart defaults
|
|
@@ -50,6 +50,7 @@ Refer to your preloaded **ui-ux-guidelines** skill for accessibility rules, inte
|
|
|
50
50
|
### Form Submission (<60 seconds target)
|
|
51
51
|
|
|
52
52
|
Use progressive disclosure — reveal form sections as the user completes each one:
|
|
53
|
+
|
|
53
54
|
1. Category selector (visual, not dropdown)
|
|
54
55
|
2. Location auto-detected from GPS, with manual override
|
|
55
56
|
3. Optional details (photo, description, contact) — don't block on these
|
|
@@ -64,6 +65,7 @@ Use progressive disclosure — reveal form sections as the user completes each o
|
|
|
64
65
|
### Map-First Design
|
|
65
66
|
|
|
66
67
|
When maps are the primary browsing interface:
|
|
68
|
+
|
|
67
69
|
- Map fills viewport, results overlay as cards
|
|
68
70
|
- Tap marker to preview, tap card to see details
|
|
69
71
|
- Cluster nearby items at zoom levels
|
|
@@ -72,6 +74,7 @@ When maps are the primary browsing interface:
|
|
|
72
74
|
### Empty States That Guide Action
|
|
73
75
|
|
|
74
76
|
Don't just say "no results" — guide the user:
|
|
77
|
+
|
|
75
78
|
- Suggest expanding search radius
|
|
76
79
|
- Offer to clear filters
|
|
77
80
|
- Suggest creating an alert for this area
|
|
@@ -80,6 +83,7 @@ Don't just say "no results" — guide the user:
|
|
|
80
83
|
### Contact Flow
|
|
81
84
|
|
|
82
85
|
Protect both parties — never expose direct contact info:
|
|
86
|
+
|
|
83
87
|
- In-app messaging or masked phone relay
|
|
84
88
|
- Rate limit contact requests to prevent harassment
|
|
85
89
|
- Clear confirmation before sending first message
|