doc-generator
Skill0 starsChanged 5 months agoMITView on GitHub
Generate and update project documentation, including README, API docs, code comments, changelogs, ADRs, and handoff notes. Use when asked to write docs from code, refresh docs after changes, or make documentation accurate and maintainable.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- vikisingh23/neuraforge-aitheir own version, first seen May 4, 2026
- suxiao1824308603/Qoder-devtools-skillstheir own version, first seen Feb 20, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- vikisingh23/neuraforge-ai★ 4same name
- suxiao1824308603/Qoder-devtools-skills★ 3same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository33 other files it gives its agents.
- AGENTS.mdAGENTS.md
- api-designSkill
- architecture-consultantSkill
- backend-patternsSkill
- ci-cdSkill
- code-reviewSkill
- containersSkill
- database-migrationsSkill
- git-workflowSkill
- go-reviewSkill
- luaSkill
- markdownSkill
- nginxSkill
- nodejsSkill
- observabilitySkill
- product-managerSkill
- project-standards-initSkill
- prompt-designSkill
- python-reviewSkill
- reactSkill
- redisSkill
- relay-imagegenSkill
- releaseSkill
- security-baselineSkill
- semi-mcp-setupSkill
- tailwindcssSkill
- test-engineeringSkill
- tibishu-note-searchSkill
- tibishu-notesSkill
- typescript-reviewSkill
- unity-csharpSkill
- validation-lintSkill
- vueSkill
The file
Files
Skill: Doc Generator
帮助自动生成高质量的项目文档,涵盖多种文档类型和格式。
🎯 Purpose
从代码和项目结构自动生成清晰、规范的文档,减少手动编写工作量,保持文档与代码同步。
🎯 触发条件
当用户说:
- "帮我生成 API 文档"
- "写一下这个函数的注释"
- "生成 README"
- "更新 Changelog"
- "生成接口说明"
👉 自动启用本 Skill
🧩 Capabilities
- API 文档生成:从代码生成 OpenAPI/Swagger 格式的接口文档
- 代码注释生成:函数/类/模块级别的注释(JSDoc、GoDoc、docstring 等)
- README 生成:项目说明文档,包含 Quick Start、Features、Configuration
- Changelog 生成:版本变更日志,遵循 Keep a Changelog 规范
- ADR 生成:架构决策记录 (Architecture Decision Record)
🧠 Usage
- 在准备补齐或重写项目文档时使用。
- 在代码完成后同步输出 API、README、注释或 Changelog 时使用。
- 在对外交付、发版或交接前整理文档资产时使用。
📥 Input
- 代码、接口定义或项目结构。
- 目标文档类型、受众和格式要求。
- 已有文档、模板或术语约定。
📤 Output
- 可继续编辑的结构化文档草稿。
- 与代码一致的注释、示例和说明结构。
- 文档缺口、风险点和维护建议。
🔄 文档类型与模板
1. API 文档结构
标准 API 文档应包含:
| 章节 | 内容 |
| Introduction | API 概述、Base URL、版本、联系方式 |
| Authentication | 认证方式、Token 管理、安全实践 |
| Quick Start | 快速开始示例 |
| Endpoints | 按资源组织的接口详情 |
| Data Models | Schema 定义、字段描述、校验规则 |
| Error Handling | 错误码参考、排错指南 |
| Changelog | API 版本历史 |
2. 接口文档模板
## GET /users/:id
获取指定用户信息。
**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| id | string | Yes | 用户 ID |
**Response:**
- 200: 用户对象
- 404: 用户不存在
**Example:**
[Request and response example]3. README 模板
# Project Name
一句话描述。
## Quick Start
[最小化运行步骤]
## Features
- Feature 1
- Feature 2
## Configuration
| Variable | Description | Default |
|----------|-------------|---------|
| PORT | 服务端口 | 3000 |
## License
MIT4. Code Comment Guidelines
| ✅ 应该注释 | ❌ 不应注释 |
| Why (业务逻辑) | What (显而易见的) |
| 复杂算法 | 每一行代码 |
| 非显而易见的行为 | 自解释的代码 |
| API 契约 | 实现细节 |
5. Changelog 模板 (Keep a Changelog)
# Changelog
## [Unreleased]
### Added
- New feature
## [1.0.0] - 2025-01-01
### Added
- Initial release
### Changed
- Updated dependency
### Fixed
- Bug fix⚙️ 生成流程
API 文档生成流程
- 分析代码结构:识别路由、HTTP 方法、参数、响应
- 生成接口描述:为每个 endpoint 生成标准文档
- 添加使用指南:Quick Start、认证说明、最佳实践
- 文档化错误处理:列出所有错误码和解决方案
- 创建示例:cURL、JavaScript、Python 代码示例
代码注释生成流程
- 分析函数签名:参数类型、返回值
- 推断函数用途:从命名和实现推断
- 生成规范注释:按语言规范(JSDoc/GoDoc/docstring)
- 补充边缘情况:异常、限制、注意事项
✅ Best Practices
- 保持同步:文档应随代码一起更新
- 示例优先:每个接口都应有可运行的示例
- 渐进式详情:简单 → 复杂的信息层次
- 可扫描:使用表格、列表、标题便于快速查找
❌ Common Pitfalls
| 问题 | 解决方案 |
| 文档与代码不同步 | 在 CI 中添加文档检查 |
| 缺少错误文档 | 为每个错误码提供说明 |
| 示例无法运行 | 使用真实可测试的示例 |
| 参数要求不清晰 | 明确标注 required/optional 和校验规则 |
⚠️ Constraints
- 不用空泛描述替代真实行为说明。
- 不输出与当前代码状态不一致的接口、参数或命令。
- 不省略错误路径、前置条件或兼容性说明。
🔍 能力溯源 (Source Mapping)
| 能力 | 来源 | 说明 |
| API 文档结构 | api-documentation-generator (外部) | ✅ 整合 5 步生成流程 |
| 文档模板系统 | documentation-templates (外部) | ✅ 整合 README/API/注释/Changelog 模板 |
| Changelog 规范 | release (本地) | ✅ 复用 Release Notes 生成规范 |
| AI-Friendly 文档 | documentation-templates (外部) | ✅ 整合 llms.txt 和 MCP-Ready 规范 |
📚 参考资料 (References)
- Keep a Changelog - Changelog 规范
- OpenAPI Specification - API 文档标准
- JSDoc - JavaScript 文档注释
- GoDoc - Go 文档规范
- antigravity-awesome-skills/api-documentation-generator
- antigravity-awesome-skills/documentation-templates
🔗 Related Skills
- release: Release Notes 生成
- api-design: API 设计规范
- code-review: 代码审查(含注释检查)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

