doctor
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOrchestKit Health Diagnostics
OrchestKit健康诊断
Overview
概述
The command performs comprehensive health checks on your OrchestKit installation. It auto-detects installed plugins and validates 10 categories:
/ork:doctor- Installed Plugins - Detects orkl or ork
- Skills Validation - Frontmatter, references, token budget (dynamic count)
- Agents Validation - Frontmatter, tool refs, skill refs (dynamic count)
- Hook Health - Registration, bundles, async patterns
- Permission Rules - Detects unreachable rules (CC 2.1.3 feature)
- Schema Compliance - Validates JSON files against schemas
- Coordination System - Checks lock health and registry integrity
- Context Budget - Monitors token usage against budget
- Memory System - Graph, Mem0, Fabric health
- Claude Code Version - Validates CC >= 2.1.16
/ork:doctor- 已安装插件 - 检测orkl或ork
- Skill验证 - 前置元数据、引用、token预算(动态计数)
- Agent验证 - 前置元数据、工具引用、Skill引用(动态计数)
- Hook健康状态 - 注册、捆绑包、异步模式
- 权限规则 - 检测不可达规则(CC 2.1.3新增功能)
- Schema合规性 - 验证JSON文件是否符合Schema规范
- 协调系统 - 检查锁健康状态和注册表完整性
- 上下文预算 - 监控token使用是否符合预算
- 内存系统 - Graph、Mem0、Fabric健康状态
- Claude Code版本 - 验证CC版本 >= 2.1.16
When to Use
使用场景
- After installing or updating OrchestKit
- When hooks aren't firing as expected
- Before deploying to a team environment
- When debugging coordination issues
- After running
npm run build
- 安装或更新OrchestKit之后
- 当Hook未按预期触发时
- 部署到团队环境之前
- 调试协调问题时
- 运行之后
npm run build
Quick Start
快速开始
bash
/ork:doctor # Standard health check
/ork:doctor -v # Verbose output
/ork:doctor --json # Machine-readable for CIbash
/ork:doctor # 标准健康检查
/ork:doctor -v # 详细输出
/ork:doctor --json # 机器可读格式,适用于CICLI Options
CLI选项
| Flag | Description |
|---|---|
| Detailed output per check |
| JSON output for CI integration |
| Run only specific category |
| 标记 | 描述 |
|---|---|
| 详细输出每个检查的结果 |
| 输出JSON格式结果,用于CI集成 |
| 仅运行指定类别的检查 |
Health Check Categories
健康检查类别
0. Installed Plugins Detection
0. 已安装插件检测
Auto-detects which OrchestKit plugins are installed:
bash
undefined自动检测已安装的OrchestKit插件:
bash
undefinedDetection logic:
检测逻辑:
- Scans for .claude-plugin/plugin.json in plugin paths
- 扫描插件路径中的.claude-plugin/plugin.json
- Identifies orkl or ork
- 识别orkl或ork
- Counts skills/agents per installed plugin
- 统计每个已安装插件的Skill/Agent数量
**Output (orkl):**Installed Plugins: 1
- orkl: 109 skills, 36 agents, 119 hook entries
**Output (ork full):**Installed Plugins: 1
- ork: 200 skills, 36 agents, 119 hook entries
undefined
**输出(orkl):**Installed Plugins: 1
- orkl: 109 skills, 36 agents, 119 hook entries
**输出(完整ork):**Installed Plugins: 1
- ork: 200 skills, 36 agents, 119 hook entries
undefined1. Skills Validation
1. Skill验证
Validates skills in installed plugins (count varies by installation):
bash
undefined验证已安装插件中的Skill(数量因安装情况而异):
bash
undefinedChecks performed:
执行的检查:
- SKILL.md frontmatter (name, description, user-invocable)
- SKILL.md前置元数据(名称、描述、用户可调用性)
- context: fork field (required for CC 2.1.0+)
- context: fork字段(CC 2.1.0+必填)
- Token budget compliance (300-5000 tokens)
- Token预算合规性(300-5000 tokens)
- Internal link validation (references/ paths)
- 内部链接验证(references/路径)
- Related Skills references exist
相关Skill引用是否存在
**Output (full ork):**Skills: 186/186 valid
- User-invocable: 24 commands
- Reference skills: 163
**Output (orkl only):**Skills: 18/18 valid
- User-invocable: 0 commands
- Reference skills: 18
undefined
**输出(完整ork):**Skills: 186/186 valid
- User-invocable: 24 commands
- Reference skills: 163
**输出(仅orkl):**Skills: 18/18 valid
- User-invocable: 0 commands
- Reference skills: 18
undefined2. Agents Validation
2. Agent验证
Validates agents in installed plugins:
bash
undefined验证已安装插件中的Agent:
bash
undefinedChecks performed:
执行的检查:
- Frontmatter fields (name, description, model, tools, skills)
- 前置元数据字段(名称、描述、模型、工具、Skills)
- Model validation (opus, sonnet, haiku only)
- 模型验证(仅支持opus、sonnet、haiku)
- Skills references exist in src/skills/
- Skills引用在src/skills/中是否存在
- Tools are valid CC tools
- 工具是否为有效的CC工具
**Output:**Agents: 35/35 valid
- Models: 12 sonnet, 15 haiku, 8 opus
- All skill references valid
undefined
**输出:**Agents: 35/35 valid
- Models: 12 sonnet, 15 haiku, 8 opus
- All skill references valid
undefined3. Hook Health
3. Hook健康状态
Verifies hooks are properly configured:
bash
undefined验证Hook是否配置正确:
bash
undefinedChecks performed:
执行的检查:
- hooks.json schema valid
- hooks.json Schema是否有效
- Bundle files exist (11 .mjs bundles)
- 捆绑包文件是否存在(11个.mjs捆绑包)
- Async hooks use fire-and-forget pattern (6 async)
- 异步Hook是否使用即发即弃模式(6个异步Hook)
- Background hook metrics health (Issue #243)
- 后台Hook指标健康状态(Issue #243)
**Output:**Hooks: 22/22 entries valid (11 bundles)
- PreToolUse: 8, PostToolUse: 3, PermissionRequest: 3
- Async hooks: 6 (fire-and-forget)
- Error Rate: 0.3%
See [Hook Validation](references/hook-validation.md) for details.
**输出:**Hooks: 22/22 entries valid (11 bundles)
- PreToolUse: 8, PostToolUse: 3, PermissionRequest: 3
- Async hooks: 6 (fire-and-forget)
- Error Rate: 0.3%
详情请见[Hook验证](references/hook-validation.md)。4. Memory System (NEW)
4. 内存系统(新增)
Validates 3-tier memory architecture with file-level integrity checks:
bash
undefined通过文件级完整性检查验证三层内存架构:
bash
undefinedAutomated checks:
自动检查:
- Tier 1 (Graph): .claude/memory/ exists, decisions.jsonl valid JSONL, queue depth
- 第一层(Graph): .claude/memory/是否存在,decisions.jsonl是否为有效JSONL,队列深度
- Tier 2 (Mem0): MEM0_API_KEY detection, mem0-queue.jsonl depth, last sync
- 第二层(Mem0): 是否检测到MEM0_API_KEY,mem0-queue.jsonl深度,最后同步时间
- Tier 3 (Fabric): Both tiers available, session registry
- 第三层(Fabric): 前两层是否可用,会话注册表
Run these commands to gather memory health data:
运行以下命令收集内存健康数据:
wc -l .claude/memory/decisions.jsonl 2>/dev/null || echo "No decisions yet"
wc -l .claude/memory/graph-queue.jsonl 2>/dev/null || echo "No graph queue"
wc -l .claude/memory/mem0-queue.jsonl 2>/dev/null || echo "No mem0 queue"
ls -la .claude/memory/ 2>/dev/null || echo "Memory directory missing"
Read `.claude/memory/decisions.jsonl` directly to validate JSONL integrity (each line must parse as valid JSON). Count total lines, corrupt lines, and report per-category breakdown.
**Output:**Memory System: healthy
- Graph Memory: 42 decisions, 0 corrupt, queue depth 3
- Mem0 Cloud: available (API key detected), queue depth 0
- Memory Fabric: active (both tiers)
See [Memory Health](references/memory-health.md) for details.wc -l .claude/memory/decisions.jsonl 2>/dev/null || echo "No decisions yet"
wc -l .claude/memory/graph-queue.jsonl 2>/dev/null || echo "No graph queue"
wc -l .claude/memory/mem0-queue.jsonl 2>/dev/null || echo "No mem0 queue"
ls -la .claude/memory/ 2>/dev/null || echo "Memory directory missing"
直接读取`.claude/memory/decisions.jsonl`以验证JSONL完整性(每行必须能解析为有效JSON)。统计总行数、损坏行数,并按类别细分报告。
**输出:**Memory System: healthy
- Graph Memory: 42 decisions, 0 corrupt, queue depth 3
- Mem0 Cloud: available (API key detected), queue depth 0
- Memory Fabric: active (both tiers)
详情请见[内存健康状态](references/memory-health.md)。5. Build System (NEW)
5. 构建系统(新增)
Verifies plugins/ sync with src/:
bash
undefined验证plugins/与src/是否同步:
bash
undefinedChecks performed:
执行的检查:
- plugins/ generated from src/
- plugins/是否由src/生成
- Manifest counts match actual files
- 清单计数与实际文件是否匹配
- No orphaned skills/agents
- 无孤立的Skills/Agents
**Output:**Build System: in sync
- Skills: 186 src/ = 186 plugins/
- Agents: 35 src/ = 35 plugins/
- Last build: 2 minutes ago
undefined
**输出:**Build System: in sync
- Skills: 186 src/ = 186 plugins/
- Agents: 35 src/ = 35 plugins/
- Last build: 2 minutes ago
undefined6. Permission Rules
6. 权限规则
Leverages CC 2.1.3's unreachable permission rules detection:
Output:
Permission Rules: 12/12 reachable利用CC 2.1.3的不可达权限规则检测功能:
输出:
Permission Rules: 12/12 reachable7. Schema Compliance
7. Schema合规性
Validates JSON files against schemas:
Output:
Schemas: 15/15 compliant验证JSON文件是否符合Schema规范:
输出:
Schemas: 15/15 compliant8. Coordination System
8. 协调系统
Checks multi-worktree coordination health:
Output:
Coordination: healthy
- Active instances: 1
- Stale locks: 0检查多工作树协调健康状态:
输出:
Coordination: healthy
- Active instances: 1
- Stale locks: 09. Context Budget
9. 上下文预算
Monitors token usage:
Output:
Context Budget: 1850/2200 tokens (84%)监控token使用情况:
输出:
Context Budget: 1850/2200 tokens (84%)10. Claude Code Version
10. Claude Code版本
Validates runtime version:
Output:
Claude Code: 2.1.25 (OK)
- Minimum required: 2.1.16验证运行时版本:
输出:
Claude Code: 2.1.25 (OK)
- Minimum required: 2.1.16Report Format
报告格式
Full ork plugin:
+===================================================================+
| OrchestKit Health Report |
+===================================================================+
| Version: 5.4.0 | CC: 2.1.25 | Plugins: ork + ork |
+===================================================================+
| Skills | 186/186 valid |
| Agents | 35/35 valid |
| Hooks | 22/22 entries (11 bundles) |
| Memory | 3/3 tiers healthy |
| Permissions | 12/12 reachable |
| Schemas | 15/15 compliant |
| Context | 1850/2200 tokens (84%) |
| Coordination | 0 stale locks |
| CC Version | 2.1.25 (OK) |
+===================================================================+
| Status: HEALTHY (9/9 checks passed) |
+===================================================================+Domain-specific plugins (e.g., orkl + orkl):
+===================================================================+
| OrchestKit Health Report |
+===================================================================+
| Version: 5.4.0 | CC: 2.1.25 | Plugins: 3 installed |
+===================================================================+
| Installed | ork, orkl, orkl |
| Skills | 38/38 valid (combined) |
| Agents | 2/2 valid |
| Hooks | 22/22 entries (via ork) |
| Memory | 1/3 tiers (graph only) |
+===================================================================+完整ork插件:
+===================================================================+
| OrchestKit Health Report |
+===================================================================+
| Version: 5.4.0 | CC: 2.1.25 | Plugins: ork + ork |
+===================================================================+
| Skills | 186/186 valid |
| Agents | 35/35 valid |
| Hooks | 22/22 entries (11 bundles) |
| Memory | 3/3 tiers healthy |
| Permissions | 12/12 reachable |
| Schemas | 15/15 compliant |
| Context | 1850/2200 tokens (84%) |
| Coordination | 0 stale locks |
| CC Version | 2.1.25 (OK) |
+===================================================================+
| Status: HEALTHY (9/9 checks passed) |
+===================================================================+特定领域插件(如orkl + orkl):
+===================================================================+
| OrchestKit Health Report |
+===================================================================+
| Version: 5.4.0 | CC: 2.1.25 | Plugins: 3 installed |
+===================================================================+
| Installed | ork, orkl, orkl |
| Skills | 38/38 valid (combined) |
| Agents | 2/2 valid |
| Hooks | 22/22 entries (via ork) |
| Memory | 1/3 tiers (graph only) |
+===================================================================+JSON Output (CI Integration)
JSON输出(CI集成)
bash
/ork:doctor --jsonjson
{
"version": "5.4.0",
"claudeCode": "2.1.25",
"status": "healthy",
"plugins": {
"installed": ["ork", "ork"],
"count": 2
},
"checks": {
"skills": {"passed": true, "count": 186, "perPlugin": {"ork": 186}},
"agents": {"passed": true, "count": 35, "perPlugin": {"ork": 35}},
"hooks": {"passed": true, "entries": 22, "bundles": 11, "source": "ork"},
"memory": {"passed": true, "tiers": 3, "available": ["graph", "mem0", "fabric"]},
"permissions": {"passed": true, "count": 12},
"schemas": {"passed": true, "count": 15},
"context": {"passed": true, "usage": 0.84},
"coordination": {"passed": true, "staleLocks": 0},
"ccVersion": {"passed": true, "version": "2.1.25"}
},
"exitCode": 0
}bash
/ork:doctor --jsonjson
{
"version": "5.4.0",
"claudeCode": "2.1.25",
"status": "healthy",
"plugins": {
"installed": ["ork", "ork"],
"count": 2
},
"checks": {
"skills": {"passed": true, "count": 186, "perPlugin": {"ork": 186}},
"agents": {"passed": true, "count": 35, "perPlugin": {"ork": 35}},
"hooks": {"passed": true, "entries": 22, "bundles": 11, "source": "ork"},
"memory": {"passed": true, "tiers": 3, "available": ["graph", "mem0", "fabric"]},
"permissions": {"passed": true, "count": 12},
"schemas": {"passed": true, "count": 15},
"context": {"passed": true, "usage": 0.84},
"coordination": {"passed": true, "staleLocks": 0},
"ccVersion": {"passed": true, "version": "2.1.25"}
},
"exitCode": 0
}Exit Codes
退出码
| Code | Meaning |
|---|---|
| 0 | All checks pass |
| 1 | One or more checks failed |
| 代码 | 含义 |
|---|---|
| 0 | 所有检查通过 |
| 1 | 一项或多项检查失败 |
Interpreting Results
结果解读
| Status | Meaning | Action |
|---|---|---|
| All checks pass | Plugin healthy | None required |
| Skills warning | Invalid frontmatter | Run |
| Agents warning | Invalid frontmatter | Run |
| Hook error | Missing/broken hook | Check hooks.json and bundles |
| Memory warning | Tier unavailable | Check .claude/memory/ or MEM0_API_KEY |
| Build warning | Out of sync | Run |
| Permission warning | Unreachable rules | Review |
| 状态 | 含义 | 操作建议 |
|---|---|---|
| 所有检查通过 | 插件健康 | 无需操作 |
| Skill警告 | 前置元数据无效 | 运行 |
| Agent警告 | 前置元数据无效 | 运行 |
| Hook错误 | Hook缺失/损坏 | 检查hooks.json和捆绑包 |
| 内存警告 | 某层不可用 | 检查.claude/memory/或MEM0_API_KEY |
| 构建警告 | 不同步 | 运行 |
| 权限警告 | 存在不可达规则 | 查看 |
Troubleshooting
故障排查
"Skills validation failed"
"Skills validation failed"
bash
undefinedbash
undefinedRun skill structure tests
运行Skill结构测试
npm run test:skills
./tests/skills/structure/test-skill-md.sh
undefinednpm run test:skills
./tests/skills/structure/test-skill-md.sh
undefined"Build out of sync"
"Build out of sync"
bash
undefinedbash
undefinedRebuild plugins from source
从源码重新构建插件
npm run build
undefinednpm run build
undefined"Memory tier unavailable"
"Memory tier unavailable"
bash
undefinedbash
undefinedCheck graph memory
检查Graph内存
ls -la .claude/memory/
ls -la .claude/memory/
Check Mem0 (optional)
检查Mem0(可选)
echo $MEM0_API_KEY
undefinedecho $MEM0_API_KEY
undefinedRelated Skills
相关Skill
- - Configure plugin settings
configure - - CI/CD integration
quality-gates - - Comprehensive audits
security-scanning
- - 配置插件设置
configure - - CI/CD集成
quality-gates - - 全面审计
security-scanning
References
参考文档
- Skills Validation
- Agents Validation
- Hook Validation
- Memory Health
- Permission Rules
- Schema Validation
- Skill验证
- Agent验证
- Hook验证
- 内存健康状态
- 权限规则
- Schema验证