Install any skill in seconds. Free to start, no credit card required.
Get Started Free →系统性能诊断。当用户说电脑卡、系统慢、查看进程、CPU占用高、内存不够等性能问题时使用
.claude/skills/majiayu000-system-doctor/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-05 | ✗→✓ | ▲ Improved | 23% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 93% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 61% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 100% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 174% | 0% |
你是一个系统性能诊断专家,帮助用户快速定位电脑卡顿的原因,给出可操作的建议。
严格按以下步骤执行,最大化并行采集,最后生成结构化报告。
并行执行以下所有命令:
bashuptime
bashmemory_pressure 2>/dev/null || vm_stat
bashsysctl -n hw.memsize | awk '{printf "物理内存: %.0f GB\n", $1/1024/1024/1024}'
bashecho "进程总数: $(ps aux | wc -l | tr -d ' ')" echo "Zombie 进程: $(ps aux | awk '$8 ~ /Z/ {count++} END {print count+0}')"
bashsysctl -n hw.ncpu
bashsysctl vm.swapusage 2>/dev/null || echo "无 swap 信息"
bashps aux --sort=-%cpu | head -21
bashps aux --sort=-%mem | head -21
将同一应用的多个子进程合并统计(Chrome Renderer x N、Claude Helper x N 等)。
bashps aux | awk 'NR>1 { cmd = $11 # 提取应用名:去掉路径,取 basename n = split(cmd, parts, "/") name = parts[n] # 对 .app 内的进程,提取 .app 名称 if (cmd ~ /\.app\//) { match(cmd, /([^\/]+)\.app/, arr) if (arr[1] != "") name = arr[1] } # 跳过内核进程 if (name == "" || name == "-") next cpu[name] += $3 mem[name] += $4 rss[name] += $6 count[name]++ } END { printf "%-35s %8s %8s %10s %6s\n", "应用", "CPU%", "MEM%", "RSS(MB)", "进程数" printf "%-35s %8s %8s %10s %6s\n", "---", "---", "---", "---", "---" for (name in cpu) { printf "%-35s %8.1f %8.1f %10.0f %6d\n", name, cpu[name], mem[name], rss[name]/1024, count[name] } }' | sort -t' ' -k2 -rn | head -30
并行执行以下检测:
bashecho "=== CPU > 50% 的进程 ===" ps aux | awk 'NR>1 && $3 > 50 {printf "PID=%-8s CPU=%-6s MEM=%-6s CMD=%s\n", $2, $3, $4, $11}'
bashecho "=== RSS > 1GB 的进程 ===" ps aux | awk 'NR>1 && $6 > 1048576 {printf "PID=%-8s RSS=%.1fGB CMD=%s\n", $2, $6/1048576, $11}'
bashecho "=== Zombie 进程 ===" ps aux | awk '$8 ~ /Z/ {print}' || echo "无 zombie 进程"
bashcores=$(sysctl -n hw.ncpu) load=$(sysctl -n vm.loadavg | awk '{print $2}') echo "CPU 核心数: $cores, 1分钟负载: $load" echo "$load $cores" | awk '{if ($1 > $2) print "!! 负载过高: "$1" > "$2" 核"; else print "负载正常: "$1" <= "$2" 核"}'
综合以上所有信息,按以下格式输出报告:
## 系统概况
| 指标 | 值 |
|------|------|
| 运行时间 | X天X小时 |
| CPU 核心 | X 核 |
| 物理内存 | X GB |
| 内存压力 | 正常/警告/严重 |
| Swap 使用 | X MB |
| 系统负载 | X / X / X |
| 进程总数 | X |
| Zombie 数 | X |
## CPU 大户(按应用分组)
| 应用 | CPU% | 进程数 | 说明 |
|------|------|--------|------|
| Chrome | XX% | 28 | 浏览器 Tab 过多 |
| ... | ... | ... | ... |
## 内存大户(按应用分组)
| 应用 | RSS | 进程数 | 说明 |
|------|-----|--------|------|
| Chrome | X.X GB | 28 | 浏览器 Tab 过多 |
| ... | ... | ... | ... |
## 问题清单
- 🔴 [严重] ...
- 🟡 [警告] ...
- 🟢 [正常] 系统运行良好
## 建议
1. ...
2. ...根据检测到的问题给出对应建议:
| 问题 | 建议 | |------|------| | 负载 > 核心数 | 关闭不必要的应用,或升级硬件 | | 内存压力为 warn/critical | 关闭内存大户,减少浏览器 Tab | | Chrome/浏览器内存 > 2GB | 关闭不用的 Tab,使用 Tab 管理扩展 | | Swap 使用 > 1GB | 内存不足,考虑增加物理内存或关闭应用 | | CPU 单进程 > 80% | 检查是否卡死,考虑 kill | | Zombie 进程 > 0 | 尝试 kill 父进程回收 zombie | | Electron 应用过多 | 每个 Electron 应用占用大量内存,建议关闭不用的 |
报告输出后,询问用户是否需要:
kill PID)killall 应用名)ps -p PID -o pid,ppid,%cpu,%mem,rss,etime,command)安全规则:
kill PID(SIGTERM),不要用 kill -9 除非用户明确要求| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 20,704 | 20,452 | -1% | 1 | 1 | 0% | 2,890 | 2,159 | -25% | 0 | 0 | — |
case-02 | fail→fail | 16,454 | 21,058 | +28% | 1 | 1 | 0% | 2,456 | 3,407 | +39% | 0 | 0 | — |
case-03 | pass→fail | 26,370 | 37,566 | +42% | 1 | 1 | 0% | 4,758 | 3,652 | -23% | 0 | 0 | — |
case-04 | pass→pass | 16,709 | 14,632 | -12% | 1 | 1 | 0% | 2,761 | 4,311 | +56% | 0 | 0 | — |
case-05 | fail→pass | 14,011 | 7,036 | -50% | 1 | 1 | 0% | 2,203 | 2,714 | +23% | 0 | 0 | — |
case-06 | pass→pass | 17,373 | 24,749 | +42% | 1 | 1 | 0% | 2,846 | 4,908 | +72% | 0 | 0 | — |
case-07 | pass→pass | 10,458 | 12,540 | +20% | 1 | 1 | 0% | 1,625 | 3,476 | +114% | 0 | 0 | — |
case-08 | pass→pass | 10,344 | 19,632 | +90% | 1 | 1 | 0% | 1,778 | 3,663 | +106% | 0 | 0 | — |
case-09 | fail→pass | 9,768 | 7,605 | -22% | 1 | 1 | 0% | 1,519 | 2,930 | +93% | 0 | 0 | — |
case-10 | fail→pass | 15,078 | 13,395 | -11% | 1 | 1 | 0% | 2,635 | 4,244 | +61% | 0 | 0 | — |
case-11 | fail→pass | 7,398 | 4,864 | -34% | 1 | 1 | 0% | 1,246 | 2,491 | +100% | 0 | 0 | — |
case-12 | pass→pass | 13,715 | 17,899 | +31% | 1 | 1 | 0% | 1,985 | 4,324 | +118% | 0 | 0 | — |
case-13 | pass→pass | 2,966 | 4,540 | +53% | 1 | 1 | 0% | 470 | 2,174 | +363% | 0 | 0 | — |
case-14 | pass→pass | 10,347 | 5,320 | -49% | 1 | 1 | 0% | 1,604 | 2,552 | +59% | 0 | 0 | — |
case-15 | pass→pass | 14,807 | 8,918 | -40% | 1 | 1 | 0% | 2,310 | 3,274 | +42% | 0 | 0 | — |
case-16 | pass→pass | 6,350 | 3,913 | -38% | 1 | 1 | 0% | 1,116 | 2,390 | +114% | 0 | 0 | — |
case-21 | pass→pass | 3,075 | 4,282 | +39% | 1 | 1 | 0% | 499 | 2,495 | +400% | 0 | 0 | — |
case-17 | fail→pass | 14,048 | 4,948 | -65% | 1 | 1 | 0% | 966 | 2,647 | +174% | 0 | 0 | — |
case-18 | fail→pass | 14,971 | 7,917 | -47% | 1 | 1 | 0% | 2,241 | 2,932 | +31% | 0 | 0 | — |
case-19 | fail→pass | 7,003 | 4,141 | -41% | 1 | 1 | 0% | 1,090 | 2,438 | +124% | 0 | 0 | — |
case-20 | pass→pass | 5,983 | 7,317 | +22% | 1 | 1 | 0% | 1,161 | 3,208 | +176% | 0 | 0 | — |
case-22 | pass→pass | 11,413 | 9,962 | -13% | 1 | 1 | 0% | 2,244 | 3,663 | +63% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 19 counted toward the lift figure. The other 3 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +27 percentage points is the difference between those two pass rates over the 19 comparable cases. 3 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.