Claude Code 技能 — 将编码任务委托给Opencode,通过git diff监督并保存50-90%的Claude token使用率
概览
Claude Code 技能,将编码任务委派给并监督结果——与 vibe-skill 和 gemini-skill 的模式相同。 当你用Claude代码输入/opencode时,这项技能: 1. 将任务分解为原子子任务(如有需要) 2.为 OpenCode 编写自包含的提示符 3.运行 opencode-delegate —— 一个以非交互模式启动 OpenCode CLI 的脚本 4.流结构化输出:[read]、[edit]、[write]、[search]、[shell]、[opencode] 5.自动对修改后的 .py、.js、.json、.sh 文件运行后语法检查 6.向你报告 git diff 及任何问题 7.在 ~/.local/share/delegate-runs 中附加结构化 JSON 条目。
概述(AI 翻译)
Claude负责协调。OpenCode代码。你来审查差异。
一个Claude Code技能,将编码任务委托给OpenCode CLI并监督结果——这与vibe-skill和gemini-skill的模式相同。
它的作用
当你在Claude代码中输入/opencode 时,这个技能:
- 将任务分解为原子子任务(如有需要)
- 为OpenCode编写自包含的提示词
- 运行
opencode-delegate——一个在非交互模式下启动OpenCode CLI的脚本 - 流结构化输出:
[read]、[edit]、[write]、[search]、[shell]、[opencode] - 自动对修改后的
.py、.js、.json、.sh文件进行运行后语法检查 - 向你报告git差异和任何问题
- 将结构化JSON条目附加到
~/.local/share/delegate-runs.jsonl(令牌、成本、持续时间、退出码)
先修条件
- 安装了OpenCode CLI(
opencode --version) - 启用技能的Claude代码
python3可用(用于流式解析器和语法检查)- 一个用于工作的 git 仓库
安装
一步步
验证安装
更新中
由于安装使用符号链接,只需一个git pull:
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
opencode-skill
Claude orchestrates. OpenCode codes. You review the diff.
A Claude Code skill that delegates coding tasks to OpenCode CLI and supervises the result — the same pattern as vibe-skill and gemini-skill.
What it does
When you type /opencode in Claude Code, this skill:
- Decomposes the task into atomic sub-tasks (if needed)
- Writes a self-contained prompt for OpenCode
- Runs
opencode-delegate— a script that launches OpenCode CLI in non-interactive mode - Streams structured output:
[read],[edit],[write],[search],[shell],[opencode] - Runs post-run syntax checks on modified
.py,.js,.json,.shfiles automatically - Reports the git diff and any issues to you
- Appends a structured JSON entry to
~/.local/share/delegate-runs.jsonl(tokens, cost, duration, exit code)
Prerequisites
- OpenCode CLI installed (
opencode --version) - Claude Code with skills enabled
python3available (for the streaming parser and syntax checks)- A git repository to work in
Installation
git clone https://github.com/pcx-wave/opencode-skill.git && cd opencode-skill && mkdir -p ~/tools ~/.claude/skills/opencode ~/.claude/skills/opencodeon ~/.claude/skills/opencodeoff ~/.claude/skills/opencodestatus ~/.claude/skills/opencode-model-pick ~/.claude/skills/opencode-model-clear && ln -sf "$(pwd)/tools/opencode-delegate" ~/tools/opencode-delegate && ln -sf "$(pwd)/tools/delegate-report" ~/tools/delegate-report && chmod +x ~/tools/opencode-delegate ~/tools/delegate-report && ln -sf "$(pwd)/SKILL.md" ~/.claude/skills/opencode/SKILL.md && ln -sf "$(pwd)/OPENCODEON.md" ~/.claude/skills/opencodeon/SKILL.md && ln -sf "$(pwd)/OPENCODEOFF.md" ~/.claude/skills/opencodeoff/SKILL.md && ln -sf "$(pwd)/OPENCODESTATUS.md" ~/.claude/skills/opencodestatus/SKILL.md && ln -sf "$(pwd)/OPENCODEMODELPICK.md" ~/.claude/skills/opencode-model-pick/SKILL.md && ln -sf "$(pwd)/OPENCODEMODELCLEAR.md" ~/.claude/skills/opencode-model-clear/SKILL.md
Step-by-step
# 1. Clone this repo
git clone https://github.com/pcx-wave/opencode-skill.git
cd opencode-skill
# 2. Install the scripts (symlinks — stay in sync with git pull)
mkdir -p ~/tools
ln -sf "$(pwd)/tools/opencode-delegate" ~/tools/opencode-delegate
ln -sf "$(pwd)/tools/delegate-report" ~/tools/delegate-report
chmod +x ~/tools/opencode-delegate ~/tools/delegate-report
# 3. Install the skills for Claude Code
mkdir -p ~/.claude/skills/opencode ~/.claude/skills/opencodeon ~/.claude/skills/opencodeoff \
~/.claude/skills/opencodestatus ~/.claude/skills/opencode-model-pick ~/.claude/skills/opencode-model-clear
ln -sf "$(pwd)/SKILL.md" ~/.claude/skills/opencode/SKILL.md
推荐工具
换一个关键词,或者移除筛选条件。
安装
npx skillfish add pcx-wave/opencode-skill