日期:2026-06-05 状态:草案 v1 定位:把 Webnovel Writer 从 Claude Code 专用插件演进为跨宿主、多 agent、可验证的写作插件 参考样本:Superpowers、PostHog AI Plugin、Shopify AI Toolkit、Compound Engineering、wshobson/agents
当前 Webnovel Writer 已具备一套完整的 Claude Code 插件形态:
webnovel-writer/
├── .claude-plugin/plugin.json
├── agents/
│ ├── context-agent.md
│ ├── data-agent.md
│ ├── deconstruction-agent.md
│ └── reviewer.md
├── skills/
│ ├── webnovel-init/
│ ├── webnovel-plan/
│ ├── webnovel-write/
│ ├── webnovel-review/
│ ├── webnovel-query/
│ ├── webnovel-learn/
│ └── webnovel-dashboard/
├── scripts/
├── references/
├── templates/
├── genres/
└── dashboard/
核心能力已经不是问题:
skills/ 定义写作工作流入口agents/ 承载写前组装、审查、数据提取、参考书拆解等 subagentscripts/ 负责项目初始化、Story System、索引、记忆、审查落库、Dashboard.story-system/ 与 .webnovel/ 已形成主链事实源与投影层真正的问题是:这些能力目前默认运行在 Claude Code 的插件语义里,文档和流程里存在多处 Claude Code 耦合。
当前 skills/agents 中主要耦合点:
| 类型 | 现状 | 问题 |
|---|---|---|
| 插件根路径 | 大量使用 CLAUDE_PLUGIN_ROOT |
Codex、OpenCode 等宿主使用 PLUGIN_ROOT 或不同机制 |
| 项目根路径 | 大量使用 CLAUDE_PROJECT_DIR |
非 Claude 宿主未必提供该变量 |
| 工具名 | Read / Write / Edit / Grep / Bash / Agent / AskUserQuestion |
各宿主工具名、调用语义不同 |
| subagent 调度 | 明确写 Agent(...) |
Codex、Gemini、OpenCode、Copilot 都有不同 subagent 入口 |
| slash 命令 | README 与 docs 默认 /webnovel-* |
非 Claude 宿主可能以 skill、command TOML、prompt entry 或插件命令暴露 |
| skill 体积 | 部分 SKILL.md 很长 |
Codex 等宿主对 skill body 有更严格的有效上下文预算 |
| hooks | 当前未形成跨宿主 bootstrap | 不同宿主启动注入能力差异较大 |
本 spec 解决的是多智能体适配最终形态,包含两层含义:
context-agent、reviewer、data-agent、deconstruction-agent 能在不同宿主的 agent/subagent 能力中被正确调度,能力不足时有明确降级规则。本 spec 不只是“补几个 manifest”,而是规定最终状态下:
一套源内容,多宿主消费
skills/、agents/、scripts/、references/、templates/、dashboard/ 是唯一业务事实源。保留 Claude Code 现有体验
/webnovel-init、/webnovel-plan、/webnovel-write、/webnovel-review、/webnovel-query、/webnovel-dashboard 继续可用。Codex / Cursor 原生插件优先
.codex-plugin/plugin.json 加载 plugin root 下的 skills/。.cursor-plugin/plugin.json 加载 plugin root 下的 skills/、agents/、hooks。Gemini / OpenCode / Copilot 使用生成适配
subagent 调度语义平台化
context-agent”,不写死 Agent(...)。using-webnovel-writer 与 adapter 负责。Python runtime 可移植
CLAUDE_PLUGIN_ROOT 单一变量。有验收矩阵
webnovel-write 多 agent 链。Superpowers 的核心做法:
skills/ 是共享源.claude-plugin/、.codex-plugin/、.cursor-plugin/、gemini-extension.json 是薄适配层using-superpowers 作为 bootstrap skillreferences/*-tools.md适合 Webnovel Writer 借鉴的点:
PostHog 的核心做法:
skills 与 .mcp.json${CLAUDE_PLUGIN_ROOT:-$PLUGIN_ROOT} 兼容 Claude/Codex 环境变量.md 为源,生成 Gemini TOML适合 Webnovel Writer 借鉴的点:
Shopify 的核心做法:
skills/ + scripts + assets适合 Webnovel Writer 借鉴的点:
Compound Engineering 的核心做法:
适合 Webnovel Writer 借鉴的点:
wshobson/agents 的核心做法:
plugins/ 是唯一源tools/adapters/ 生成 Codex、Gemini、OpenCode、Copilot 等宿主产物适合 Webnovel Writer 借鉴的点:
SKILL.md 应瘦身,细节移入 references/以下目录是唯一业务事实源:
webnovel-writer/skills/
webnovel-writer/agents/
webnovel-writer/scripts/
webnovel-writer/references/
webnovel-writer/templates/
webnovel-writer/genres/
webnovel-writer/dashboard/
任何宿主适配产物都不得成为新的业务事实源。
禁止:
skills-codex/agents-gemini/适配层只允许处理:
适配层不得处理:
最终形态下,skill 正文应优先写动作语义:
| 不推荐 | 推荐 |
|---|---|
使用 Read 工具读取文件 |
读取文件 |
使用 Bash 运行命令 |
运行命令 |
使用 Grep 搜索 |
搜索 |
使用 Agent 调用 reviewer |
调用 reviewer subagent |
使用 AskUserQuestion 询问用户 |
向用户确认 |
Claude Code 专用工具名只允许出现在:
allowed-toolsusing-webnovel-writer/references/claude-tools.mdwebnovel-write 的核心规则不是“必须调用 Claude 的 Agent 工具”,而是:
必须把写前组装、审查、事实提取交给隔离上下文的专门 subagent,不得由主流程口头替代。
因此最终 skill 应表达为:
调用 `context-agent` subagent 生成写作任务书。
按当前宿主的 subagent 调度方式执行;若当前宿主不支持 subagent,进入兼容模式或阻断。
平台如何执行由 tool mapping 决定。
最终形态下,每个 SKILL.md 应成为入口与导航,不应承载完整长篇协议。
目标结构:
skills/webnovel-write/
├── SKILL.md # 入口、决策树、步骤摘要、引用加载策略
└── references/
├── protocol.md # 完整写章协议
├── agent-contracts.md # context/reviewer/data-agent 输入输出契约
├── failure-recovery.md # 失败补跑与恢复
└── ...
SKILL.md 推荐控制在 8 KB 以内;长内容进入 references/。
不同宿主能力不一致。最终形态不假装能力一致。
| 场景 | 处理 |
|---|---|
| 宿主支持 subagent | 正常多 agent 链 |
| 宿主不支持 subagent,但用户只查询/学习/启动 dashboard | 正常执行 |
宿主不支持 subagent,用户要 webnovel-write |
默认阻断,提示需要支持 subagent 的宿主;允许显式 --single-agent 兼容模式 |
| 宿主不支持 hooks | 不依赖 hooks 自动注入;通过 context file / command / skill 入口加载 |
| 宿主不支持 slash command | 暴露为 skill 或 command TOML |
最终仓库根目录:
.
├── .claude-plugin/
│ └── marketplace.json
├── .cursor-plugin/
│ └── marketplace.json
├── .agents/
│ └── plugins/
│ └── marketplace.json # Codex marketplace registry,可选
├── docs/
├── scripts/
│ └── generate_harness_artifacts.py # 新增:生成宿主产物
├── tests/
│ └── harness/
│ ├── test_manifests.py
│ ├── test_portability.py
│ └── test_generated_artifacts.py
├── webnovel-writer/
└── README.md
说明:
.codex-plugin/plugin.json。scripts/,避免混入插件 runtime scripts。最终 plugin root 仍然是:
webnovel-writer/
最终结构:
webnovel-writer/
├── .claude-plugin/
│ └── plugin.json
├── .codex-plugin/
│ └── plugin.json
├── .cursor-plugin/
│ └── plugin.json
├── .opencode/
│ └── plugins/
│ └── webnovel-writer.js
├── hooks/
│ ├── hooks.json
│ ├── hooks-cursor.json
│ ├── run-hook.cmd
│ └── session-start
├── skills/
│ ├── using-webnovel-writer/
│ │ ├── SKILL.md
│ │ └── references/
│ │ ├── claude-tools.md
│ │ ├── codex-tools.md
│ │ ├── cursor-tools.md
│ │ ├── gemini-tools.md
│ │ ├── opencode-tools.md
│ │ └── copilot-tools.md
│ ├── webnovel-init/
│ ├── webnovel-plan/
│ ├── webnovel-write/
│ ├── webnovel-review/
│ ├── webnovel-query/
│ ├── webnovel-learn/
│ └── webnovel-dashboard/
├── agents/
│ ├── webnovel-context-agent.md
│ ├── webnovel-data-agent.md
│ ├── webnovel-deconstruction-agent.md
│ └── webnovel-reviewer.md
├── scripts/
├── references/
├── templates/
├── genres/
├── dashboard/
├── AGENTS.md
├── CLAUDE.md
├── GEMINI.md
└── README.md
当前 agent 名称:
context-agent
data-agent
deconstruction-agent
reviewer
最终建议改为插件作用域名称:
webnovel-context-agent
webnovel-data-agent
webnovel-deconstruction-agent
webnovel-reviewer
原因:
reviewer、context-agent 冲突兼容策略:
Claude Code 继续作为一级支持宿主。
源文件:
.claude-plugin/marketplace.json
webnovel-writer/.claude-plugin/plugin.json
webnovel-writer/skills/
webnovel-writer/agents/
webnovel-writer/hooks/hooks.json
安装:
claude plugin marketplace add lingfengQAQ/webnovel-writer --scope user
claude plugin install webnovel-writer@webnovel-writer-marketplace --scope user
要求:
allowed-tools frontmatter 可保留。Agent 工具由 Claude Code 原生处理。hooks/session-start 注入短 bootstrap。Codex 使用原生 plugin manifest。
新增:
webnovel-writer/.codex-plugin/plugin.json
最小 manifest:
{
"name": "webnovel-writer",
"version": "6.0.0",
"description": "Long-form Chinese webnovel writing system with skills, agents, story state, RAG, and review workflows.",
"author": { "name": "lingfengQAQ" },
"homepage": "https://github.com/lingfengQAQ/webnovel-writer",
"repository": "https://github.com/lingfengQAQ/webnovel-writer",
"license": "GPL-3.0",
"keywords": ["webnovel", "writing", "skills", "agents", "rag"],
"skills": "./skills/",
"hooks": "./hooks/hooks.json",
"interface": {
"displayName": "Webnovel Writer",
"shortDescription": "Long-form webnovel planning, writing, review, and story-state workflows",
"longDescription": "Plan, write, review, query, and maintain long-form Chinese webnovel projects with story state, memory, RAG, and agent workflows.",
"developerName": "lingfengQAQ",
"category": "Writing",
"capabilities": ["Interactive", "Read", "Write"],
"defaultPrompt": [
"初始化一个新的网文项目",
"写下一章并更新故事状态",
"查询当前项目里的角色和伏笔状态"
]
}
}
Codex 支持级别:
| 能力 | 方式 |
|---|---|
| skills | 原生 .codex-plugin/plugin.json 指向 ./skills/ |
| hooks | 可选;用户需信任 hook |
| agents | 最终通过 adapter 生成 Codex agent 配置,或由 skill 以 prompt template 调度 |
| commands | 不单独维护;需要时由 skills 或 generated command-skill 暴露 |
| tool mapping | using-webnovel-writer/references/codex-tools.md |
Codex 多 agent 要求:
webnovel-write 需要 Codex 启用 multi-agent 能力。webnovel-query、webnovel-learn、webnovel-dashboard 可执行webnovel-review 可进入单 reviewer prompt 兼容模式webnovel-write 默认阻断,除非用户显式选择 --single-agentCursor 使用 Cursor plugin manifest。
新增:
.cursor-plugin/marketplace.json
webnovel-writer/.cursor-plugin/plugin.json
webnovel-writer/hooks/hooks-cursor.json
Cursor plugin manifest:
{
"name": "webnovel-writer",
"displayName": "Webnovel Writer",
"description": "长篇网文创作系统(skills + agents + data chain + RAG)",
"version": "6.0.0",
"author": { "name": "lingfengQAQ" },
"homepage": "https://github.com/lingfengQAQ/webnovel-writer",
"repository": "https://github.com/lingfengQAQ/webnovel-writer",
"license": "GPL-3.0",
"keywords": ["webnovel", "cursor", "skills", "agents", "rag"],
"skills": "./skills/",
"agents": "./agents/",
"hooks": "./hooks/hooks-cursor.json"
}
要求:
skills/ 与 agents/,不生成复制目录。additional_context。/add-plugin webnovel-writer。Gemini CLI 最终采用生成 extension root 方式,不直接把仓库根当 Gemini extension 根。
原因:
gemini-extension.json 与 GEMINI.md 在 extension root。生成产物:
dist/gemini/webnovel-writer/
├── gemini-extension.json
├── GEMINI.md
├── skills/
│ ├── webnovel-writer__using-webnovel-writer/
│ ├── webnovel-writer__webnovel-init/
│ ├── webnovel-writer__webnovel-plan/
│ ├── webnovel-writer__webnovel-write/
│ ├── webnovel-writer__webnovel-review/
│ ├── webnovel-writer__webnovel-query/
│ ├── webnovel-writer__webnovel-learn/
│ └── webnovel-writer__webnovel-dashboard/
├── agents/
│ ├── webnovel-writer__webnovel-context-agent.md
│ ├── webnovel-writer__webnovel-data-agent.md
│ ├── webnovel-writer__webnovel-deconstruction-agent.md
│ └── webnovel-writer__webnovel-reviewer.md
├── commands/
│ ├── webnovel-init.toml
│ ├── webnovel-plan.toml
│ ├── webnovel-write.toml
│ ├── webnovel-review.toml
│ ├── webnovel-query.toml
│ ├── webnovel-learn.toml
│ └── webnovel-dashboard.toml
├── scripts/
├── references/
├── templates/
├── genres/
└── dashboard/
gemini-extension.json:
{
"name": "webnovel-writer",
"description": "Long-form Chinese webnovel writing system.",
"version": "6.0.0",
"contextFileName": "GEMINI.md"
}
Gemini tool mapping:
| 源语义 | Gemini |
|---|---|
| 读取文件 | read_file |
| 写入文件 | write_file |
| 编辑文件 | replace |
| 搜索 | grep_search |
| 运行命令 | run_shell_command |
| 向用户确认 | ask_user 或直接提问 |
| 调用 subagent | @webnovel-writer__agent-name |
OpenCode 使用 JS 插件 + 生成目录。
新增:
webnovel-writer/.opencode/plugins/webnovel-writer.js
最终行为:
skills/ 注册到 OpenCode config。.opencode/ 或安装目录。生成产物:
dist/opencode/webnovel-writer/
├── .opencode/
│ ├── plugins/
│ │ └── webnovel-writer.js
│ ├── skills/
│ ├── agents/
│ └── commands/
└── opencode.json
OpenCode tool mapping:
| 源语义 | OpenCode |
|---|---|
| 读取文件 | read |
| 写入文件 | write |
| 编辑文件 | edit |
| 搜索 | grep |
| 运行命令 | bash |
| 任务跟踪 | todowrite |
| 调用 subagent | task 或 @agent |
Copilot CLI 第一阶段使用 Claude plugin compatibility;最终可生成 Copilot 原生产物。
最终生成产物:
dist/copilot/webnovel-writer/
├── .copilot/
│ ├── skills/
│ ├── agents/
│ └── commands/
└── plugin.json
支持策略:
.copilot/。~/.agents/skills,避免 shadowing 其他宿主插件。这两类宿主如果已支持 Claude Code plugin compatibility,则使用 Claude plugin metadata 作为第一路径。
策略:
新增:
skills/using-webnovel-writer/SKILL.md
职责:
webnovel-* skill。不职责:
新增:
hooks/session-start
hooks/run-hook.cmd
hooks/hooks.json
hooks/hooks-cursor.json
注入内容应短,不应把完整系统文档灌进上下文。
推荐注入:
<important>
Webnovel Writer is installed.
When the user asks to initialize, plan, write, review, query, learn from, or inspect a Chinese webnovel project, load the relevant webnovel-* skill.
For platform-specific tool and subagent mappings, load using-webnovel-writer.
</important>
Claude / Cursor / Codex hook 输出格式按宿主区分:
| 宿主 | 输出字段 |
|---|---|
| Claude Code | hookSpecificOutput.additionalContext |
| Cursor | additional_context |
| Codex / SDK 标准 | additionalContext |
hooks 只负责启动提示,不作为唯一入口。Gemini/OpenCode/Copilot 不能依赖 hooks 存在。
最终新增:
webnovel-writer/AGENTS.md
webnovel-writer/CLAUDE.md
webnovel-writer/GEMINI.md
职责:
skills/using-webnovel-writer/。GEMINI.md 应引用:
@./skills/using-webnovel-writer/SKILL.md
@./skills/using-webnovel-writer/references/gemini-tools.md
最终所有 skill bash 片段必须使用统一变量:
export WEBNOVEL_PLUGIN_ROOT="${WEBNOVEL_PLUGIN_ROOT:-${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}}"
export WORKSPACE_ROOT="${WORKSPACE_ROOT:-${CLAUDE_PROJECT_DIR:-$PWD}}"
if [ -z "${WEBNOVEL_PLUGIN_ROOT}" ] || [ ! -d "${WEBNOVEL_PLUGIN_ROOT}/scripts" ]; then
echo "ERROR: 未找到 Webnovel Writer 插件根目录" >&2
exit 1
fi
export SCRIPTS_DIR="${WEBNOVEL_PLUGIN_ROOT}/scripts"
export PROJECT_ROOT="$(python -X utf8 "${SCRIPTS_DIR}/webnovel.py" --project-root "${WORKSPACE_ROOT}" where)"
禁止在新增文档中继续直接使用:
${CLAUDE_PLUGIN_ROOT}/scripts
除非是在兼容说明或历史迁移章节。
最终应扩展或新增:
webnovel-writer/scripts/runtime_compat.py
职责:
建议 CLI:
python -X utf8 "${SCRIPTS_DIR}/webnovel.py" runtime-info --format json
输出:
{
"plugin_root": ".../webnovel-writer",
"workspace_root": "...",
"project_root": "...",
"scripts_dir": ".../webnovel-writer/scripts",
"dashboard_dir": ".../webnovel-writer/dashboard",
"platform_env": {
"PLUGIN_ROOT": true,
"CLAUDE_PLUGIN_ROOT": false,
"CLAUDE_PROJECT_DIR": false
}
}
跨宿主不改变 Python 依赖策略:
python -m pip install -r requirements.txt
但 skill 中必须把“安装依赖”写成可重复、可失败恢复的步骤:
每个 skill 最终结构:
skills/<skill-name>/
├── SKILL.md
├── references/
│ ├── protocol.md
│ ├── failure-recovery.md
│ └── ...
├── scripts/ # 仅 skill 私有脚本,公共脚本仍放 plugin scripts/
└── assets/ # 可选
SKILL.md 必须包含:
SKILL.md 不应包含:
Claude 源 frontmatter 可保留:
---
name: webnovel-write
description: Use when writing a publishable webnovel chapter from an existing project outline and story runtime.
allowed-tools: Read Write Edit Grep Bash Agent
---
要求:
description 必须包含明确触发条件。allowed-tools 视为 Claude-only 字段;adapter 对 Codex/Gemini/OpenCode 可剥离或映射。webnovel-write 是多 agent 适配核心。
最终正文不应写:
必须使用 `Agent` 工具调用 `context-agent`
应写:
必须调用 `webnovel-context-agent` subagent 生成写作任务书。
按当前宿主的 subagent 调度方式执行;如果当前宿主不支持 subagent,见 `using-webnovel-writer` 的降级策略。
Agent(...) 示例移入:
skills/using-webnovel-writer/references/claude-tools.md
webnovel-review 最终应支持两种模式:
| 模式 | 条件 | 行为 |
|---|---|---|
| full-agent | 宿主支持 subagent | 调用 webnovel-reviewer,主流程只落库和汇总 |
| compatibility | 宿主不支持 subagent | 主流程临时扮演 reviewer,但必须输出同一 JSON schema,并在报告中标记兼容模式 |
兼容模式只允许用于 review,不允许替代 webnovel-write 的完整多 agent 链。
webnovel-init 涉及 deconstruction-agent、AskUserQuestion、WebSearch/WebFetch。
最终要求:
AskUserQuestion。webnovel-deconstruction-agent subagent”。Dashboard 是最易跨宿主的 skill。
最终要求:
WEBNOVEL_PLUGIN_ROOT。源 agent 继续使用 Markdown + YAML frontmatter:
---
name: webnovel-context-agent
description: Use before chapter drafting to assemble a writing brief from outline, contracts, memory, and review feedback.
tools: Read, Grep, Bash
model: inherit
---
正文写:
不写:
Agent(...) 调用样例四个核心 agent 的输出契约必须稳定。
| Agent | 输出 |
|---|---|
webnovel-context-agent |
五段式写作任务书 |
webnovel-reviewer |
严格 JSON issues 列表 |
webnovel-data-agent |
fulfillment_result.json、disambiguation_result.json、extraction_result.json 所需内容 |
webnovel-deconstruction-agent |
严格 init_reference_research JSON |
这些输出契约写入:
skills/webnovel-write/references/agent-contracts.md
skills/webnovel-init/references/agent-contracts.md
skills/webnovel-review/references/agent-contracts.md
Agent adapter 负责把源 agent 转为宿主格式。
| 宿主 | 输出 |
|---|---|
| Claude Code | agents/*.md 原样 |
| Cursor | agents/*.md 原样或轻度 frontmatter 兼容 |
| Codex | .codex/agents/webnovel-writer/<agent>.toml 或 prompt template |
| Gemini | agents/webnovel-writer__<agent>.md,工具名映射 |
| OpenCode | .opencode/agents/<agent>.md,工具权限块映射 |
| Copilot | .copilot/agents/<agent>.md |
源 agent 使用:
model: inherit
不在源 agent 中写 sonnet、opus、haiku 作为强要求。
需要高能力模型的场景写在正文:
该 agent 需要较强推理能力;若宿主支持选择模型,优先使用当前可用的高能力模型。
新增:
scripts/generate_harness_artifacts.py
命令:
python -X utf8 scripts/generate_harness_artifacts.py --target codex
python -X utf8 scripts/generate_harness_artifacts.py --target gemini
python -X utf8 scripts/generate_harness_artifacts.py --target opencode
python -X utf8 scripts/generate_harness_artifacts.py --target copilot
python -X utf8 scripts/generate_harness_artifacts.py --target all
python -X utf8 scripts/generate_harness_artifacts.py --check
生成器负责:
生成器不负责:
生成产物统一进入:
dist/<harness>/webnovel-writer/
dist/ 默认 gitignored。
需要提交的只有:
例外:
.codex-plugin/plugin.json.cursor-plugin/plugin.json这些小型原生 manifest 可以提交。
CI 必须运行:
python -X utf8 scripts/generate_harness_artifacts.py --target all
python -X utf8 scripts/generate_harness_artifacts.py --check
若生成产物与提交的 manifest/registry 不一致,CI 失败。
新增:
skills/using-webnovel-writer/references/
├── claude-tools.md
├── codex-tools.md
├── cursor-tools.md
├── gemini-tools.md
├── opencode-tools.md
└── copilot-tools.md
| 源语义 | Claude | Codex | Gemini | OpenCode | Copilot |
|---|---|---|---|---|---|
| 读取文件 | Read |
native read | read_file |
read |
view |
| 写文件 | Write |
native write | write_file |
write |
create |
| 编辑文件 | Edit |
native edit | replace |
edit |
edit |
| 搜索文本 | Grep |
native search | grep_search |
grep |
grep |
| 运行命令 | Bash |
shell command | run_shell_command |
bash |
bash |
| 网页搜索 | WebSearch |
web search if enabled | google_web_search |
web search if enabled | no guaranteed equivalent |
| 抓取网页 | WebFetch |
web fetch if enabled | web_fetch |
web fetch if enabled | web_fetch |
| 询问用户 | AskUserQuestion / direct |
direct / structured input if available | ask_user |
direct | direct |
| 调用 subagent | Agent / Task |
spawn_agent or named subagent prompt |
@agent |
task / @agent |
task |
| 任务跟踪 | TodoWrite |
plan/update if available | no guaranteed equivalent | todowrite |
todos/sql if available |
新增或修改 skill 时:
rg、python、git 这类 shell 命令可以直接写。最终 webnovel-write 编排:
主流程
1. 解析环境与项目根
2. preflight
3. placeholder-scan
4. 刷新 Story System runtime contracts
5. 调用 webnovel-context-agent
-> 输出五段式写作任务书
6. 主流程根据任务书起草正文
7. 调用 webnovel-reviewer
-> 输出 review_results.json
8. blocking issue 修复循环
9. 润色与排版
10. 调用 webnovel-data-agent
-> 输出 commit artifacts
11. chapter-commit
12. backup
核心不变:
context-agent 负责写前 research 与任务书。reviewer 负责可验证问题。data-agent 负责事实提取与 artifacts。完整写章链要求:
不要求:
为低能力宿主预留 --single-agent,但默认不启用。
允许场景:
禁止场景:
/webnovel-write 自动降级。兼容模式输出必须标记:
{
"compatibility_mode": "single-agent",
"missing_capability": "subagent",
"requires_manual_review": true
}
当前 sync_plugin_version.py 需要扩展,覆盖:
webnovel-writer/.claude-plugin/plugin.json
webnovel-writer/.codex-plugin/plugin.json
webnovel-writer/.cursor-plugin/plugin.json
.claude-plugin/marketplace.json
.cursor-plugin/marketplace.json
README.md
dist manifest templates
命令保持:
python -X utf8 webnovel-writer/scripts/sync_plugin_version.py --version X.Y.Z --release-notes "..."
新增:
docs/operations/multi-harness-release.md
docs/guides/install-codex.md
docs/guides/install-cursor.md
docs/guides/install-gemini.md
docs/guides/install-opencode.md
docs/guides/install-copilot.md
README 快速开始保留 Claude Code 作为推荐路径,但增加:
其他宿主安装:Codex / Cursor / Gemini CLI / OpenCode / Copilot
优先级:
.codex-plugin/plugin.json,后续申请目录。.cursor-plugin marketplace。新增测试:
tests/harness/test_manifest_validity.py
tests/harness/test_skill_frontmatter.py
tests/harness/test_agent_frontmatter.py
tests/harness/test_portability_lint.py
tests/harness/test_generated_artifacts.py
检查:
SKILL.md 有 name / description。name / description / model。CLAUDE_PLUGIN_ROOT。SKILL.md 超过阈值时必须有 references/。新增:
python -X utf8 webnovel-writer/scripts/webnovel.py runtime-info --format json
python -X utf8 webnovel-writer/scripts/webnovel.py --project-root <fixture> preflight --format json
python -X utf8 webnovel-writer/scripts/webnovel.py --project-root <fixture> where
| 宿主 | 最低验收 |
|---|---|
| Claude Code | 安装插件;/webnovel-query 查询 fixture;/webnovel-review 审查 fixture;/webnovel-dashboard 启动 |
| Codex | plugin 可读;skills 可列出;webnovel-query fixture 通过;webnovel-review full/compat 其中一种通过 |
| Cursor | plugin 可安装;skills/agents 可发现;webnovel-query 与 webnovel-review 通过 |
| Gemini | 生成 extension;gemini extensions install <dist> 成功;/webnovel-query 或 command TOML 通过 |
| OpenCode | JS plugin 加载;skills 注册;webnovel-dashboard 或 query 通过 |
| Copilot | 生成 .copilot artifacts;skill/agent 可发现;query smoke 通过 |
完整写章验收只要求在支持 subagent 的宿主上通过:
输入:
使用 Webnovel Writer 写第 4 章。项目在 agents/evals/files/test-project/。
通过条件:
webnovel-context-agent。webnovel-reviewer。review_results.json 存在且合法。webnovel-data-agent。chapter-commit 成功。在不支持 subagent 的宿主:
输入:
使用 Webnovel Writer 审查第 4 章。项目在 agents/evals/files/test-project/。
通过条件:
目标:不改变业务流程,先让 Codex/Cursor 能发现 plugin。
改动:
.codex-plugin/plugin.json.cursor-plugin/plugin.json.cursor-plugin/marketplace.jsonhooks/session-startusing-webnovel-writerWEBNOVEL_PLUGIN_ROOT验收:
目标:让 skills 成为跨宿主入口。
改动:
SKILL.md 到 references/protocol.mdRead tool / Bash tool / Agent toolAgent(...) 示例移入 claude-tools.mdcodex-tools.md、gemini-tools.md、opencode-tools.md验收:
目标:agent 名称全局唯一,调度语义平台化。
改动:
context-agent -> webnovel-context-agentdata-agent -> webnovel-data-agentdeconstruction-agent -> webnovel-deconstruction-agentreviewer -> webnovel-reviewer验收:
目标:生成宿主原生产物。
改动:
scripts/generate_harness_artifacts.py.opencode.copilot验收:
--target all 成功。目标:用真实宿主跑通核心任务。
验收顺序:
| 风险 | 影响 | 缓解 |
|---|---|---|
| skill 过长导致宿主截断 | Codex/Gemini 行为不稳定 | SKILL.md 瘦身,references 渐进加载 |
| agent 调度语义不一致 | webnovel-write 链路断裂 |
平台 tool mapping + adapter + compatibility mode |
| hooks 需要用户信任 | bootstrap 不一定生效 | 不依赖 hooks 作为唯一入口 |
| plugin root 嵌套 | Gemini/OpenCode 安装复杂 | 生成 dist extension root |
| Python 依赖缺失 | scripts 失败 | preflight 明确诊断 |
| RAG API key 缺失 | init/write 部分能力不可用 | 按功能阻断,不影响 query/dashboard |
| 多份 manifest 版本漂移 | 发布混乱 | 扩展 version sync + CI |
| 旧 agent 名 shadowing | 调用错误 agent | 命名空间化 + alias 迁移 |
webnovel-write 默认不在无 subagent 宿主自动降级。webnovel-review 可以有 compatibility mode。webnovel- 前缀。CLAUDE_PLUGIN_ROOT 不再作为新文档主变量。最终完成时,必须满足:
skills/。skills/ / agents/。using-webnovel-writer 存在并包含所有宿主 tool mapping。WEBNOVEL_PLUGIN_ROOT 兼容变量。webnovel- 前缀。本 spec 完成后,可以继续评估:
webnovel.py 暴露为 MCP server。这些都不是本 spec 的前置条件。