Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/asgarovf/locusai/performance-optimizernpx skills add asgarovf/locusai --skill performance-optimizergit clone --depth 1 https://github.com/asgarovf/locusaiWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/asgarovf/locusai/performance-optimizer)<a href="https://agentmods.dev/skills/asgarovf/locusai/performance-optimizer"><img src="https://agentmods.dev/badge/skills/asgarovf/locusai/performance-optimizer.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00036 | $0.01378 |
| Opus 5 | $0.00018 | $0.00689 |
| Sonnet 5 | $0.00007 | $0.00276 |
| Haiku 4.5 | $0.00004 | $0.00138 |
Grade A, and why
performance-optimizer scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
curl -w "@curl-format.txt" -o /dev/null -s http://localhost:3000/api/users How it starts
The opening of the file, as written. The whole thing — 203 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Performance Optimizer
When to use this skill
- Application or endpoint is slow
- Database queries taking too long
- High memory usage or memory leaks
- Frontend load times need improvement
- Need to handle higher throughput
- Optimizing build or CI/CD times
Step 1: Measure first
Never optimize without measuring. Identify the actual bottleneck.
Backend profiling
# Node.js — CPU profile
node --prof app.js
node --prof-process isolate-*.log > processed.txt
# Node.js — built-in profiler
node --inspect app.js # Then open chrome://inspect
# Python — cProfile
python -m cProfile -s cumtime app.py
python -m cProfile -o output.prof app.py # Save for analysis
# HTTP endpoint timing
curl -w "@curl-format.txt" -o /dev/null -s http://localhost:3000/api/users
# curl-format.txt contains: time_total, time_connect, time_starttransfer
Database profiling
-- PostgreSQL: Identify slow queries
SELECT query, mean_exec_time, calls, total_exec_time
FROM pg_stat_statements
ORDER BY mean_exec_time DESC
LIMIT 20;
-- Explain a slow query
EXPLAIN ANALYZE SELECT * FROM orders
WHERE user_id = 123 AND status = 'active'
ORDER BY created_at DESC;
Frontend profiling
# Lighthouse CLI
npx lighthouse http://localhost:3000 --output=json --output-path=./report.json
# Bundle size analysis
npx webpack-bundle-analyzer stats.json
npx vite-bundle-visualizer
Step 2: Common bottlenecks and fixes
N+1 queries
// BAD: N+1 — one query per user
const users = await db.query('SELECT * FROM users');
for (const user of users) {
user.orders = await db.query('SELECT * FROM orders WHERE user_id = $1', [user.id]);
}
// GOOD: 2 queries total
const users = await db.query('SELECT * FROM users');
const userIds = users.map(u => u.id);
const orders = await db.query('SELECT * FROM orders WHERE user_id = ANY($1)', [userIds]);
const ordersByUser = groupBy(orders, 'user_id');
users.forEach(u => u.orders = ordersByUser[u.id] ?? []);
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 203 lines · 36 tokens per session scan A 2bd774bbb483
performance-optimizer is a skill published in the GitHub repository asgarovf/locusai (23 stars, last pushed 5mo ago), licensed MIT. It adds 36 tokens to every session and 1,378 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
Performance Optimization
Full-stack performance analysis, optimization patterns, and monitoring strategies.
performance-optimization
Optimizes application performance. Use when performance requirements exist, when you suspect performance regressions, or when Core Web Vitals or load times need improvement. Use when profiling reveals bottlenecks that need fixing.
performance-optimizer
Systematic performance profiling and optimization for Python and web backends — measure first, fix second, verify the fix.
performance-profiling
Performance Profiling & Optimization: Helps diagnose and fix performance issues including memory leaks, CPU bottlenecks, slow queries, high latency, and throughput problems. Covers profiling tools, flame graphs, load testing, caching strategies, and optimization techniques for Node.js, Java, Flutter, and web…
performance-optimization
Profiling, optimization techniques, and performance best practices.
performance-optimizer
Analyze and optimize code performance, identify bottlenecks, and suggest improvements.