/webnovel-writer:webnovel-writefrom webnovel-writer
Writes webnovel chapters (2200-3800 words) with a structured workflow: context, drafting, review, polish, and data extraction. Supports fast and minimal modes.
Ships in webnovel-writer. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Round 29 Phase 2:本文件为骨架(目标 / 模式 / 跨步硬约束 / 闸门清单)。每个 Step 的完整执行协议 已拆分到
references/steps/step-N.md,进入该步时必须先cat对应文件全文再执行。
以稳定流程产出可发布章节:优先使用 正文/第{NNNN}章-{title_safe}.md,无标题时回退 正文/第{NNNN}章.md。
默认章节字数目标:弹性区间 2200-3800。
字数弹性模型:
state.project_info.word_count_policy.hard_min / hard_max(默认 2200/3800 · Round 21.1)average_words_per_chapter_target=3000 只是项目级软目标参考,不是单章硬下限target_words_per_chapter_target)warnings[] 追加 EDITOR_NOTES_WORD_COUNT_DRIFT保证审查、润色、数据回写完整闭环,避免"写完即丢上下文"。
输出直接可被后续章节消费的结构化数据:review_metrics、summaries、chapter_meta。
--fast/--minimal 只允许降级可选环节。cat "${SKILL_ROOT}/references/steps/step-N.md" 全文(Round 29 拆分);未加载该文件不得执行该步任何动作。/webnovel-write:Step 0 → 0.5 → 1 → 2A → 2B → 3+3.5(并行) → 4 → 5 → 6 → 7/webnovel-write --fast:Step 0 → 0.5 → 1 → 2A → 3+3.5(并行) → 4 → 5 → 6 → 7(跳过 2B)/webnovel-write --minimal:Step 0 → 0.5 → 1 → 2A → 3(仅5个基础审查,跳过3.5)→ 4 → 5 → 6 → 7最小产物(所有模式):
正文/第{NNNN}章-{title_safe}.md 或 正文/第{NNNN}章.mdindex.db.review_metrics 新纪录(含 overall_score).webnovel/summaries/ch{NNNN}.md.webnovel/state.json 的进度与 chapter_meta 更新workflow_manager.py 的 OPTIONAL_PRECEDING_STEPS),但即使内联执行也必须显式 workflow start-step --step-id "Step 2A" 和 complete-step,让工作流登记完整。审查报告/第{NNNN}章审查报告.md),包含所有审查器的结果汇总。不得只在内存中汇总分数而不写文件。overall_score: X 唯一出现在 frontmatter 顶头;其他位置分数用别名(综合分/thrill_score/sub_score);各 checker 行禁共用同一 token ≥3 次;外部模型分数必须用 disk JSON 真值。细则见 references/steps/step-3.md。--fast / --minimal 只允许按上方定义裁剪步骤,不允许自创混合模式、"半步"或"简化版"。overall_score 必须来自审查子代理的聚合结果,不得因为"子代理还没返回"而自行估算分数。正文/第NNNN章*.md)的修改,必须通过 polish_cycle.py(Step 8)完成,严禁直接 git add . && git commit -m "polish" 或 git commit --amend。裸跑会绕过 post_draft_check/hygiene_check,让 ASCII 引号、word_count 漂移、checker 数据滞留,并且 polish 任务在 workflow_state.json 不留痕。references/steps/step-2a.md。references/steps/step-7.md。references/steps/step-3.md。在开始下一章的任何步骤(包括 Step 0)之前,必须验证当前章的以下条件全部满足:
feedback_checker_count_13):checker = 跑的 subagent 数量 = 评分维度数量(Round 13 v2 取消 veto 架构,全部 checker 平等参与评分)。标准/--fast = 13 checker / 13 评分维度(2 读者视角维度:naturalness + reader-critic,11 工艺维度含 flow-checker)。--minimal = 5 checker(naturalness + reader-critic + consistency + continuity + ooc)。overall_score = avg(所有评分维度)。两个读者视角 checker 不 block 流程,其 problems 和其他 checker 同等进入 Step 4 定向修复。极端情况(Step 4 修复后 critical 仍未消除)才回 Step 2A 重写。--minimal 模式跳过此条件)--fast 模式含内部 13 评分维度分数 + 外部 15 模型×13 维度评分矩阵;--minimal 模式仅含内部 5 评分维度分数)anti_ai_force_check=pass验证方式:在开始下一章 Step 0 之前,执行以下检查:
ls "${PROJECT_ROOT}/正文/第${chapter_padded}章"*.md >/dev/null 2>&1 && \
test -f "${PROJECT_ROOT}/审查报告/第${chapter_padded}章审查报告.md" && \
test -f "${PROJECT_ROOT}/.webnovel/summaries/ch${chapter_padded}.md" && \
test -f "${PROJECT_ROOT}/.webnovel/audit_reports/ch${chapter_padded}.json" && \
python -X utf8 "${SCRIPTS_DIR}/webnovel.py" --project-root "${PROJECT_ROOT}" audit check-decision --chapter ${chapter_num} --require approve,approve_with_warnings && \
git log --oneline -1 | grep "第${chapter_num}章"
任一条件不满足,禁止开始下一章。新增闸门条件:
audit_reports/ch{NNNN}.json 存在(Step 6 产物)block(审计未通过禁止进入下一章)禁止在 checker 运行期间开始下一章的起草。 等待是流程的一部分,不是浪费时间。
references/steps/step-N.md,其内列明该步其余必读。references/reference-index.md)。路径约定:
references/... 相对当前 skill 目录。../../references/... 指向全局共享参考。references/steps/step-0.md(含 Step 0.5 + 搜索规则)/ step-1.md / step-2a.md / step-2b.md / step-3.md / step-3.5.md / step-4.md(含 4.5)/ step-5.md / step-6.md / step-7.md(含 Step 8)references/reference-index.mdreferences/gate-matrix.md(新增/修改/删除任一闸门前必读)Read/Grep:读取 state.json、大纲、章节正文与参考文件。Bash:运行 extract_chapter_context.py、index_manager、workflow_manager。Task:调用 context-agent、审查 subagent、data-agent 并行执行。cat "${SKILL_ROOT}/references/steps/step-0.md"
要点:preflight 必须成功(CLAUDE_PLUGIN_ROOT fallback 推导见 step-0.md);agents_sync / cache_sync / polish_drift 任何 ERROR 必须在 Step 1 前清零;workflow start-task 必须成功。Step 登记三件套(start-step → 工作 → complete-step 带语义 artifact)贯穿全流程,strict 默认开启(无 start-step 的 complete-step 直接被拒);shell 类步骤优先用 workflow run-step 原子包装。搜索统一走 tavily_search.py(禁 MCP 工具),失败必须停下报告用户。
cat "${SKILL_ROOT}/references/steps/step-1.md"
要点:Step 1 前必跑 state get-reading-trend(追读处方传给 context-agent);chapter % 5 == 1 且 >5 时先 Task(arc-review-checker) 连读审查上一章块(R29 Phase 8)。然后 Task 调用 context-agent 产出单一创作执行包(8 板块任务书 + Contract 全字段 + 直写提示词);完成后必须验证三份产物落盘(context_snapshot + 执行包 JSON + MD),任一缺失禁止进入 Step 2A。Ch1-3 叠加开篇黄金协议与首章加严 rubric。
cat "${SKILL_ROOT}/references/steps/step-2a.md"
要点:起草前必读 core-constraints / anti-ai-guide / visual-concreteness(前 5 章另加 first-chapter-hook-rubric + 写前自检);起草前仅一项硬自检:大纲点逐项核对 100% 兑现;只输出纯正文(禁 Markdown / ASCII 引号 / U+FFFD / 元叙述 / 章号距离指代);起草后必跑引号扫描 + FFFD 验证 + post_draft_check.py exit=0 才能进入下一步(签名/破折号/6-gram 为 warn 级参考,自然度以 reader-naturalness checker 为准)。
--fast / --minimal 跳过)cat "${SKILL_ROOT}/references/steps/step-2b.md"
要点:Round 29 默认 verify-only no-op(grep 扫模板腔,不动笔,登记 deviation_notes);仅当检出模板腔 ≥3 处 / 执行包明确要求 / 用户要求才走改写路径;改写后再跑 post_draft_check + FFFD 验证。禁止跳过登记。
cat "${SKILL_ROOT}/references/steps/step-3.md"
要点:0+6+5 三批启动(Batch 0 读者视角双 checker 先行);全部 checker 返回前禁止进入 Step 4;13 份 checker JSON 落盘逐一验证 parseable(H71 嵌套引号自检);review_metrics 落库 + checker_scores 双通道落库(索引层 + 状态层)缺一不可;overall_score = round(internal*0.6 + external*0.4)。
--minimal 跳过)cat "${SKILL_ROOT}/references/steps/step-3.5.md"
要点:build_external_context.py 构建 14 字段上下文 → healthcheck → external_review.py --model-key all --dimension-strategy auto 一次性跑全部 15 模型;≥10/15 有效为健康线;与 Step 3 并行但必须显式 start-step。Step 3+3.5 完成闸门(5 项验证)全部通过才可进入 Step 4(清单见 step-3.5.md)。
cat "${SKILL_ROOT}/references/steps/step-4.md"
要点:标准模式默认 Task(polish-agent) 干净上下文执行修复(主流程负责 issues 汇总 + 预先 canon-grep 出 canon_anchors · R29 P7);修复顺序 critical(必须)→ high(修复或 deviation)→ medium/low(默认不修 · R29);字数预算(净增 ≤200 · 不破 hard_max);产出润色后正文 + 润色报告(polish_reports/ 落盘,含 anti_ai_force_check,fail 不得进入 Step 5)。Step 4.5 复测触发档(<75 强制 / <80 近线 / 下滑 ≥5 / HIGH-issue 全面),盲评复测不传 prev_score(R29 去锚定);复测组合调用后必须最后重设 overall_score = combined。
cat "${SKILL_ROOT}/references/steps/step-5.md"
要点:Task 调用 data-agent 执行 A-K 子步全量;完成后必跑数据完整性后验证(checker_scores 13 canonical key / word_count 误差 ≤2% / strand 一致);失败隔离——G/H 子步失败只补跑子步,禁止重跑写作链。
cat "${SKILL_ROOT}/references/steps/step-6.md"
要点:Part 1 CLI 结构审计(Layer A/B/G)+ Part 2 audit-agent 深度审计(Layer C/D/E/F findings)都必须完成;决议与落盘由 audit finalize CLI 确定性完成(R29:agent 只产 findings 不自算 decision);下章 editor_notes 由 agent 写(非 block 必写);decision=block 禁止进入 Step 7;超时 300s 视为未完成。
cat "${SKILL_ROOT}/references/steps/step-7.md"
要点:顺序锁死——Step 6 complete-step → (step gap) hygiene_check + pre_commit_step_k 双闸 exit=0 → start-step Step 7 → git commit → complete-step → complete-task。在 Step 7 active 状态跑 hygiene 会 H3 P0;commit 失败必须 fail-step 且不得调 complete-task。
cat "${SKILL_ROOT}/references/steps/step-7.md"
要点:Step 7 commit 之后任何正文修改的唯一入口是 polish_cycle.py(自动完成 7 步,commit 是最后一步原子落盘;轮数上限 3,突破需 deviation)。严禁裸跑 git commit / --amend。完整规范另见 references/post-commit-polish.md(Post-Commit Polish 触发场景 / 多轮 / 恢复策略)。
未满足以下条件前,不得结束流程:
正文/第{chapter_padded}章-{title_safe}.md 或 正文/第{chapter_padded}章.md.webnovel/context/ch{chapter_padded}_context.json 与 .webnovel/context/ch{chapter_padded}_context.md 同时存在且非空post_draft_check.py exit=0overall_score(聚合 13 评分维度 · Round 13 v2)且 review_metrics 成功落库;naturalness_verdict / reader_critic_verdict 作为报告字段记录,不 block 流程;其 problems 与其他 checker 的 issues 合并进入 Step 4 修复--minimal 模式跳过此条件).md 文件已生成(标准/--fast 模式含内部 13 评分维度分数 + 外部 15 模型×13 维度评分矩阵,内外均含 reader_flow + naturalness + reader_critic · Round 13 v2;--minimal 模式含内部 5 评分维度分数)critical,high 未修项有 deviation 记录.webnovel/polish_reports/ch{chapter_padded}.md 存在且非空,含 anti_ai_force_check 字段anti_ai_force_check=pass(基于全文检查;fail 时不得进入 Step 5)state.json、index.db、summaries/ch{chapter_padded}.mdaudit_reports/ch{chapter_padded}.json、editor_notes/ch{next_padded}_prep.md、observability/chapter_audit.jsonl 追加一行;audit decision ∈ {approve, approve_with_warnings}workflow_state.json 的当前 task 已 complete-task 且 completed_steps 覆盖 Step 1/2A/2B/3/3.5/4/5/6/7 全量(Step 2A 可由 context-agent 内联但必须显式登记);每个 step 的 artifact 非空且非 {"v2": true} 占位pre_commit_step_k.py exit=0chapter_meta.{NNNN}.polish_log 存在,每条必须含 version / timestamp / notes 三字段,version 匹配 vN 或 vN.M.K,timestamp 为 ISO-8601。schema 违规会让下章 context-agent 解析 polish 经验失败(跨章传递断层)polish_drift: ok=True;若 P0 drift(正文已改 + narrative_version=v1)则 preflight 失败,必须先走 polish_cycle.py 提交或 git stash 暂存layers.A_process_integrity.checks 中 A9 dimension_floor 必须 status ∈ {pass, warn};fail critical 阻断 Step 7。任一维度 <60 → cap 70 fail critical;<75 → cap 85 warn high;前 5 章 reader-critic <80 → cap 80 fail criticaltmp/reader_pull_chNNNN.json 含 hook_close.primary_type 但 state.chapter_meta.NNNN.hook_close 缺失 → P0 fail(Phase G 落库被跳过的 根治)set-chapter-meta-field --field thrill_score --value '{...}' 写库;前 5 章 verdict ∈ {tepid, frustrating} 且 reader-critic <80 → audit 双 floor 联动 blockset-hook-close 必须写入 source_narrative_version;若当前 chapter_meta.NNNN.narrative_version 与 hook_close.source_narrative_version 不一致 → P0 fail,说明 Step 8 polish 后未重跑 reader-pull/未回填章末钩子,会污染 H25 hook trend。老数据缺 source 但有 polish_log → P1 提醒回填。polish_cycle.update_state_after_polish 末尾必须自动:(a) 抽取章末最后 4 段 200 字内作为 hook_close.text_excerpt;(b) hook_close.source_narrative_version=new_version;(c) hook_close.needs_reclassify=True;(d) hook_close.polish_synced_at=now。下游 hygiene H28 检测 needs_reclassify==True 直接 P0 fail,迫使作者/AI 阅读章末后立即跑 state update --set-hook-close 重新分类(决策钩 / 信息钩 / 情绪钩 / 动作钩),重分类后 set-hook-close 自动清 needs_reclassify=False 解锁 commit。这是从"H28 detect → 人工修"升级到"polish 自动标 stale → 必须重分类才能 commit"的强闭环。post_draft_config.json 的 dialogue_ratio_override_chapters,hygiene H21 之前漏读,导致项目级豁免章仍报"对话占比连 3 章 < 0.20" P1 假阳。现 H21 同读该字段,豁免章不计入连续低占比 streak(Ch3 空间种田激活章 / Ch2 金融操盘+前世独白章等)。chapter_meta.{NNNN}.checker_scores 必须包含全部 13 个 canonical key(11 工艺 + naturalness + reader-critic),缺任一 P0 阻断。Ch24 漏 reader-naturalness-checker 原 H18 只查"已存在 key 是否 canonical"不查完整性,导致下游 audit 静默错算 overall。chapter_meta.checker_scores 与 review_metrics.dimension_scores 13 个 canonical 项漂移 ≤±1。例外:post_polish_recheck 中的 checker(Step 4.5 合法 polish 真值改)。Ch24 实测 9 项漂移最大 14 分(prose-quality 89 vs 75 真源),P1 警告。post_polish_recheck 留 before/after 记录;无记录则 P1 警告。state update --set-checker-score 必须配套 --append-recheck,违反 Step 3+4.5 真源不可篡改原则。state.last_completed_chapter 与 state.current_chapter 必须 == max(chapter_meta keys)。Ch24 写到 24 但二字段停在 20(连续 4 章累积漂移),P1 警告。.webnovel/signature_density_config.json 设 "_enforcement": "block" 恢复整族硬闸。闸门与 hygiene H* 的一一对应、多层防御设计与同步维护规则见 references/gate-matrix.md。
执行检查:
test -f "${PROJECT_ROOT}/.webnovel/state.json"
ls "${PROJECT_ROOT}/正文/第${chapter_padded}章"*.md >/dev/null 2>&1
test -f "${PROJECT_ROOT}/.webnovel/summaries/ch${chapter_padded}.md"
test -f "${PROJECT_ROOT}/.webnovel/audit_reports/ch${chapter_padded}.json"
python -X utf8 "${SCRIPTS_DIR}/webnovel.py" --project-root "${PROJECT_ROOT}" audit check-decision --chapter ${chapter_num} --require approve,approve_with_warnings
python -X utf8 "${SCRIPTS_DIR}/webnovel.py" --project-root "${PROJECT_ROOT}" index get-recent-review-metrics --limit 1
tail -n 1 "${PROJECT_ROOT}/.webnovel/observability/data_agent_timing.jsonl" || true
tail -n 1 "${PROJECT_ROOT}/.webnovel/observability/chapter_audit.jsonl" || true
成功标准:
overall_score 与 Step 5 输入一致。触发条件:
恢复流程:
anti_ai_force_check=fail:留在 Step 4 继续改写直到 pass,不回退也不跳过;audit_reports/ch{NNNN}.json 的 blocking_issues 逐项 remediation(通常回到 Step 1/3/3.5/4/5),修复后重跑 Step 6;references/ai-cliche-replacement-dict.md (opens in a new tab)references/anti-ai-guide.md (opens in a new tab)references/chapter-end-hook-taxonomy.md (opens in a new tab)references/context-contract.md (opens in a new tab)references/core-constraints.md (opens in a new tab)references/first-chapter-hook-rubric.md (opens in a new tab)references/gate-matrix.md (opens in a new tab)references/no-engineering-prose.md (opens in a new tab)references/no-meta-leak.md (opens in a new tab)references/outline-release-plans-template.md (opens in a new tab)references/polish-guide.md (opens in a new tab)references/post-commit-polish.md (opens in a new tab)references/post-draft-gate.md (opens in a new tab)references/reference-index.md (opens in a new tab)references/round20-quality-floor.md (opens in a new tab)references/step-3-review-gate.md (opens in a new tab)references/step-3.5-external-review.md (opens in a new tab)references/step-5-debt-switch.md (opens in a new tab)references/step-6-audit-gate.md (opens in a new tab)references/step-6-audit-matrix.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
8 skills in this plugin
/webnovel-planBuilds volume and chapter outlines from the total outline, inherits creative constraints, and prepares writing-ready chapter plans. Use when the user asks for outlining or runs /webnovel-plan.npx claudepluginhub xuanranl/webnovelwriter --plugin webnovel-writerOther plugins' skills for the same job