Borrowing it
Nothing to install: this file belongs to tusharagg1/aifolimizer. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/tusharagg1/aifolimizer/master/.claude/skills/perf-optimizer/SKILL.mdgit clone --depth 1 https://github.com/tusharagg1/aifolimizerWrote 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/tusharagg1/aifolimizer/perf-optimizer)<a href="https://agentmods.dev/skills/tusharagg1/aifolimizer/perf-optimizer"><img src="https://agentmods.dev/badge/skills/tusharagg1/aifolimizer/perf-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.1 | $0.00099 | $0.01938 |
| Opus 5 | $0.00049 | $0.00969 |
| Sonnet 5 | $0.00020 | $0.00388 |
| Haiku 4.5 | $0.00010 | $0.00194 |
Grade A, and why
perf-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 6d 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.
- **Blocking sync calls inside async** - `requests.get` in async route, `time.sleep` How it starts
The opening of the file, as written. The whole thing — 128 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Performance Optimizer
Senior performance engineer mode. Backend hotpath focus - FastAPI routes (app/api/ws.py), MCP tools (mcp_server.py), service modules (app/services/*), cache layers (L1 dict + L2 diskcache). Hard rule: replace existing code only when measurably better. No speculative rewrites.
Scope
In-scope:
- FastAPI handlers and MCP tools - request latency, payload size, serialization cost
- Service-layer functions - yfinance/FRED/CoinGecko fetches, technicals computation, portfolio enrichment
- Caching - L1 (in-process dict) and L2 (diskcache) hit rates, TTL tuning, key design
- Concurrency -
asyncio.gatherbatching, blocking-call detection, thread/process pool usage - Data structures - pandas vs dict, repeated
iterrows, dict copies, list comprehensions vs generators
Out-of-scope (refuse):
- Frontend perf (project is backend-only as of bac7241)
- Algorithmic rewrites of financial logic (technical indicators, risk math) - correctness first, not perf
- Infra changes (deploy, k8s, containers) - single-user local app
How to run
Stage 0 - Identify hotpath (measure, never guess)
- Ask user: which path is slow? (endpoint, MCP tool name, script, batch job). Refuse to "audit everything for perf" - too broad, low signal.
- Confirm reproduction: how to trigger, expected latency, observed latency. If user has no measurement, ask them to time it first.
- Use graph tools to map the hotpath:
semantic_search_nodesfor entry functionquery_graphwith pattern=callees_ofto follow downstream callsget_impact_radiusto scope changed-code blast radius
- Read the actual files only after graph reveals the call tree. Do NOT pre-read files.
Stage 1 - Profile (real numbers, not vibes)
For Python hotpath, instrument with one of:
time.perf_counter()around suspected slow blocks (cheapest, surgical)cProfilefor full function profile:python -m cProfile -o out.prof script.pythensnakeviz out.proftracemallocfor memory:tracemalloc.start(); ... ; tracemalloc.get_traced_memory()py-spy top --pid <pid>for live sampling against running uvicorn (no code change)
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.
- 6d ago First seen · 128 lines · 99 tokens per session scan A f85bac4fa1ca
perf-optimizer is a skill published in the GitHub repository tusharagg1/aifolimizer (2 stars, last pushed 4d ago), licensed MIT. It adds 99 tokens to every session and 1,938 once invoked, about $0.0005 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-31.
Other skills, from other repositories
gitee-expert
You have access to Gitee (gitee.com), China's largest GitHub-style platform. This skill teaches the effective workflows for discovery, intel, translation and webhook monitoring.
tushare
Skill "tushare" from HKUDS/Vibe-Trading, covering tushare, 概述, 快速上手, 读取环境变量中的token, 或者读取本地记录的token and 初始化pro接口实例.
measure-instrumentation-spec
Specifies what analytics events to track, when they fire, and what properties to include, as a contract between product and engineering that prevents undertracked features. Use before engineering builds a feature or when auditing existing tracking for gaps. For the dashboard built on top of these events, use…
fastcrud
Use when building or modifying CRUD endpoints with FastCRUD (the fastcrud PyPI package) in a FastAPI project — covers FastCRUD, crudrouter, EndpointCreator, FilterConfig, JoinConfig, auto-relationship detection, the filter operator syntax (gte, in, ilike, etc.), cursor pagination, soft delete, and how to avoid N+1…
cloud_api
Manages cloud AI provider API keys for Gemini, OpenAI, Claude, DeepSeek, Grok.
mcp_protocol
你是 MCP(Model Context Protocol)服务封装专家。封装 MCP 服务时,必须遵循以下规范:.