Xpersona
Z

zh-novel-writer - 批量生成引擎

CLAWHUB · Unverified

批量生成网络小说章节。通过环境变读取 API keys 并调用外部 LLM API (ModelScope, Fyra, Ph8) 生成中文小说内容。 使用场景:用户给出大纲并要求"批量生成章节"、"写第X章到第Y章"、"后台静默写作"。 前置要求:需设置环境变量 NOVEL_MODELSCOPE_KEY 或 N... Skill: zh-novel-writer - 批量生成引擎 Owner: shine8592 Summary: 批量生成网络小说章节。通过环境变读取 API keys 并调用外部 LLM API (ModelScope, Fyra, Ph8) 生成中文小说内容。 使用场景:用户给出大纲并要求"批量生成章节"、"写第X章到第Y章"、"后台静默写作"。 前置要求:需设置环境变量 NOVEL_MODELSCOPE_KEY 或 N... Tags: chinese:1.0.3, latest:1.0.3, novel:1.0.3, writing:1.0.3 Version history: v1.0.3 | 2026-04-04T14:46:46.648Z | user No changes detected in this version. - No file or documentation changes. - Functi

62
Rank
84
Safety
976
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 976 downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: medium.

clawhub skill install s17crw4r7gg8er3naarwg8zhm983zck3:zh-novel-writer
  1. Setup complexity is MEDIUM. Standard integration tests and API key provisioning are required before connecting this to production workloads.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-shine8592-zh-novel-writer/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

17,792 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: zh-novel-writer
description: >
  批量生成网络小说章节。通过环境变读取 API keys 并调用外部 LLM API
  (ModelScope, Fyra, Ph8) 生成中文小说内容。
  使用场景:用户给出大纲并要求"批量生成章节"、"写第X章到第Y章"、"后台静默写作"。
  前置要求:需设置环境变量 NOVEL_MODELSCOPE_KEY 或 NOVEL_FYRA_KEY 或 NOVEL_PH8_KEY 至少一个。
  外部依赖:Python 3, pip install httpx。
  NOT for: 单章精修、人工审稿、出版级校对。
---

# Novel Writer — 网络小说批量生成

## 前置要求

- Python 3 + `pip install httpx`
- 至少设置一个 API key 环境变量:

```bash
export NOVEL_MODELSCOPE_KEY="your_modelscope_key"
export NOVEL_FYRA_KEY="your_fyra_key"
export NOVEL_PH8_KEY="your_ph8_key"
```

## External API Endpoints

| 服务 | URL | 环境变量 |
|------|-----|---------|
| ModelScope | https://api-inference.modelscope.cn/v1/chat/completions | NOVEL_MODELSCOPE_KEY |
| Fyra | https://Fyra.im/v1/chat/completions | NOVEL_FYRA_KEY |
| Ph8 | https://ph8.co/v1/chat/completions | NOVEL_PH8_KEY |

用户文本会发送到以上 API 端点以生成小说内容。

## Quick Start

1. 确认大纲文件和章节范围
2. 读 `references/api-config.md` 获取 API 配置说明
3. 运行 `scripts/batch_generate.py`

## Workflow

```
大纲 → 逐章prompt → 逐个调用外部 LLM API → 分段生成 → 保存文件
```

## 脚本说明

`scripts/batch_generate.py`:
- 分段生成章节(单次 API 输出有限制时自动分段追加)
- 多 API 容错:按 ModelScope → Fyra → Ph8 顺序尝试
- 429 限流自动等 30 秒重试
- 未配置 API key 的 API 会被自动跳过

## References
- API 配置 → `references/api-config.md`
- Prompt 模板 → `references/prompt-template.md`

_meta.json

{
  "ownerId": "kn7b58zxnygbypnjf7yb4zwy5982rg9e",
  "slug": "zh-novel-writer",
  "version": "1.0.3",
  "publishedAt": 1775314006648
}

references/api-config.md

# API 配置

## 环境变量

脚本从以下环境变量读取 API keys:

| API | 环境变量 | 端点 | 模型 |
|-----|---------|------|------|
| ModelScope | `NOVEL_MODELSCOPE_KEY` | https://api-inference.modelscope.cn/v1/chat/completions | deepseek-ai/DeepSeek-V3.2 |
| Fyra | `NOVEL_FYRA_KEY` | https://Fyra.im/v1/chat/completions | mistral-large-3-675b-instruct |
| Ph8 | `NOVEL_PH8_KEY` | https://ph8.co/v1/chat/completions | qwen3-235b-a22b-2507 |

至少设置一个。用户文本会发送到以上端点。

## 调用策略

1. 默认顺序:ModelScope → Fyra → Ph8
2. 429 限流:自动等 30 秒重试
3. 失败:自动切下一个 API
4. 未配置 key 的 API 自动跳过

## 示例

```bash
export NOVEL_MODELSCOPE_KEY="ms-xxxxxxxxx"
python3 scripts/batch_generate.py --outline outline.json --start 1 --end 10 --output chapters/
```

references/prompt-template.md

# Prompt 模板 — 小说章节生成

## 首段(第一章)模板

```
你是网络小说主笔,正在写第{N}章:{标题}。

【本章剧情】{大纲剧情}
{角色信息}

硬性要求:
1. 纯中文!所有数字用中文写法(一、二、三十),绝不出现阿拉伯数字和英文
2. 零AI标记词汇!不得出现"暗思涌起""心理描写""环境描写""动作描写""命运的齿轮"等
3. 禁止模板化结尾!不要"真正的危机才刚刚开始""未完待续"
4. 主角名{主角名},全文统一
5. {金手指描述}
6. 直接输出小说正文,不要任何说明文字

字数必须达到12000字。
```

## 续段(第2+段)模板

```
你是网络小说主笔,继续写第{N}章:{标题}。

【本章剧情】{大纲剧情}

【已有内容结尾】
{结尾300-500字摘录}...

【核心约束】人物、世界观、金手指、剧情走向必须与已有内容连贯。

从已有内容的结尾处**自然续写**,不可重复已有内容。

硬性要求:
1. 纯中文!数字用中文写法,零英文零阿拉伯数字
2. 零AI标记词汇
3. 禁止模板化结尾
4. 直接输出续写正文

续写内容必须至少{需要字数}字。
```

## 硬编码约束(注入所有 prompt)

```
1. 纯中文!所有数字用中文写法(一、二、三十),绝不出现阿拉伯数字和英文
2. 零AI标记词汇(不得出现"暗思涌起""心理描写""环境描写""动作描写""命运齿轮"等)
3. 禁止模板化结尾("真正的危机才刚刚开始""未完待续"等)
4. 主角姓名统一,不可切换
5. 金手指描述一致
6. 忠于大纲,不自由发挥核心剧情
7. 直接输出正文,不要说明
```

## 大纲格式要求

大纲 JSON:
```json
{
  "chapters": {
    "1": {"title": "废物少年", "plot": "主角出场,被退婚..."},
    "2": {"title": "退婚之辱", "plot": "退婚现场,主角立誓..."},
  }
}
```

## Prompt 变量注入

| {{变量}} | 说明 | 示例 |
|---------|------|------|
| `{{主角名}}` | 主角名字 | 林阎 |
| `{{金手指}}` | 核心设定 | 一枚神秘铜钱 |
| `{{卷号}}` | 当前卷 | 第一卷 |
| `{{大纲剧情}}` | 本章大纲 | 来自大纲文件 |
| `{{角色信息}}` | 本章出场角色 | 林阎、柳如烟 |
| `{{需要字数}}` | 计算出的目标 | 4000-6000 |

skill-card.md

## Description:

Generates batches of Chinese web-novel chapters from an outline by prompting configured external LLM APIs and saving chapter Markdown files.

This skill is ready for commercial/non-commercial use.

## Publisher:

[shine8592](https://clawhub.ai/user/shine8592)

### License/Terms of Use:

MIT-0

## Use Case:

External creators and developers use this skill to batch-generate Chinese web-novel chapters from a JSON outline, chapter range, and configured API credentials. It is intended for draft generation rather than single-chapter polish, human editorial review, or publication-grade proofreading.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Outlines, manuscript excerpts, and generated chapter text can be sent to ModelScope, Fyra, or Ph8 when API keys are configured.

Mitigation: Avoid sending sensitive or confidential manuscript material, review the selected provider's data terms, and use dedicated API keys with spending limits.

Risk: Batch generation can continue making paid API calls across broad chapter ranges without a clear per-chapter cost limit.

Mitigation: Start with a small chapter range, monitor provider billing and logs, and run the script in a contained environment with constrained credentials.

## Reference(s):

- [API configuration](references/api-config.md)
- [Prompt template](references/prompt-template.md)
- [ModelScope chat completions endpoint](https://api-inference.modelscope.cn/v1/chat/completions)
- [Fyra chat completions endpoint](https://Fyra.im/v1/chat/completions)
- [Ph8 chat completions endpoint](https://ph8.co/v1/chat/completions)

## Skill Output:

**Output Type(s):** [text, markdown, shell commands, configuration, guidance]

**Output Format:** [Markdown chapter files with concise shell and configuration guidance]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [May produce one Markdown file per generated chapter across a requested chapter range; generated text is sent to configured external LLM APIs.]

## Skill Version(s):

1.0.3 (source: server release metadata)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to zh-novel-writer - 批量生成引擎 and adjacent AI workflows.