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 skills add Morningstar202604/awesome-skillkit --skill performance-profilergit clone --depth 1 https://github.com/Morningstar202604/awesome-skillkitWrote 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/morningstar202604/awesome-skillkit/performance-profiler)<a href="https://agentmods.dev/skills/morningstar202604/awesome-skillkit/performance-profiler"><img src="https://agentmods.dev/badge/skills/morningstar202604/awesome-skillkit/performance-profiler/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/morningstar202604/awesome-skillkit/performance-profiler"><img src="https://agentmods.dev/badge/skills/morningstar202604/awesome-skillkit/performance-profiler.svg" alt="Reviewed on agentmods" width="80" 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.00280 | $0.01596 |
| Opus 5.5 | $0.00112 | $0.00638 |
| Sonnet 5.5 | $0.00056 | $0.00319 |
| Haiku 4.5 | $0.00028 | $0.00160 |
Grade A, and why
performance-profiler scanned grade A with 0 findings 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 2mo 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 106 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Performance Profiler
系统性性能剖析:定位瓶颈、量化前后差异、给出优化方向。
核心能力
- CPU 剖析 — Node.js 火焰图、Python py-spy、Go pprof
- 内存剖析 — 堆快照、泄漏检测、GC 压力
- 包体积分析 — webpack-bundle-analyzer、Next.js bundle analyzer
- 数据库优化 — EXPLAIN ANALYZE、慢查询日志、N+1 检测
- 压测 — k6 脚本、Artillery 场景、阶梯加压
- 前后对比 — 先建基线,再剖析、优化、复测验证
输入清单
| 输入 | 必需 | 说明 |
|---|---|---|
| project_path | 是 | 待剖析项目根目录路径 |
| format | 否 | text / json(用 --json) |
| large_file_threshold_kb | 否 | 大文件告警阈值(KB) |
缺失时一次性问齐:「请提供:① project_path(项目根目录)。输出格式与阈值我按默认处理。」
前置自检
python3 --version
test -f scripts/performance_profiler.py && echo "OK script present"
- 预期:版本号输出;脚本存在打印
OK script present。 - 若失败:脚本缺失 → STOP 回报;非 Python 项目剖析时还需对应运行时(node/py-spy/go)与 k6/artillery 按需安装。
工作流
步骤 1:扫描风险指标(基线)
python3 scripts/performance_profiler.py examples/sample-codebase # 随包样例代码库;你的真实项目换成项目根
python3 scripts/performance_profiler.py examples/sample-codebase --json
python3 scripts/performance_profiler.py examples/sample-codebase --large-file-threshold-kb 256
- 动作:扫描项目,输出性能风险指标(大文件、可疑模式等)。
- 预期:终端打印风险清单;
--json时输出结构化 JSON;--large-file-threshold-kb覆盖阈值。 - 若失败:
No such file or directory→ project_path 错;非预期退出 → 去掉--json看文本报错。
步骤 2:建立前后测量基线
- 动作:在任意优化前记录 P50/P95/P99 延迟、RPS、错误率、内存占用。
- 预期:得到可对比的数字基线。
- 若失败:无监控数据 → 先用步骤 1 扫描 + 运行时 profiler 取数,禁止凭感觉优化。
步骤 3:按语言剖析并优化
- 动作:对照 references/profiling-recipes.md 取对应命令生成火焰图/堆快照;按 references/optimization-playbook.md 的清单做优化。
- 预期:定位到具体热点(函数/查询/依赖)。
- 若失败:无热点 → 回到基线确认瓶颈假设是否成立。
步骤 4:复测验证
- 动作:优化后重复步骤 1–2,对比基线确认改善。
- 预期:关键指标较基线下降(延迟)或资源占用减少。
- 若失败:无改善甚至回退 → 回滚变更,重读 recipes 选其他路径。
快速优化清单
- 数据库:为高频查询列加索引;连接池(pgBouncer/HikariCP);结果缓存(Redis);把 N+1 合并为批量查询。
- 应用:同步 I/O 改异步;大结果集分页;大文件流式处理;缓存昂贵计算(LRU/Redis)。
- 前端:大包 code-split(动态 import);首屏外图片懒加载;gzip/brotli 压缩;静态资源走 CDN。
失败处置表
| 现象/错误码 | 原因 | 处置 |
|---|---|---|
No such file or directory |
project_path 错误 | 核对路径后重跑 |
| 非预期非零退出 | 项目含不支持结构 | 去掉 --json 看文本错误 |
| 优化后指标无改善 | 热点判断错 | 回滚,重读 profiling-recipes.md |
| 缺运行时工具 | node/py-spy/go 未装 | 安装对应剖析工具后重测 |
What ships with it
7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 2mo ago Changed · -168 tokens per session 3ddb4b65bd18
- 2mo ago Changed 0d8726d35234
- 2mo ago Changed · +26 lines · +200 tokens per session 0230d4a357b6
- 3mo ago First seen · 80 lines · 80 tokens per session scan A 09ea8b4b21e3
performance-profiler is a skill published in the GitHub repository Morningstar202604/awesome-skillkit (0 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 280 tokens to every session and 1,596 once invoked, about $0.0011 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
performance-profiler compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| performance-profilerMorningstar202604/awesome-skillkit | Skill | 0 | 2mo ago | Apache-2.0 | A | 280 | Claude Code, Codex |
| systematic-debuggingNousResearch/hermes-agent | Skill | 267k | today | MIT | A | 16 | Claude Code, Codex |
| python-debugpyNousResearch/hermes-agent | Skill | 267k | today | MIT | B | 17 | Claude Code, Codex |
| sglang-diffusion-benchmark-profilesgl-project/sglang | Skill | 39k | today | Apache-2.0 | A | 26 | Claude Code, Codex |
| resolve-handoffomnigent-ai/omnigent | Skill | 12k | today | Apache-2.0 | A | 23 | Claude Code, Codex |
| verify-omnigentomnigent-ai/omnigent | Skill | 12k | today | Apache-2.0 | A | 100 | Claude Code, Codex |
| iterate-implementationhumanlayer/humanlayer | Skill | 13k | 7d ago | Apache-2.0 | A | 16 | Claude Code, Codex |