loopx-performance-diagnosis
它能做什么
该技能帮助找出你所拥有的程序中,运行缓慢或占用资源过多的原因。适合发现明显变慢、并希望在修改代码前获得证据的开发者。
适用场景
- ✓当某个命令、程序或进程明显比预期更慢或更占资源时。
- ✓当你需要测量自己拥有的程序的 CPU、内存或文件输入输出时。
- ✓当某次修改之后出现变慢,而你需要性能分析证据才能修复时。
技能链接
https://github.com/loopx-project/loopx/blob/main/skills/loopx-performance-diagnosis/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的 Python 脚本启动需要 30 秒,请帮我找出原因。”
每周 5 个新技能,1 分钟读完。
工作原理
该技能引导智能体定义真实的操作和预期结果,在安全副本上用合适的性能分析工具进行测量,并在总结证据时避免暴露私人路径或数据。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
LoopX performance diagnosis
First identify the question. For a LoopX-managed benchmark's outcome quality, score growth, useful progress per time/token, or agent trajectory, use loopx-benchmark. A flatter score curve, repeated reads or more tokens alone do not establish a process-performance regression. Keep that analysis with the benchmark owner; use this skill as a focused subtask only when evidence identifies a slow owned command or resource cost. Do not require a profiler before analyzing effectiveness or interaction overhead.
Read the current Goal/Todo contract and repository optimization evidence rules. State the real user operation, observed failure and owning acceptance. Preserve the exact source, runtime/interpreter, backend/history, inputs and concurrency. Use an owned disposable target for writes. Do not attach to a production process, elevate privileges, weaken OS policy, or start paid/remote workloads without the existing authorization. Raw stacks, paths, arguments and profiles stay ignored and local-private; public summaries contain only generalized evidence.
Read loopx/capabilities/performance_diagnosis/README.md for tool selection and
blind spots. On installed copies use loopx capability show performance-diagnosis
to locate its canonical documentation. Python waits/startup: Pyinstrument; Python
threads/native on Linux: py-spy; allocations: Memray; Node/TS: V8 CPU/heap.
Go/JVM/kernel costs need their native tools. Research official sources when the
installed runtime or missing evidence makes the documented choice uncertain.
Do not choose a tool from popularity or claim one profiler covers every layer.
- Run the uninstrumented target and record ordinary elapsed time. Use repeated controlled samples for comparisons; profiling time is not a baseline or p95.
- Verify the optional tool version locally. Preserve the selected interpreter; install optional tools in an isolated environment when authorized. Do not silently install them into product dependencies or fall back on permissions.
- Write the exact target argv to an ignored JSON array. Run
loopx performance-diagnosis plan --tool TOOL --command-json FILE --output-directory FRESH_IGNORED_DIRECTORY --format json. Read the whole plan. A plan has not executed or verified tool readiness. - Execute
profile_argvthrough the Host executor as an argv array without shell interpolation. Capture only the owned process; record failures and coverage gaps. Profile a separate Node worker instead of inferring its CPU from Python transport waits. Do not collect locals or automatically profile unrelated children. - Require actual successful target exit and nonempty artifact. Read Speedscope
or V8 CPU using
loopx performance-diagnosis inspect --profile-json FILE --format json; Memray/heap use their own reporters. Keep threads independent and self/inclusive time distinct. Never sum inclusive rows to obtain latency. - Turn the hotspot into a falsifiable hypothesis. Use a controlled intervention to distinguish caller/transport, shared semantics and backend cost. Reuse the owning contract; do not skip freshness, authority checks or decision inputs.
- Repeat the original uninstrumented workload and semantic checks after a fix. Preserve passed, failed and untested results and update the existing checkpoint. Readback of a stack does not prove root cause, improvement or provider admission.
Do not add a new receipt/approval requirement or automatically mutate scheduling, Goal state or telemetry. Stop invoking the workflow to disable it; remove optional tools/captures from their owned local environment when no longer needed.
常见问题
它会衡量模型回答得好不好吗?
不会。基准质量和智能体效率由另一份基准测试技能负责。
它能分析正在运行的生产服务器吗?
不能。该技能指出,不应附加到生产进程上,也不应提升权限。
它使用哪些工具?
它会根据编程语言选择性能分析器,例如 Python 启动和等待的分析使用 Pyinstrument。
详情
作者的原始描述
Diagnose demonstrated CPU, command latency, allocation or IO regressions in an owned process with controlled measurements and language-appropriate profilers. Route benchmark effectiveness, score growth and trajectory efficiency to loopx-benchmark; profiling does not qualify a budget or grant execution authority.
repo: loopx-project/loopx
热度
- GitHub 星标
- 6.5k
- 排名
- #13875
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
loopx
6.5k教你的智能体设置并运行 LoopX,这是一个本地工具,可在多次聊天会话之间持续跟踪长期目标、任务和证据。
loopx-change-quality
6.5k指导你的智能体为 LoopX 目标审查最终的代码改动,在合并前检查质量,并生成质量回执。
loopx-doc-registry
6.5k教你的智能体记录并索引持久的项目材料,例如设计文档和研究笔记,使未来的智能体能够找到它们。
loopx-material
6.5k指导你的智能体管理项目的已存储研究材料,包括盘点、在各阶段之间移动条目、排序,以及经所有者批准的更改。