From webnovel-writer
Recovers interrupted webnovel tasks by detecting workflow interruption points via state.json, loading protocols, and offering user-confirmed recovery options. Activates on resume requests or /webnovel-resume.
How this skill is triggered — by the user, by Claude, or both
Slash command
/webnovel-writer:webnovel-resumeThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
- Claude Code 的“工作区根目录”不一定等于“书项目根目录”。常见结构:工作区为 `D:\wk\xiaoshuo`,书项目为 `D:\wk\xiaoshuo\凡人资本论`。
D:\wk\xiaoshuo,书项目为 D:\wk\xiaoshuo\凡人资本论。.webnovel/state.json),后续所有读写路径都以该目录为准。环境设置(bash 命令执行前):
export WORKSPACE_ROOT="${CLAUDE_PROJECT_DIR:-$PWD}"
if [ -z "${CLAUDE_PLUGIN_ROOT}" ] || [ ! -d "${CLAUDE_PLUGIN_ROOT}/skills/webnovel-resume" ]; then
echo "ERROR: 未设置 CLAUDE_PLUGIN_ROOT 或缺少目录: ${CLAUDE_PLUGIN_ROOT}/skills/webnovel-resume" >&2
exit 1
fi
export SKILL_ROOT="${CLAUDE_PLUGIN_ROOT}/skills/webnovel-resume"
if [ -z "${CLAUDE_PLUGIN_ROOT}" ] || [ ! -d "${CLAUDE_PLUGIN_ROOT}/scripts" ]; then
echo "ERROR: 未设置 CLAUDE_PLUGIN_ROOT 或缺少目录: ${CLAUDE_PLUGIN_ROOT}/scripts" >&2
exit 1
fi
export SCRIPTS_DIR="${CLAUDE_PLUGIN_ROOT}/scripts"
export PROJECT_ROOT="$(python "${SCRIPTS_DIR}/webnovel.py" --project-root "${WORKSPACE_ROOT}" where)"
Copy and track progress:
任务恢复进度:
- [ ] Step 1: 加载恢复协议 (cat "${SKILL_ROOT}/references/workflow-resume.md")
- [ ] Step 2: 加载数据规范 (cat "${SKILL_ROOT}/references/system-data-flow.md")
- [ ] Step 3: 确认上下文充足
- [ ] Step 4: 检测中断状态
- [ ] Step 5: 展示恢复选项 (AskUserQuestion)
- [ ] Step 6: 执行恢复
- [ ] Step 7: 继续任务 (可选)
cat "${SKILL_ROOT}/references/workflow-resume.md"
核心原则(读取后应用):
cat "${SKILL_ROOT}/references/system-data-flow.md"
检查清单:
如有缺失 → 返回对应 Step
| Step | 难度 | 恢复策略 |
|---|---|---|
| Step 1 | ⭐ | 直接重新执行 |
| Step 1.5 | ⭐ | 重新设计 |
| Step 2A | ⭐⭐ | 删除半成品,重新开始 |
| Step 2B | ⭐⭐ | 继续适配或回到 2A |
| Step 3 | ⭐⭐⭐ | 用户决定:重审或跳过 |
| Step 4 | ⭐⭐ | 继续润色或删除重写 |
| Step 5 | ⭐⭐ | 重新运行(幂等) |
| Step 6 | ⭐⭐⭐ | 检查暂存区,决定提交/回滚 |
python "${SCRIPTS_DIR}/webnovel.py" --project-root "$PROJECT_ROOT" workflow detect
输出情况:
展示给用户:
示例输出:
🔴 检测到中断任务:
任务:/webnovel-write 7
中断位置:Step 2 - 章节内容生成中
已完成:
✅ Step 1: 上下文加载
未完成:
⏸️ Step 2: 章节内容(已写1500字)
⏹️ Step 3-7: 未开始
恢复选项:
A) 删除半成品,从Step 1重新开始(推荐)
B) 回滚到Ch6,放弃Ch7所有进度
请选择(A/B):
选项 A - 删除重来(推荐):
python "${SCRIPTS_DIR}/webnovel.py" --project-root "$PROJECT_ROOT" workflow cleanup --chapter {N} --confirm
python "${SCRIPTS_DIR}/webnovel.py" --project-root "$PROJECT_ROOT" workflow clear
选项 B - Git 回滚:
git -C "$PROJECT_ROOT" reset --hard ch{N-1:04d}
python "${SCRIPTS_DIR}/webnovel.py" --project-root "$PROJECT_ROOT" workflow clear
如用户选择立即继续:
/{original_command} {original_args}
恢复选项:
A) 重新执行双章审查(成本:~$0.15)⚠️
B) 跳过审查,继续下一章(可后续补审)
⚠️ state.json 可能部分更新
A) 检查并修复 state.json
B) 回滚到上一章(安全)
⚠️ 中断已超过1小时
上下文丢失风险高
建议重新开始而非续写
npx claudepluginhub lingfengqaq/webnovel-writer --plugin webnovel-writerRecovers interrupted webnovel tasks with precise workflow state tracking. Detects interruption point and provides safe recovery options. Activates when user wants to resume or /webnovel-resume.
AI-assisted long-form novel writing CLI using WPS Notes. Automates world-building, chapter writing, and continuity tracking via WPS note storage.
Resumes coding sessions by detecting blockers, reconciling STATE.md with filesystem, and suggesting next actions from checkpoints or plans.