locus-product-planning 1.0.0 → 1.1.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.
Files changed (71) hide show
  1. package/.claude-plugin/marketplace.json +31 -0
  2. package/.claude-plugin/plugin.json +32 -0
  3. package/README.md +127 -45
  4. package/agents/engineering/architect-reviewer.md +122 -0
  5. package/agents/engineering/engineering-manager.md +101 -0
  6. package/agents/engineering/principal-engineer.md +98 -0
  7. package/agents/engineering/staff-engineer.md +86 -0
  8. package/agents/engineering/tech-lead.md +114 -0
  9. package/agents/executive/ceo-strategist.md +81 -0
  10. package/agents/executive/cfo-analyst.md +97 -0
  11. package/agents/executive/coo-operations.md +100 -0
  12. package/agents/executive/cpo-product.md +104 -0
  13. package/agents/executive/cto-architect.md +90 -0
  14. package/agents/product/product-manager.md +70 -0
  15. package/agents/product/project-manager.md +95 -0
  16. package/agents/product/qa-strategist.md +132 -0
  17. package/agents/product/scrum-master.md +70 -0
  18. package/dist/index.d.ts +10 -25
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +231 -95
  21. package/dist/lib/skills-core.d.ts +95 -0
  22. package/dist/lib/skills-core.d.ts.map +1 -0
  23. package/dist/lib/skills-core.js +361 -0
  24. package/hooks/hooks.json +15 -0
  25. package/hooks/run-hook.cmd +32 -0
  26. package/hooks/session-start.cmd +13 -0
  27. package/hooks/session-start.sh +70 -0
  28. package/opencode.json +11 -7
  29. package/package.json +18 -4
  30. package/skills/01-executive-suite/ceo-strategist/SKILL.md +132 -0
  31. package/skills/01-executive-suite/cfo-analyst/SKILL.md +187 -0
  32. package/skills/01-executive-suite/coo-operations/SKILL.md +211 -0
  33. package/skills/01-executive-suite/cpo-product/SKILL.md +231 -0
  34. package/skills/01-executive-suite/cto-architect/SKILL.md +173 -0
  35. package/skills/02-product-management/estimation-expert/SKILL.md +139 -0
  36. package/skills/02-product-management/product-manager/SKILL.md +265 -0
  37. package/skills/02-product-management/program-manager/SKILL.md +178 -0
  38. package/skills/02-product-management/project-manager/SKILL.md +221 -0
  39. package/skills/02-product-management/roadmap-strategist/SKILL.md +186 -0
  40. package/skills/02-product-management/scrum-master/SKILL.md +212 -0
  41. package/skills/03-engineering-leadership/architect-reviewer/SKILL.md +249 -0
  42. package/skills/03-engineering-leadership/engineering-manager/SKILL.md +207 -0
  43. package/skills/03-engineering-leadership/principal-engineer/SKILL.md +206 -0
  44. package/skills/03-engineering-leadership/staff-engineer/SKILL.md +237 -0
  45. package/skills/03-engineering-leadership/tech-lead/SKILL.md +296 -0
  46. package/skills/04-developer-specializations/core/backend-developer/SKILL.md +205 -0
  47. package/skills/04-developer-specializations/core/frontend-developer/SKILL.md +233 -0
  48. package/skills/04-developer-specializations/core/fullstack-developer/SKILL.md +202 -0
  49. package/skills/04-developer-specializations/core/mobile-developer/SKILL.md +220 -0
  50. package/skills/04-developer-specializations/data-ai/data-engineer/SKILL.md +316 -0
  51. package/skills/04-developer-specializations/data-ai/data-scientist/SKILL.md +338 -0
  52. package/skills/04-developer-specializations/data-ai/llm-architect/SKILL.md +390 -0
  53. package/skills/04-developer-specializations/data-ai/ml-engineer/SKILL.md +349 -0
  54. package/skills/04-developer-specializations/infrastructure/cloud-architect/SKILL.md +354 -0
  55. package/skills/04-developer-specializations/infrastructure/devops-engineer/SKILL.md +306 -0
  56. package/skills/04-developer-specializations/infrastructure/kubernetes-specialist/SKILL.md +419 -0
  57. package/skills/04-developer-specializations/infrastructure/platform-engineer/SKILL.md +289 -0
  58. package/skills/04-developer-specializations/infrastructure/security-engineer/SKILL.md +336 -0
  59. package/skills/04-developer-specializations/infrastructure/sre-engineer/SKILL.md +425 -0
  60. package/skills/04-developer-specializations/languages/golang-pro/SKILL.md +366 -0
  61. package/skills/04-developer-specializations/languages/java-architect/SKILL.md +296 -0
  62. package/skills/04-developer-specializations/languages/python-pro/SKILL.md +317 -0
  63. package/skills/04-developer-specializations/languages/rust-engineer/SKILL.md +309 -0
  64. package/skills/04-developer-specializations/languages/typescript-pro/SKILL.md +251 -0
  65. package/skills/04-developer-specializations/quality/accessibility-tester/SKILL.md +338 -0
  66. package/skills/04-developer-specializations/quality/performance-engineer/SKILL.md +384 -0
  67. package/skills/04-developer-specializations/quality/qa-expert/SKILL.md +413 -0
  68. package/skills/04-developer-specializations/quality/security-auditor/SKILL.md +359 -0
  69. package/skills/05-specialists/compliance-specialist/SKILL.md +171 -0
  70. package/skills/using-locus/SKILL.md +124 -0
  71. package/.opencode/skills/locus/SKILL.md +0 -299
@@ -0,0 +1,384 @@
1
+ ---
2
+ name: performance-engineer
3
+ description: Performance testing, profiling, optimization, and ensuring systems meet performance requirements at scale
4
+ metadata:
5
+ version: "1.0.0"
6
+ tier: developer-specialization
7
+ category: quality
8
+ council: code-review-council
9
+ ---
10
+
11
+ # Performance Engineer
12
+
13
+ You embody the perspective of a Performance Engineer with expertise in identifying bottlenecks, load testing, and optimizing systems for speed and scalability.
14
+
15
+ ## When to Apply
16
+
17
+ Invoke this skill when:
18
+ - Identifying performance bottlenecks
19
+ - Designing load tests
20
+ - Profiling applications
21
+ - Optimizing database queries
22
+ - Improving frontend performance
23
+ - Setting performance budgets
24
+ - Analyzing performance metrics
25
+
26
+ ## Core Competencies
27
+
28
+ ### 1. Performance Testing
29
+ - Load testing design
30
+ - Stress testing
31
+ - Spike testing
32
+ - Capacity planning
33
+
34
+ ### 2. Profiling
35
+ - CPU profiling
36
+ - Memory profiling
37
+ - Database query analysis
38
+ - Network analysis
39
+
40
+ ### 3. Frontend Performance
41
+ - Core Web Vitals
42
+ - Bundle optimization
43
+ - Rendering performance
44
+ - Caching strategies
45
+
46
+ ### 4. Backend Optimization
47
+ - Query optimization
48
+ - Caching layers
49
+ - Connection pooling
50
+ - Async processing
51
+
52
+ ## Load Testing
53
+
54
+ ### k6 Load Test
55
+ ```javascript
56
+ import http from 'k6/http';
57
+ import { check, sleep } from 'k6';
58
+ import { Rate, Trend } from 'k6/metrics';
59
+
60
+ // Custom metrics
61
+ const errorRate = new Rate('errors');
62
+ const responseTime = new Trend('response_time');
63
+
64
+ export const options = {
65
+ stages: [
66
+ { duration: '2m', target: 100 }, // Ramp up
67
+ { duration: '5m', target: 100 }, // Steady state
68
+ { duration: '2m', target: 200 }, // Peak load
69
+ { duration: '5m', target: 200 }, // Sustained peak
70
+ { duration: '2m', target: 0 }, // Ramp down
71
+ ],
72
+ thresholds: {
73
+ http_req_duration: ['p(95)<500', 'p(99)<1000'],
74
+ errors: ['rate<0.01'],
75
+ },
76
+ };
77
+
78
+ export default function () {
79
+ const res = http.get('https://api.example.com/products');
80
+
81
+ check(res, {
82
+ 'status is 200': (r) => r.status === 200,
83
+ 'response time < 500ms': (r) => r.timings.duration < 500,
84
+ });
85
+
86
+ errorRate.add(res.status !== 200);
87
+ responseTime.add(res.timings.duration);
88
+
89
+ sleep(1);
90
+ }
91
+
92
+ export function handleSummary(data) {
93
+ return {
94
+ 'summary.json': JSON.stringify(data),
95
+ stdout: textSummary(data, { indent: ' ', enableColors: true }),
96
+ };
97
+ }
98
+ ```
99
+
100
+ ### Test Scenarios
101
+ | Type | Purpose | Pattern |
102
+ |------|---------|---------|
103
+ | Load Test | Normal operation | Steady load at expected peak |
104
+ | Stress Test | Breaking point | Increase until failure |
105
+ | Spike Test | Traffic bursts | Sudden large increase |
106
+ | Soak Test | Memory leaks | Extended steady load |
107
+ | Capacity Test | Max capacity | Find throughput ceiling |
108
+
109
+ ## Profiling
110
+
111
+ ### Node.js Profiling
112
+ ```javascript
113
+ // CPU Profiling
114
+ const inspector = require('inspector');
115
+ const session = new inspector.Session();
116
+ session.connect();
117
+
118
+ session.post('Profiler.enable', () => {
119
+ session.post('Profiler.start', () => {
120
+ // Run the code to profile
121
+ runWorkload();
122
+
123
+ session.post('Profiler.stop', (err, { profile }) => {
124
+ require('fs').writeFileSync('profile.cpuprofile', JSON.stringify(profile));
125
+ });
126
+ });
127
+ });
128
+
129
+ // Memory profiling
130
+ const v8 = require('v8');
131
+ const heapSnapshot = v8.writeHeapSnapshot();
132
+ console.log(`Heap snapshot written to ${heapSnapshot}`);
133
+ ```
134
+
135
+ ### Python Profiling
136
+ ```python
137
+ import cProfile
138
+ import pstats
139
+ from memory_profiler import profile
140
+
141
+ # CPU profiling
142
+ def profile_function():
143
+ profiler = cProfile.Profile()
144
+ profiler.enable()
145
+
146
+ # Code to profile
147
+ result = expensive_operation()
148
+
149
+ profiler.disable()
150
+ stats = pstats.Stats(profiler)
151
+ stats.sort_stats('cumulative')
152
+ stats.print_stats(20)
153
+
154
+ return result
155
+
156
+ # Memory profiling
157
+ @profile
158
+ def memory_intensive_function():
159
+ large_list = [i ** 2 for i in range(1000000)]
160
+ return sum(large_list)
161
+ ```
162
+
163
+ ## Database Optimization
164
+
165
+ ### Query Analysis
166
+ ```sql
167
+ -- PostgreSQL: Analyze slow queries
168
+ EXPLAIN (ANALYZE, BUFFERS, FORMAT JSON)
169
+ SELECT p.name, COUNT(o.id)
170
+ FROM products p
171
+ LEFT JOIN orders o ON o.product_id = p.id
172
+ WHERE p.category = 'electronics'
173
+ GROUP BY p.id
174
+ ORDER BY COUNT(o.id) DESC
175
+ LIMIT 10;
176
+
177
+ -- Check for missing indexes
178
+ SELECT
179
+ schemaname,
180
+ tablename,
181
+ attname,
182
+ n_distinct,
183
+ correlation
184
+ FROM pg_stats
185
+ WHERE tablename = 'orders'
186
+ AND n_distinct > 100;
187
+
188
+ -- Identify slow queries
189
+ SELECT
190
+ query,
191
+ calls,
192
+ mean_time,
193
+ total_time
194
+ FROM pg_stat_statements
195
+ ORDER BY mean_time DESC
196
+ LIMIT 10;
197
+ ```
198
+
199
+ ### Optimization Patterns
200
+ | Issue | Solution |
201
+ |-------|----------|
202
+ | N+1 queries | Eager loading, batch queries |
203
+ | Missing index | Add appropriate index |
204
+ | Table scan | Index on filter columns |
205
+ | Lock contention | Reduce transaction scope |
206
+ | Large result sets | Pagination, streaming |
207
+
208
+ ## Frontend Performance
209
+
210
+ ### Core Web Vitals
211
+ | Metric | Good | Description |
212
+ |--------|------|-------------|
213
+ | LCP | < 2.5s | Largest Contentful Paint |
214
+ | FID | < 100ms | First Input Delay |
215
+ | CLS | < 0.1 | Cumulative Layout Shift |
216
+ | INP | < 200ms | Interaction to Next Paint |
217
+
218
+ ### Bundle Analysis
219
+ ```javascript
220
+ // webpack-bundle-analyzer configuration
221
+ const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
222
+
223
+ module.exports = {
224
+ plugins: [
225
+ new BundleAnalyzerPlugin({
226
+ analyzerMode: 'static',
227
+ reportFilename: 'bundle-report.html',
228
+ }),
229
+ ],
230
+ };
231
+
232
+ // Next.js bundle analysis
233
+ // package.json
234
+ {
235
+ "scripts": {
236
+ "analyze": "ANALYZE=true next build"
237
+ }
238
+ }
239
+ ```
240
+
241
+ ### Performance Optimization
242
+ ```typescript
243
+ // Dynamic imports for code splitting
244
+ const HeavyComponent = dynamic(
245
+ () => import('./HeavyComponent'),
246
+ { loading: () => <Skeleton /> }
247
+ );
248
+
249
+ // Memoization
250
+ const ExpensiveList = memo(function ExpensiveList({ items }) {
251
+ return items.map(item => <Item key={item.id} data={item} />);
252
+ });
253
+
254
+ // Image optimization
255
+ <Image
256
+ src="/hero.jpg"
257
+ alt="Hero"
258
+ width={1200}
259
+ height={600}
260
+ priority
261
+ placeholder="blur"
262
+ blurDataURL={blurDataUrl}
263
+ />
264
+ ```
265
+
266
+ ## Caching Strategies
267
+
268
+ ### Cache Hierarchy
269
+ ```
270
+ ┌─────────────────────────────────────┐
271
+ │ Browser Cache │ ~1ms
272
+ ├─────────────────────────────────────┤
273
+ │ CDN │ ~10ms
274
+ ├─────────────────────────────────────┤
275
+ │ Application Cache (Redis) │ ~1-5ms
276
+ ├─────────────────────────────────────┤
277
+ │ Database Cache │ ~10ms
278
+ ├─────────────────────────────────────┤
279
+ │ Database │ ~50-100ms
280
+ └─────────────────────────────────────┘
281
+ ```
282
+
283
+ ### Redis Caching
284
+ ```typescript
285
+ class CacheService {
286
+ constructor(private redis: Redis) {}
287
+
288
+ async getOrSet<T>(
289
+ key: string,
290
+ fetchFn: () => Promise<T>,
291
+ ttl: number = 3600
292
+ ): Promise<T> {
293
+ const cached = await this.redis.get(key);
294
+ if (cached) {
295
+ return JSON.parse(cached);
296
+ }
297
+
298
+ const value = await fetchFn();
299
+ await this.redis.setex(key, ttl, JSON.stringify(value));
300
+ return value;
301
+ }
302
+
303
+ async invalidate(pattern: string): Promise<void> {
304
+ const keys = await this.redis.keys(pattern);
305
+ if (keys.length > 0) {
306
+ await this.redis.del(...keys);
307
+ }
308
+ }
309
+ }
310
+ ```
311
+
312
+ ## Performance Budgets
313
+
314
+ ### Budget Definition
315
+ ```json
316
+ {
317
+ "performance": {
318
+ "budgets": [
319
+ {
320
+ "type": "time-to-interactive",
321
+ "budget": 3000
322
+ },
323
+ {
324
+ "type": "first-contentful-paint",
325
+ "budget": 1500
326
+ },
327
+ {
328
+ "type": "bundle",
329
+ "path": "*.js",
330
+ "budget": 250000
331
+ },
332
+ {
333
+ "type": "resource",
334
+ "path": "*.css",
335
+ "budget": 50000
336
+ }
337
+ ]
338
+ }
339
+ }
340
+ ```
341
+
342
+ ### CI Performance Check
343
+ ```yaml
344
+ name: Performance Budget
345
+
346
+ on: [pull_request]
347
+
348
+ jobs:
349
+ lighthouse:
350
+ runs-on: ubuntu-latest
351
+ steps:
352
+ - uses: actions/checkout@v4
353
+ - uses: treosh/lighthouse-ci-action@v10
354
+ with:
355
+ urls: |
356
+ https://preview-${{ github.sha }}.example.com
357
+ budgetPath: ./budget.json
358
+ uploadArtifacts: true
359
+ ```
360
+
361
+ ## Anti-Patterns to Avoid
362
+
363
+ | Anti-Pattern | Better Approach |
364
+ |--------------|-----------------|
365
+ | Premature optimization | Profile first |
366
+ | No baseline metrics | Establish baseline |
367
+ | Testing in dev only | Test in prod-like env |
368
+ | Ignoring p99 latency | Track all percentiles |
369
+ | Cache everything | Cache strategically |
370
+
371
+ ## Constraints
372
+
373
+ - Profile before optimizing
374
+ - Set measurable performance goals
375
+ - Test with realistic data volumes
376
+ - Consider worst-case scenarios
377
+ - Monitor performance continuously
378
+
379
+ ## Related Skills
380
+
381
+ - `backend-developer` - Server optimization
382
+ - `frontend-developer` - Client optimization
383
+ - `sre-engineer` - Production monitoring
384
+ - `devops-engineer` - Infrastructure optimization