code-documenter
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCode Documenter Skill
Code Documenter Skill
An intelligent documentation system that analyzes codebases and generates
thorough, comprehensive documentation tailored to your project type and audience
needs.
这是一个智能文档系统,可分析代码库,并根据你的项目类型和受众需求生成详尽、全面的文档。
Core Philosophy
核心理念
Documentation serves readers, not authors. Every decision about structure,
depth, and content is evaluated from the reader's perspective:
- Will this help them understand?
- Will this help them succeed?
- Will this answer their questions?
- Does this earn its place?
Comprehensive without overwhelm. Thorough coverage of what matters, ruthless
cutting of what doesn't. The goal is complete, accurate, useful
documentation—not exhaustive documentation of every line of code.
Documentation as code artifact. Docs should be versioned, tested, and
maintained with the same rigor as code. They're not afterthoughts; they're
essential.
文档为读者服务,而非作者。 关于结构、深度和内容的每一项决策,都会从读者的角度进行评估:
- 这能帮助他们理解吗?
- 这能帮助他们成功使用吗?
- 这能解答他们的疑问吗?
- 这有存在的必要吗?
全面但不过度冗余。 详尽覆盖重要内容,果断剔除无关信息。目标是创建完整、准确、实用的文档——而非对每一行代码进行无差别记录。
文档作为代码工件。 文档应与代码一样,遵循相同的版本控制、测试和维护标准。它们不是事后补充,而是必不可少的组成部分。
When to Use This Skill
何时使用该技能
Primary use cases:
- After completing significant new work (epic, major feature, new app)
- When shipping an open source project
- When documentation has fallen out of sync with code
- When onboarding requires better documentation
- When setting up a new project properly
Not for:
- In-progress features (wait until stable)
- Code comments or docstrings (this generates external docs)
- API reference generation from code (use language-specific tools for that)
主要使用场景:
- 完成重要的新工作后(史诗故事、重大功能、新应用)
- 发布开源项目时
- 文档与代码不同步时
- 新员工入职需要更完善的文档时
- 正确搭建新项目时
不适用场景:
- 开发中的功能(需等到稳定后)
- 代码注释或文档字符串(此工具生成外部文档)
- 从代码生成API参考(使用特定语言的工具完成)
Session Flow
会话流程
Mode Selection
模式选择
The skill operates in two modes:
| Mode | When to Use | Behavior |
|---|---|---|
| Quick Mode | Incremental updates after new features | Autonomous, fast, focused on what changed |
| Comprehensive Mode | New projects, major overhauls, first-time setup | Collaborative, thorough, quality gates throughout |
The skill will ask: "Quick update or comprehensive documentation?"
该技能支持两种模式:
| 模式 | 适用场景 | 行为 |
|---|---|---|
| 快速模式 | 添加新功能后的增量更新 | 自主运行,速度快,聚焦于变更内容 |
| 全面模式 | 新项目、重大重构、首次搭建 | 协作式,详尽全面,全程设有质量关卡 |
该技能会询问: "快速更新还是全面文档生成?"
Phase 1: Multi-Agent Project Analysis
阶段1:多Agent项目分析
The skill deploys specialized analysis agents to understand your project:
Analysis Phase:
├─ Agent 1: Project Structure
│ └─ Scanning file tree, identifying project type, tech stack
├─ Agent 2: Code Surface Analysis
│ └─ Finding APIs, components, commands, exports
├─ Agent 3: Dependency Analysis
│ └─ Reviewing packages, frameworks, key dependencies
├─ Agent 4: Git History Analysis
│ └─ Analyzing commits since last doc update
├─ Agent 5: Existing Documentation Review
│ └─ Reading current docs, assessing state
└─ Synthesis: Generating documentation plan...Quick Mode: Focused analysis on what changed since last update
Comprehensive Mode: Full analysis of entire project
Comprehensive Mode: Full analysis of entire project
Each agent reports findings in structured format. You see everything happening.
该技能会部署专门的分析Agent来理解你的项目:
Analysis Phase:
├─ Agent 1: Project Structure
│ └─ Scanning file tree, identifying project type, tech stack
├─ Agent 2: Code Surface Analysis
│ └─ Finding APIs, components, commands, exports
├─ Agent 3: Dependency Analysis
│ └─ Reviewing packages, frameworks, key dependencies
├─ Agent 4: Git History Analysis
│ └─ Analyzing commits since last doc update
├─ Agent 5: Existing Documentation Review
│ └─ Reading current docs, assessing state
└─ Synthesis: Generating documentation plan...快速模式: 聚焦分析上次更新后的变更内容
全面模式: 对整个项目进行完整分析
全面模式: 对整个项目进行完整分析
每个Agent都会以结构化格式报告发现的内容,你可以全程查看所有过程。
Phase 2: Documentation State Assessment
阶段2:文档状态评估
The skill compares code state vs. documentation state:
If manifest exists ():
.doc-state.json- Loads documentation state from last run
- Compares current code vs. last documented state
- Identifies what's changed (added/modified/removed)
- Shows you the documentation debt
If no manifest:
- First time documenting this project
- Will create fresh manifest after completion
Key metrics shown:
- Health Score: Current documentation health (0-100)
- Coverage: What % of public surface is documented
- Freshness: How current are docs vs. code
- Debt: What needs attention (prioritized)
该技能会对比代码状态与文档状态:
如果存在清单文件():
.doc-state.json- 加载上次运行时的文档状态
- 对比当前代码与上次记录的文档状态
- 识别变更内容(新增/修改/删除)
- 展示文档债务情况
如果没有清单文件:
- 首次为该项目生成文档
- 完成后会创建新的清单文件
展示的关键指标:
- 健康度评分: 当前文档健康度(0-100)
- 覆盖率: 已文档化的公共接口占比
- 新鲜度: 文档与代码的同步程度
- 债务: 需要关注的内容(按优先级排序)
Phase 3: Audience & Scope Discovery
阶段3:受众与范围确认
The skill asks:
-
"Who needs these docs?"
- Developers only
- Users only
- Both developers and users
-
"What depth of documentation?"
- Standard: Right-sized coverage (4,000-7,000 words)
- Deep: Comprehensive with internals (8,000-12,000 words)
Quick Mode: Uses stored preferences from manifest
Comprehensive Mode: Asks explicitly, shows examples
Comprehensive Mode: Asks explicitly, shows examples
该技能会询问:
-
"谁需要这些文档?"
- 仅开发者
- 仅用户
- 开发者和用户
-
"文档的深度要求?"
- 标准深度: 合适的覆盖范围(4000-7000字)
- 深度覆盖: 包含内部实现的全面文档(8000-12000字)
快速模式: 使用清单中存储的偏好设置
全面模式: 明确询问,并展示示例
全面模式: 明确询问,并展示示例
Phase 4: Documentation Boundaries
阶段4:文档边界定义
The skill proposes what should be documented:
Based on my analysis of your Express + PostgreSQL API:
PUBLIC SURFACE (Always Document)
├─ 12 API endpoints in /routes
├─ Database schema (3 tables)
├─ 14 environment variables
└─ Authentication flow
INTERNAL IMPLEMENTATION (Recommended for Deep)
├─ 6 middleware functions
├─ Error handling patterns
└─ Database migration strategy
INFRASTRUCTURE (Essential for all levels)
├─ Docker setup
├─ CI/CD pipeline
└─ Deployment process
EXCLUDED (Recommend skip)
├─ Test files (obvious from names)
├─ Build scripts (standard tooling)
└─ Internal helpers (<10 lines each)
Adjust these boundaries? [approve/modify]You approve or adjust before documentation generation begins.
该技能会建议应包含的文档内容:
Based on my analysis of your Express + PostgreSQL API:
PUBLIC SURFACE (Always Document)
├─ 12 API endpoints in /routes
├─ Database schema (3 tables)
├─ 14 environment variables
└─ Authentication flow
INTERNAL IMPLEMENTATION (Recommended for Deep)
├─ 6 middleware functions
├─ Error handling patterns
└─ Database migration strategy
INFRASTRUCTURE (Essential for all levels)
├─ Docker setup
├─ CI/CD pipeline
└─ Deployment process
EXCLUDED (Recommend skip)
├─ Test files (obvious from names)
├─ Build scripts (standard tooling)
└─ Internal helpers (<10 lines each)
Adjust these boundaries? [approve/modify]你可以在开始生成文档前批准或调整这些边界。
Phase 5: Documentation Plan Presentation
阶段5:文档计划展示
The skill presents a complete plan:
DOCUMENTATION PLAN
Structure:
└─ /docs
├─ developers/
│ ├─ api.md (API endpoint reference)
│ ├─ architecture.md (System design + diagrams)
│ ├─ contributing.md (How to contribute)
│ ├─ deployment.md (Deploy & operate)
│ ├─ troubleshooting.md (Common issues)
│ ├─ examples/ (12 runnable examples)
│ └─ adr/ (4 architecture decisions)
├─ users/
│ ├─ getting-started.md (Quick start guide)
│ ├─ features.md (Feature overview)
│ ├─ troubleshooting.md (User-facing issues)
│ └─ examples/ (5 user examples)
├─ CHANGELOG.md (Documentation change log)
└─ documentation-map.md (Navigation guide)
Files to update:
- README.md (complete rewrite, progressive disclosure)
- docs/developers/api.md (2 new endpoints, 1 modified)
- docs/CHANGELOG.md (new entry)
Files to create:
- docs/adr/004-caching-strategy.md (new decision)
- docs/developers/examples/pagination.js (new example)
Files to remove:
- docs/developers/legacy-auth.md (endpoint removed)
Estimated scope: ~5,200 words total
Target health score: 92/100
Proceed? [yes/adjust scope/abort]Comprehensive Mode: Review and approve before generation
Quick Mode: Brief preview, option to review or proceed
Quick Mode: Brief preview, option to review or proceed
该技能会展示完整的文档计划:
DOCUMENTATION PLAN
Structure:
└─ /docs
├─ developers/
│ ├─ api.md (API endpoint reference)
│ ├─ architecture.md (System design + diagrams)
│ ├─ contributing.md (How to contribute)
│ ├─ deployment.md (Deploy & operate)
│ ├─ troubleshooting.md (Common issues)
│ ├─ examples/ (12 runnable examples)
│ └─ adr/ (4 architecture decisions)
├─ users/
│ ├─ getting-started.md (Quick start guide)
│ ├─ features.md (Feature overview)
│ ├─ troubleshooting.md (User-facing issues)
│ └─ examples/ (5 user examples)
├─ CHANGELOG.md (Documentation change log)
└─ documentation-map.md (Navigation guide)
Files to update:
- README.md (complete rewrite, progressive disclosure)
- docs/developers/api.md (2 new endpoints, 1 modified)
- docs/CHANGELOG.md (new entry)
Files to create:
- docs/adr/004-caching-strategy.md (new decision)
- docs/developers/examples/pagination.js (new example)
Files to remove:
- docs/developers/legacy-auth.md (endpoint removed)
Estimated scope: ~5,200 words total
Target health score: 92/100
Proceed? [yes/adjust scope/abort]全面模式: 生成前需审核并批准
快速模式: 简要预览,可选择审核或直接继续
快速模式: 简要预览,可选择审核或直接继续
Phase 6: Documentation Generation
阶段6:文档生成
Comprehensive Mode (with Quality Gates)
全面模式(含质量关卡)
The skill works through documentation in phases, pausing for review:
Gate 1: Core Documentation (README + Getting Started)
- Generates README with progressive disclosure
- Creates getting started guides
- Quality Check: Does this hook and onboard effectively?
- You review and approve or request changes
Gate 2: Reference Documentation (API/Commands/Components)
- Generates reference documentation
- Creates working examples
- Quality Check: Is everything covered? Examples clear?
- You review and approve or request changes
Gate 3: Architecture & Decisions
- Documents architecture with Mermaid diagrams
- Creates ADRs for key decisions
- Quality Check: Does this explain the WHY?
- You review and approve or request changes
Gate 4: Supporting Documentation
- Generates troubleshooting guides
- Creates contributing guidelines
- Documentation map for navigation
- Quality Check: Complete and helpful?
- You review and approve or request changes
Gate 5: Polish & Verification
- Generates test scripts for examples
- Creates link validation script
- Runs accessibility check
- Final health score calculation
- Final review
该技能会分阶段生成文档,并在每个阶段暂停等待审核:
关卡1:核心文档(README + 快速入门)
- 生成采用渐进式披露的README
- 创建快速入门指南
- 质量检查: 是否能有效吸引并引导用户?
- 你需要审核并批准,或要求修改
关卡2:参考文档(API/命令/组件)
- 生成参考文档
- 创建可运行的示例
- 质量检查: 是否覆盖所有内容?示例是否清晰?
- 你需要审核并批准,或要求修改
关卡3:架构与决策
- 使用Mermaid图记录架构
- 为关键决策创建ADR
- 质量检查: 是否解释了决策的原因?
- 你需要审核并批准,或要求修改
关卡4:支持文档
- 生成故障排除指南
- 创建贡献指南
- 生成用于导航的文档地图
- 质量检查: 是否完整且实用?
- 你需要审核并批准,或要求修改
关卡5:优化与验证
- 为示例生成测试脚本
- 创建链接验证脚本
- 运行可访问性检查
- 计算最终健康度评分
- 最终审核
Quick Mode (Autonomous)
快速模式(自主运行)
The skill executes the plan efficiently:
- Updates only changed sections
- Preserves manual edits in unchanged areas
- Generates new content as needed
- Updates manifest and changelog
- Reports final results
该技能会高效执行计划:
- 仅更新变更的部分
- 保留未变更区域的手动编辑内容
- 根据需要生成新内容
- 更新清单文件和变更日志
- 报告最终结果
Phase 7: Session Completion
阶段7:会话完成
The skill produces:
Files Created/Updated:
- All documentation files as planned
- (updated manifest)
.doc-state.json - (new entry)
docs/CHANGELOG.md - Test and validation scripts
Documentation Health Report:
DOCUMENTATION HEALTH REPORT
Overall Health Score: 92/100 (↑ from 78)
Component Scores:
├─ Coverage Health: 95/100 (↑ from 82)
│ └─ 97% of public surface documented
├─ Freshness Health: 98/100 (↑ from 65)
│ └─ All docs current as of commit a3f2b1c
├─ Quality Health: 88/100 (↑ from 81)
│ └─ 12 examples, 4 ADRs, troubleshooting complete
└─ Consistency Health: 90/100 (↑ from 84)
└─ Tone consistent, terminology standardized
Debt Status:
├─ Critical: 0 items (was 2)
├─ Important: 1 item (was 4)
└─ Minor: 3 items (unchanged)
Next session recommendations:
- Document the new webhook system (flagged as potential)
- Add performance troubleshooting section
- Consider hosting docs on GitHub PagesSession Notes:
- Decisions made
- Scope adjustments
- What was included/excluded and why
- Next steps
该技能会生成以下内容:
创建/更新的文件:
- 计划中的所有文档文件
- (更新后的清单文件)
.doc-state.json - (新条目)
docs/CHANGELOG.md - 测试与验证脚本
文档健康度报告:
DOCUMENTATION HEALTH REPORT
Overall Health Score: 92/100 (↑ from 78)
Component Scores:
├─ Coverage Health: 95/100 (↑ from 82)
│ └─ 97% of public surface documented
├─ Freshness Health: 98/100 (↑ from 65)
│ └─ All docs current as of commit a3f2b1c
├─ Quality Health: 88/100 (↑ from 81)
│ └─ 12 examples, 4 ADRs, troubleshooting complete
└─ Consistency Health: 90/100 (↑ from 84)
└─ Tone consistent, terminology standardized
Debt Status:
├─ Critical: 0 items (was 2)
├─ Important: 1 item (was 4)
└─ Minor: 3 items (unchanged)
Next session recommendations:
- Document the new webhook system (flagged as potential)
- Add performance troubleshooting section
- Consider hosting docs on GitHub Pages会话记录:
- 做出的决策
- 范围调整
- 包含/排除内容的原因
- 后续步骤
File Outputs
文件输出
Core Documentation Structure
核心文档结构
Developer-only projects:
/docs
├── CHANGELOG.md
├── api.md / commands.md / components.md
├── architecture.md
├── contributing.md
├── deployment.md
├── troubleshooting.md
├── examples/
│ ├── example-1.js
│ ├── example-2.js
│ └── test-examples.sh
├── adr/
│ ├── 001-initial-decisions.md
│ ├── 002-database-choice.md
│ └── ...
└── scripts/
├── validate-links.sh
└── accessibility-check.mdMulti-audience projects:
/docs
├── CHANGELOG.md
├── documentation-map.md
├── users/
│ ├── getting-started.md
│ ├── features.md
│ ├── troubleshooting.md
│ └── examples/
│ ├── basic-usage.js
│ └── advanced-usage.js
├── developers/
│ ├── api.md / architecture.md
│ ├── contributing.md
│ ├── deployment.md
│ ├── troubleshooting.md
│ ├── examples/
│ │ ├── integration.js
│ │ ├── extending.js
│ │ └── test-examples.sh
│ └── adr/
│ ├── 001-framework-choice.md
│ └── ...
└── scripts/
├── validate-links.sh
└── accessibility-check.md仅面向开发者的项目:
/docs
├── CHANGELOG.md
├── api.md / commands.md / components.md
├── architecture.md
├── contributing.md
├── deployment.md
├── troubleshooting.md
├── examples/
│ ├── example-1.js
│ ├── example-2.js
│ └── test-examples.sh
├── adr/
│ ├── 001-initial-decisions.md
│ ├── 002-database-choice.md
│ └── ...
└── scripts/
├── validate-links.sh
└── accessibility-check.md多受众项目:
/docs
├── CHANGELOG.md
├── documentation-map.md
├── users/
│ ├── getting-started.md
│ ├── features.md
│ ├── troubleshooting.md
│ └── examples/
│ ├── basic-usage.js
│ └── advanced-usage.js
├── developers/
│ ├── api.md / architecture.md
│ ├── contributing.md
│ ├── deployment.md
│ ├── troubleshooting.md
│ ├── examples/
│ │ ├── integration.js
│ │ ├── extending.js
│ │ └── test-examples.sh
│ └── adr/
│ ├── 001-framework-choice.md
│ └── ...
└── scripts/
├── validate-links.sh
└── accessibility-check.mdDocumentation Manifest (.doc-state.json
)
.doc-state.json文档清单(.doc-state.json
)
.doc-state.jsonTracks complete documentation state:
json
{
"version": "1.0",
"project": {
"name": "my-api",
"type": "express-api",
"lastScanned": "2025-01-10T14:30:00Z",
"gitCommit": "a3f2b1c"
},
"preferences": {
"audiences": ["developers", "users"],
"depthLevel": "standard",
"tone": "professional"
},
"healthScore": {
"overall": 92,
"components": {
"coverage": 95,
"freshness": 98,
"quality": 88,
"consistency": 90
},
"trend": [78, 85, 92]
},
"coverage": {
"endpoints": { "total": 12, "documented": 12, "changed": 0 },
"components": { "total": 8, "documented": 8, "changed": 0 },
"schemas": { "total": 3, "documented": 3, "changed": 0 }
},
"debt": {
"critical": [],
"important": [
{
"item": "Document webhook system",
"effort": "medium",
"status": "to-fix"
}
],
"minor": [
{
"item": "Add performance troubleshooting",
"effort": "low",
"status": "accepted"
}
]
},
"documentationMap": {
"README.md": {
"lastUpdated": "2025-01-10T14:30:00Z",
"covers": ["overview", "quickstart"],
"wordCount": 850
},
"docs/developers/api.md": {
"lastUpdated": "2025-01-10T14:30:00Z",
"covers": ["endpoints"],
"wordCount": 2400
}
}
}跟踪完整的文档状态:
json
{
"version": "1.0",
"project": {
"name": "my-api",
"type": "express-api",
"lastScanned": "2025-01-10T14:30:00Z",
"gitCommit": "a3f2b1c"
},
"preferences": {
"audiences": ["developers", "users"],
"depthLevel": "standard",
"tone": "professional"
},
"healthScore": {
"overall": 92,
"components": {
"coverage": 95,
"freshness": 98,
"quality": 88,
"consistency": 90
},
"trend": [78, 85, 92]
},
"coverage": {
"endpoints": { "total": 12, "documented": 12, "changed": 0 },
"components": { "total": 8, "documented": 8, "changed": 0 },
"schemas": { "total": 3, "documented": 3, "changed": 0 }
},
"debt": {
"critical": [],
"important": [
{
"item": "Document webhook system",
"effort": "medium",
"status": "to-fix"
}
],
"minor": [
{
"item": "Add performance troubleshooting",
"effort": "low",
"status": "accepted"
}
]
},
"documentationMap": {
"README.md": {
"lastUpdated": "2025-01-10T14:30:00Z",
"covers": ["overview", "quickstart"],
"wordCount": 850
},
"docs/developers/api.md": {
"lastUpdated": "2025-01-10T14:30:00Z",
"covers": ["endpoints"],
"wordCount": 2400
}
}
}Collaboration Behaviors
协作行为
In Comprehensive Mode
全面模式下
Proactive contributions:
- "I notice you're using Redis but there's no ADR explaining why—should I document that decision?"
- "Your error handling is sophisticated. This deserves explanation in architecture docs."
- "The authentication flow is non-standard. Users will have questions—let me address them."
Challenge assumptions:
- "You said 'standard depth' but you have 47 endpoints. That needs Deep documentation."
- "This 'getting started' guide assumes too much. Your users won't know X."
- "Three examples aren't enough here. The concept is complex."
Surface insights:
- "Your git history shows you refactored auth 3 times. That's an ADR waiting to be written."
- "These three files handle all business logic but aren't documented at all. Gap."
- "You have inline JSDoc but it contradicts what's in the markdown docs. Consistency issue."
主动贡献:
- "我注意到你使用了Redis,但没有ADR解释原因——需要我记录这个决策吗?"
- "你的错误处理机制很复杂,值得在架构文档中进行说明。"
- "认证流程是非标准的,用户会有疑问——让我来解决这些问题。"
挑战假设:
- "你选择了'标准深度',但你有47个端点,这需要深度文档。"
- "这个'快速入门'指南假设用户了解太多内容,你的用户不会知道X。"
- "这里的三个示例不够,这个概念很复杂。"
呈现洞察:
- "你的Git历史显示你重构了3次认证模块,这需要编写ADR。"
- "这三个文件处理所有业务逻辑,但完全没有文档,存在缺口。"
- "你有内联JSDoc,但与Markdown文档中的内容矛盾,存在一致性问题。"
In Quick Mode
快速模式下
Efficient execution:
- "Updating 3 files based on changes in commit a3f2b1c..."
- "2 new endpoints detected, adding to api.md..."
- "Removed documentation for deleted legacy-auth endpoint..."
Flag concerns:
- "Warning: Manual changes detected in architecture.md, preserving your edits"
- "Note: Health score dropped from 92 to 85 due to new undocumented features"
高效执行:
- "正在根据提交a3f2b1c中的变更更新3个文件..."
- "检测到2个新端点,正在添加到api.md..."
- "已删除已废弃的legacy-auth端点的文档..."
标记问题:
- "警告:在architecture.md中检测到手动修改,将保留你的编辑内容"
- "注意:由于存在未文档化的新功能,健康度评分从92降至85"
Quality Standards
质量标准
The skill maintains high documentation quality through:
该技能通过以下方式维持高文档质量:
Clarity
清晰性
- Concepts explained before they're used
- Technical terms defined on first use
- Examples precede or immediately follow concepts
- Progressive disclosure (simple → complex)
- 先解释概念再使用
- 首次使用技术术语时进行定义
- 示例在概念之前或紧随其后
- 渐进式披露(从简单到复杂)
Completeness
完整性
- Every public-facing element documented
- Edge cases and gotchas addressed
- Troubleshooting for predictable failures
- Examples for common use cases
- 所有面向公众的元素都有文档
- 涵盖边缘情况和注意事项
- 针对可预见的故障提供故障排除方案
- 包含常见用例的示例
Accuracy
准确性
- All facts verified against code
- Examples tested and working
- Links validated
- No outdated information
- 所有事实均通过代码验证
- 示例经过测试可正常运行
- 链接经过验证
- 无过时信息
Accessibility
可访问性
- Diagrams include alt text
- Links have descriptive text
- Heading hierarchy is logical
- Code snippets have language labels
- 图表包含替代文本
- 链接有描述性文本
- 标题层次结构合理
- 代码片段有语言标签
Consistency
一致性
- Terminology used uniformly
- Tone maintained throughout
- Formatting standardized
- Structure predictable
- 术语使用统一
- 语气保持一致
- 格式标准化
- 结构可预测
Special Features
特殊功能
Architecture Decision Records (ADRs)
架构决策记录(ADR)
Captures WHY decisions were made:
The skill identifies decision points through:
- Major dependency additions (git history)
- Non-standard architectural patterns (code analysis)
- Framework/library choices
- Flagged commits with "decision" language
- Your explicit identification
Each ADR documents:
- Context (what was the situation?)
- Decision (what did we decide?)
- Rationale (why this choice?)
- Consequences (trade-offs accepted)
- Alternatives considered
记录决策的原因:
该技能通过以下方式识别决策点:
- 主要依赖项的添加(Git历史)
- 非标准的架构模式(代码分析)
- 框架/库的选择
- 标记为“决策”的提交
- 你明确指出的内容
每个ADR记录:
- 背景(当时的情况是什么?)
- 决策(我们做出了什么决定?)
- 理由(为什么选择这个方案?)
- 结果(接受的权衡)
- 考虑过的替代方案
Living, Tested Examples
可维护的测试示例
Examples are runnable code in :
/examples- Actually work (not pseudocode)
- Cover common use cases
- Include test script to verify they run
- Referenced from documentation
- Maintained as code evolves
示例是目录中的可运行代码:
/examples- 可实际运行(不是伪代码)
- 覆盖常见用例
- 包含验证运行的测试脚本
- 在文档中被引用
- 随代码演进而维护
Troubleshooting Database
故障排除数据库
Two flavors:
- User troubleshooting: Common errors, how to fix them
- Developer troubleshooting: Debugging guides, edge cases, gotchas
The skill seeds initial content in Comprehensive Mode, grows it in Quick Mode as
you add real troubleshooting content.
两种类型:
- 用户故障排除: 常见错误及解决方法
- 开发者故障排除: 调试指南、边缘情况、注意事项
该技能在全面模式下初始化内容,在快速模式下随着你添加实际的故障排除内容而扩展。
Documentation Map
文档地图
For large projects, a navigation guide:
- Different learning paths (beginner/advanced)
- How docs connect to each other
- What to read when
- Visual/textual navigation aid
针对大型项目的导航指南:
- 不同的学习路径(初级/高级)
- 文档之间的关联方式
- 何时阅读哪些内容
- 可视化/文本导航辅助
Mermaid Diagrams
Mermaid图
The skill generates code-based diagrams:
- Architecture diagrams
- Sequence diagrams
- Entity-relationship diagrams
- State diagrams
- Flowcharts
All version-controllable, all render in GitHub.
该技能生成基于代码的图表:
- 架构图
- 序列图
- 实体关系图
- 状态图
- 流程图
所有图表均可版本控制,可在GitHub中渲染。
Documentation Hosting Integration
文档托管集成
Detects if you're using:
- GitHub Pages
- ReadTheDocs
- GitBook
- MkDocs
Generates appropriate config files and optimizes structure for static site
generation.
检测你是否使用:
- GitHub Pages
- ReadTheDocs
- GitBook
- MkDocs
生成相应的配置文件,并优化结构以适配静态站点生成。
Reference Documents
参考文档
Load contextually when needed:
- — How to document different project types
references/project-types-guide.md - — Common documentation patterns and structures
references/documentation-patterns.md - — Detailed quality criteria and examples
references/quality-standards.md - — Technical specification for
references/manifest-spec.md.doc-state.json - — Standard vs. Deep explained with examples
references/depth-levels-guide.md - — How health score is calculated
references/health-score-formula.md - — Writing effective Architecture Decision Records
references/adr-guide.md
需要时会加载相关上下文:
- — 如何为不同类型的项目编写文档
references/project-types-guide.md - — 常见的文档模式和结构
references/documentation-patterns.md - — 详细的质量标准和示例
references/quality-standards.md - —
references/manifest-spec.md的技术规范.doc-state.json - — 标准深度与深度覆盖的示例说明
references/depth-levels-guide.md - — 健康度评分的计算方式
references/health-score-formula.md - — 编写有效的架构决策记录
references/adr-guide.md
Templates
模板
Available in :
templates/- — Progressive disclosure README structure
README-template.md - — API endpoint documentation
api-docs-template.md - — Component/module documentation
component-docs-template.md - — Troubleshooting guide structure
troubleshooting-template.md - — Contributing guidelines
contributing-template.md - — Navigation guide template
documentation-map-template.md
在目录中可用:
templates/- — 渐进式披露的README结构
README-template.md - — API端点文档模板
api-docs-template.md - — 组件/模块文档模板
component-docs-template.md - — 故障排除指南结构
troubleshooting-template.md - — 贡献指南模板
contributing-template.md - — 导航指南模板
documentation-map-template.md
Success Criteria
成功标准
Documentation is complete when:
✓ Health score ≥ 85
✓ All critical and important debt resolved
✓ Examples run without errors
✓ Links validate successfully
✓ Accessibility check passes
✓ Tone is consistent throughout
✓ You're confident someone could use your project from the docs alone
✓ All critical and important debt resolved
✓ Examples run without errors
✓ Links validate successfully
✓ Accessibility check passes
✓ Tone is consistent throughout
✓ You're confident someone could use your project from the docs alone
文档完成的标准:
✓ 健康度评分 ≥ 85
✓ 所有关键和重要的文档债务已解决
✓ 示例可无错误运行
✓ 链接验证通过
✓ 可访问性检查通过
✓ 语气全程一致
✓ 你确信仅通过文档就能让他人使用你的项目
✓ 所有关键和重要的文档债务已解决
✓ 示例可无错误运行
✓ 链接验证通过
✓ 可访问性检查通过
✓ 语气全程一致
✓ 你确信仅通过文档就能让他人使用你的项目
Key Reminders
关键提醒
- Reader-first always: Every decision serves the reader
- Git-aware: Smart incremental updates, not regeneration
- Transparency: You see all analysis and decisions
- Preserve quality: Don't overwrite good manual edits
- Test examples: Generate test scripts for working code
- Track health: Health score trends over time
- Prioritize debt: Not all debt is equal
- Comprehensive without exhaustive: Document what matters
- 始终以读者为中心: 每一个决策都为读者服务
- Git感知: 智能增量更新,而非重新生成
- 透明化: 你可以看到所有分析和决策过程
- 保留质量: 不会覆盖优质的手动编辑内容
- 测试示例: 为可运行代码生成测试脚本
- 追踪健康度: 健康度评分随时间变化的趋势
- 优先处理债务: 并非所有债务的优先级都相同
- 全面但不过度: 只记录重要内容