更新时间:2026-05-21
这些 OpenClaw 技能包可以迁移到 Claude Code 使用,但不能只把 SKILL.md 和 api-config.json 原样复制过去。
原因是两边的职责模型不同:
SKILL.md + api-config.json + Node 脚本 + 打包安装脚本 的组合。api-config.json 负责把自然语言触发映射到本地脚本或接口调用。api-config.json。推荐路线:
/skill-name 触发完整流程。api-config.json 里的参数 schema、执行方式、输出解析统一暴露成 Claude Code 可调用工具。这里的目标不是把旧技能包“转型”成 Claude Code 专用包,而是在不破坏 OpenClaw 已有闭环的前提下,新增 Claude Code 可识别、可调用、可复用的入口。
所以旧资产的处理原则是:
api-config.json:保留,继续给 OpenClaw 使用。SKILL.md:保留,继续给 OpenClaw 使用;Claude Code 可以另建 .claude/skills 或插件 skills。install.js、七牛 zip 包、OpenClaw 部署脚本:保留,不要因为 Claude Code 改造打断现有安装链路。更准确的架构目标是:
同一套业务核心
-> OpenClaw adapter
-> Claude Code adapter
-> MCP adapter
-> CLI adapter
当前观察:
scripts/tools/douyin-speaking-daily-runner.js 是完整 CLI 脚本,核心流程和命令行解析混在一起。scripts/tools/douyin-video-transcriber.js 也是 CLI 主入口。industry-trend-intelligence/scripts/industry-trend-runner.js 也是 CLI 主入口。scripts/tools/douyin-speaking-daily-report.js 已有 module.exports,复用性更好。建议重构:
scripts/core/
douyin-speaking-daily/
runDailyWorkflow.js
scriptCoCreation.js
transcriptQueue.js
douyin-video-transcript/
transcribeVideo.js
industry-trend/
runTrendWorkflow.js
scripts/tools/
douyin-speaking-daily-runner.js 只负责 parse argv + 调 core + emit result
douyin-video-transcriber.js 只负责 parse argv + 调 core + emit result
这样 OpenClaw 继续执行旧命令,Claude Code / MCP 则可以直接 import core function。
最小改法:
async function runDailyWorkflow(options, context = {}) {
// 原 main 里的业务逻辑迁移到这里
return result;
}
async function main() {
const args = parseArgs(process.argv.slice(2));
const result = await runDailyWorkflow(args, createCliContext(args));
emitResult(args, result);
}
if (require.main === module) main();
module.exports = { runDailyWorkflow };
这样不会破坏旧 CLI。
openclaw-tool-runner.js 重构为平台中立 local-script runner当前 scripts/tools/openclaw-tool-runner.js 已经有很有价值的能力:
--tool。{{param}}。PREFIX=<json>。这个逻辑不是 OpenClaw 独有,Claude Code 和 MCP 也能复用。
建议:
scripts/runtime/
local-script-runner.js
output-parser.js
template-args.js
tool-resolver.js
scripts/tools/
openclaw-tool-runner.js 保留旧入口,内部调用 scripts/runtime/local-script-runner.js
Claude Code P0 可以直接复用这个 runtime,MCP P1 也可以复用它执行 api-config.json。
api-config.json 读取逻辑抽成通用 tool manifest loader当前 api-config.json 是 OpenClaw 专用,但里面有大量可复用信息:
不需要立刻废弃它,而是新增读取器:
scripts/runtime/
api-config-loader.js
tool-manifest-normalizer.js
作用:
OpenClaw api-config.json
-> normalized tool manifest
-> OpenClaw 继续使用
-> Claude Code P0 wrapper 使用
-> MCP tool 注册使用
短期不要新增太多重复配置,否则会出现 OpenClaw 配一遍、Claude Code 再配一遍、MCP 又配一遍的维护灾难。
当前多个脚本都有自己的:
parseArgsboolintValuesplitListreadJsonMaybehasConcreteArg这些函数在 OpenClaw 和 Claude Code 下都会继续用。
建议抽到:
scripts/runtime/
args.js
values.js
json.js
好处:
{{xxx}}。当前比较好的设计是 assistantMessage,但各脚本返回字段还不完全统一。
建议统一:
{
"status": "ok",
"assistantMessage": "直接给用户看的正文",
"summary": {},
"nextAction": "",
"outputDir": "",
"files": [],
"warnings": [],
"errors": []
}
新增:
scripts/runtime/
result-envelope.js
所有旧 runner 逐步改成:
return okResult({
assistantMessage,
summary,
files,
nextAction
});
OpenClaw 仍然显示 assistantMessage,Claude Code 也能直接显示正文。
当前脚本里存在这些假设:
VOC_TOKENOPENCLAW_VOC_TOKENVOC_SOCIAL_TOKEN~/.openclaw/voc-credentials.json新增 Claude Code 后,不建议在业务脚本里继续写死 .openclaw。
建议:
scripts/runtime/
credentials.js
读取顺序:
1. 显式参数 --voc-token / context.vocToken
2. 环境变量 VOC_TOKEN / VOC_SOCIAL_TOKEN / OPENCLAW_VOC_TOKEN
3. 项目 memory 或 config
4. ~/.openclaw/voc-credentials.json
5. ~/.claude/voc-credentials.json
6. Claude Code plugin data dir
旧 OpenClaw 不受影响,Claude Code 可以新增自己的 credential 位置。
当前大量默认路径依赖 process.cwd():
memory/...outputs/...openclaw-voc-output/...Claude Code 下 cwd 可能是用户项目,插件目录,或 repo 根目录。
建议每个核心函数都接受:
context = {
workspaceRoot,
memoryRoot,
outputRoot,
platform: 'openclaw' | 'claude-code' | 'cli' | 'mcp'
}
CLI wrapper 默认:
workspaceRoot = process.cwd()
memoryRoot = path.join(workspaceRoot, 'memory')
outputRoot = path.join(workspaceRoot, 'outputs')
OpenClaw 和 Claude Code adapter 可以覆盖。
当前抖音、小红书的实际接口调用散落在多个工具和 runner 里。
新增 Claude Code 后,低层 API 最适合变成 MCP tools,所以要先抽 client:
scripts/clients/
voc-social-client.js
douyin-client.js
xiaohongshu-client.js
transcription-gateway-client.js
业务 runner 不直接拼接口 URL,而是调用 client。
收益:
以抖音日报为例,现在 runner 已经能做很多事:
功能闭环是好事,但 Claude Code 接入后,建议内部拆成模块:
profile/
collection/
transcript/
report/
script-co-create/
memory/
对外还是一个 runner,对内更清楚。这样 Claude Code 如果只想调用“逐字稿”或“脚本共创”,不用跑完整日报。
当前 Windows / PowerShell 输出里已经多次出现乱码风险。新增 Claude Code 后,路径、stdout、JSON、中文 prompt 都会经过更多层。
建议:
这些先保留:
douyin/*/api-config.json
industry-trend-intelligence/skills/*/api-config.json
xiaohongshu/*/api-config.json
原因:
保留:
douyin/douyin-speaking-daily-runner
industry-trend-intelligence/skills/industry-trend-runner
新增 Claude Code 目录即可:
.claude/skills/...
claude-code-adapter/...
低层 API 应该是工具,不是用户入口。
保持用户入口少而清晰:
低层能力放到 MCP tools:
参考 Claude Code 官方文档:
~/.claude/skills/<skill-name>/SKILL.md、项目 .claude/skills/<skill-name>/SKILL.md、插件 skills/<skill-name>/SKILL.md 都可以被 Claude Code 识别;技能可以被自然语言触发,也可以用 /skill-name 直接调用。description、allowed-tools、disable-model-invocation、arguments、${CLAUDE_SKILL_DIR} 等字段,适合做工作流入口和上下文说明。.claude/commands/*.md 适合承接高频固定入口,例如 /douyin-daily、/trend-daily,但复杂能力仍应沉淀为 Skill 或 MCP tool。skills/、commands/、hooks/、.mcp.json、bin/、settings.json 等放在同一个插件包里统一分发。对应到我们的技能包,最重要的判断是:
Skill 负责“什么时候用、怎么协作、如何输出”;MCP 或脚本适配器负责“真正调用哪个接口、传什么参数、怎么解析结果”。
本仓库目前有三类主要技能资产:
douyin/
douyin-speaking-daily-runner/
douyin-video-transcript/
douyin-general-search/
douyin-video-comments/
...
industry-trend-intelligence/
skills/
industry-trend-runner/
industry-trend-profile-builder/
xiaohongshu-search-notes/
xiaohongshu-note-detail/
xiaohongshu-note-comments/
...
scripts/
install.js
skill-package-manifest.json
xiaohongshu/
xiaohongshu-search-notes/
xiaohongshu-note-detail/
xiaohongshu-note-comments/
...
典型 OpenClaw 技能目录结构:
skill-name/
SKILL.md
api-config.json
典型 api-config.json 结构:
{
"name": "douyin-speaking-daily-runner",
"type": "local-script",
"execution": {
"kind": "command",
"command": "node",
"args": [
"scripts/tools/douyin-speaking-daily-runner.js",
"--result-prefix",
"DOUYIN_SPEAKING_DAILY_RUNNER_RESULT",
"--profile",
"{{profile}}"
],
"cwd": "{{workspaceRoot}}",
"outputParser": {
"type": "stdout-prefix-json",
"prefix": "DOUYIN_SPEAKING_DAILY_RUNNER_RESULT="
}
},
"parameters": {
"type": "object",
"properties": {}
},
"output": {
"type": "object",
"properties": {
"assistantMessage": { "type": "string" }
}
}
}
这套结构在 OpenClaw 里是完整的,但在 Claude Code 里缺少三个东西:
.claude/skills/<name>/SKILL.md 或插件 skills/<name>/SKILL.md。.mcp.json、.claude-plugin/plugin.json 或项目级 .claude/skills。建议把现有 OpenClaw 技能包重构成五层:
自然语言入口层
用户说“启动抖音口播每日稿件日报”
用户说“给我看小红书家装趋势日报”
Skill 协作层
Claude Code SKILL.md
负责角色、触发词、工作流、输出要求、交互策略
工具调用层
P0:Node wrapper
P1:MCP server
负责调用 API、本地脚本、上传下载、转写、报告生成
业务脚本层
复用现有 scripts/tools/*.js
复用 industry-trend-intelligence/scripts/*.js
记忆与产物层
memory/*.json
outputs/*
report markdown/json
transcript cache
这样迁移后,同一套底层业务脚本可以同时服务:
目标:最快让 Claude Code 可识别、可运行、可自然语言协作。
做法:
.claude/
skills/
douyin-speaking-daily/
SKILL.md
examples/
startup.md
script-co-create.md
scripts/
run-douyin-speaking-daily.ps1
industry-trend-intelligence/
SKILL.md
examples/
home-customization.md
generic-trend.md
scripts/
run-industry-trend.ps1
P0 的 Skill 不需要把所有 API 都写进去,只需要写清:
assistantMessage,文件路径只放末尾。示例:
---
name: douyin-speaking-daily
description: 生成抖音口播每日稿件日报,支持爆款选题、逐字稿补跑、脚本共创、定稿和偏好沉淀。用户说启动日报、生成口播选题、进入脚本共创、定稿时使用。
allowed-tools: Bash Read Write
---
## 工作流
1. 优先读取 `memory/douyin-speaking-profile.json`。
2. 如果没有档案,用自然语言向用户建档,不展示专业参数。
3. 调用 `node scripts/tools/douyin-speaking-daily-runner.js`。
4. 优先把返回 JSON 里的 `assistantMessage` 原样发给用户。
5. 不要只返回文件路径。
优点:
缺点:
适用范围:
目标:让 Claude Code 像调用内置工具一样调用我们的 VOC 技能接口。
新增:
claude-code-adapter/
mcp/
package.json
src/
server.js
load-api-configs.js
local-script-tool.js
http-endpoint-tool.js
output-parser.js
credential-store.js
workspace-resolver.js
skills/
douyin-speaking-daily/
SKILL.md
industry-trend-intelligence/
SKILL.md
.mcp.json
README.md
核心思路:
api-config.json。api-config.json 转成一个 MCP tool。parameters 映射成 MCP input schema。execution.kind 决定调用本地命令还是 HTTP 接口。outputParser 解析 stdout 或 HTTP response。映射关系:
| OpenClaw 字段 | Claude Code / MCP 对应 |
|---|---|
name |
MCP tool name |
description |
MCP tool description |
parameters |
MCP input schema |
execution.command |
本地进程 spawn |
execution.args |
参数模板渲染 |
execution.cwd |
workspace root resolver |
outputParser.type=stdout-prefix-json |
stdout 前缀 JSON 解析器 |
output.properties.assistantMessage |
Claude 聊天优先展示正文 |
relatedSkills |
Claude Skill 内的工作流路由说明 |
MCP 工具命名建议:
voc_douyin_speaking_daily_run
voc_douyin_video_transcript
voc_douyin_general_search
voc_xiaohongshu_search_notes
voc_xiaohongshu_note_comments
voc_industry_trend_run
voc_industry_trend_profile_build
Claude Code Skill 里只保留高层协作说明:
当用户要“启动日报”时:
1. 调用 `voc_douyin_speaking_daily_run`。
2. 如果返回 `needs_profile`,引导建档。
3. 如果返回 `needs_account_confirmation`,展示候选账号,不要自行确认。
4. 如果返回 `assistantMessage`,直接展示正文。
5. 如果用户选择选题,继续调用同一个 runner 的 `selectedTopicIndex` 或 `message`。
优点:
缺点:
目标:把 VOC 技能包变成 Claude Code 可安装、可复用、可分发的插件套件。
推荐目录:
claude-code-plugin-voc-intelligence/
.claude-plugin/
plugin.json
skills/
douyin-speaking-daily/
SKILL.md
douyin-video-transcript/
SKILL.md
industry-trend-intelligence/
SKILL.md
social-trend-intelligence/
SKILL.md
.mcp.json
mcp/
package.json
src/
server.js
...
bin/
voc-runner.cmd
voc-runner.ps1
hooks/
hooks.json
preflight-token-check.js
settings.json
README.md
插件化后可以做到:
bin/ 里的命令在插件启用时进入 Claude Code 的 Bash 路径。voc-douyin-speakingvoc-social-trendvoc-xiaohongshuvoc-transcript当前 OpenClaw 里每个 API 都可以是一个技能,例如:
douyin-general-searchdouyin-video-commentsxiaohongshu-search-notesxiaohongshu-note-comments迁移到 Claude Code 后,不建议把每个低层 API 都做成用户可见 Skill。
建议:
推荐用户可见 Skill:
douyin-speaking-daily
douyin-video-transcript
industry-trend-intelligence
social-trend-intelligence
推荐 MCP tools:
douyin_general_search
douyin_video_detail
douyin_video_comments
douyin_user_posts
douyin_video_transcript
xiaohongshu_search_notes
xiaohongshu_note_detail
xiaohongshu_note_comments
industry_trend_runner
api-config.json 平台中立化当前 api-config.json 是 OpenClaw 专用。建议新增一个平台中立的 tool.schema.json,或者让 MCP adapter 兼容读取 api-config.json。
推荐先兼容读取,后续再演进:
api-config.json 继续给 OpenClaw 用
tool.schema.json 后续平台中立版本
claude-tool.config.json 如需 Claude 特定覆盖再加
短期不建议马上删除 api-config.json,因为 OpenClaw 仍要继续跑。
所有脚本都应支持:
--workspace-root
--result-prefix
--output
--collection-mode sample|live
--message
输出必须稳定:
RESULT_PREFIX={"status":"ok","assistantMessage":"...","files":[]}
对 Claude Code 来说,最重要的是:
assistantMessage。目前 OpenClaw 默认用:
memory/douyin-speaking-profile.json
memory/douyin-speaking-script-memory.json
memory/douyin-speaking-history.json
memory/industry-trend-memory.json
Claude Code 迁移时有两种选择:
方案 A:继续使用项目内 memory/。
适合:
方案 B:插件持久化目录。
适合:
建议:
P0:继续使用项目 memory/
P1:MCP adapter 支持 --memory-root
P2:Plugin 使用 ${CLAUDE_PLUGIN_DATA}/memory,并允许项目级覆盖
OpenClaw 里已经优化过“不要展示专业参数”的启动方式。Claude Code Skill 也要继承这个设计。
用户入口话术示例:
启动抖音口播每日稿件日报。
先读取已有账号档案,如果没有就帮我建档。
今天帮我采集抖音爆款口播选题,自动补一条最值得拆的视频逐字稿。
最后直接在聊天里给我日报,不要只给文件路径。
Claude Code Skill 应把这类话术作为默认入口,而不是让用户输入:
profile=...
autoTranscriptTopN=1
autoTranscriptProvider=iflytek-gateway
需要区分:
建议:
P0:Skill 文档里写清楚何时需要用户确认。
P1:MCP tool 增加 budget、dryRun、collectionMode。
P2:Hook 做运行前检查和余额提醒。
特别是:
autoTranscriptTopN > 0 会消耗转写额度。finalize=true 会写入长期记忆。Claude Code 的体验要沿用我们已经验证过的内容优先原则:
优先展示 assistantMessage
其次展示关键摘要
最后才展示文件路径
所有 runner 输出建议统一:
{
"status": "ok",
"assistantMessage": "直接给用户看的正文",
"summary": {},
"nextAction": "建议用户下一步怎么说",
"files": [],
"warnings": [],
"errors": []
}
docs/specs/claude-code-skill-package-porting-analysis.md
.claude/
skills/
douyin-speaking-daily/
SKILL.md
douyin-video-transcript/
SKILL.md
industry-trend-intelligence/
SKILL.md
claude-code-adapter/
README.md
mcp/
package.json
src/
server.js
load-api-configs.js
local-script-tool.js
http-endpoint-tool.js
output-parser.js
credential-store.js
workspace-resolver.js
claude-code-adapter/
skills/
douyin-speaking-daily/
SKILL.md
examples.md
industry-trend-intelligence/
SKILL.md
examples.md
tests/
api-config-loader.test.js
output-parser.test.js
local-script-tool.test.js
fixtures/
douyin-speaking-daily-runner.api-config.json
industry-trend-runner.api-config.json
claude-code-plugin-voc-intelligence/
.claude-plugin/
plugin.json
skills/
.mcp.json
mcp/
bin/
hooks/
settings.json
scripts/tools/douyin-speaking-daily-runner.js
scripts/tools/douyin-video-transcriber.js
industry-trend-intelligence/scripts/industry-trend-runner.js
industry-trend-intelligence/scripts/industry-trend-profile-builder.js
industry-trend-intelligence/scripts/industry-trend-memory.js
industry-trend-intelligence/scripts/xiaohongshu-trend-collector.js
调整重点:
--workspace-root。--result-prefix。assistantMessage 永远优先返回。范围:
industry-trend-intelligencedouyin-speaking-daily交付:
.claude/skills/industry-trend-intelligence/SKILL.md
.claude/skills/douyin-speaking-daily/SKILL.md
测试目标:
用户说:启动抖音口播每日稿件日报
Claude 能调用 runner
Claude 直接展示日报正文
用户说:选题2,进入脚本共创
Claude 能续接最近日报
用户说:定稿
Claude 能写入偏好记忆
范围:
local-script 类型。douyin-speaking-daily-runnerindustry-trend-runner验收:
Claude Code /mcp 可以看到 voc 工具
工具可以返回 assistantMessage
错误能结构化返回
范围:
目标:
Claude 不再靠 shell 拼命令。
Claude 能组合多个工具完成“通用社媒趋势情报官”。
范围:
claude-code-plugin-voc-intelligence/
交付:
api-config.json。Claude Code 能识别 Skill,不等于能识别 OpenClaw 的 api-config.json。如果没有脚本调用说明或 MCP adapter,Claude 只能读说明,无法稳定执行工具。
不要把 douyin-video-comments、xiaohongshu-note-detail 这种低层能力暴露成用户主要入口。用户应该看到“日报”“趋势情报”“逐字稿”“脚本共创”这类任务入口。
Claude Code 用户也不应该只看到文件路径。所有核心 runner 都要返回 assistantMessage。
当前 PowerShell 输出中已经出现过中文乱码。迁移时要统一:
UTF-8
绝对路径
path.resolve
不要手拼 Windows 反斜杠
逐字稿、社媒采集、批量评论抓取都可能消耗额度。MCP tool 参数里应保留:
dryRun
collectionMode
dailyBudget
autoTranscriptTopN
maxCommentPages
最终不是“OpenClaw 技能包复制成 Claude Code 技能包”,而是沉淀成一套平台中立 VOC Agent Kit:
voc-agent-kit/
core/
scripts/
schemas/
runners/
openclaw/
skills/
api-config.json
install.js
claude-code/
skills/
mcp/
plugin/
docs/
user-guides/
developer-guides/
这样同一个底层能力可以有多套外壳:
api-config.json。如果要最快开始,我建议先做这个版本:
.claude/skills/douyin-speaking-daily/SKILL.md
.claude/skills/industry-trend-intelligence/SKILL.md
claude-code-adapter/scripts/run-openclaw-local-script.js
claude-code-adapter/tests/output-parser.test.js
run-openclaw-local-script.js 做三件事:
api-config.json。{{param}}。这样可以不立刻写完整 MCP,但已经把 OpenClaw 的关键执行协议抽象出来,为 P1 MCP 迁移铺路。
用户可以这样说:
启动抖音口播每日稿件日报。
Claude Code 应返回:
今日爆款选题池
Top 5 选题
逐字稿状态
下一步怎么选题/共创/定稿
用户可以继续说:
选题2,进入脚本共创。
开头更狠一点,老板视角。
定稿。
不要纯工具清单方向。
Claude Code 应能连续完成:
assistantMessage 被优先展示。不要先做“大一统插件”。先做 P0 轻量适配和 P1 MCP 骨架。
顺序应该是:
.claude/skills 证明 Claude Code 的用户工作流能跑通。api-config.json 抽象成通用工具执行器。这样风险最低,也不会影响 OpenClaw 当前已经跑通的技能包。