综合技术文档:分层 AI 智能体文档 - Openclaw Skills
作者:互联网
2026-04-04
什么是 综合技术文档?
此技能可将零散的代码库或系统描述转化为专业的多维文档套件。它不会生成单一的庞大文件,而是针对不同的用户角色生成四个独立的文档:寻求技术原理的开发人员、需要可视化流程图的架构师、寻求快速参考的高级用户以及需要导航索引的新用户。
通过在 Openclaw Skills 中利用此逻辑,开发人员可以确保每位利益相关者都能获得所需的准确信息深度。系统会根据系统的复杂程度自动调整输出,范围从小型脚本的简单速查表到包含 50 个以上文件的大型仓库的企业级文档。
下载入口:https://github.com/openclaw/skills/tree/main/skills/liuxxxu/comprehensive-tech-documentation
安装与下载
1. ClawHub CLI
从源直接安装技能的最快方式。
npx clawhub@latest install comprehensive-tech-documentation
2. 手动安装
将技能文件夹复制到以下位置之一
全局模式~/.openclaw/skills/
工作区
/skills/
优先级:工作区 > 本地 > 内置
3. 提示词安装
将此提示词复制到 OpenClaw 即可自动安装。
请帮我使用 Clawhub 安装 comprehensive-tech-documentation。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
综合技术文档 应用场景
- 使用详细的 Mermaid 图表为利益相关者可视化复杂的系统架构。
- 通过深入的技术原理剖析,帮助新开发人员快速上手项目。
- 为日常操作创建可扫描的快速参考指南和命令速查表。
- 构建导航索引,为不同的用户角色(如架构师、贡献者、用户)提供清晰的学习路径。
- 根据特定项目要求生成中文或英文的本地化文档。
- 扫描核心入口点、配置文件和实现细节,以深入了解系统。
- 提取关键信息,包括核心概念、数据流模式和集成点。
- 生成详细说明设计理念和实现逻辑的技术原理文档。
- 创建架构可视化文档,包含多达 15 种不同的 Mermaid 图表类型(流程图、时序图等)。
- 生成包含复制粘贴模板、命令列表和故障排除步骤的快速参考指南。
- 编制导航索引,以交叉引用所有文档并建立基于角色的学习路径。
综合技术文档 配置指南
要在 Openclaw Skills 中启用此功能,请确保您的环境支持 Mermaid 图表渲染,并且您的智能体可以访问目标代码库。
# 通过向智能体提供上下文来触发文档生成
agent: "为当前技能/项目编写综合文档"
# 对于特定输出,使用针对性命令
agent: "结合架构图解释其工作原理"
综合技术文档 数据架构与分类体系
| 文档名称 | 标准文件名 | 目标受众 |
|---|---|---|
| 技术原理 | 技术原理文档.md |
开发人员、贡献者 |
| 架构可视化 | 架构与流程可视化.md |
架构师、视觉学习者 |
| 快速参考指南 | 快速参考指南.md |
日常用户、DevOps |
| 导航索引 | 文档索引.md |
新用户、项目负责人 |
name: comprehensive-tech-documentation description: "Creates layered, comprehensive technical documentation for projects, skills, or systems. Use when user requests 'write technical documentation', 'explain how this works', or 'document the architecture'. Produces 3-4 documents with different depths and purposes."
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):
-
?? 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
-
?? 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
-
?? Quick Reference Guide (快速参考指南.md)
- Templates and examples
- Command cheat sheets
- Field definitions
- Troubleshooting
- Target: All users (most frequently used)
- Reading time: 5-15 minutes
-
??? 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:
MUST READ:
- Main entry point (SKILL.md, README.md, main config)
- Core implementation files
- Configuration files
- Integration documentation
PARALLEL READ:
- Use parallel file reads for independent files
- Group related files (e.g., all configs together)
Decision point: If system is small (<5 files), might only need 1-2 docs.
Phase 2: Analysis & Extraction (10-15 minutes)
Extract key information:
- 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:
# Title - 技术原理详解
## 目录
[Table of contents with clear sections]
## 核心概念
1.1 设计理念
1.2 核心机制
## 系统架构
2.1 组件结构 (with tree diagram)
2.2 数据分层
## 工作原理
3.1 触发条件
3.2 处理流程
3.3 输出机制
## 技术实现
4.1 关键代码实现
4.2 配置系统
4.3 扩展机制
## 数据流转
5.1 完整生命周期
5.2 跨系统通信
## 核心循环/机制
6.1 主要循环
6.2 反馈机制
## 集成方式
7.1 Platform A
7.2 Platform B
7.3 Generic setup
## 最佳实践
8.1 应该做
8.2 不应该做
8.3 维护建议
## 技术洞察
9.1 设计哲学
9.2 局限性
9.3 与其他系统对比
## 实际应用示例
10.1 场景A
10.2 场景B
## 总结
Word count: 5000-8000 words for complex systems
2. Architecture Visualization (架构与流程可视化.md)
Include these diagram types:
# Title - 架构与流程可视化
## 1. 核心架构图
### 1.1 系统层次架构
[Mermaid: graph TB with subgraphs]
### 1.2 数据流架构
[Mermaid: flowchart LR showing data movement]
## 2. 核心流程
### 2.1 主要流程完整序列
[Mermaid: sequenceDiagram]
### 2.2 子流程
[Mermaid: flowchart TD with decision nodes]
## 3. 触发条件映射
[Mermaid: flowchart TD - decision tree]
## 4. 跨系统通信
[Mermaid: graph showing system interactions]
## 5. 模式识别机制
[Mermaid: flowchart showing pattern matching]
## 6. 文件系统拓扑
[Mermaid: graph TD showing directory structure]
## 7. 状态转换图
[Mermaid: stateDiagram-v2]
## 8. 集成模式对比
[Mermaid: comparison graphs]
## 9. 性能与扩展性
[Mermaid: growth curves]
## 10. 监控与度量
[Mermaid: metrics dashboard]
Diagram count: 10-15 Mermaid diagrams
3. Quick Reference Guide (快速参考指南.md)
Structure:
# Title - 快速参考指南
## ?? 一分钟了解
[Core concept in 3-5 bullet points]
## ?? 何时使用
[Trigger conditions table]
## ?? 模板
[Copy-paste templates with all fields]
## ?? 优先级/分类指南
[Reference tables]
## ?? 提升/决策指南
[Decision flowchart in text]
## ?? 快速安装
[Copy-paste commands for each platform]
## ?? 字段说明
[All field definitions in tables]
## ??? 常用命令
[Bash/PowerShell command examples]
## ?? 文件结构
[ASCII tree diagrams]
## ?? 工作流程示例
[3-5 numbered scenarios with outcomes]
## ?? 最佳实践
[? DO and ? DON'T lists]
## ?? 故障排查
[Problem-solution pairs]
## ?? 速查卡
[Super compact cheat sheet at the end]
Word count: 2500-3500 words
4. Navigation Index (README-文档索引.md)
Structure:
# Title - 文档索引
## ?? 文档导航
[3-column table: Quick Start | Architecture | Deep Dive]
## ?? 文档列表
[Table with: Doc name, Type, Word count, Summary, Audience]
## ??? 学习路径
### 路径A: 快速上手(30分钟)
[Numbered steps with specific sections to read]
### 路径B: 深入理解(1小时)
[Longer path]
### 路径C: 精通全貌(2小时)
[Complete path]
## ?? 按场景查找
[5-10 common scenarios with recommended docs]
## ?? 文档内容对比
[Matrix showing topic coverage across all docs]
## ?? 快速问题解答
[10 FAQ with links to specific doc sections]
## ?? 相关资源
[External links]
## ?? 文档更新记录
## ?? 反馈与贡献
## ?? 下一步
[Role-based next actions in 2x2 table]
Word count: 2000-3000 words
Phase 4: Visualization (20-30 minutes)
Create Mermaid diagrams for Architecture doc:
Essential diagrams:
- 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
subgraphfor logical grouping - Apply
stylefor visual hierarchy (colors) - Keep each diagram focused on one aspect
- Add
Noteannotations 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
How complex is the system?
│
├─ Simple (1-2 files, single purpose)
│ └─ Create: Quick Reference only
│
├─ Medium (3-10 files, clear structure)
│ └─ Create: Quick Reference + Technical Principles
│
├─ Complex (10+ files, multiple subsystems)
│ └─ Create: All 4 documents
│
└─ Massive (50+ files, enterprise scale)
└─ Create: All 4 + additional domain-specific docs
Document Templates
Technical Principles Template
# [System Name] - 技术原理详解
## 目录
[auto-generated or manual]
---
## 核心概念
### 1.1 设计理念
> [One-sentence design philosophy quote]
[System Name] 的核心理念是:
> **[Core idea in bold quote]**
这个框架解决了以下核心问题:
1. **[Problem 1]**:[Description]
2. **[Problem 2]**:[Description]
### 1.2 核心机制
[ASCII or text diagram showing the main loop]
---
## 系统架构
### 2.1 组件结构
[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 └──────────────────┘
[Continue with all sections...]
---
## 总结
**[System Name]** 是一个[description],它通过系统化地:
1. **[Action 1]**:[Description]
2. **[Action 2]**:[Description]
[Closing statement about value]
---
**文档版本**: 1.0
**最后更新**: [Date]
**作者**: GitHub Copilot (Claude Sonnet 4.5)
Quick Reference Template
# [System Name] - 快速参考指南
## ?? 一分钟了解
**[System Name]** [one-line description]
### 核心概念
[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]
[Continue...]
版本: 1.0
更新: [Date]
适用: [System] v[version]+
提示: 保持此指南在手边,快速查阅关键信息! ??
## 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: `SKILL.md`
- ? 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. ??
相关推荐
专题
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
最新数据
相关文章
Docker Compose 管理器:利用 Openclaw 技能编排容器
内容转播客:通过 NotebookLM 进行媒体转换 - Openclaw Skills
Claude Context Distiller:优化 Token 使用 - Openclaw Skills
币安止损管理器:自动化加密货币风险管理 - Openclaw Skills
币安价格提醒:实时加密货币监控 - Openclaw Skills
币安跟单交易:自动化社交交易代理 - Openclaw Skills
AI 研究分析师:市场调研与投资报告 - Openclaw Skills
AI代码解释器:快速掌握复杂逻辑 - Openclaw Skills
Moltbook:AI 智能体社交网络集成 - Openclaw Skills
Polymarket 日历:市场结算与事件追踪 - Openclaw Skills
AI精选
