Git Repo to Book
v3.2Write a full-length technical book using multi-代理 AI orchestration. Spawns parallel re搜索, writing, and review 代理s to produce 60K-100K+ word manuscripts. Also supports revising individual chapters of existing books. Based on the real 工作流 that produced an 88,000-word, 14-chapter book in under 18 hours.
运行时依赖
版本
Step R3 — Re搜索 更新s (if needed)
安装命令
点击复制技能文档
Git Repo to Book
Write a full-length technical book using multi-代理 AI orchestration. Based on the real 工作流 that produced The OpenClaw Paradigm — 88,000+ words, 14 chapters, 42 diagrams in under 18 hours.
Scope & Boundaries
This 技能 handles:
Planning, re搜索ing, writing, reviewing, and publishing multi-chapter technical books Revising individual chapters of existing books (review → rewrite → re-integrate) Orchestrating parallel sub-代理s for each phase Merging chapters into a polished manuscript with TOC, metadata, and HTML 导出 Managing the WORK记录 protocol for 代理 coordination
This 技能 does NOT handle:
Cover de签名 or artwork generation (use an illustration 技能) Publishing to Amazon/Kindle/bookstores (输出 is Markdown + HTML) Fiction/creative writing (优化d for technical/non-fiction) Translation to other languages 输入s 输入 Required Description Topic/subject Yes What the book is about Source repo No GitHub URL to analyze as source material Chapter count No Auto-扩展d from repo size (see below), or user override Tar获取 length No Auto-扩展d from repo size (see below), or user override Bud获取 limit No Max API cost in dollars. Default: $100. 代理 暂停s if exceeded 输出 格式化s No Markdown (always), HTML (optional), PDF (optional) 模型 preferences No Defaults in 代理 模型 Recommendations section 输出s book/final-manuscript.md — polished, publication-ready manuscript book/illustrated-manuscript.md — manuscript with scrapbook illustrations (if article-illustrator avAIlable) book/metadata.json — title, author, word count, chapter count, date book/book.html — HTML 导出 (optional) Git 仓库 with full project 历史 Auto-Scaling: Repo Size → Book Size
When a source repo is provided, automatically assess its scope before planning:
# Count source files and total lines find -name '.py' -o -name '.ts' -o -name '.js' -o -name '.go' -o -name '.rs' -o -name '.md' | wc -l find -name '.py' -o -name '.ts' -o -name '.js' -o -name '.go' -o -name '.rs' -o -name '.md' | xargs wc -l 2>/dev/null | tAIl -1
Repo Size Source Files Lines of Code Recommended Chapters Tar获取 Words Estimated Cost Small <50 files <5K lines 5-6 chapters ~30,000 $5-15 Medium 50-200 files 5K-30K lines 8-10 chapters ~55,000 $15-35 Large 200-500 files 30K-100K lines 12-14 chapters ~80,000 $30-60 Very Large >500 files >100K lines 14-18 chapters ~100,000+ $50-100
If no source repo is provided (topic-only book), default to Medium (10 chapters, ~55K words).
The user can always override these defaults.
Pre-Flight Cost Estimation
Before 启动ing any work, present the user with a cost estimate and 获取 confirmation:
Book Project Estimate
Topic: [topic] Source: [repo URL or "topic-only"] Repo size: [Small/Medium/Large/Very Large] ([N] files, [N] lines)
Plan:
- Chapters: [N]
- Tar获取 words: ~[N]
- Writing 代理s: [N] parallel
- Estimated API cost: $[X]-$[Y]
Bud获取 limit: $[user-设置 or 100 default]
模型s:
- Writing: claude-sonnet-4-6 (~$0.003/1K 输入, $0.015/1K 输出)
- Re搜索: gemini-2.5-pro (~$0.002/1K 输入, $0.012/1K 输出)
- Review: deepseek-v3.2 (~$0.001/1K 输入, $0.003/1K 输出)
Proceed? (yes / adjust bud获取 / change chapter count)
Cost 追踪ing during execution: After each phase, 记录 cumulative spend in WORK记录.md:
Cost 检查point - Phase [N] Complete
Phase cost: $X.XX Cumulative: $XX.XX / $[bud获取] bud获取 RemAIning bud获取: $XX.XX Projected total: $XX.XX (on 追踪 / over bud获取)If projected total exceeds bud获取 by >20%, 暂停 and ask the user before continuing.
Architecture Why an 编排器 Sub代理 (not direct Director control)
The nAIve 应用roach is: Director spawns re搜索 代理s, wAIts for completion announce, spawns writing 代理s, wAIts agAIn, etc. This breaks in practice because:
Announce-to-action gap: When a sub代理 finishes, OpenClaw 发送s a completion message to the parent 会话. The parent 获取s a new turn, but it must choose to chAIn the next phase. If it treats the announce as in格式化ional (报告s 结果s to user and 停止s), the 流水线 stalls. There is no guaranteed hook that forces the next action.
上下文 loss between turns: Each turn the Director takes is a fresh LLM call. Between sub代理 completion and the next turn, there's no persistent 状态 machine 追踪ing "we're in phase 3 of 7." The Director must re-derive 流水线 状态 from WORK记录.md every time, which is fragile.
User messages interrupt: If the user 发送s a message between phases, the Director's next turn handles that message instead of continuing the 流水线. The 流水线 stalls until another trigger arrives.
Solution: 编排器 sub代理 pattern. The Director spawns a single 编排器 sub代理 (maxSpawnDepth: 2) that owns the entire 流水线 lifecycle. The 编排器 运行s as a continuous 会话, spawning worker sub-sub-代理s for each phase and immediately chAIning the next phase when workers complete. Because