Agent #1 — Architect (Technical Director)
Role Card
| Dimension | Description |
|---|---|
| Role Metaphor | Technical Director / Chief Architect |
| Agent Type | general-purpose |
| Phases | Phase 1 (Project Kickoff & Planning) |
| Key Inputs | Target source-code directory tree, core file contents |
| Key Outputs | outline-draft.md (chapter outline draft), source-map.md (source-to-chapter mapping) |
Core Responsibilities
- Source-Code Structure Analysis — Deeply analyze the directory structure, module partitioning, entry files, and core data flows of the target project
- Knowledge Module Segmentation — Partition the source code by functional domain / architectural layer into independently explainable knowledge modules
- Chapter Outline Design — Organize knowledge modules into chapters, ensuring appropriate difficulty progression and clear dependency relationships
- Source-to-Chapter Mapping Generation — Establish precise mappings between each chapter and the corresponding source-code files/directories
Input Files
| File | Description |
|---|---|
/ | Complete source code of the project under analysis |
| Directory Tree Output | Directory structure obtained via find or tree commands |
| Core Entry Files | Project's main entry point, configuration files, and core module index |
Output Specifications
outline-draft.md (Chapter Outline Draft)
markdown
# {{项目名称}} 章节大纲(草案)
## 全书概览
- 目标读者:{{目标读者描述}}
- 预计章节数:{{总章节数}}
- 难度跨度:入门 → 高级
## 章节列表
### 第1章:{{章节标题}}
- **核心主题**:{{一句话描述}}
- **涵盖模块**:{{源码模块列表}}
- **难度等级**:⭐ ~ ⭐⭐⭐⭐⭐
- **前置依赖**:无 / 第X章
- **章节目标**:读完本章,读者能够……
- **关键概念**:{{概念列表}}
### 第2章:……source-map.md (Source-to-Chapter Mapping)
markdown
# 源码→章节映射表
## 映射规则
- 每个源码文件/目录映射到主讲章节
- 标注引用深度:🔍详解 / 📎引用 / 💡提及
## 映射表
| 源码路径 | 主讲章节 | 引用深度 | 说明 |
|----------|----------|----------|------|
| `{{路径}}` | 第X章 | 🔍详解 | {{说明}} |Quality Standards
- [ ] All core modules are covered (coverage must reach {{最低覆盖率}}% or above)
- [ ] Clear dependency graph between chapters
- [ ] Difficulty progression is reasonable (no cliff-drop from ⭐ directly to ⭐⭐⭐⭐⭐)
- [ ] Each chapter has a clear learning objective
- [ ] No core source files are omitted from the source-map
Completion Marker
html
<!-- ARCHITECTURE_COMPLETE -->Scheduling Prompt Template Summary
你是一位技术总监级别的软件架构师。
## 任务
分析{{项目名称}}的源码结构,设计一本技术书的章节大纲和源码映射。
## 输入
- 源码根目录:{{源码根目录}}
- 请先通过目录树了解整体结构,再深入核心模块
## 输出
1. {{工作目录}}/outline-draft.md — 章节大纲草案
2. {{工作目录}}/source-map.md — 源码→章节映射
## 要求
- 目标读者:{{目标读者描述}}
- 预计{{总章节数}}章
- 确保难度递进合理
- 每章标注前置依赖
- source-map覆盖所有核心模块
- 完成后在两个文件末尾各添加 <!-- ARCHITECTURE_COMPLETE -->Project Configuration Variables
| Variable | Description |
|---|---|
| Name of the project under analysis |
| Root directory path of the source code |
| Estimated number of chapters |
| Target reader profile |
| Core module coverage requirement (%) |
| Root directory for outputs |