doctor

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Doctor Skill

Doctor Skill

Note: All
~/.claude/...
paths in this guide respect
CLAUDE_CONFIG_DIR
when that environment variable is set.
注意:当设置了环境变量
CLAUDE_CONFIG_DIR
时,本指南中所有
~/.claude/...
路径都会遵循该变量的配置。

Task: Run Installation Diagnostics

任务:运行安装诊断

You are the OMC Doctor - diagnose and fix installation issues.
你是OMC诊断工具——负责诊断并修复安装问题。

Step 1: Check Plugin Version

步骤1:检查插件版本

bash
undefined
bash
undefined

Get installed version

Get installed version

INSTALLED=$(ls ~/.claude/plugins/cache/omc/oh-my-claudecode/ 2>/dev/null | sort -V | tail -1) echo "Installed: $INSTALLED"
INSTALLED=$(ls ~/.claude/plugins/cache/omc/oh-my-claudecode/ 2>/dev/null | sort -V | tail -1) echo "Installed: $INSTALLED"

Get latest from npm

Get latest from npm

LATEST=$(npm view oh-my-claude-sisyphus version 2>/dev/null) echo "Latest: $LATEST"

**Diagnosis**:
- If no version installed: CRITICAL - plugin not installed
- If INSTALLED != LATEST: WARN - outdated plugin
- If multiple versions exist: WARN - stale cache
LATEST=$(npm view oh-my-claude-sisyphus version 2>/dev/null) echo "Latest: $LATEST"

**诊断结果**:
- 若未安装任何版本:严重问题 - 插件未安装
- 若INSTALLED与LATEST版本不一致:警告 - 插件版本过时
- 若存在多个版本:警告 - 缓存过期

Step 2: Check for Legacy Hooks in settings.json

步骤2:检查settings.json中的遗留钩子

Read
~/.claude/settings.json
and check if there's a
"hooks"
key with entries like:
  • bash $HOME/.claude/hooks/keyword-detector.sh
  • bash $HOME/.claude/hooks/persistent-mode.sh
  • bash $HOME/.claude/hooks/session-start.sh
Diagnosis:
  • If found: CRITICAL - legacy hooks causing duplicates
读取
~/.claude/settings.json
文件,检查是否存在
"hooks"
键,且包含如下条目:
  • bash $HOME/.claude/hooks/keyword-detector.sh
  • bash $HOME/.claude/hooks/persistent-mode.sh
  • bash $HOME/.claude/hooks/session-start.sh
诊断结果:
  • 若存在上述条目:严重问题 - 遗留钩子导致重复冲突

Step 3: Check for Legacy Bash Hook Scripts

步骤3:检查遗留的Bash钩子脚本

bash
ls -la ~/.claude/hooks/*.sh 2>/dev/null
Diagnosis:
  • If
    keyword-detector.sh
    ,
    persistent-mode.sh
    ,
    session-start.sh
    , or
    stop-continuation.sh
    exist: WARN - legacy scripts (can cause confusion)
bash
ls -la ~/.claude/hooks/*.sh 2>/dev/null
诊断结果:
  • 若存在
    keyword-detector.sh
    persistent-mode.sh
    session-start.sh
    stop-continuation.sh
    :警告 - 遗留脚本(可能造成混淆)

Step 4: Check CLAUDE.md

步骤4:检查CLAUDE.md文件

bash
undefined
bash
undefined

Check if CLAUDE.md exists

Check if CLAUDE.md exists

ls -la ~/.claude/CLAUDE.md 2>/dev/null
ls -la ~/.claude/CLAUDE.md 2>/dev/null

Check for OMC marker

Check for OMC marker

grep -q "oh-my-claudecode Multi-Agent System" ~/.claude/CLAUDE.md 2>/dev/null && echo "Has OMC config" || echo "Missing OMC config"

**Diagnosis**:
- If missing: CRITICAL - CLAUDE.md not configured
- If missing OMC marker: WARN - outdated CLAUDE.md
grep -q "oh-my-claudecode Multi-Agent System" ~/.claude/CLAUDE.md 2>/dev/null && echo "Has OMC config" || echo "Missing OMC config"

**诊断结果**:
- 若文件缺失:严重问题 - CLAUDE.md未配置
- 若缺失OMC标记:警告 - CLAUDE.md版本过时

Step 5: Check for Stale Plugin Cache

步骤5:检查过期的插件缓存

bash
undefined
bash
undefined

Count versions in cache

Count versions in cache

ls ~/.claude/plugins/cache/omc/oh-my-claudecode/ 2>/dev/null | wc -l

**Diagnosis**:
- If > 1 version: WARN - multiple cached versions (cleanup recommended)
ls ~/.claude/plugins/cache/omc/oh-my-claudecode/ 2>/dev/null | wc -l

**诊断结果**:
- 若版本数量>1:警告 - 存在多个缓存版本(建议清理)

Step 6: Check for Legacy Curl-Installed Content

步骤6:检查通过Curl安装的遗留内容

Check for legacy agents, commands, and skills installed via curl (before plugin system):
bash
undefined
检查通过curl安装的遗留代理、命令和技能(插件系统之前的版本):
bash
undefined

Check for legacy agents directory

Check for legacy agents directory

ls -la ~/.claude/agents/ 2>/dev/null
ls -la ~/.claude/agents/ 2>/dev/null

Check for legacy commands directory

Check for legacy commands directory

ls -la ~/.claude/commands/ 2>/dev/null
ls -la ~/.claude/commands/ 2>/dev/null

Check for legacy skills directory

Check for legacy skills directory

ls -la ~/.claude/skills/ 2>/dev/null

**Diagnosis**:
- If `~/.claude/agents/` exists with oh-my-claudecode-related files: WARN - legacy agents (now provided by plugin)
- If `~/.claude/commands/` exists with oh-my-claudecode-related files: WARN - legacy commands (now provided by plugin)
- If `~/.claude/skills/` exists with oh-my-claudecode-related files: WARN - legacy skills (now provided by plugin)

Look for files like:
- `architect.md`, `researcher.md`, `explore.md`, `executor.md`, etc. in agents/
- `ultrawork.md`, `deepsearch.md`, etc. in commands/
- Any oh-my-claudecode-related `.md` files in skills/

---
ls -la ~/.claude/skills/ 2>/dev/null

**诊断结果**:
- 若`~/.claude/agents/`目录存在且包含oh-my-claudecode相关文件:警告 - 遗留代理(现由插件提供)
- 若`~/.claude/commands/`目录存在且包含oh-my-claudecode相关文件:警告 - 遗留命令(现由插件提供)
- 若`~/.claude/skills/`目录存在且包含oh-my-claudecode相关文件:警告 - 遗留技能(现由插件提供)

需查找的文件示例:
- agents/目录下的`architect.md`、`researcher.md`、`explore.md`、`executor.md`等
- commands/目录下的`ultrawork.md`、`deepsearch.md`等
- skills/目录下任何与oh-my-claudecode相关的`.md`文件

---

Report Format

报告格式

After running all checks, output a report:
undefined
完成所有检查后,输出如下格式的报告:
undefined

OMC Doctor Report

OMC Doctor Report

Summary

Summary

[HEALTHY / ISSUES FOUND]
[HEALTHY / ISSUES FOUND]

Checks

Checks

CheckStatusDetails
Plugin VersionOK/WARN/CRITICAL...
Legacy Hooks (settings.json)OK/CRITICAL...
Legacy Scripts (~/.claude/hooks/)OK/WARN...
CLAUDE.mdOK/WARN/CRITICAL...
Plugin CacheOK/WARN...
Legacy Agents (~/.claude/agents/)OK/WARN...
Legacy Commands (~/.claude/commands/)OK/WARN...
Legacy Skills (~/.claude/skills/)OK/WARN...
CheckStatusDetails
Plugin VersionOK/WARN/CRITICAL...
Legacy Hooks (settings.json)OK/CRITICAL...
Legacy Scripts (~/.claude/hooks/)OK/WARN...
CLAUDE.mdOK/WARN/CRITICAL...
Plugin CacheOK/WARN...
Legacy Agents (~/.claude/agents/)OK/WARN...
Legacy Commands (~/.claude/commands/)OK/WARN...
Legacy Skills (~/.claude/skills/)OK/WARN...

Issues Found

Issues Found

  1. [Issue description]
  2. [Issue description]
  1. [Issue description]
  2. [Issue description]

Recommended Fixes

Recommended Fixes

[List fixes based on issues]

---
[List fixes based on issues]

---

Auto-Fix (if user confirms)

自动修复(需用户确认)

If issues found, ask user: "Would you like me to fix these issues automatically?"
If yes, apply fixes:
若发现问题,询问用户:"是否需要我自动修复这些问题?"
若用户同意,执行以下修复操作:

Fix: Legacy Hooks in settings.json

修复:settings.json中的遗留钩子

Remove the
"hooks"
section from
~/.claude/settings.json
(keep other settings intact)
~/.claude/settings.json
中移除
"hooks"
部分(保留其他设置不变)

Fix: Legacy Bash Scripts

修复:遗留的Bash脚本

bash
rm -f ~/.claude/hooks/keyword-detector.sh
rm -f ~/.claude/hooks/persistent-mode.sh
rm -f ~/.claude/hooks/session-start.sh
rm -f ~/.claude/hooks/stop-continuation.sh
bash
rm -f ~/.claude/hooks/keyword-detector.sh
rm -f ~/.claude/hooks/persistent-mode.sh
rm -f ~/.claude/hooks/session-start.sh
rm -f ~/.claude/hooks/stop-continuation.sh

Fix: Outdated Plugin

修复:过时的插件

bash
rm -rf ~/.claude/plugins/cache/oh-my-claudecode
echo "Plugin cache cleared. Restart Claude Code to fetch latest version."
bash
rm -rf ~/.claude/plugins/cache/oh-my-claudecode
echo "Plugin cache cleared. Restart Claude Code to fetch latest version."

Fix: Stale Cache (multiple versions)

修复:过期缓存(多个版本)

bash
undefined
bash
undefined

Keep only latest version

Keep only latest version

cd ~/.claude/plugins/cache/omc/oh-my-claudecode/ ls | sort -V | head -n -1 | xargs rm -rf
undefined
cd ~/.claude/plugins/cache/omc/oh-my-claudecode/ ls | sort -V | head -n -1 | xargs rm -rf
undefined

Fix: Missing/Outdated CLAUDE.md

修复:缺失/过时的CLAUDE.md

Fetch latest from GitHub and write to
~/.claude/CLAUDE.md
:
WebFetch(url: "https://raw.githubusercontent.com/Yeachan-Heo/oh-my-claudecode/main/docs/CLAUDE.md", prompt: "Return the complete raw markdown content exactly as-is")
从GitHub获取最新版本并写入
~/.claude/CLAUDE.md
WebFetch(url: "https://raw.githubusercontent.com/Yeachan-Heo/oh-my-claudecode/main/docs/CLAUDE.md", prompt: "Return the complete raw markdown content exactly as-is")

Fix: Legacy Curl-Installed Content

修复:通过Curl安装的遗留内容

Remove legacy agents, commands, and skills directories (now provided by plugin):
bash
undefined
移除遗留的代理、命令和技能目录(现由插件提供):
bash
undefined

Backup first (optional - ask user)

Backup first (optional - ask user)

mv ~/.claude/agents ~/.claude/agents.bak

mv ~/.claude/agents ~/.claude/agents.bak

mv ~/.claude/commands ~/.claude/commands.bak

mv ~/.claude/commands ~/.claude/commands.bak

mv ~/.claude/skills ~/.claude/skills.bak

mv ~/.claude/skills ~/.claude/skills.bak

Or remove directly

Or remove directly

rm -rf ~/.claude/agents rm -rf ~/.claude/commands rm -rf ~/.claude/skills

**Note**: Only remove if these contain oh-my-claudecode-related files. If user has custom agents/commands/skills, warn them and ask before removing.

---
rm -rf ~/.claude/agents rm -rf ~/.claude/commands rm -rf ~/.claude/skills

**注意**:仅当这些目录包含oh-my-claudecode相关文件时才进行移除。若用户有自定义的代理/命令/技能,需先发出警告并征得用户同意后再操作。

---

Post-Fix

修复后操作

After applying fixes, inform user:
Fixes applied. Restart Claude Code for changes to take effect.
完成修复后,告知用户:
修复已完成。请重启Claude Code以使更改生效。