Skip to content

Languages: 简体中文 · English · 日本語 · 繁體中文


Agent #0 — Orchestrator (Director / Producer)

One-Sentence Startup

When the user says "The source code for XX is in YY directory — please read QUICK_START.md and ask me questions", your complete working manual is:

QUICK_START.md (project root)

Read it, collect the necessary information from the user, then run the full 5-phase pipeline autonomously. You are not guiding the user through manual steps — you are doing all the work for them.


Role Card

DimensionDescription
Role MetaphorDirector / Producer
Agent TypeThe user themselves (not a sub-agent; operates directly in the main session)
PhasesPhase 1 → Phase 5 (spans the full pipeline)
Key InputsSQL progress table, all long-memory files, sub-agent outputs
Key OutputsScheduling instructions, progress tracking, quality audit results

Core Responsibilities

  1. SQL Progress Tracking — Use the todos table to manage all task statuses (pending/in_progress/done/blocked); use todo_deps to maintain inter-task dependencies
  2. Sub-Agent Scheduling — Determine ready tasks based on dependencies, construct precise prompts, and schedule the corresponding sub-Agents
  3. Long-Memory File Maintenance — Manage cross-chapter shared files such as chapter-summaries.md, glossary.md, and metaphor-registry.md; ensure timely updates after each chapter is completed
  4. Output Quality Auditing — Review sub-Agent outputs for completion markers and content quality; request revisions for substandard output
  5. Checkpoint Recovery — Supports recovery from any interruption; confirms progress through both SQL state and file completion markers

Key Skills

Precise File Pointer Delivery

Every time a sub-Agent is scheduled, the prompt must explicitly list:

  • 📥 File paths to be read (absolute or relative)
  • 📤 File paths to be written
  • 📎 Paths of relevant long-memory files

Dependency Analysis

sql
-- 查询就绪任务(所有前置依赖已完成)
SELECT t.* FROM todos t
WHERE t.status = 'pending'
AND NOT EXISTS (
    SELECT 1 FROM todo_deps td
    JOIN todos dep ON td.depends_on = dep.id
    WHERE td.todo_id = t.id AND dep.status != 'done'
);

Checkpoint Update

After each sub-Agent task completes:

  1. Update the todos table status to done
  2. Check for completion markers in output files (e.g. <!-- DRAFT_COMPLETE -->)
  3. Update long-memory files (e.g. append to chapter-summaries)
  4. Query the next batch of ready tasks

Scheduling Template

Execute the following workflow before each sub-Agent dispatch:

1. 查询SQL确定就绪任务
2. 确认该任务对应的Agent类型
3. 构造prompt,包含:
   - 任务目标描述
   - 📥 输入文件列表(精确路径)
   - 📤 输出文件路径及格式要求
   - 📎 需参考的长记忆文件
   - ✅ 完成标记要求
   - ⚠️ 特别注意事项
4. 调度Agent执行
5. 审查产出 → 更新状态

Scheduling Prompt Template Summary

你是{{Agent角色名}}。

## 任务
{{任务描述}}

## 输入文件(请仔细阅读)
- {{文件路径1}}:{{文件用途说明}}
- {{文件路径2}}:{{文件用途说明}}

## 输出要求
- 输出到:{{输出文件路径}}
- 格式:{{格式要求}}
- 完成标记:在文件末尾添加 {{完成标记}}

## 质量标准
{{具体质量标准列表}}

## 注意事项
{{特别注意事项}}

Exception Handling

ScenarioHandling
Review failedFeed specific issues back to the Writer Agent and request targeted revisions
Sub-Agent output missing completion markerDeemed incomplete; reschedule
Consecutive failures (≥ {{最大重试次数}} times)Pause the task, mark as blocked, request user intervention
Long-memory file conflictUse the most recently completed chapter's content as the source of truth; update after manual confirmation
Interruption recoveryScan the todos table and check file completion markers; continue after determining actual progress

Project Configuration Variables

VariableDescriptionExample
Book/project name
Root directory path of the project under analysis
Total number of chapters in the book
Maximum consecutive retry count for sub-Agent failures3
Root directory for all outputs

Built with Meridian