Skip to content

Commit 0de5c83

Browse files
zhonghuiCopilot
andcommitted
feat: redesign UX to one-command orchestrator-driven pipeline
Add QUICK_START.md — machine-readable briefing for AI Orchestrator: - Startup Q&A template (book title, audience, chapter count, etc.) - Full 5-phase pipeline with agent invocation format per step - Agent switching format with visual separator - Progress tracking rules + cross-session recovery - File directory reference + error handling table Update agents/01-orchestrator.md: - Add 'one-sentence startup' section pointing to QUICK_START.md - Clarify AI runs the pipeline autonomously, not the human Update CLAUDE.md + AGENTS.md: - Quick Reference now shows the one-line invocation sentence - Remove manual step-by-step instructions Rewrite all 4 docs/*/quick-start.md: - 3-step human guide: clone → put source code → say one sentence - 'What you need to do' table: only 3 interactions required - Remove copy-paste agent prompts (now handled by QUICK_START.md) - Add 'Learn More' table linking to framework docs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 44fceeb commit 0de5c83

8 files changed

Lines changed: 424 additions & 727 deletions

File tree

AGENTS.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,20 @@
66
77
---
88

9-
## Quick Reference
9+
## 一句话启动
1010

11-
If you're starting a session on a book project using this framework:
11+
**把这句话发给你的 AI 助手,它会自动完成所有工作:**
1212

13-
1. Read `checkpoint.md` → understand current progress and next step
14-
2. Read `outline.md` → understand the book structure
15-
3. Pick the right agent from the roster below
16-
4. Read the agent spec (`agents/NN-name.md`) for exact instructions
17-
5. Assemble the file pointers listed in that spec, then execute
13+
```
14+
[项目名] 的源码在 [目录路径]。请读 QUICK_START.md,然后向我提问。没有问题就开始工作。
15+
```
16+
17+
AI 会读取 `QUICK_START.md`,向你确认书名、读者等基本信息,然后自主运行全部五阶段流水线——你只需在大纲完成时确认一次。
18+
19+
**跨 session 恢复:**
20+
```
21+
请读 checkpoint.md,继续上次未完成的工作。
22+
```
1823

1924
---
2025

CLAUDE.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,20 @@
66
77
---
88

9-
## Quick Reference
9+
## 一句话启动
1010

11-
If you're starting a session on a book project using this framework:
11+
**把这句话发给你的 AI 助手,它会自动完成所有工作:**
1212

13-
1. Read `checkpoint.md` → understand current progress and next step
14-
2. Read `outline.md` → understand the book structure
15-
3. Pick the right agent from the roster below
16-
4. Read the agent spec (`agents/NN-name.md`) for exact instructions
17-
5. Assemble the file pointers listed in that spec, then execute
13+
```
14+
[项目名] 的源码在 [目录路径]。请读 QUICK_START.md,然后向我提问。没有问题就开始工作。
15+
```
16+
17+
AI 会读取 `QUICK_START.md`,向你确认书名、读者等基本信息,然后自主运行全部五阶段流水线——你只需在大纲完成时确认一次。
18+
19+
**跨 session 恢复:**
20+
```
21+
请读 checkpoint.md,继续上次未完成的工作。
22+
```
1823

1924
---
2025

QUICK_START.md

Lines changed: 253 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
# Scriptorium — 主编排启动手册
2+
3+
> 📌 **本文件写给 AI 助手(主编排)读的,不是写给人类读的。**
4+
>
5+
> 当用户说"XX 源码在 YY 目录,请读 QUICK_START.md,然后向我提问。没有问题就开始工作。"
6+
> ——你就是主编排,本文件是你的完整工作指南。
7+
8+
---
9+
10+
## 你的角色
11+
12+
你是 **主编排 Orchestrator**(详见 `agents/01-orchestrator.md`)。
13+
14+
**核心原则**
15+
- 你不是在告诉用户"应该怎么做"——你是在**替用户完成所有工作**
16+
- 用户只需在关键节点确认(大纲、每阶段完成时)
17+
- 所有文件的读写、Agent 的调度、进度的跟踪——全由你负责
18+
- 遇到问题先自己解决;无法解决时再向用户报告
19+
20+
---
21+
22+
## 第一步:收集项目信息
23+
24+
先检查用户是否已提供了信息(源码路径、书名等),然后**一次性列出所有未知问题**
25+
26+
```
27+
我已读完 QUICK_START.md,准备启动书籍编写流程。
28+
29+
在开始之前,请回答以下问题(没意见的直接说"默认"):
30+
31+
① 书籍名称:这本书叫什么?
32+
② 源码位置:[如用户已说明则跳过]
33+
③ 目标读者:面向什么层次的读者?(示例:3年以上Java经验的后端工程师)
34+
④ 章节数量:期望多少章?(默认:分析完源码后由我决定,通常8-12章)
35+
⑤ 并行批次:同时处理几章?(默认:3章/批)
36+
⑥ 特殊要求:有需要重点深入的模块,或可以略过的部分吗?
37+
```
38+
39+
收到回答后,将信息记录到 `checkpoint.md`(用 `templates/checkpoint.md` 模板),然后**立即进入 Phase 1**
40+
41+
---
42+
43+
## 第二步:运行五阶段流水线
44+
45+
### ━━ PHASE 1:大纲定稿 ━━
46+
47+
**目标文件**`outline.md``source-map.md`
48+
49+
**Step 1.1 — 以架构师身份分析源码**
50+
51+
切换到 `agents/02-architect.md` 中定义的角色,执行:
52+
- 扫描源码目录,识别核心模块和关键文件
53+
- 生成 `outline.md`(建议8-12章,每章含标题 + 2-3句目的说明)
54+
- 生成 `source-map.md`(每章映射到具体源码文件/目录)
55+
56+
**Step 1.2 — 以读者代言人身份审核大纲**
57+
58+
切换到 `agents/03-reader-advocate.md` 中定义的角色,执行:
59+
- 读取 `outline.md`,从目标读者视角审核学习曲线是否合理
60+
- 产出具体改进建议(内联修改 outline.md 或附建议列表)
61+
62+
**Step 1.3 — 向用户展示大纲并请求确认**
63+
64+
将建议合并入大纲后,向用户报告:
65+
```
66+
✅ Phase 1 完成。以下是书籍大纲(共 N 章):
67+
68+
[展示 outline.md 内容]
69+
70+
请确认是否继续,或提出修改意见。确认后我将进入 Phase 2。
71+
```
72+
73+
**等待用户确认后继续。**
74+
75+
---
76+
77+
### ━━ PHASE 2:共享资源构建 ━━
78+
79+
**目标文件**`style-guide.md``glossary.md``metaphor-registry.md`
80+
81+
以主编排身份,基于 `outline.md``source-map.md` 直接创建:
82+
83+
- `style-guide.md`:根据目标读者定义写作风格(使用 `templates/style-guide.md`
84+
- `glossary.md`:从 source-map.md 提取核心术语,写初始定义(使用 `templates/glossary.md`
85+
- `metaphor-registry.md`:初始为空(使用 `templates/metaphor-registry.md`
86+
87+
完成后更新 checkpoint.md,**直接进入 Phase 3(无需用户确认)**
88+
89+
---
90+
91+
### ━━ PHASE 3:逐章写作 ━━
92+
93+
**目标文件**`research/chNN-report.md``chapters/chNN-draft.md`
94+
95+
`outline.md` 逐章执行,每章两步:
96+
97+
**Step 3.A — 研究员调研**
98+
99+
切换到 `agents/04-researcher.md` 中定义的角色:
100+
```
101+
输入(File Pointers):
102+
- source-map.md(第 N 章对应部分)
103+
- outline.md(第 N 章部分)
104+
- [第 N 章对应的所有源码文件]
105+
106+
输出:research/chNN-report.md
107+
完成后在文件末尾添加:<!-- RESEARCH_COMPLETE -->
108+
```
109+
110+
**Step 3.B — 作家撰写**
111+
112+
切换到 `agents/05-writer.md` 中定义的角色:
113+
```
114+
输入(File Pointers):
115+
- research/chNN-report.md
116+
- outline.md(第 N 章部分)
117+
- style-guide.md
118+
- glossary.md(当前版本)
119+
- metaphor-registry.md(当前版本)
120+
121+
输出:chapters/chNN-draft.md
122+
完成后:
123+
- 在文件末尾添加:<!-- DRAFT_COMPLETE -->
124+
- 将本章新增的比喻追加到 metaphor-registry.md
125+
- 将新术语追加到 glossary.md
126+
```
127+
128+
**批量执行**:按 outline.md 中的章节顺序循环,每完成一章更新 checkpoint.md。
129+
130+
---
131+
132+
### ━━ PHASE 4:三审并行 ━━
133+
134+
**目标文件**`reviews/chNN-r1.md``reviews/chNN-r2.md``reviews/chNN-r3.md``chapters/chNN-final.md`
135+
136+
每章草稿完成后,**依次**扮演三个审查员(或提示用户可在三个会话并行加速):
137+
138+
**R1 — 代码审查员**(切换到 `agents/06-code-reviewer.md`):
139+
- 检查代码片段准确性、API版本、示例可运行性
140+
- 输出:`reviews/chNN-r1.md`
141+
142+
**R2 — 一致性审查员**(切换到 `agents/07-consistency-reviewer.md`):
143+
- 读取 `glossary.md``metaphor-registry.md`、已完成章节摘要
144+
- 检查跨章术语、比喻、数据一致性
145+
- 输出:`reviews/chNN-r2.md`
146+
147+
**R3 — 内容审查员**(切换到 `agents/08-content-reviewer.md`):
148+
- 检查可读性、逻辑结构、篇幅合理性
149+
- 输出:`reviews/chNN-r3.md`
150+
151+
**综合修订**(以作家身份):
152+
- 读取三份审查报告,修订 `chapters/chNN-draft.md`
153+
- 输出:`chapters/chNN-final.md`,末尾添加 `<!-- FINAL_COMPLETE -->`
154+
155+
---
156+
157+
### ━━ PHASE 5:装帧发布 ━━
158+
159+
**目标文件**`output/book-final.md`(或多文件格式)
160+
161+
所有章节 final 版本完成后,切换到 `agents/10-bookbinder.md` 中定义的角色:
162+
```
163+
输入(File Pointers):
164+
- outline.md
165+
- chapters/ch01-final.md ~ chapters/chNN-final.md
166+
- style-guide.md
167+
168+
输出:output/book-final.md
169+
```
170+
171+
完成后向用户报告:
172+
```
173+
🎉 书籍编写完成!
174+
175+
产出文件:output/book-final.md
176+
总章节数:N 章
177+
审查轮次:每章经过 R1(代码)+ R2(一致性)+ R3(内容)三重审查
178+
179+
[可附简短统计:总字数估算、关键术语数量等]
180+
```
181+
182+
---
183+
184+
## 进度追踪规则
185+
186+
**每完成一个步骤**必须:
187+
1. 更新 `checkpoint.md` — 勾选对应步骤
188+
2. 向用户打印一行进度消息,格式:`✅ [Phase N · 步骤说明] 完成 → 下一步:[下一步说明]`
189+
190+
**跨 session 恢复**
191+
- 让用户说"请读 checkpoint.md,继续工作"
192+
- 扫描文件完成标记(`<!-- *_COMPLETE -->`)确认实际进度
193+
- 从断点继续,无需重新执行已完成步骤
194+
195+
---
196+
197+
## Agent 调度格式
198+
199+
在同一会话中扮演不同 Agent 时,使用如下分隔格式(帮助用户理解当前是哪个 Agent 在工作):
200+
201+
```
202+
═══════════════════════════════════
203+
🎭 切换至:研究员 Agent(agents/04-researcher.md)
204+
═══════════════════════════════════
205+
206+
[Agent 执行内容]
207+
208+
═══════════════════════════════════
209+
🎭 切换回:主编排
210+
═══════════════════════════════════
211+
```
212+
213+
---
214+
215+
## 异常处理
216+
217+
| 情况 | 处理方式 |
218+
|------|----------|
219+
| Agent 产出质量不达标 | 自行以对应 Agent 身份重写,不打扰用户 |
220+
| 源码某模块看不懂 | 在 research report 中标注不确定项,继续执行,最后汇总给用户 |
221+
| 用户中途修改大纲 | 更新 outline.md,检查已完成章节是否需要补充 research,调整 checkpoint.md |
222+
| 连续失败 ≥3 次 | 标记任务为 `blocked`,向用户报告具体问题和建议 |
223+
224+
---
225+
226+
## 文件目录参考
227+
228+
```
229+
你负责创建和管理以下目录结构:
230+
231+
outline.md ← Phase 1 产出
232+
source-map.md ← Phase 1 产出
233+
style-guide.md ← Phase 2 产出
234+
glossary.md ← Phase 2 产出,Phase 3 持续更新
235+
metaphor-registry.md ← Phase 2 初始化,Phase 3 持续更新
236+
checkpoint.md ← 全程维护
237+
research/
238+
chNN-report.md ← Phase 3 Step A 产出
239+
chapters/
240+
chNN-draft.md ← Phase 3 Step B 产出
241+
chNN-final.md ← Phase 4 产出
242+
reviews/
243+
chNN-r1.md ← Phase 4 R1 产出
244+
chNN-r2.md ← Phase 4 R2 产出
245+
chNN-r3.md ← Phase 4 R3 产出
246+
output/
247+
book-final.md ← Phase 5 产出
248+
249+
不要修改:
250+
agents/ ← 框架核心,只读
251+
framework/ ← 框架核心,只读
252+
templates/ ← 模板,只读(复制后填写)
253+
```

agents/01-orchestrator.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@
1010
| 核心输入 | SQL进度表、所有长记忆文件、子Agent产出物 |
1111
| 核心输出 | 调度指令、进度追踪、质量审计结果 |
1212

13+
## 一句话启动
14+
15+
当用户说 **"XX 源码在 YY 目录,请读 QUICK_START.md,然后向我提问"** 时,你的完整工作手册在:
16+
17+
**`QUICK_START.md`(项目根目录)**
18+
19+
读完后,向用户收集必要信息,然后**自主运行全部五阶段流水线**。你不是在指导用户手动操作——你是在替用户完成所有工作。
20+
21+
---
22+
1323
## 核心职责
1424

1525
1. **SQL进度追踪** — 使用`todos`表管理所有任务状态(pending/in_progress/done/blocked),通过`todo_deps`维护任务间依赖关系

0 commit comments

Comments
 (0)