← 返回 Skills 市场
tanson515

Fanfic Writer

作者 tanson515 · GitHub ↗ · v2.1.0
cross-platform ⚠ suspicious
1367
总下载
2
收藏
6
当前安装
4
版本数
在 OpenClaw 中安装
/install fanfic-writer
功能描述
自动化小说写作助手 v2.1 - 基于证据的状态管理、多视角QC、原子I/O、每个阶段人工确认
使用说明 (SKILL.md)

Fanfic Writer v2.1 - 自动化小说写作系统 / Automated Novel Writing System

版本 Version: 2.1.0
架构 Architecture: 基于证据的状态管理 with atomic I/O
安全机制 Safety: Auto-Rescue, Auto-Abort Guardrail, FORCED 连击熔断
核心特性: 每个阶段人工确认


系统概览 / System Overview

Fanfic Writer v2.1 是一套生产级的小说写作流水线,每个阶段都需要人工确认:

/ Fanfic Writer v2.1 is a production-grade novel writing pipeline with human confirmation at each phase:

  • 9 阶段流水线 / 9 Phase Pipeline: 从初始化到最终QC
  • 7 状态面板 / 7 State Panels: 角色、剧情线、时间线、道具、地点、POV规则、会话记忆
  • 证据链 / Evidence Chain: 所有状态变更带有 (章节, 片段, 置信度) 追踪
  • 原子I/O / Atomic I/O: temp → fsync → rename 模式 + 快照回滚
  • 多视角QC / Multi-Perspective QC: 3-评审协议 + 100分制评分
  • 安全机制 / Safety Mechanisms: Auto-Rescue, Auto-Abort
  • 人工确认 / Human Confirmation: 每个阶段必须确认才能继续

人工确认流程 / Human Confirmation Flow

根据设计文档,每个阶段都需要人工确认:

阶段 Phase 需要确认的内容 状态 Status
Phase 1 书名、类型、字数、存放目录 必需
Phase 2 风格指南 必需
Phase 3 主线大纲 必需
Phase 4 章节规划 必需
Phase 5 世界观设定 必需
Phase 6 每章正文后确认进入下一章 必需
Phase 7 Backpatch 确认 必需
Phase 8-9 最终合并确认 必需

快速开始 / Quick Start

通过 OpenClaw 调用

帮我写一本都市灵异小说

AI 会引导你完成每个阶段的确认。

通过 CLI

# 初始化新书 (每个阶段会确认)
python -m scripts.v2.cli init

# 写作 (每章会确认)
python -m scripts.v2.cli write --run-dir \x3Cpath>

架构 / Architecture

目录结构 / Directory Structure

novels/
└── {book_title_slug}__{book_uid}/
    └── runs/
        └── {run_id}/
            ├── 0-config/              # 配置层
            ├── 1-outline/             # 大纲层
            ├── 2-planning/           # 规划层
            ├── 3-world/              # 世界观层
            ├── 4-state/              # 运行时状态 (7面板)
            ├── drafts/                # 草稿层
            ├── chapters/              # 最终章节
            ├── anchors/               # 锚点
            ├── logs/                  # 日志
            ├── archive/              # 归档
            └── final/                 # 最终输出

阶段参考 / Phase Reference

阶段 Phase 名称 Name 描述 Description 需要确认
1 Initialization 创建工作空间、配置 ✅ 书名/类型/字数/目录
2 Style Guide 定义叙事风格 ✅ 风格指南
3 Main Outline 生成书籍级情节结构 ✅ 主线大纲
4 Chapter Planning 详细章节列表与钩子 ✅ 章节规划
5 World Building 角色、阵营、规则、道具 ✅ 世界观
5.5 Alignment Check 验证世界观匹配意图清单 自动
6 Writing Loop 清洗→草稿→QC→提交 ✅ 每章确认
7 Backpatch Pass FORCED章节回补修复 ✅ 确认
8 Merge Book 合并章节为最终版本 ✅ 确认
9 Whole-Book QC 最终7点质量检查 ✅ 确认

阶段6: 写作循环 (核心) / Phase 6: Writing Loop (Core)

确认流程 / Confirmation Flow

[生成大纲] → 用户确认 → [生成正文] → QC评分 → 用户确认 → [下一章]

QC 评分标准

分数 Score 状态 Status 动作 Action
≥85 PASS 保存,继续
75-84 WARNING 保存(带警告),继续
\x3C75 REVISE 重试
第三次\x3C75 FORCED 保存,进Backpatch

配置 / Configuration

0-book-config.json

{
  "version": "2.1.0",
  "book": {
    "title": "书名",
    "title_slug": "book_slug",
    "book_uid": "8char_hash",
    "genre": "都市灵异",
    "target_word_count": 100000,
    "chapter_target_words": 2500
  },
  "generation": {
    "model": "moonshot/kimi-k2.5",
    "mode": "manual",
    "max_attempts": 3,
    "auto_threshold": 85,
    "auto_rescue_enabled": true
  }
}

OpenClaw 集成 / OpenClaw Integration

模型说明

重要: 这个 skill 不硬编码任何模型。当 OpenClaw 调用此 skill 时,自动使用 OpenClaw 当前配置的模型。

函数入口

from scripts.v2.openclaw_entry import run_skill, get_required_confirmations

# 获取某阶段需要确认的内容
confirmations = get_required_confirmations("6_write")
# Returns: ["每章正文生成后确认", "每章评分确认"]

# 运行 skill - 模型由 OpenClaw 自动提供
result = run_skill(
    book_title="我的小说",
    genre="都市",
    target_words=100000,
    mode="manual"
    # oc_context 由 OpenClaw 自动传入,包含当前模型
)

oc_context 参数

OpenClaw 会自动传入 oc_context 参数,包含:

  • model_call - 调用当前模型的方法
  • model_name - 当前模型名称(可选)
  • generate - 备选方法(可选)

开发 / Development

模块结构 / Module Structure

scripts/v2/
├── __init__.py
├── utils.py              # ID生成、slug、路径
├── atomic_io.py          # 原子写入、快照
├── workspace.py          # 目录管理
├── config_manager.py     # 配置I/O
├── state_manager.py      # 7面板
├── prompt_registry.py    # 模板注册表
├── prompt_assembly.py   # 提示词构建
├── price_table.py       # 费率表管理
├── resume_manager.py    # 断点续传、锁管理
├── phase_runner.py      # 阶段1-5
├── writing_loop.py       # 阶段6
├── safety_mechanisms.py  # 阶段7-9
├── cli.py               # CLI入口
└── openclaw_entry.py    # OpenClaw入口 (v2.1新增)

版本历史 / Version History

v2.1.0 (2026-02-16)

  • ✅ 每个阶段人工确认机制
  • ✅ OpenClaw 函数入口
  • ✅ 接入真实模型 API
  • ✅ 修复 Windows 兼容性
  • ✅ 完善中文文档

v2.0.0 (2026-02-11)

  • 初始版本
  • 9阶段流水线
  • 7状态面板
  • 多视角QC

许可证 / License

MIT License

安全使用建议
This skill appears to be what it claims: a multi-stage novel-writing pipeline that reads/writes project files and uses your OpenClaw-provided model. Before installing or running it: 1) decide where project files should live and set NOVELS_DIR to a folder you control (to avoid the odd hardcoded default path). 2) Inspect scripts/v2/openclaw_entry.py and scripts/v2/safety_mechanisms.py (and any omitted files named token_tracker.py, tomato_fetch.py, price_table.py) for network calls or external API use — those files are the most likely to contact external services. 3) Run the included test_v2.py in a controlled environment to verify imports and behavior. 4) Because the skill persists drafts, logs, and registry entries, do not run it on a machine that contains sensitive data you would not want written into the skill's working directory. If you want extra assurance, review any code that mentions 'fetch', 'requests', 'http', or 'openclaw config' to ensure it won't send sensitive information off-machine without your knowledge.
功能分析
Type: OpenClaw Skill Name: fanfic-writer Version: 2.1.0 The skill exhibits extensive file system access and manipulation (e.g., creating, moving, deleting directories and files in `scripts/v2/atomic_io.py`, `scripts/chapter_manager.py`, `scripts/v2/workspace.py`), network communication via `urllib.request` to an external domain (`fanqienovel.com` in `scripts/tomato_fetch.py`), and process management capabilities (`os.kill` in `scripts/v2/resume_manager.py`). While these actions are plausibly necessary for a complex novel-writing agent, they represent high-risk capabilities if exploited. The AI agent's instructions (prompts) are a significant attack surface, and although the provided templates include explicit negative constraints against AI drift, the inherent nature of prompt injection poses a continuous risk. There is no evidence of intentional malicious behavior, but the broad permissions and powerful capabilities warrant a 'suspicious' classification.
能力评估
Purpose & Capability
The name/description (automated novel writing with staged confirmations) match the included Python scripts and prompt templates: outline generation, segmented writing, QC, state management, atomic I/O, merge and CLI entrypoints. There are no declared environment variables or credentials unrelated to the described purpose.
Instruction Scope
SKILL.md and the code direct the agent/user to create and operate on a local book workspace (init, write, merge, QC) and to call run_skill with oc_context provided by OpenClaw. The runtime instructions and CLI expect the skill to read and write many local files (configs, session state, chapter drafts, logs). This is coherent with the purpose, but it does mean the skill will persist user content and state to disk; it also references running 'openclaw config get' for troubleshooting (instructional example) which could reveal model config if executed by a user. No instructions were found that tell the agent to read arbitrary system secrets, shell history, or to transmit data to unknown external endpoints.
Install Mechanism
There is no install spec and no remote download/install step; the package is instruction-plus-source. That reduces install-time risk because nothing will be fetched/installed automatically. The repository contains many code files, but they are local and executed by Python when invoked by the user/agent.
Credentials
The skill declares no required env vars or credentials. The code does reference an optional NOVELS_DIR environment variable to override the working directory; if unset it falls back to a hardcoded default Windows-style path (C:\Users\10179\clawd\novels). Requesting no secrets is proportionate, but the hardcoded default path is odd and may cause files to be created in an unexpected location on install — you may want to set NOVELS_DIR explicitly to a safe folder before running.
Persistence & Privilege
The skill creates and updates persistent on-disk state (book directories, drafts, chapters, registry, session files, logs, final output). That is expected for a writing/workflow tool and consistent with the documented behavior (atomic I/O, snapshots, evidence chain). always:false and normal autonomous invocation are used. The skill does not appear to modify other skills' configs or request platform-wide privileges.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install fanfic-writer
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /fanfic-writer 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v2.1.0
Fanfic Writer v2.1.0 introduces robust human confirmation and OpenClaw integration for safer, more flexible automated novel writing. - Added mandatory human confirmation at every workflow stage. - Integrated OpenClaw entry function: supports external model configuration and pipeline control. - Implemented atomic I/O (write → fsync → rename) and enhanced safety mechanisms (auto-rescue, auto-abort). - Improved Windows compatibility and expanded Chinese documentation. - Updated documentation to clarify phases, architecture, and integration points.
v2.0.1
No user-visible changes in this version. - Version bump only; no changes detected to files or features. - All functionality and documentation remain identical to the previous version.
v2.0.0
fanfic-writer v2.0.0 introduces a major pipeline upgrade with robust safety and quality assurance. - New evidence-based state management system with atomic I/O operations and rollback support. - 9-phase automated novel writing pipeline, including multi-pass quality control and backpatching. - 7-panel state tracking (characters, plots, timeline, etc.) with evidence chaining for traceability. - Multi-perspective, weighted QC with explicit scoring and automated verdict/action mapping. - Auto-rescue and auto-abort mechanisms for error recovery and deadlock prevention, plus FORCED commit fuse. - Enhanced directory and process structure for tracing, audit, and final output consolidation.
v1.0.0
Fanfic Writer 1.0.0 – Initial release - Introduces a full novel-writing workflow with 6+ phases: genre selection, scope, outlining, chapter planning, worldbuilding, and chapter-by-chapter writing. - Enforces strict Markdown formatting and quality control standards at every phase and user interaction. - Adds persistent file-based recordkeeping for all config, outlines, drafts, and progress. - Provides step-by-step user confirmation points, preventing progress without review and approval. - Implements comprehensive token usage tracking and structured workspace organization for each novel. - Includes whole-book integration and final quality check after writing completion.
元数据
Slug fanfic-writer
版本 2.1.0
许可证
累计安装 6
当前安装数 6
历史版本数 4
常见问题

Fanfic Writer 是什么?

自动化小说写作助手 v2.1 - 基于证据的状态管理、多视角QC、原子I/O、每个阶段人工确认. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1367 次。

如何安装 Fanfic Writer?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install fanfic-writer」即可一键安装,无需额外配置。

Fanfic Writer 是免费的吗?

是的,Fanfic Writer 完全免费(开源免费),可自由下载、安装和使用。

Fanfic Writer 支持哪些平台?

Fanfic Writer 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Fanfic Writer?

由 tanson515(@tanson515)开发并维护,当前版本 v2.1.0。

💬 留言讨论