npx skills add ...
npx skills add bytedance/deer-flow --skill code-documentation
Use this skill when the user requests to generate, create, or improve documentation for code, APIs, libraries, repositories, or software projects. Supports README generation, API reference documentation, inline code comments, architecture documentation, changelog generation, and developer guides. Trigger on requests like "document this code", "create a README", "generate API docs", "write developer guide", or when analyzing codebases for documentation purposes.
npx skills add bytedance/deer-flow --skill code-documentation
This skill generates professional, comprehensive documentation for software projects, codebases, libraries, and APIs. It follows industry best practices from projects like React, Django, Stripe, and Kubernetes to produce documentation that is accurate, well-structured, and useful for both new contributors and experienced developers.
The output ranges from single-file READMEs to multi-document developer guides, always matched to the project's complexity and the user's needs.
Always load this skill when:
Before writing any documentation, thoroughly understand the codebase.
Identify the project fundamentals:
| Field | How to Determine |
|---|---|
| Language(s) | Check file extensions, package.json, pyproject.toml, go.mod, Cargo.toml, etc. |
| Framework | Look at dependencies for known frameworks (React, Django, Express, Spring, etc.) |
| Build System | Check for Makefile, CMakeLists.txt, webpack.config.js, build.gradle, etc. |
| Package Manager | npm/yarn/pnpm, pip/uv/poetry, cargo, go modules, etc. |
| Project Structure | Map out the directory tree to understand the architecture |
| Entry Points | Find main files, CLI entry points, exported modules |
| Existing Docs | Check for existing README, docs/, wiki, or inline documentation |
Use sandbox tools to explore the codebase:
Based on analysis, determine what documentation to produce:
| Project Size | Recommended Documentation |
|---|---|
| Single file / script | Inline comments + usage header |
| Small library | README with API reference |
| Medium project | README + API docs + examples |
| Large project | README + Architecture + API + Contributing + Changelog |
Every project needs a README. Follow this structure:
For each public API surface, document:
Function / Method Documentation:
Class Documentation:
For medium-to-large projects, include architecture documentation:
Generate language-appropriate inline documentation:
Python (Docstrings — Google style):
TypeScript (JSDoc / TSDoc):
Go (GoDoc):
Verify the documentation covers:
| Standard | Check |
|---|---|
| Accuracy | Every code example must actually work with the described API |
| Completeness | No public API surface left undocumented |
| Consistency | Same formatting and structure throughout |
| Freshness | Documentation matches the current code, not an older version |
| Accessibility | No jargon without explanation, acronyms defined on first use |
| Examples | Every complex concept has at least one practical example |
Ensure:
#, ##, ###)```python, ```bash)code formatting for function names, file paths, variable names, and CLI commands| Language | Doc Format | Style Guide |
|---|---|---|
| Python | Google-style docstrings | PEP 257 |
| TypeScript/JavaScript | TSDoc / JSDoc | TypeDoc conventions |
| Go | GoDoc comments | Effective Go |
| Rust | Rustdoc (///) | Rust API Guidelines |
| Java | Javadoc | Oracle Javadoc Guide |
| C/C++ | Doxygen | Doxygen manual |
After generation:
/mnt/user-data/outputs/present_files tooldeep-research skill for documenting third-party integrations or dependencies