Agent安装
- 作者仓库星标 3,406
- 作者更新于 实时读取
- 作者仓库 claude-octopus
- 领域
- 文档
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @nyldn · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需手动接入
- 是否需要外部 API Key
- 需要 · Vendor-specific
- 兼容的系统
- macOS · Linux · Windows
- 底层运行要求
- Node.js
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 读取环境变量
- 网络行为
- 允许外网请求
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: skill-doctor
description: Environment diagnostics — check providers, auth, config, hooks, scheduler, and more Run environm…
category: 文档
runtime: Node.js
---
# skill-doctor 输出预览
## PART A: 任务判断
- 适用问题:PRD、RFC、README、项目说明或知识库整理。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Overview / When to Use / The Process”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于PRD、RFC、README、项目说明或知识库整理,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Overview / When to Use / The Process”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、读取环境变量、会按任务需要访问外部网络、需要准备 Vendor-specific API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令、读取环境变量;会按任务需要访问外部网络;需要准备 Vendor-specific API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文出现了 `/octo`、`/plugin` 这类斜杠命令;如果你的 Agent 支持命令触发,优先用命令开场,再补充目标和边界。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令、读取环境变量。
先用一个小任务确认它会围绕“Overview / When to Use / The Process”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: skill-doctor
description: Environment diagnostics — check providers, auth, config, hooks, scheduler, and more Run environm…
category: 文档
source: nyldn/claude-octopus
---
# skill-doctor
## 什么时候使用
- 把项目文档方向的常用动作沉淀成 Agent 可调用的技能 适合处理README、PRD、RFC、教程和知识库文档,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的…
- 面向PRD、RFC、README、项目说明或知识库整理,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Overview / When to Use / The Process」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令、读取环境变量;会按任务需要访问外部网络;需要准备 Vendor-specific API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "skill-doctor" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Overview / When to Use / The Process
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> Node.js | 读取文件、写入/修改文件、执行终端命令、读取环境变量 | 会按任务需要访问外部网络
安全层 -> 需要准备 Vendor-specific API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Host: Codex CLI — This skill was designed for Claude Code and adapted for Codex. Cross-reference commands use installed skill names in Codex rather than
/octo:*slash commands. Use the active Codex shell and subagent tools. Do not claim a provider, model, or host subagent is available until the current session exposes it. For host tool equivalents, seeskills/blocks/codex-host-adapter.md.
Environment Doctor
Overview
Run environment diagnostics across 11 check categories. Identifies misconfigured providers, stale state, broken hooks, and other issues that prevent Claude Octopus from working correctly.
Core principle: Detect problems before they surface in workflows.
When to Use
Use this skill when:
- Something isn't working and you're not sure why
- After installing or updating the plugin
- Before a demo or important workflow run
- Checking if providers are properly authenticated
- Verifying scheduler, hooks, or skills are correctly configured
Do NOT use for:
- First-time setup (use
/octo:setup— it guides configuration) - Project workflow status (use
/octo:status) - Debugging application code (use
/octo:debug)
The Process
Step 1: Resolve Plugin Root and Run Full Diagnostics
Use this resolver before running Octopus scripts. Do not assume
~/.claude-octopus/plugin exists; Windows Git Bash installs may not support the
stable symlink. Run this as a single Bash call.
OCTO_PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-}"
if [[ -z "$OCTO_PLUGIN_ROOT" || ! -x "$OCTO_PLUGIN_ROOT/scripts/orchestrate.sh" ]]; then
OCTO_PLUGIN_ROOT="${HOME}/.claude-octopus/plugin"
fi
if [[ ! -x "$OCTO_PLUGIN_ROOT/scripts/orchestrate.sh" ]] && command -v octopus >/dev/null 2>&1; then
OCTO_BIN="$(command -v octopus)"
OCTO_PLUGIN_ROOT="$(cd "$(dirname "$OCTO_BIN")/.." && pwd)"
fi
if [[ ! -x "$OCTO_PLUGIN_ROOT/scripts/orchestrate.sh" ]]; then
OCTO_PLUGIN_ROOT="$(
find "${HOME}/.claude/plugins" -type f -path "*/scripts/orchestrate.sh" -print 2>/dev/null \
| sed 's#/scripts/orchestrate.sh$##' \
| grep -E '(nyldn-plugins|claude-octopus|/octo(/[0-9]|$))' \
| sort \
| tail -1
)"
fi
if [[ -z "$OCTO_PLUGIN_ROOT" || ! -x "$OCTO_PLUGIN_ROOT/scripts/orchestrate.sh" ]]; then
echo "Claude Octopus plugin root not found. Reinstall the octo plugin, then retry /octo:doctor."
exit 1
fi
mkdir -p "${HOME}/.claude-octopus"
ln -sfn "$OCTO_PLUGIN_ROOT" "${HOME}/.claude-octopus/plugin" 2>/dev/null || true
export OCTO_PLUGIN_ROOT
cd "$OCTO_PLUGIN_ROOT" && bash scripts/orchestrate.sh doctor
This runs all 11 check categories and displays a formatted report.
Step 2: Filter by Category (Optional)
If the user asks about a specific area, filter:
cd "${HOME}/.claude-octopus/plugin" && bash scripts/orchestrate.sh doctor providers
cd "${HOME}/.claude-octopus/plugin" && bash scripts/orchestrate.sh doctor auth
cd "${HOME}/.claude-octopus/plugin" && bash scripts/orchestrate.sh doctor config
cd "${HOME}/.claude-octopus/plugin" && bash scripts/orchestrate.sh doctor state
cd "${HOME}/.claude-octopus/plugin" && bash scripts/orchestrate.sh doctor smoke
cd "${HOME}/.claude-octopus/plugin" && bash scripts/orchestrate.sh doctor hooks
cd "${HOME}/.claude-octopus/plugin" && bash scripts/orchestrate.sh doctor scheduler
cd "${HOME}/.claude-octopus/plugin" && bash scripts/orchestrate.sh doctor skills
cd "${HOME}/.claude-octopus/plugin" && bash scripts/orchestrate.sh doctor conflicts
cd "${HOME}/.claude-octopus/plugin" && bash scripts/orchestrate.sh doctor agents
cd "${HOME}/.claude-octopus/plugin" && bash scripts/orchestrate.sh doctor recurrence
Step 3: Check & Install Dependencies
Run the dependency checker to find missing CLIs, statusline config, and recommended plugins:
bash "${HOME}/.claude-octopus/plugin/scripts/install-deps.sh" check
If the check reports missing deps, offer to install them:
bash "${HOME}/.claude-octopus/plugin/scripts/install-deps.sh" install
This auto-installs: Codex CLI, Gemini CLI, jq, and the statusline resolver. For plugins (claude-mem, document-skills), it prints /plugin install commands the user must run manually.
Step 4: Verbose or JSON Output
# Detailed output for troubleshooting
cd "${HOME}/.claude-octopus/plugin" && bash scripts/orchestrate.sh doctor --verbose
# Machine-readable output
cd "${HOME}/.claude-octopus/plugin" && bash scripts/orchestrate.sh doctor --json
# Combine: specific category + verbose
cd "${HOME}/.claude-octopus/plugin" && bash scripts/orchestrate.sh doctor auth --verbose
Step 5: Interactive Remediation (MANDATORY for fixable issues)
After running diagnostics, if ANY fixable issues are found, you MUST use AskUserQuestion to offer fixes. Do NOT just print instructions — offer to execute them.
RTK not installed:
AskUserQuestion({
questions: [{
question: "RTK saves 60-90% on bash output tokens. Install it now?",
header: "Install RTK",
multiSelect: false,
options: [
{label: "Install via brew (Recommended)", description: "brew install rtk — fast, macOS"},
{label: "Install via cargo", description: "cargo install rtk-token-killer"},
{label: "Skip", description: "Continue without RTK"}
]
}]
})
If user chooses install, run it, then offer hook setup.
RTK installed but hook not configured on macOS/Linux:
On Windows Git Bash, do not offer rtk init -g. RTK uses CLAUDE.md injection
mode there, so report the hook check as skipped.
AskUserQuestion({
questions: [{
question: "RTK is installed but the Claude Code hook isn't active. Configure it?",
header: "RTK Hook",
multiSelect: false,
options: [
{label: "Run rtk init -g (Recommended)", description: "Auto-installs Claude Code bash hook on macOS/Linux"},
{label: "Skip", description: "I'll configure it later"}
]
}]
})
Missing providers (Codex/Gemini not installed):
AskUserQuestion({
questions: [{
question: "Some providers are missing. Install them?",
header: "Providers",
multiSelect: true,
options: [
{label: "Codex CLI", description: "npm install -g @openai/codex"},
{label: "Gemini CLI", description: "brew install gemini-cli (macOS)"},
{label: "Skip all", description: "Continue with available providers"}
]
}]
})
Auth expired: Offer to run the login command for the expired provider.
Multiple fixable issues: Batch them into a single AskUserQuestion with multiSelect where appropriate, rather than asking one at a time.
Check Categories
| Category | What it checks |
|---|---|
providers |
Claude Code version, Codex CLI installed, Gemini CLI installed, Perplexity API key, Ollama local LLM (server + models), circuit breaker status, provider fallback history |
auth |
Authentication status for each provider |
config |
Plugin version, install scope, feature flags |
state |
Project state.json, stale results, workspace writable |
smoke |
Smoke test cache, model configuration |
hooks |
hooks.json validity, hook scripts |
scheduler |
Scheduler daemon, jobs, budget gates, kill switches |
skills |
Skill files loaded and valid |
conflicts |
Conflicting plugins detection |
agents |
Agent definitions, worktree isolation, CLI registration, version compatibility |
recurrence |
Failure pattern detection — flags repeated quality gate failures, source hotspots, 48h trends |
deps |
Software dependencies — Node.js, jq, Codex/Gemini CLIs, RTK token compression (gain stats + hook status), statusline resolver, recommended plugins |
Interpreting Results
Healthy Output
All checks pass — no action needed.
Common Issues and Fixes
| Issue | Fix |
|---|---|
| Codex CLI not found | npm install -g @openai/codex or install via codex login |
| Gemini CLI not found | Install Gemini CLI from Google |
| Perplexity not configured | export PERPLEXITY_API_KEY="pplx-..." (optional) |
| Auth expired | Re-run codex login or gemini login |
| Circuit breaker OPEN | Provider had 3+ consecutive transient failures — wait for cooldown or check provider status |
| Stale state | Delete .octo/state.json and re-initialize |
| Invalid hooks.json | Check hooks.json syntax — must be valid JSON |
| RTK not installed | Offer to install: brew install rtk && rtk init -g (saves 60-90% tokens). Use AskUserQuestion to offer brew vs cargo install. |
| RTK installed but hook not configured | On macOS/Linux, offer rtk init -g; on Windows Git Bash, report skipped because RTK uses CLAUDE.md injection mode |
| RTK gain stats unavailable | Run some bash commands first, then check rtk gain to see token savings |
| Conflicting plugins | Uninstall conflicting plugins or adjust scope |
Integration with Other Skills
| Scenario | Route |
|---|---|
| Doctor finds missing provider | Suggest /octo:setup to configure |
| Doctor finds stale project state | Suggest /octo:status to review |
| Doctor finds hook errors | Guide user to fix hooks.json |
| All checks pass, user still has issues | Suggest /octo:debug for deeper investigation |
Hook Profile
Claude Octopus hooks can run in different profiles to balance cost and coverage.
Current profile: $OCTO_HOOK_PROFILE (default: standard)
Available profiles:
- minimal — Only session lifecycle and cost tracking hooks (lowest overhead)
- standard — All hooks except expensive review/security gates (default)
- strict — All hooks enabled including quality and security gates
Override: Set OCTO_PROFILE=budget|balanced|quality or OCTO_DISABLED_HOOKS=hook1,hook2 to fine-tune. Legacy OCTO_HOOK_PROFILE still works (minimal→budget, standard→balanced, strict→quality).
Intensity Profile
The doctor reports the active intensity profile — a single knob controlling hook gating, model selection, phase skipping, and context verbosity.
What the Doctor Checks
- Current profile:
OCTO_PROFILEvalue (budget/balanced/quality, default: balanced) - Profile source: env var, legacy
OCTO_HOOK_PROFILE, or auto-selected from intent - Hook gating: which hooks are enabled/disabled at this profile level
- Model hints: which model (sonnet/opus) is recommended for each phase
- Context verbosity: compressed/standard/full
Profile Summary
| Dimension | budget | balanced | quality |
|---|---|---|---|
| Hooks | essential only | standard (no quality gates) | all hooks |
| Models | Sonnet everywhere | Sonnet + Opus for synthesis | Opus for most phases |
| Phases | Skip discover if context given | Skip re-discovery | All phases run |
| Context | Compressed | Standard | Full inlining |
Project Tier Hint
Also report OCTO_TIER when set. This is a recommendation hint, not a hard policy.
| Tier | Doctor guidance |
|---|---|
prototype |
Prefer faster checks and warn before high-cost provider fanout |
mvp |
Use balanced defaults and consensus on risky changes |
production |
Recommend full verification, security review, and stricter release gates |
If unset, show OCTO_TIER=unset and suggest setting it only when the project has a stable risk profile.
Remote Session Checks
If CLAUDE_CODE_REMOTE=true or OCTOPUS_REMOTE_SESSION=true, report:
- remote session detected
- autonomous mode default active when no explicit autonomy is set
- provider probes skipped to conserve time/quota
- full HUD disabled unless
OCTOPUS_REMOTE_STATUSLINE=full - provider CLIs may need to be installed in the cloud setup script
Suggest /octo:setup only for configuration guidance; do not recommend interactive provider logins inside the remote session.
Runtime Context
The doctor checks for project-level RUNTIME.md — a file that provides project-specific context (API endpoints, env vars, test commands, build steps) to orchestration prompts.
What the Doctor Checks
- RUNTIME.md exists in the project root (also checks
.octopus/RUNTIME.mdand.claude-octopus/RUNTIME.md) - If missing, suggest creating one from the template:
cp "${HOME}/.claude-octopus/plugin/config/templates/RUNTIME.md" ./RUNTIME.md - If present, confirm it contains at least one populated section (not just the template defaults)
Why It Matters
Without a RUNTIME.md, orchestration prompts lack project-specific details — leading to generic advice about test commands, environment variables, and build steps. A populated RUNTIME.md makes every workflow more accurate.
Quick Reference
| User Input | Action |
|---|---|
/octo:doctor |
Run all 11 categories |
/octo:doctor providers |
Check provider installation only |
/octo:doctor auth --verbose |
Detailed auth status |
/octo:doctor --json |
Machine-readable output |
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核