Novel Writer V2

v1.0.1

章节正文生成器 - 根据章节大纲、Voice Profile 和角色档案构建 LLM 提示词,用于生成章节正文。当需要根据大纲创作具体章节时使用。

0· 18·0 current·0 all-time
MIT-0
Download zip
LicenseMIT-0 · Free to use, modify, and redistribute. No attribution required.
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (chapter prompt generator) align with the shipped Python script and SKILL.md. Required functionality (reading outlines, style.yml, characters/*.yml, building prompts, writing output) is coherent with the stated purpose; no unrelated binaries or credentials are requested.
Instruction Scope
SKILL.md and the script limit actions to reading files under the provided book directory (style.yml, characters/*.yml, outline) and writing a prompt Markdown file. There are no instructions to read system-wide config, shell history, environment secrets, or to send data to external endpoints. The SKILL.md explicitly states 'no network calls, no credentials, local run'.
Install Mechanism
No install spec; it's instruction-only plus a small Python script. Dependencies are standard (rich, PyYAML) installable via pip. No downloads from arbitrary URLs or archive extraction are present.
Credentials
The skill declares no required environment variables, no primary credential, and no config paths. The script uses only file I/O for project files and does not access environment secrets or external services.
Persistence & Privilege
Skill is not always-on and can be invoked by the user. It does not modify other skills or global agent settings and only writes output files under the target project (or any path you specify).
Assessment
This skill appears coherent and local: it reads files you point it to (outline, style.yml, characters/*.yml) and writes a prompt Markdown file. Before running: 1) review the script (already included) if you don't trust the publisher, 2) run pip install in a virtualenv to isolate dependencies, 3) ensure you pass only project files (don't pass paths to sensitive system files), and 4) remember the tool only generates prompts — you still need to call an LLM to produce chapter text. The source has no homepage and is 'unknown', so if you require provenance or support, consider that when deciding to install.

Like a lobster shell, security has layers — review code before you run it.

latestvk978r5ghychyjffrfvw2ywmthn84780g

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

SKILL.md

Novel Writer - 章节正文生成器

Overview

读取章节大纲(Markdown)、风格配置(style.yml)和角色档案(characters/*.yml),构建结构化的 LLM 提示词,用于生成符合风格要求的章节正文。

使用场景

  • 需要根据章节大纲生成正文提示词
  • 需要保持风格一致性(Voice Profile)
  • 需要整合角色档案信息
  • 需要调节生成温度控制随机性

核心功能

功能说明
大纲解析读取 Markdown 格式章节大纲
Voice Profile 注入从 style.yml 加载风格标签、语速、语气、反 AI 规则
角色档案整合自动加载角色名称、身份、特征信息
提示词构建生成系统提示 + 用户提示的结构化提示词
温度控制支持调节 LLM 生成随机性(0.0-1.0)
字数目标设定目标字数指导生成

CLI 使用

# 基本用法
python3 scripts/write_chapter.py --book-dir projects/my-novel --chapter 1 --outline chapters/outlines/chapter-1.md

# 指定字数和温度
python3 scripts/write_chapter.py \
  --book-dir projects/my-novel \
  --chapter 5 \
  --outline chapters/outlines/chapter-5.md \
  --word-count 4000 \
  --temperature 0.8

# 输出到文件
python3 scripts/write_chapter.py \
  --book-dir projects/my-novel \
  --chapter 10 \
  --outline chapters/outlines/chapter-10.md \
  --output chapters/prompts/chapter-10-prompt.md

# 简写
python3 scripts/write_chapter.py -d ./project -c 1 -l outline.md -w 3000 -t 0.7 -o prompt.md

参数说明

参数必填说明
--book-dir小说项目根目录路径
--chapter章节编号
--outline章节大纲文件路径(相对于 book-dir)
--word-count目标字数(默认 2000)
--temperatureLLM 温度 0.0-1.0(默认 0.7)
--output输出文件路径(默认 output/prompts.md)

项目目录结构

projects/my-novel/
├── outline.md          # 故事大纲
├── style.yml           # 风格配置(Voice Profile)
├── characters/         # 角色档案
│   ├── 主角.yml
│   └── 配角.yml
├── chapters/
│   ├── outlines/       # 章节大纲(chapter-outliner 生成)
│   │   └── chapter-01.md
│   └── prompts/        # 提示词输出(novel-writer 生成)
│       └── chapter-01-prompt.md
└── output/
    └── prompts.md      # 默认输出位置

输出提示词格式

# 第 1 章 提示词

**生成时间**: 2026-04-04 23:30:00
**目标字数**: 3000 字
**温度**: 0.7

## 系统提示

你是一名专业的小说作家,擅长根据大纲生成精彩的章节内容。
请严格遵循以下要求:
- 遵循章节大纲的节拍结构
- 保持风格一致性
- 对话自然流畅
- 描写生动具体

## 用户提示

### 章节信息
- 章节:第 1 章
- 目标字数:3000 字
- 建议温度:0.7

### 章节大纲
[来自 outline 文件的内容]

### 风格要求
- 风格标签:温柔,叙事性,略带忧伤
- 语速:缓慢
- 语气:亲切的讲述者语气
- 情感倾向:0.3

### 反 AI 规则
- 避免过度使用形容词
- 减少"的"字频率
- 不使用"仿佛"、"好像"等比喻词

### 角色参考
#### 林风
- 身份:私家侦探
- 特征:冷静,敏锐,略带沧桑

#### 苏雨
- 身份:咖啡馆老板娘
- 特征:温柔,神秘

### 写作要求
1. 严格遵循章节大纲的节拍结构
2. 保持风格一致性
3. 对话自然流畅,符合角色性格
4. 描写生动具体,避免空洞抽象
5. 节奏张弛有度,避免平铺直叙

风格配置 (style.yml)

voice_profile:
  labels:
  - 温柔
  - 叙事性
  - 略带忧伤
  pace: 缓慢
  tone: 亲切的讲述者语气
  sentiment: 0.3
  anti_ai_rules:
  - 避免过度使用形容词
  - 减少"的"字频率
  - 不使用"仿佛"、"好像"等比喻词

角色档案格式 (characters/*.yml)

name: 林风
role: 私家侦探
age: 35
traits:
- 冷静
- 敏锐
- 略带沧桑
background: |
  前刑警,因一次任务失误辞职,
  现为私家侦探。
goals:
- 查明真相
- 保护弱者

温度建议

温度范围效果适用场景
0.0-0.3高度确定技术文档、事实性内容
0.4-0.6平衡一般叙事、对话
0.7-0.9创造性小说创作、创意写作
1.0高度随机实验性写作

依赖

  • Python 3.8+
  • rich (终端渲染)
  • PyYAML (配置文件解析)

安装依赖:

pip install -r scripts/requirements.txt

与其他技能集成

与 chapter-outliner 集成

# 1. 生成章节大纲
python3 ../chapter-outliner/scripts/generate_outline.py \
  --book-dir projects/my-novel \
  --chapter 1 \
  --output chapters/outlines/chapter-1.md

# 2. 根据大纲生成提示词
python3 scripts/write_chapter.py \
  --book-dir projects/my-novel \
  --chapter 1 \
  --outline chapters/outlines/chapter-1.md \
  --output chapters/prompts/chapter-1-prompt.md

与 style-analyzer 集成

# 1. 分析参考文本风格
python3 ../style-analyzer/scripts/analyze_style.py \
  --input reference.txt \
  --output style.yml

# 2. 生成章节提示词(自动使用 style.yml)
python3 scripts/write_chapter.py \
  --book-dir projects/my-novel \
  --chapter 1 \
  --outline outlines/chapter-1.md

与 smart-prompt-builder 集成

# 使用 smart-prompt-builder 生成场景提示词
python3 ../smart-prompt-builder/scripts/build_prompt.py \
  --scene-type description \
  --style-file style.yml \
  --context '{"scene": "雨夜"}'

# 将结果整合到 novel-writer 的提示词中

注意事项

  • 此脚本生成LLM 提示词,实际内容需调用 LLM API 生成
  • 章节大纲文件为必填参数
  • style.yml 和 characters/ 为可选(缺失时使用默认设置)
  • 温度值越高,生成内容越随机(推荐 0.7-0.9 用于小说)
  • 支持 UTF-8 和 GBK 编码的配置文件(自动检测)
  • 无网络调用,无需凭证,本地运行

Files

3 total
Select a file
Select a file to preview.

Comments

Loading comments…