docs-codebase

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Technical Documentation

技术文档

Execution-ready patterns for clear, maintainable technical documentation.
Modern best practices (January 2026): docs-as-code, ownership + review cadence, documentation QA gates (links/style/spelling), AI-assisted drafting + review, OpenAPI 3.2.0 where streaming schemas matter, and GEO (Generative Engine Optimization) for AI search.
可直接落地的清晰、可维护技术文档模式。
2026年1月现代最佳实践:文档即代码(docs-as-code)、文档归属+审核周期、文档质量检查关卡(链接/风格/拼写)、AI辅助撰写与审核、面向流式架构的OpenAPI 3.2.0、面向AI搜索的GEO(生成式引擎优化)。

Quick Reference

快速参考

Documentation TypeTemplateWhen to Use
Project READMEreadme-template.mdNew project, onboarding
Architecture Decisionadr-template.mdTechnical decisions
API Referenceapi-docs-template.mdREST/GraphQL APIs
Changelogchangelog-template.mdVersion history
Contributing Guidecontributing-template.mdOpen source, teams
文档类型模板适用场景
项目READMEreadme-template.md新项目、员工入职
架构决策记录adr-template.md技术决策留存
API参考文档api-docs-template.mdREST/GraphQL API
变更日志changelog-template.md版本历史记录
贡献指南contributing-template.md开源项目、团队协作

Workflow

工作流

  1. Identify the documentation type and audience.
  2. Find existing patterns in the repo; follow local conventions.
  3. Start from the closest template in
    assets/
    and adapt.
  4. Add ownership + review cadence for critical docs (runbooks, onboarding, API reference).
  5. Run documentation QA (links, formatting, spelling, examples) before merging.
  1. 确定文档类型和受众。
  2. 查看仓库中已有的模式,遵循本地约定。
  3. assets/
    目录下最匹配的模板开始,进行调整。
  4. 为关键文档(运行手册、入职文档、API参考)添加归属与审核周期。
  5. 合并前运行文档质量检查(链接、格式、拼写、示例)。

Decision Tree

决策树

text
User needs: [Documentation Task]
    ├─ New project? → **README.md**
    ├─ Technical decision? → **ADR**
    ├─ Building API? → **OpenAPI spec** + api-docs-template
    ├─ New version? → **CHANGELOG.md**
    ├─ Team collaboration? → **CONTRIBUTING.md**
    ├─ Documenting code? → **Docstrings** (JSDoc, Python)
    └─ Building docs site? → **MkDocs** (Python) or **Docusaurus** (JS)
text
用户需求:[文档任务]
    ├─ 新项目?→ **README.md**
    ├─ 技术决策?→ **ADR**
    ├─ 开发API?→ **OpenAPI 规范** + api-docs-template
    ├─ 新版本发布?→ **CHANGELOG.md**
    ├─ 团队协作?→ **CONTRIBUTING.md**
    ├─ 代码注释?→ **文档字符串**(JSDoc、Python)
    └─ 搭建文档站点?→ **MkDocs**(Python)或 **Docusaurus**(JS)

Cross-Platform AI Documentation

跨平台AI文档

AGENTS.md Standard

AGENTS.md 标准

Prefer
AGENTS.md
as the cross-tool source of truth. If a specific tool requires a different filename (example: Claude Code uses
CLAUDE.md
), keep it aligned via a symlink only when you want identical content across tools.
bash
undefined
优先将
AGENTS.md
作为跨工具的事实来源。如果特定工具要求不同的文件名(例如:Claude Code 使用
CLAUDE.md
),仅当你希望跨工具内容完全一致时,通过符号链接保持对齐。
bash
undefined

If
CLAUDE.md
does not exist and you want identical content:

如果
CLAUDE.md
不存在且需要内容完全一致:

ln -s AGENTS.md CLAUDE.md
undefined
ln -s AGENTS.md CLAUDE.md
undefined

Do / Avoid

建议做法 / 避免做法

Do

建议做法

  • Assign owners and review cadences to critical docs
  • Add CI checks for links, style, and staleness
  • Prefer small, task-oriented docs over big wiki pages
  • Use Keep a Changelog format with semantic versioning
  • 为关键文档指定负责人和审核周期
  • 添加CI检查,覆盖链接、格式和文档时效性
  • 优先选择小型、面向任务的文档,而非大型维基页面
  • 使用「Keep a Changelog」格式配合语义化版本控制

Avoid

避免做法

  • Docs without owners (guaranteed to rot)
  • Stale runbooks (dangerous during incidents)
  • Copy/paste docs that drift from code
  • 无负责人的文档(必然会过时失效)
  • 过时的运行手册(事故期间会造成危险)
  • 与代码脱节的复制粘贴式文档

Resources

资源

ResourcePurpose
references/readme-best-practices.mdREADME structure, badges
references/adr-writing-guide.mdADR lifecycle, examples
references/changelog-best-practices.mdKeep a Changelog format
references/api-documentation-standards.mdREST, GraphQL, gRPC docs
references/code-commenting-guide.mdDocstrings, inline comments
references/contributing-guide-standards.mdCONTRIBUTING.md structure
references/docs-as-code-setup.mdMkDocs, Docusaurus, CI/CD
references/writing-best-practices.mdClear communication
references/markdown-style-guide.mdMarkdown formatting
references/documentation-testing.mdVale, markdownlint, cspell
references/ai-documentation-tools.mdMintlify, DocuWriter, GEO
references/production-gotchas-guide.mdDocumenting platform issues
资源用途
references/readme-best-practices.mdREADME结构、徽章使用
references/adr-writing-guide.mdADR生命周期、示例
references/changelog-best-practices.mdKeep a Changelog格式指南
references/api-documentation-standards.mdREST、GraphQL、gRPC文档规范
references/code-commenting-guide.md文档字符串、行内注释
references/contributing-guide-standards.mdCONTRIBUTING.md结构规范
references/docs-as-code-setup.mdMkDocs、Docusaurus、CI/CD配置
references/writing-best-practices.md清晰沟通技巧
references/markdown-style-guide.mdMarkdown格式规范
references/documentation-testing.mdVale、markdownlint、cspell工具使用
references/ai-documentation-tools.mdMintlify、DocuWriter、GEO工具使用
references/production-gotchas-guide.md平台问题文档化

Templates

模板

CategoryTemplates
Architectureadr-template.md
API Referenceapi-docs-template.md
Project Managementreadme-template.md, changelog-template.md, contributing-template.md
Docs-as-Codedocs-structure-template.md, ownership-model.md
分类模板
架构adr-template.md
API参考api-docs-template.md
项目管理readme-template.md, changelog-template.md, contributing-template.md
文档即代码docs-structure-template.md, ownership-model.md

Related Skills

相关技能

SkillPurpose
qa-docs-coverageDocumentation gap audit
dev-api-designREST API patterns
git-workflowConventional Commits
docs-ai-prdPRD templates
技能用途
qa-docs-coverage文档缺口审计
dev-api-designREST API模式设计
git-workflow规范化提交
docs-ai-prdPRD模板