Comprehensive Technical Documentation
Creates a complete documentation suite that serves different audiences and use cases, from quick reference to deep technical analysis.
Quick Reference
| User Request | Documentation Output |
|---|
| "写技术文档" or "Write docs" | Full 4-document suite |
| "解释原理" or "Explain how it works" |
Technical Principles doc + Architecture |
| "快速参考" or "Quick reference" | Quick Reference Guide only |
| "画架构图" or "Draw architecture" | Architecture Visualization doc |
| "写导航索引" or "Create index" | Navigation Index doc |
Background
When documenting complex systems, a single monolithic document fails to serve different audiences:
- - New users need quick start guides
- Architects need visual diagrams
- Developers need deep technical details
- Everyone needs navigation
This skill solves that by creating a layered documentation system with 3-4 complementary documents.
Solution
The Documentation Suite
Create these documents (adapt based on project scope):
- 1. 📖 Technical Principles (技术原理文档.md)
- Deep dive into how the system works
- Design philosophy and decisions
- Implementation details
- Best practices
-
Target: Developers, contributors
-
Reading time: 30-60 minutes
- 2. 📊 Architecture Visualization (架构与流程可视化.md)
- Mermaid diagrams for architecture
- Flow charts and sequence diagrams
- State machines
- Data flow diagrams
-
Target: Architects, visual learners
-
Reading time: 15-30 minutes
- 3. 🔖 Quick Reference Guide (快速参考指南.md)
- Templates and examples
- Command cheat sheets
- Field definitions
- Troubleshooting
-
Target: All users (most frequently used)
-
Reading time: 5-15 minutes
- 4. 🗺️ Navigation Index (README-文档索引.md or 文档索引.md)
- Document comparison table
- Learning paths by role
- Scenario-based navigation
- FAQ with document links
-
Target: First-time users, navigators
-
Reading time: 5 minutes
Step-by-Step Workflow
Phase 1: Deep Understanding (15-30 minutes)
Read core files to understand the system:
CODEBLOCK0
Decision point: If system is small (<5 files), might only need 1-2 docs.
Phase 2: Analysis & Extraction (10-15 minutes)
Extract key information:
- 1. Core Concepts - What problem does it solve?
- Architecture - What are the major components?
- Data Flow - How does information move?
- Integration Points - How does it connect to other systems?
- User Workflows - What are the main use cases?
- Pain Points - What commonly goes wrong?
Phase 3: Document Creation (30-60 minutes)
Create documents in this order:
1. Technical Principles (技术原理文档.md)
Structure:
CODEBLOCK1
Word count: 5000-8000 words for complex systems
2. Architecture Visualization (架构与流程可视化.md)
Include these diagram types:
CODEBLOCK2
Diagram count: 10-15 Mermaid diagrams
3. Quick Reference Guide (快速参考指南.md)
Structure:
CODEBLOCK3
Word count: 2500-3500 words
4. Navigation Index (README-文档索引.md)
Structure:
CODEBLOCK4
Word count: 2000-3000 words
Phase 4: Visualization (20-30 minutes)
Create Mermaid diagrams for Architecture doc:
Essential diagrams:
- 1. System architecture (graph TB with subgraphs)
- Data flow (flowchart LR)
- Main sequence flow (sequenceDiagram)
- Decision tree (flowchart TD)
- State machine (stateDiagram-v2)
- File system topology (graph TD)
Mermaid best practices:
- - Use
subgraph for logical grouping - Apply
style for visual hierarchy (colors) - Keep each diagram focused on one aspect
- Add
Note annotations for clarity
Phase 5: Quality Check (10 minutes)
Verify completeness:
- - [ ] All documents use consistent terminology
- [ ] Cross-references between docs work
- [ ] Code examples are syntactically correct
- [ ] Mermaid diagrams render properly
- [ ] File paths are accurate
- [ ] Tables are properly formatted
- [ ] Each doc has clear target audience
- [ ] Reading time estimates are realistic
- [ ] Documents are in logical reading order
Output Decision Tree
CODEBLOCK5
Document Templates
Technical Principles Template
CODEBLOCK6
[Directory tree with comments]
project/
├── component-a/ # Purpose
├── component-b/ # Purpose
└── config/ # Purpose
### 2.2 数据分层
[Layer diagram in ASCII]
┌──────────────────┐
│ Layer 3 │ ← Description
└──────────────────┘
▲
│ relationship
│
┌──────────────────┐
│ Layer 2 │ ← Description
└──────────────────┘
CODEBLOCK8
Quick Reference Template
CODEBLOCK9
[Simple flow diagram]
Step1 → Step2 → Step3
- **[Concept 1]**:[Description]
- **[Concept 2]**:[Description]
---
## 🎯 何时使用
| 场景 | 记录位置 | 类别 |
|------|---------|------|
| [Trigger] | [Location] | [Type] |
---
## 📝 记录模板
### [Template Type 1]
markdown
[Actual template content to copy-paste]
CODEBLOCK11
Common Variations
Variation A: Codebase Documentation
For documenting a code repository:
Focus on:
- - Architecture patterns
- API design
- Code organization
- Development workflow
- Testing strategy
Additional diagrams:
- - Class diagrams
- API flow
- Database schema
Variation B: Skill Documentation
For documenting an AI agent skill:
Focus on:
- - When to trigger
- Decision logic
- Output format
- Integration with other skills
Additional sections:
- - Trigger conditions
- Examples of good/bad prompts
Variation C: Tool/Library Documentation
For documenting a tool or library:
Focus on:
- - Installation steps
- Configuration options
- API reference
- Usage examples
- Troubleshooting
Additional sections:
- - Compatibility matrix
- Performance benchmarks
Variation D: Process Documentation
For documenting a workflow or methodology:
Focus on:
- - Step-by-step procedures
- Decision points
- Quality gates
- Roles and responsibilities
Additional diagrams:
- - Swimlane diagrams
- Gantt charts
Gotchas
⚠️ Don't create all 4 docs for simple systems - Use judgment. A 50-line script doesn't need 4 documents.
⚠️ Don't duplicate content - Each document should have a distinct purpose. Cross-reference instead of copy-paste.
⚠️ Don't skip the index - Without navigation, users get lost. The index document is crucial for multi-doc suites.
⚠️ Don't use broken Mermaid syntax - Test diagrams before finalizing. Common errors:
- - Missing closing quotes
- Invalid node IDs
- Unsupported diagram features
⚠️ Don't ignore reading time estimates - Help users plan their time. Be realistic about document length.
⚠️ Don't mix languages inconsistently - If user requests Chinese, use Chinese for all headings and body text. Keep code/commands in original language.
⚠️ Don't assume prior knowledge - Define acronyms and technical terms, especially in Quick Reference.
⚠️ Don't forget visual hierarchy - Use emojis (📖 🎯 💡) and formatting to make docs scannable.
Writing Style Guidelines
For Technical Principles Doc
- - Tone: Academic but accessible
- Depth: Assume reader wants to understand "why" not just "how"
- Code examples: Include actual implementations with explanations
- Length: Don't shy away from detail; this is the deep-dive doc
For Architecture Visualization Doc
- - Diagram-first: Let diagrams tell the story
- Minimal text: Just enough to explain what you're looking at
- Consistent notation: Use same colors/shapes for same concepts
- Progressive complexity: Start simple, add detail gradually
For Quick Reference Doc
- - Tone: Practical and direct
- Format: Heavy use of tables, lists, and code blocks
- No fluff: Every sentence should provide actionable information
- Scannable: Use visual markers (✅ ❌ 🔴 🟢) liberally
For Navigation Index Doc
- - Tone: Welcoming and guiding
- Purpose: Help users find what they need fast
- Structure: Clear hierarchy with visual tables
- Empathy: Anticipate what different users need
Localization
When creating Chinese documentation:
Do:
- - ✅ Use Chinese for all headings and body text
- ✅ Keep technical terms in English within backticks: INLINECODE3
- ✅ Use Chinese punctuation (,。;:)
- ✅ Provide clear Chinese translations for concepts
- ✅ Use emojis universally (work in all languages)
Don't:
- - ❌ Mix English and Chinese in the same sentence without backticks
- ❌ Translate file names or commands
- ❌ Use English-style comma in Chinese text
- ❌ Translate acronyms (keep API as API, not 应用程序接口)
Integration with Other Skills
Pairs well with:
- - self-improvement - After creating docs, log if you learned better documentation patterns
- proactive-agent - Proactively offer to update docs when code changes
- agent-customization - Document your custom skills using this approach
Quality Checklist
Before delivering documentation:
- - [ ] All 4 documents created (or justified why fewer)
- [ ] Reading time estimates in index
- [ ] At least 8 Mermaid diagrams in Architecture doc
- [ ] Quick Reference has copy-paste templates
- [ ] Technical Principles explains "why" not just "what"
- [ ] Index provides learning paths for 3 personas
- [ ] Cross-references between docs work
- [ ] No broken Mermaid syntax
- [ ] Consistent terminology across all docs
- [ ] Each doc has version and last-updated date
- [ ] Troubleshooting section in Quick Reference
- [ ] File tree diagrams use consistent formatting
- [ ] Tables are aligned and complete
- [ ] Code blocks have language specified
- [ ] Chinese localization follows guidelines (if applicable)
Example Prompt Patterns
To trigger this skill:
✅ Good prompts:
- - "当前skill的原理是什么,写一份详尽文档"
- "Write comprehensive documentation for this codebase"
- "Document the architecture with diagrams"
- "Create a quick reference guide and full technical docs"
✅ Clarifying questions (if needed):
- - "Who is the primary audience?" (if unclear)
- "Is this for internal use or public consumption?"
- "Do you need Chinese or English documentation?"
❌ Avoid confusion with:
- - "Write a README" (too vague - might just need one doc)
- "Add comments to the code" (different skill)
- "Create API documentation" (use API-specific skill if available)
Related
- - agent-customization - For creating SKILL.md files specifically
- self-improvement - For logging documentation patterns you discover
- proactive-agent - For maintaining docs over time
Source
- - Created: 2026-03-05
- Origin: Extracted from conversation where comprehensive docs were created for self-improving-agent skill
- Pattern: Successfully applied to document a complex AI agent skill with multiple subsystems
- Validation: Created 4 documents totaling ~13,000 words with 10+ diagrams
Note: This skill produces 5,000-15,000 words of documentation. Budget 1-2 hours for complete execution on complex systems.
Tip: Start by reading core files in parallel to save time. The understanding phase is critical - don't rush it.
Remember: Different users need different depths. The layered approach ensures everyone finds what they need. 📚
综合技术文档
创建一套完整的文档体系,服务于不同的受众和使用场景,从快速参考到深入技术分析。
快速参考
| 用户请求 | 文档输出 |
|---|
| 写技术文档 或 Write docs | 完整的4份文档套件 |
| 解释原理 或 Explain how it works |
技术原理文档 + 架构文档 |
| 快速参考 或 Quick reference | 仅快速参考指南 |
| 画架构图 或 Draw architecture | 架构可视化文档 |
| 写导航索引 或 Create index | 导航索引文档 |
背景
在记录复杂系统时,单一的整体文档无法满足不同受众的需求:
- - 新用户需要快速入门指南
- 架构师需要可视化图表
- 开发者需要深入的技术细节
- 所有人都需要导航
本技能通过创建分层文档系统来解决这一问题,包含3-4份互补的文档。
解决方案
文档套件
创建以下文档(根据项目范围进行调整):
- 1. 📖 技术原理(技术原理文档.md)
- 深入探讨系统工作原理
- 设计理念和决策
- 实现细节
- 最佳实践
-
目标受众:开发者、贡献者
-
阅读时间:30-60分钟
- 2. 📊 架构可视化(架构与流程可视化.md)
- 架构的Mermaid图表
- 流程图和时序图
- 状态机
- 数据流图
-
目标受众:架构师、视觉学习者
-
阅读时间:15-30分钟
- 3. 🔖 快速参考指南(快速参考指南.md)
- 模板和示例
- 命令速查表
- 字段定义
- 故障排查
-
目标受众:所有用户(最常用)
-
阅读时间:5-15分钟
- 4. 🗺️ 导航索引(README-文档索引.md 或 文档索引.md)
- 文档对比表
- 按角色的学习路径
- 基于场景的导航
- 带文档链接的常见问题
-
目标受众:首次用户、导航者
-
阅读时间:5分钟
分步工作流程
阶段1:深入理解(15-30分钟)
阅读核心文件以理解系统:
markdown
必须阅读:
- - 主入口文件(SKILL.md、README.md、主配置文件)
- 核心实现文件
- 配置文件
- 集成文档
并行阅读:
- - 对独立文件使用并行读取
- 将相关文件分组(例如,所有配置文件一起)
决策点:如果系统较小(<5个文件),可能只需要1-2份文档。
阶段2:分析与提取(10-15分钟)
提取关键信息:
- 1. 核心概念 - 它解决了什么问题?
- 架构 - 主要组件有哪些?
- 数据流 - 信息如何流动?
- 集成点 - 如何与其他系统连接?
- 用户工作流程 - 主要用例是什么?
- 痛点 - 常见问题是什么?
阶段3:文档创建(30-60分钟)
按此顺序创建文档:
1. 技术原理(技术原理文档.md)
结构:
markdown
标题 - 技术原理详解
目录
[带有清晰章节的目录]
核心概念
1.1 设计理念
1.2 核心机制
系统架构
2.1 组件结构(带树形图)
2.2 数据分层
工作原理
3.1 触发条件
3.2 处理流程
3.3 输出机制
技术实现
4.1 关键代码实现
4.2 配置系统
4.3 扩展机制
数据流转
5.1 完整生命周期
5.2 跨系统通信
核心循环/机制
6.1 主要循环
6.2 反馈机制
集成方式
7.1 平台A
7.2 平台B
7.3 通用设置
最佳实践
8.1 应该做
8.2 不应该做
8.3 维护建议
技术洞察
9.1 设计哲学
9.2 局限性
9.3 与其他系统对比
实际应用示例
10.1 场景A
10.2 场景B
总结
字数:复杂系统5000-8000字
2. 架构可视化(架构与流程可视化.md)
包含以下图表类型:
markdown
标题 - 架构与流程可视化
1. 核心架构图
1.1 系统层次架构
[Mermaid: 带子图的graph TB]
1.2 数据流架构
[Mermaid: 展示数据移动的flowchart LR]
2. 核心流程
2.1 主要流程完整序列
[Mermaid: sequenceDiagram]
2.2 子流程
[Mermaid: 带决策节点的flowchart TD]
3. 触发条件映射
[Mermaid: flowchart TD - 决策树]
4. 跨系统通信
[Mermaid: 展示系统交互的graph]
5. 模式识别机制
[Mermaid: 展示模式匹配的flowchart]
6. 文件系统拓扑
[Mermaid: 展示目录结构的graph TD]
7. 状态转换图
[Mermaid: stateDiagram-v2]
8. 集成模式对比
[Mermaid: 对比图]
9. 性能与扩展性
[Mermaid: 增长曲线]
10. 监控与度量
[Mermaid: 指标仪表板]
图表数量:10-15个Mermaid图表
3. 快速参考指南(快速参考指南.md)
结构:
markdown
标题 - 快速参考指南
📚 一分钟了解
[3-5个要点的核心概念]
🎯 何时使用
[触发条件表]
📝 模板
[带所有字段的复制粘贴模板]
🎨 优先级/分类指南
[参考表]
🚀 提升/决策指南
[文本形式的决策流程图]
🔧 快速安装
[每个平台的复制粘贴命令]
📊 字段说明
[表格形式的所有字段定义]
🛠️ 常用命令
[Bash/PowerShell命令示例]
📦 文件结构
[ASCII树形图]
🔄 工作流程示例
[3-5个带结果的编号场景]
💡 最佳实践
[✅ 应该做 和 ❌ 不应该做 列表]
🆘 故障排查
[问题-解决方案对]
🔖 速查卡
[末尾的超紧凑速查表]
字数:2500-3500字
4. 导航索引(README-文档索引.md)
结构:
markdown
标题 - 文档索引
📚 文档导航
[3列表格:快速入门 | 架构 | 深入理解]
📖 文档列表
[表格:文档名称、类型、字数、摘要、受众]
🗺️ 学习路径
路径A:快速上手(30分钟)
[带特定章节阅读的编号步骤]
路径B:深入理解(1小时)
[较长的路径]
路径C:精通全貌(2小时)
[完整路径]
💡 按场景查找
[5-10个常见场景及推荐文档]
📊 文档内容对比
[展示所有文档主题覆盖范围的矩阵]
🎯 快速问题解答
[10个常见问题及指向特定文档章节的链接]
🔗 相关资源
[外部链接]
📝 文档更新记录
💬 反馈与贡献
🎓 下一步
[2x2表格中基于角色的下一步行动]
字数:2000-3000字
阶段4:可视化(20-30分钟)
为架构文档创建Mermaid图表:
必备图表:
- 1. 系统架构(带子图的graph TB)
- 数据流(flowchart LR)
- 主要序列流(sequenceDiagram)
- 决策树(flowchart TD)
- 状态机(stateDiagram-v2)
- 文件系统拓扑(graph TD)
Mermaid最佳实践:
- - 使用subgraph进行逻辑分组
- 应用style实现视觉层次(颜色)
- 保持每个图表聚焦于一个方面
- 添加Note注释以提高清晰度
阶段5:质量检查(10分钟)
验证完整性:
- - [ ] 所有文档使用一致的术语
- [ ] 文档之间的交叉引用有效
- [ ] 代码示例语法正确
- [ ] Mermaid图表正确渲染
-