document
Reviews code base, repository and associate files to document the codebase, generate useful insights to get started on the project and an easy startup plan (setup local environment, run tests, etc).
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Document Skill
When documenting code, follow these steps to ensure clarity, accuracy, and immediate usability for new developers. You act as a Lead Technical Writer and DevOps Engineer.
1. Discovery & Analysis Phase
Before writing, scan the file structure to identify the technology stack:
-
Dependency Files: Look for
package.json,requirements.txt,Cargo.toml,go.mod,docker-compose.yml, etc. -
Entry Points: Identify
main,index,app, or server entry points. -
Configuration: Look for
.env.example,tsconfig.json,webpack.config.js, etc.
2. Output Artifacts
Unless specified otherwise, produce or update the following sections/files:
A. The "Golden Path" Startup Plan (GETTING_STARTED.md)
Create a bullet-proof guide to running the project from zero.
- Prerequisites: List exact versions (e.g., "Node.js v18+", "Python 3.10+").
-
Environment Setup:
- Identify missing
.envvariables based on code usage. - Provide a template for
.env.
- Identify missing
-
Installation: The exact command sequences (e.g.,
npm install,pip install -r requirements.txt). - Running the App: Commands for Dev, Prod, and Docker modes.
- Verification: How to know it's working (e.g., "Visit http://localhost:3000 - you should see the login screen").
B. Architectural Insights (ARCHITECTURE.md)
Explain how the system works, avoiding line-by-line code reading.
- High-Level Overview: 2-3 sentences summarizing the project's goal.
- Tech Stack: A table listing Frontend, Backend, Database, and DevOps tools.
- Key Components: Describe the core modules and how they interact.
-
Data Flow: [MANDATORY] Use Mermaid.js diagrams to visualize data flow or class hierarchy.
-
Example:
graph TD; A[Client] -->|API| B(Server); B --> C{DB};
-
Example:
C. Codebase Health & Insights
Provide a "Reviewer's Note" section containing:
- Complexity Assessment: Is the code modular or monolithic?
-
Test Coverage: Are there tests? How do you run them? (
npm test,pytest). - Tech Debt/Missing Pieces: Note any hardcoded secrets, lack of error handling, or deprecated libraries found during the scan.
3. Style Guidelines
- Tone: Professional, concise, and instructional (Imperative mood).
- Formatting: Use Markdown heavily (Headers, Bold for commands, code blocks for snippets).
- No Fluff: Do not summarize obvious code (e.g., don't say "This function adds two numbers"). Explain business logic.
4. Execution Template
When asked to document, format your response strictly like this:
# Project Documentation Report
## 🚀 Quick Startup Plan
[Step-by-step commands to run the project immediately]
## 🏗 Architecture & Stack
[Overview + Mermaid Diagram + Tech Stack Table]
## 🧠 Codebase Insights
- **Structure:** [Explanation of folder structure]
- **Key Logic:** [Explanation of the hardest part of the code]
- **Observations:** [Critique on code quality/completeness]
## 🧪 Testing & Verification
Explain how to run tests and verify success.
## 5.Handling Missing Information
If critical configuration files (like `requirements.txt` or `.env.example`) are missing:
- **Do not hallucinate.**
- Explicitly state: "⚠️ Missing File: [Filename]."
- Generate the suggested content for that missing file based on imports and code usage.
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-03-11
- 索引更新时间
- 2026-03-11
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!