Agent skill

System Doctor

by majiayu000 in majiayu000/spellbook

系统性能诊断。当用户说电脑卡、系统慢、查看进程、CPU占用高、内存不够等性能问题时使用. An agent skill from majiayu000/spellbook.

MITAuto-check: notes

Install System Doctor

skills CLI
$ npx skills add majiayu000/spellbook --skill system-doctor -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install majiayu000/spellbook system-doctor --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/majiayu000/spellbook.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/system-doctor .claude/skills/system-doctor && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
system-doctor
GitHub stars
287
Token cost
~941 tokens
SKILL.md length
144 words
Files
1
Skills in repo
97
Repo updated
First seen
Licence
MIT

At a glance

系统性能诊断。当用户说电脑卡、系统慢、查看进程、CPU占用高、内存不够等性能问题时使用. An agent skill from majiayu000/spellbook.

  • Works in 6 steps: 系统负载与运行时间 → 内存压力 → 内存概况 → …
  • SKILL.md covers 诊断流程 and 注意事项
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

System Doctor is an agent skill from majiayu000/spellbook. 系统性能诊断。当用户说电脑卡、系统慢、查看进程、CPU占用高、内存不够等性能问题时使用

Its SKILL.md is about 940 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: Cross-runtime skills for Claude Code, Codex, and multi-agent workflows. The licence is MIT.

Example prompts

  • “/system-doctor”

Requirements

  • Pre-approved tools (allowed-tools): Bash

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. 系统负载与运行时间
  2. 内存压力
  3. 内存概况
  4. 进程总数与 zombie 进程
  5. CPU 核心数
  6. Swap 使用

What it can do on your machine

Read from SKILL.md and the folder at commit ed52af7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

System Doctor loads about 941 tokens when it runs. Until then it costs about 14 tokens; SKILL.md has 144 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~14
When it runs · the whole SKILL.md, loaded when a task matches
~941

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from majiayu000/spellbook at commit ed52af7, republished under its MIT licence (© majiayu000). 144 words, ~941 tokens.

Download SKILL.mdSave it as .claude/skills/system-doctor/SKILL.md (or your agent's skills folder).
name
system-doctor
description
系统性能诊断。当用户说电脑卡、系统慢、查看进程、CPU占用高、内存不够等性能问题时使用
allowed-tools
Bash
metadata.argument-hint
[无参数]

系统性能诊断工具

你是一个系统性能诊断专家,帮助用户快速定位电脑卡顿的原因,给出可操作的建议。

诊断流程

严格按以下步骤执行,最大化并行采集,最后生成结构化报告。

第一步:系统概况

并行执行以下所有命令:

  1. 系统负载与运行时间
bash
uptime
  1. 内存压力
bash
memory_pressure 2>/dev/null || vm_stat
  1. 内存概况
bash
sysctl -n hw.memsize | awk '{printf "物理内存: %.0f GB\n", $1/1024/1024/1024}'
  1. 进程总数与 zombie 进程
bash
echo "进程总数: $(ps aux | wc -l | tr -d ' ')"
echo "Zombie 进程: $(ps aux | awk '$8 ~ /Z/ {count++} END {print count+0}')"
  1. CPU 核心数
bash
sysctl -n hw.ncpu
  1. Swap 使用
bash
sysctl vm.swapusage 2>/dev/null || echo "无 swap 信息"
第二步:CPU 大户 Top 20
bash
ps aux --sort=-%cpu | head -21
第三步:内存大户 Top 20
bash
ps aux --sort=-%mem | head -21
第四步:进程分组汇总

将同一应用的多个子进程合并统计(Chrome Renderer x N、Claude Helper x N 等)。

bash
ps 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
第五步:异常检测

并行执行以下检测:

  1. CPU 占用 > 50% 的进程
bash
echo "=== CPU > 50% 的进程 ==="
ps aux | awk 'NR>1 && $3 > 50 {printf "PID=%-8s CPU=%-6s MEM=%-6s CMD=%s\n", $2, $3, $4, $11}'
  1. 内存占用 > 1GB 的进程
bash
echo "=== RSS > 1GB 的进程 ==="
ps aux | awk 'NR>1 && $6 > 1048576 {printf "PID=%-8s RSS=%.1fGB CMD=%s\n", $2, $6/1048576, $11}'
  1. Zombie 进程详情
bash
echo "=== Zombie 进程 ==="
ps aux | awk '$8 ~ /Z/ {print}' || echo "无 zombie 进程"
  1. 负载是否过高(负载 > CPU 核心数视为过高)
bash
cores=$(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 应用占用大量内存,建议关闭不用的
第七步:交互式操作

报告输出后,询问用户是否需要:

  1. 关闭某个占用高的进程(通过 kill PID)
  2. 关闭某个应用的所有进程(通过 killall 应用名)
  3. 查看某个进程的详细信息(通过 ps -p PID -o pid,ppid,%cpu,%mem,rss,etime,command)

安全规则:

  • 不要主动 kill 任何进程,必须用户确认
  • 不要 kill 系统关键进程(kernel_task、WindowServer、loginwindow、launchd 等)
  • kill 前先提示用户保存工作
  • 优先使用 kill PID(SIGTERM),不要用 kill -9 除非用户明确要求

注意事项

  • 用中文输出所有信息
  • 扫描时最大化并行执行,减少等待时间
  • 所有诊断操作都是只读的(除非用户请求 kill 进程)
  • 如果是 Linux 系统,自动替换 macOS 特有命令(memory_pressure → free -h,sysctl → /proc/cpuinfo 等)

© majiayu000, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/system-doctor of majiayu000/spellbook.

Open the folder on GitHubat commit ed52af7

Compare with similar skills

System Doctor next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

System Doctor compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
System Doctor this skillmajiayu000/spellbook287—~941Automated safety check: NotesMIT
Doctorsuperset-sh/superset15k—~434Automated safety check: PassCustom licence
Muse Code Product Doctorasgeirtj/system_prompts_leaks69k—~3.5kAutomated safety check: PassCC0-1.0
Doctorbrycewang-stanford/Auto-Empirical-Research-Skills4.6k—~2.4kAutomated safety check: PassCustom licence
Doctoralsk1992/CloddsBot3k—~1.6kAutomated safety check: NotesMIT
Doctortinyfish-io/tinyfish-cookbook2.2k—~1.6kAutomated safety check: PassMIT

Similar skills

  • Doctor

    superset-sh/superset

    Diagnose and fix Superset problems such as connection failures, offline hosts, terminals not attaching, auth or update issues.

    15k GitHub stars~434 tokensUpdated today
    Auto-check passed
  • Muse Code Product Doctor

    asgeirtj/system_prompts_leaks

    Diagnoses a Muse Code installation's own failures from binary and session evidence, instead of treating the report as an ordinary repository bug.

    69k GitHub stars~3.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Doctor

    brycewang-stanford/Auto-Empirical-Research-Skills

    System diagnostics and health checks for Diverga plugin. An agent skill from brycewang-stanford/Auto-Empirical-Research-Skills.

    4.6k GitHub stars~2.4k tokensUpdated 6 days ago
    Auto-check passed
  • Doctor

    alsk1992/CloddsBot

    System health diagnostics and troubleshooting. An agent skill from alsk1992/CloddsBot.

    3k GitHub stars~1.6k tokensUpdated 8 days ago
    Auto-check: notes
  • Doctor

    tinyfish-io/tinyfish-cookbook

    Diagnose and repair your TinyFish setup — MCP registration, auth, and connectivity.

    2.2k GitHub stars~1.6k tokensUpdated 2 days ago
    Auto-check passed
  • Math Modeling Environment Doctor

    jihe520/MathModelAgent

    Checks that the tools and Python packages needed for a math modeling paper workflow are installed and offers platform-specific install commands for anything missing.

    6.2k GitHub stars~1.5k tokensUpdated 8 days ago
    DevelopmentAuto-check: notes

More from majiayu000/spellbook

All 97 skills in this repo
  • Skill Ecosystem Doctor

    majiayu000/spellbook

    Audits and repairs how coding-agent Skills are owned, copied and exposed across runtimes, from canonical sources to quarantine and retirement.

    287 GitHub stars~3k tokensUpdated 3 days ago
    Auto-check passed
  • AGENTS.md Scaffold

    majiayu000/spellbook

    Scans a repository for real evidence and proposes, or on request writes, a small stack of root and scoped AGENTS.md files with validation commands and generated-file boundaries.

    287 GitHub stars~1.5k tokensUpdated 3 days ago
    Auto-check passed
  • Product Demo Builder

    majiayu000/spellbook

    Plans, produces or diagnoses evidence-backed product demo videos: script, capture plan, pacing checks and verified final media built on real product behavior.

    287 GitHub stars~3.3k tokensUpdated 3 days ago
    Auto-check passed
  • Flowguard Task Guard

    majiayu000/spellbook

    Single entry point that routes long or ambiguous agent tasks, checks live state, bounds autonomous loops and leaves a resumable handoff.

    287 GitHub stars~2.1k tokensUpdated 3 days ago
    Auto-check passed
  • npm Supply Chain Check

    majiayu000/spellbook

    Scans a repository, its lockfiles and node_modules for known malicious npm package versions and install-time indicators, using a read-only Python scanner.

    287 GitHub stars~1.5k tokensUpdated 3 days ago
    Auto-check passed
  • Product Manager Toolkit

    majiayu000/spellbook

    Product management helpers: a RICE scoring script, an interview transcript analyzer and PRD templates for prioritizing features, synthesizing research and writing requirements.

    287 GitHub stars~2.2k tokensUpdated 3 days ago
    Auto-check passed

Questions about System Doctor

What does System Doctor do?

系统性能诊断。当用户说电脑卡、系统慢、查看进程、CPU占用高、内存不够等性能问题时使用. An agent skill from majiayu000/spellbook. System Doctor is an agent skill from majiayu000/spellbook.

How do I install System Doctor in Claude Code?

Run `npx skills add majiayu000/spellbook --skill system-doctor -a claude-code`. Or copy the skill folder (skills/system-doctor in majiayu000/spellbook) into .claude/skills/system-doctor in your project. Claude Code loads it when a task matches its description.

How do I install System Doctor in Codex?

Run `npx skills add majiayu000/spellbook --skill system-doctor -a codex`. Or copy the skill folder (skills/system-doctor in majiayu000/spellbook) into .agents/skills/system-doctor in your project. Codex loads it when a task matches its description.

Can I use System Doctor in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add majiayu000/spellbook --skill system-doctor -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/system-doctor, .gemini/skills/system-doctor, .github/skills/system-doctor and .opencode/skills/system-doctor in your project.

What does System Doctor need to run?

SKILL.md names no scripts, command-line tools or credentials: System Doctor is instructions for the agent only. Its frontmatter pre-approves these tools: Bash.

Does System Doctor access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is System Doctor safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does System Doctor use?

System Doctor is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does System Doctor use?

About 941 tokens (SKILL.md is roughly 3.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to System Doctor?

Skills that share tags, products or a category with System Doctor: Doctor (superset-sh/superset, 15k stars), Muse Code Product Doctor (asgeirtj/system_prompts_leaks, 69k stars), Doctor (brycewang-stanford/Auto-Empirical-Research-Skills, 4.6k stars) and Doctor (alsk1992/CloddsBot, 3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains System Doctor?

majiayu000 (a GitHub user) maintains it in majiayu000/spellbook, which has 287 GitHub stars. The repository holds 97 skills in this directory. The repository was last updated on October 8, 2026.

Source: majiayu000/spellbook on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.