Bestseller Writer 📚
One idea → Full manuscript → Amazon KDP listing. Fully autonomous.
Turn a shower thought into a publishable book. 5-stage multi-agent pipeline handles everything: story structure, characters, all chapters (written in parallel), editorial pass, and a complete Amazon KDP publishing package.
No writing experience needed. No blank page. Just your idea.
What You Get
| Output | Description |
|---|
| INLINECODE0 | Complete book (50-80k words, 25-35 chapters) |
| INLINECODE1 |
Title options, Amazon description, 7 keywords, BISAC categories, pricing strategy, cover brief + Midjourney prompt |
|
plan.md | Full story/argument structure with chapter-by-chapter outline |
|
characters.md | Deep character profiles with arcs (fiction) or authority framework (non-fiction) |
|
editorial_memo.md | Professional developmental edit notes |
Quick Start (CLI)
Install dependency
CODEBLOCK0
Generate a book
CODEBLOCK1
Options
CODEBLOCK2
Environment
export ANTHROPIC_API_KEY=sk-ant-...
Agent-Orchestrated Mode
If you're running inside an OpenClaw agent, the agent follows this pipeline directly using sessions_spawn. Trigger with:
"Write me a book about [idea]" or "Generate a bestseller about [idea]"
The agent will:
- 1. Create output directory at INLINECODE6
- Run all 5 stages sequentially (chapters in parallel batches)
- Deliver
kdp_package.md as the final deliverable - Report word count and publish checklist
Pipeline Architecture
CODEBLOCK4
Genre Support
| Genre | Framework | Avg Length |
|---|
| Thriller/Mystery | Save the Cat beats + 3-act | 70-80k words |
| Romance |
Meet cute → Black moment → HEA | 60-70k words |
| Fantasy/Sci-Fi | World + Hero's Journey | 80-100k words |
| Self-Help | Problem → Framework → Transformation | 40-50k words |
| Business | Insight → Evidence → Application | 45-55k words |
| Memoir | Chronological + thematic arc | 55-70k words |
Revenue Model
Amazon KDP passive income per book:
- - Average: $50-500/month
- Stack 10 books: $500-5,000/month
- Stack 30 books: $1,500-15,000/month
Launch strategy (built into kdp_package.md):
- 1. Publish at $0.99 → enroll KDP Select
- Day 1-4: Paid launch, collect reviews
- Day 5-9: Free promo (spikes ranking)
- Day 10+: Raise to $2.99-$4.99 (70% royalty)
- Repeat with next book
Niche targeting (highest ROI):
- - Cozy mysteries with recurring characters (series = repeat buyers)
- Self-help for specific professions (accountants, nurses, teachers)
- Business books for specific industries
- Local history/interest books (low competition)
Cost Estimate
| Stage | Model | API Cost (approx) |
|---|
| Planner | Opus | ~$0.15 |
| Characters |
Sonnet | ~$0.05 |
| 25 chapters | Sonnet × 25 | ~$0.75 |
| Editor | Opus | ~$0.20 |
| KDP Package | Sonnet | ~$0.05 |
|
Total | |
~$1.20 per book |
One book costs ~$1.20 to generate and can earn $50-500/month. ROI is infinite.
Agent Instructions (for OpenClaw)
When the user asks to write a book or generate a manuscript:
Step 1 — Collect Info
Ask for (or infer from context):
- - The idea (required)
- Genre (infer if obvious, otherwise ask)
- Fiction or non-fiction
Step 2 — Run Pipeline
Create output dir: INLINECODE8
Spawn agents in sequence using sessions_spawn with runtime="subagent":
Agent 1 — Planner:
Task: Full planning prompt (see scripts/generate.js buildPlannerPrompt)
Save output to: INLINECODE12
Agent 2 — Character Designer:
Task: Character/authority prompt with plan as context
Save output to: INLINECODE13
Agents 3-N — Chapter Writers (parallel, max 4 at once):
Task: Chapter writing prompt with plan + characters + prev chapter ending
Save output to: INLINECODE14
Agent N+1 — Editor:
Task: Editorial pass prompt with plan + sample chapters
Save output to: INLINECODE15
Agent N+2 — KDP Packager:
Task: KDP package prompt with plan + editorial
Save output to: INLINECODE16
Step 3 — Assemble
Concatenate all
chapter_NN.md files into INLINECODE18
Step 4 — Deliver
Send user:
- - Word count
- Path to MANUSCRIPT.md
- Key items from kdp_package.md (chosen title, pricing, first keyword string)
- Next steps for publishing
Troubleshooting
Chapters are too short?
The writer agents are prompted for 2,000-2,500 words. If output is shorter, re-run that specific chapter with: "This chapter is too short. Expand to at least 2,000 words, adding more scene depth, dialogue, and sensory detail."
Voice is inconsistent?
The editor stage catches this. After the editorial memo, re-run any flagged chapters with the specific feedback.
KDP keywords not relevant?
Edit kdp_package.md keywords manually using Google Keyword Planner or Publisher Rocket to verify search volume before uploading.
Want a series?
After Book 1 is done, pass plan.md + characters.md into a new run with --idea "Book 2: [continuation]". Characters and world are already built.
畅销书作家 📚
一个想法 → 完整手稿 → Amazon KDP上架。完全自主。
将灵光一现变成可出版书籍。五阶段多智能体流水线处理一切:故事结构、角色、所有章节(并行撰写)、编辑审校,以及完整的Amazon KDP出版包。
无需写作经验。无需面对空白页面。只需你的想法。
你将获得
| 输出文件 | 描述 |
|---|
| MANUSCRIPT.md | 完整书籍(5-8万字,25-35章) |
| kdp_package.md |
书名选项、亚马逊描述、7个关键词、BISAC分类、定价策略、封面简介 + Midjourney提示词 |
| plan.md | 完整故事/论点结构,含逐章大纲 |
| characters.md | 深度角色档案与成长弧线(虚构类)或权威框架(非虚构类) |
| editorial_memo.md | 专业发展编辑批注 |
快速开始(命令行)
安装依赖
bash
cd skills/bestseller-writer/scripts
npm install
生成一本书
bash
惊悚小说
node generate.js --idea 一名侦探发现了自己被谋杀的证据 --genre thriller
自助类
node generate.js --idea 如何在90天内用AI建立一个月入1万美元的业务 --genre self-help
爱情小说
node generate.js --idea 两个敌对餐车老板被迫共享一个节庆摊位 --genre romance
商业/非虚构
node generate.js --idea 为什么大多数初创公司招聘失败以及如何解决 --genre business
选项
--idea, -i 你的书籍概念(必填)
--genre, -g 类型:thriller, romance, self-help, business, memoir, fantasy, nonfiction
--output, -o 输出目录(默认:./book-output/[slug])
--chapters 章节数量(默认:25)
--batch 并行章节批处理大小(默认:4)
--planner 规划师与编辑模型(默认:claude-opus-4-5)
--writer 写作智能体模型(默认:claude-sonnet-4-5)
环境变量
bash
export ANTHROPIC
APIKEY=sk-ant-...
智能体编排模式
如果你在OpenClaw智能体内运行,智能体将直接使用sessions_spawn遵循此流水线。触发方式:
帮我写一本关于[想法]的书 或 生成一本关于[想法]的畅销书
智能体将:
- 1. 在~/Desktop/books/[slug]/创建输出目录
- 依次运行全部5个阶段(章节并行批处理)
- 交付kdp_package.md作为最终交付物
- 报告字数与发布清单
流水线架构
💡 你的想法
│
▼
┌─────────────────────────────────────┐
│ 阶段1:规划师(Opus) │
│ 市场定位、书名选项、 │
│ 完整逐章大纲、 │
│ 对标书籍、推介文案 │
└──────────────────┬──────────────────┘
│
▼
┌─────────────────────────────────────┐
│ 阶段2:角色设计师 │
│ (Sonnet) │
│ 深度档案、成长弧线、声音指南 │
│ (虚构类)或权威/读者 │
│ 化身框架(非虚构类) │
└──────────────────┬──────────────────┘
│
┌─────────┴─────────┐
▼ ▼
┌─────────────┐ ┌─────────────┐
│ 章节 │ ... │ 章节 │ ← 并行批处理
│ 1-4 (Sonnet)│ │ 21-25 │ (每次4章)
└──────┬──────┘ └──────┬──────┘
└─────────┬─────────┘
▼
┌─────────────────────────────────────┐
│ 阶段4:编辑(Opus) │
│ 一致性、节奏、声音、 │
│ 开头/结尾评估、 │
│ 市场潜力评分 │
└──────────────────┬──────────────────┘
│
▼
┌─────────────────────────────────────┐
│ 阶段5:KDP打包器(Sonnet) │
│ 书名、描述、关键词、 │
│ 分类、定价、封面简介、 │
│ Midjourney提示词、发布清单 │
└─────────────────────────────────────┘
│
▼
📦 MANUSCRIPT.md + kdp_package.md
类型支持
| 类型 | 框架 | 平均长度 |
|---|
| 惊悚/悬疑 | 救猫咪节拍 + 三幕结构 | 7-8万字 |
| 爱情小说 |
邂逅 → 低谷 → 幸福结局 | 6-7万字 |
| 奇幻/科幻 | 世界观 + 英雄之旅 | 8-10万字 |
| 自助类 | 问题 → 框架 → 转变 | 4-5万字 |
| 商业类 | 洞察 → 证据 → 应用 | 4.5-5.5万字 |
| 回忆录 | 时间顺序 + 主题弧线 | 5.5-7万字 |
收入模型
Amazon KDP每本书被动收入:
- - 平均:50-500美元/月
- 积累10本书:500-5,000美元/月
- 积累30本书:1,500-15,000美元/月
发布策略(已内置到kdp_package.md):
- 1. 以0.99美元发布 → 加入KDP Select
- 第1-4天:付费发布,收集评论
- 第5-9天:免费促销(提升排名)
- 第10天起:提价至2.99-4.99美元(70%版税)
- 用下一本书重复此流程
利基定位(最高投资回报率):
- - 带固定角色的温馨悬疑(系列 = 重复购买者)
- 针对特定职业的自助书籍(会计师、护士、教师)
- 针对特定行业的商业书籍
- 本地历史/兴趣书籍(竞争低)
成本估算
| 阶段 | 模型 | API成本(约) |
|---|
| 规划师 | Opus | ~0.15美元 |
| 角色 |
Sonnet | ~0.05美元 |
| 25个章节 | Sonnet × 25 | ~0.75美元 |
| 编辑 | Opus | ~0.20美元 |
| KDP包 | Sonnet | ~0.05美元 |
|
总计 | |
~1.20美元/本书 |
生成一本书约需1.20美元,每月可赚50-500美元。投资回报率无限。
智能体指令(适用于OpenClaw)
当用户要求写一本书或生成手稿时:
第1步 — 收集信息
询问(或从上下文中推断):
- - 想法(必填)
- 类型(如明显则推断,否则询问)
- 虚构或非虚构
第2步 — 运行流水线
创建输出目录:~/Desktop/books/[slug]/
使用sessions_spawn按顺序生成智能体,设置runtime=subagent:
智能体1 — 规划师:
任务:完整规划提示(参见scripts/generate.js中的buildPlannerPrompt)
保存输出到:plan.md
智能体2 — 角色设计师:
任务:以计划为上下文的角色/权威提示
保存输出到:characters.md
智能体3-N — 章节作者(并行,最多同时4个):
任务:以计划+角色+前一章结尾为上下文的章节写作提示
保存输出到:chapter_NN.md
智能体N+1 — 编辑:
任务:以计划+样本章节为上下文的编辑审校提示
保存输出到:editorial_memo.md
智能体N+2 — KDP打包器:
任务:以计划+编辑意见为上下文的KDP包提示
保存输出到:kdp_package.md
第3步 — 汇编
将所有chapter_NN.md文件合并为MANUSCRIPT.md
第4步 — 交付
向用户发送:
- - 字数
- MANUSCRIPT.md的路径
- kdp_package.md中的关键项目(选定书名、定价、首个关键词字符串)
- 发布后续步骤
故障排除
章节太短?
写作智能体被提示写2,000-2,500字。如果输出较短,用以下提示重新运行该特定