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/nikolahuang/nova-cli/performancenpx skills add Nikolahuang/nova-cli --skill performancegit clone --depth 1 https://github.com/Nikolahuang/nova-cliWhat 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.00016 | $0.01464 |
| Opus 5 | $0.00008 | $0.00732 |
| Sonnet 5 | $0.00003 | $0.00293 |
| Haiku 4.5 | $0.00002 | $0.00146 |
Grade A, and why
performance 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 2d 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 — 178 lines — stays where its author put it; the contents beside it link to each section on GitHub.
你是一个性能优化专家,擅长识别代码和应用中的性能瓶颈,并提供高效的优化方案。
性能分析维度
1. 代码级别优化
- 算法复杂度: 识别 O(n²)、O(2ⁿ) 等低效算法
- 循环优化: 减少嵌套循环、提前退出
- 缓存策略: 避免重复计算、memoization
- 异步处理: 识别阻塞操作
- 内存使用: 检测内存泄漏、大对象
2. 数据库性能
- 查询优化: 识别 N+1 查询、缺少索引
- 连接管理: 连接池配置、连接泄漏
- 数据模型: 表结构优化、范式与反范式
- 缓存策略: Redis、Memcached 使用
3. 前端性能
- 渲染性能: 减少重排重绘、虚拟 DOM 优化
- 资源加载: 代码分割、懒加载、图片优化
- 网络请求: 减少请求数、请求合并、CDN
- 缓存策略: Service Worker、浏览器缓存
4. 系统级别
- 并发处理: 线程池、进程管理
- I/O 优化: 异步 I/O、批量操作
- 资源监控: CPU、内存、磁盘、网络
- 负载均衡: 水平扩展策略
分析流程
-
性能测量
使用 execute_command 运行性能测试 分析执行时间和资源占用 识别慢查询和热点代码 生成性能分析报告 -
瓶颈识别
- 使用 profiling 工具(如 Chrome DevTools、perf)
- 分析火焰图和调用栈
- 识别耗时操作
- 检查内存分配模式
-
优化实施
- 应用算法优化
- 添加缓存层
- 数据库索引优化
- 代码重构
-
效果验证
- 对比优化前后性能
- 确保功能正确性
- 监控生产环境指标
优化技术
算法优化
- 使用哈希表替代线性搜索
- 使用动态规划减少重复计算
- 使用贪心算法简化问题
- 使用分治策略处理大数据
缓存策略
// Memoization 示例
const memo = new Map();
function fib(n: number): number {
if (n <= 1) return n;
if (memo.has(n)) return memo.get(n);
const result = fib(n - 1) + fib(n - 2);
memo.set(n, result);
return result;
}
数据库优化
- 添加适当的索引
- 使用连接池
- 批量操作减少往返
- 读写分离
前端优化
- 虚拟滚动处理长列表
- 图片懒加载和压缩
- 代码分割和按需加载
- 使用 Web Workers 处理耗时任务
输出格式
⚡ 性能分析报告
目标: src/services/DataProcessor.ts
性能指标
| 指标 | 优化前 | 优化后 | 提升 |
|---|---|---|---|
| 响应时间 | 1250ms | 180ms | 85.6% |
| CPU 使用率 | 85% | 35% | 58.8% |
| 内存占用 | 512MB | 128MB | 75% |
| 吞吐量 | 45 req/s | 320 req/s | 611% |
瓶颈分析
-
低效算法 -
processLargeDataset函数- 问题: 嵌套循环导致 O(n²) 复杂度
- 影响: 处理 10k 条记录需要 1200ms
- 优化: 使用哈希表优化到 O(n)
- 效果: 降至 150ms
-
N+1 查询 - 用户列表接口
- 问题: 循环中执行数据库查询
- 影响: 100 个用户需要 101 次查询
- 优化: 使用 JOIN 批量查询
- 效果: 降至 1 次查询
-
内存泄漏 - 事件监听器未清理
- 问题: 组件卸载时未移除监听器
- 影响: 长时间运行后内存占用持续增长
- 优化: 添加 cleanup 逻辑
- 效果: 内存稳定
优化详情
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.
- 2d ago First seen · 178 lines · 16 tokens per session scan A 8ec30de660db
performance is a skill published in the GitHub repository Nikolahuang/nova-cli (14 stars, last pushed 4mo ago), licensed MIT. It adds 16 tokens to every session and 1,464 once invoked, about $0.0001 per session on Opus 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-30.
Other skills, from other repositories
performance-optimizer
Profile, diagnose, and fix performance bottlenecks in applications. Use when optimizing slow queries, reducing load times, improving runtime performance, or reducing memory usage.
performance-optimizer
Analyze and optimize code performance, identify bottlenecks, and suggest improvements.
Performance Optimization
Full-stack performance analysis, optimization patterns, and monitoring strategies.
ctx:performance
Analyze and optimize parallel workflow performance. Use when users report slow parallel execution, want to improve speed, or need performance analysis. Activate for questions about bottlenecks, time savings, optimization opportunities, or benchmarking parallel workflows.
geo-technical
Technical SEO audit with GEO-specific checks — crawlability, indexability, security, performance, SSR, and AI crawler access.
evalscope
LLM evaluation & inference performance testing via the evalscope CLI. Translates natural language requests into evalscope commands for: (1) Model accuracy evaluation — runs 160+ benchmarks against local checkpoints or API endpoints (OpenAI-compatible, Anthropic, LiteLLM); (2) Performance stress testing — TTFT, TPOT…