微算力 · API 导航与自营网关
API 接入 EN
未登录登录
📚

技术文档写作与维护最佳实践

Documentation · v1.0.0
专业技能 安全 S+ 级 作者 ivangdavila 公开目录收录
2.6k 下载 3 安装 9.8k 收藏 71 浏览

简介

技术文档最佳实践指南,涵盖结构层次、README撰写、API文档、维护策略及常见反模式,助力打造清晰可维护的技术文档。

原始描述

Technical documentation patterns, structure, maintenance, and avoiding common documentation failures.

通过你的 Agent 添加

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/documentation/
Codex CLI~/.codex/skills/documentation/
DeepSeek Harness~/.agents/skills/documentation/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

技能正文


name: documentation description: Write or review inline code documentation that captures domain knowledge, non-obvious constraints, non-greppable cross-file contracts, and state lifecycle. Use when the task is adding or reviewing docstrings, module headers, constant rationale, or training/data invariants. Do not use for README files, markdown guides, plan documents, or code changes where comments are incidental.

Documentation

Purpose

Enforce the repo's inline code documentation standards. Document what a future editor cannot safely derive from the code itself.

Use When

  • Adding or reviewing module/class/function docstrings or short file headers.
  • Documenting training state, checkpoint, or config invariants.
  • A review flags missing or low-quality documentation.

Do Not Use When

  • Writing README, plan, or notes documents.
  • General code changes where documentation isn't the focus.
  • Markdown formatting issues (use markdown).

Procedure

  1. Read references/index.md first.
  2. Inspect the target file and the smallest set of related files needed to confirm what context is truly missing.
  3. Add or tighten docs only where they capture:
    • domain knowledge
    • non-obvious constraints
    • non-greppable cross-file contracts
    • state lifecycle or constant rationale
  4. Prefer short, durable comments over boilerplate:
    • short file headers when a whole module has one responsibility story
    • docstrings that explain why or constraints—not a rephrasing of the signature
    • notes on MPS vs CUDA assumptions when non-obvious
  5. Do not add manual call graphs, line-by-line prose, or comments that are more likely to drift than to help.
  6. If the missing context belongs in a canonical guide, update the guide under README/guides/ instead of burying the whole explanation in code comments.

References

Read references/index.md first.

Handoff Rules

  • Hand off to debug if the problem is a runtime defect, not missing docs.
  • Hand off to markdown for prose-heavy documentation files.

正文来自原始仓库, 版权归作者所有,许可:GPL。 权利人认为有不妥,可申请下架。

原始仓库

作者的项目地址:https://github.com/mattmireles/gemma-tuner-multimodal

标签

documentationtechnical-writingreadmeapi-docsdeveloper-experiencedxdocumentation-maintenancecode-examplestroubleshooting

同类 Skill