Performance Optimization
Triage skill for performance issues. Routes to the correct sub-tool or reference based on bottleneck type.
Decision Tree
Performance Issue?
├── Database (slow queries, N+1, indexes, pagination)
│ → Invoke database-optimization skill (covers all DB patterns)
├── Frontend (rendering, bundle size, change detection)
│ → ⚠️ MUST READ docs/claude/frontend-patterns.md
│ → Key: OnPush, trackBy, lazy loading, virtual scroll, tree-shaking
├── API/Endpoint (response time, payload, serialization)
│ → ⚠️ MUST READ references/performance-patterns.md (parallel queries, caching, DTOs)
├── Background Jobs (throughput, batch processing)
│ → ⚠️ MUST READ references/performance-patterns.md (bounded parallelism, batch ops)
└── Cross-Service (message bus, eventual consistency)
→ ⚠️ MUST READ references/performance-patterns.md (payload size, idempotency)
Quick Assessment Checklist
- Identify bottleneck type using decision tree above
- Measure baseline (response time, query count, bundle size)
- Route to correct sub-tool or reference
- Apply patterns from the routed resource
- Verify improvement against baseline
- Monitor for regressions
EP-Specific Quick Wins
- Parallel tuple queries:
var (a, b) = await (queryA, queryB);
- Eager loading:
repo.GetAllAsync(filter, ct, e => e.Related)
- Projections:
.Select(e => new { e.Id, e.Name }) instead of full entity
- Full-text search:
searchService.Search(q, text, Entity.SearchColumns())
- Batch updates:
repo.UpdateManyAsync(items, dismissSendEvent: true, checkDiff: false)
- Paged processing:
PageBy(skip, take) at database level
For detailed patterns, profiling commands, and anti-patterns:
⚠️ MUST READ: .claude/skills/performance/references/performance-patterns.md
Approval Gate
Present findings and optimization plan. Wait for explicit user approval before making changes -- performance optimizations can have wide-reaching side effects.
IMPORTANT Task Planning Notes
- Always plan and break many small todo tasks
- Always add a final review todo task to review the works done at the end to find any fix or enhancement needed
1---2name: performance-103description: [Review & Quality] Use when analyzing and improving performance for database queries, API endpoints, frontend rendering, or cross-service communication. Triage skill that routes to database-optimization, frontend-patterns, or provides API/job/cross-service profiling guidance.4---5
6# Performance Optimization
7
8Triage skill for performance issues. Routes to the correct sub-tool or reference based on bottleneck type.
9
10## Decision Tree
11
12```
13Performance Issue?
14├── Database (slow queries, N+1, indexes, pagination)
15│ → Invoke database-optimization skill (covers all DB patterns)
16├── Frontend (rendering, bundle size, change detection)
17│ → ⚠️ MUST READ docs/claude/frontend-patterns.md
18│ → Key: OnPush, trackBy, lazy loading, virtual scroll, tree-shaking
19├── API/Endpoint (response time, payload, serialization)
20│ → ⚠️ MUST READ references/performance-patterns.md (parallel queries, caching, DTOs)
21├── Background Jobs (throughput, batch processing)
22│ → ⚠️ MUST READ references/performance-patterns.md (bounded parallelism, batch ops)
23└── Cross-Service (message bus, eventual consistency)
24 → ⚠️ MUST READ references/performance-patterns.md (payload size, idempotency)
25```
26
27## Quick Assessment Checklist
28
291. **Identify** bottleneck type using decision tree above
302. **Measure** baseline (response time, query count, bundle size)
313. **Route** to correct sub-tool or reference
324. **Apply** patterns from the routed resource
335. **Verify** improvement against baseline
346. **Monitor** for regressions
35
36## EP-Specific Quick Wins
37
38- **Parallel tuple queries**: `var (a, b) = await (queryA, queryB);`
39- **Eager loading**: `repo.GetAllAsync(filter, ct, e => e.Related)`
40- **Projections**: `.Select(e => new { e.Id, e.Name })` instead of full entity
41- **Full-text search**: `searchService.Search(q, text, Entity.SearchColumns())`
42- **Batch updates**: `repo.UpdateManyAsync(items, dismissSendEvent: true, checkDiff: false)`
43- **Paged processing**: `PageBy(skip, take)` at database level
44
45For detailed patterns, profiling commands, and anti-patterns:
46**⚠️ MUST READ:** `.claude/skills/performance/references/performance-patterns.md`
47
48## Approval Gate
49
50Present findings and optimization plan. Wait for explicit user approval before making changes -- performance optimizations can have wide-reaching side effects.
51
52
53## IMPORTANT Task Planning Notes
54
55- Always plan and break many small todo tasks
56- Always add a final review todo task to review the works done at the end to find any fix or enhancement needed