Agent skill

Code Documentation Writer

by bytedance in bytedance/deer-flow

Writes READMEs, API references, architecture notes, developer guides, changelogs and inline comments after first mapping the codebase.

MITAuto-check passedDevelopment

Install Code Documentation Writer

skills CLI
$ npx skills add bytedance/deer-flow --skill code-documentation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install bytedance/deer-flow code-documentation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/bytedance/deer-flow.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/public/code-documentation .claude/skills/code-documentation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
code-documentation
GitHub stars
83k
Used in
1 other repo
Token cost
~3.5k tokens
SKILL.md length
895 words
Files
1
Skills in repo
23
Repo updated
First seen
Licence
MIT

At a glance

Writes READMEs, API references, architecture notes, developer guides, changelogs and inline comments after first mapping the codebase.

  • Works in 3 steps: Codebase Analysis → Documentation Generation → Quality Assurance
  • Creating a README for a repository that has none
  • SKILL.md covers Overview, Core Capabilities, When to Use This Skill and Documentation Workflow, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Before writing a line of documentation, the agent surveys the project: languages from file extensions and manifests such as `package.json`, `pyproject.toml`, `go.mod` or `Cargo.toml`, the frameworks in the dependencies, the build system and package manager, the directory layout, entry points and any docs already present. That survey decides how large the documentation should be, from a single README up to a set of linked guides.

The skill covers README files, API reference pages derived from the source, architecture and design documents with diagrams, onboarding and contribution guides, changelogs built from commit history or release notes, and inline documentation in the conventions of the language, including JSDoc, docstrings, GoDoc, Javadoc and Rustdoc. It can also update documentation that already exists. The excerpt is cut off, so the later phases are not described here.

When your agent uses it

  • Creating a README for a repository that has none
  • Generating API reference pages from the source of a library
  • Adding docstrings or JSDoc comments across a module
  • Writing a contribution or onboarding guide for new developers

Example prompts

  • “Document this repository and write a README with install and usage sections.”
  • “Generate API docs for everything exported from src/index.ts.”
  • “Draft a CHANGELOG from the commits since the last tag.”
  • “Add architecture documentation with a diagram of how the services talk to each other.”

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Codebase Analysis
  2. Documentation Generation
  3. Quality Assurance

What it can do on your machine

Read from SKILL.md and the folder at commit 35cdcab. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown, bash, python, typescript and go).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • keepachangelog.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Code Documentation Writer loads about 3.5k tokens when it runs. Until then it costs about 121 tokens; SKILL.md has 895 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~121
When it runs · the whole SKILL.md, loaded when a task matches
~3.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from bytedance/deer-flow at commit 35cdcab, republished under its MIT licence (© bytedance). 895 words, ~3,456 tokens.

Download SKILL.mdSave it as .claude/skills/code-documentation/SKILL.md (or your agent's skills folder).
name
code-documentation
description
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.

Code Documentation Skill

Overview

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.

Core Capabilities

  • Generate comprehensive README.md files with badges, installation, usage, and API reference
  • Create API reference documentation from source code analysis
  • Produce architecture and design documentation with diagrams
  • Write developer onboarding and contribution guides
  • Generate changelogs from commit history or release notes
  • Create inline code documentation following language-specific conventions
  • Support JSDoc, docstrings, GoDoc, Javadoc, and Rustdoc formats
  • Adapt documentation style to the project's language and ecosystem

When to Use This Skill

Always load this skill when:

  • User asks to "document", "create docs", or "write documentation" for any code
  • User requests a README, API reference, or developer guide
  • User shares a codebase or repository and wants documentation generated
  • User asks to improve or update existing documentation
  • User needs architecture documentation, including diagrams
  • User requests a changelog or migration guide

Documentation Workflow

Phase 1: Codebase Analysis

Before writing any documentation, thoroughly understand the codebase.

Step 1.1: Project Discovery

Identify the project fundamentals:

FieldHow to Determine
Language(s)Check file extensions, package.json, pyproject.toml, go.mod, Cargo.toml, etc.
FrameworkLook at dependencies for known frameworks (React, Django, Express, Spring, etc.)
Build SystemCheck for Makefile, CMakeLists.txt, webpack.config.js, build.gradle, etc.
Package Managernpm/yarn/pnpm, pip/uv/poetry, cargo, go modules, etc.
Project StructureMap out the directory tree to understand the architecture
Entry PointsFind main files, CLI entry points, exported modules
Existing DocsCheck for existing README, docs/, wiki, or inline documentation
Step 1.2: Code Structure Analysis

Use sandbox tools to explore the codebase:

bash
# Get directory structure
ls /mnt/user-data/uploads/project-dir/

# Read key files
read_file /mnt/user-data/uploads/project-dir/package.json
read_file /mnt/user-data/uploads/project-dir/pyproject.toml

# Search for public API surfaces
grep -r "export " /mnt/user-data/uploads/project-dir/src/
grep -r "def " /mnt/user-data/uploads/project-dir/src/ --include="*.py"
grep -r "func " /mnt/user-data/uploads/project-dir/ --include="*.go"
Step 1.3: Identify Documentation Scope

Based on analysis, determine what documentation to produce:

Project SizeRecommended Documentation
Single file / scriptInline comments + usage header
Small libraryREADME with API reference
Medium projectREADME + API docs + examples
Large projectREADME + Architecture + API + Contributing + Changelog
Phase 2: Documentation Generation
Step 2.1: README Generation

Every project needs a README. Follow this structure:

markdown
# Project Name

[One-line project description — what it does and why it matters]

[![Badge](link)](#) [![Badge](link)](#)

## Features

- [Key feature 1 — brief description]
- [Key feature 2 — brief description]
- [Key feature 3 — brief description]

## Quick Start

### Prerequisites

- [Prerequisite 1 with version requirement]
- [Prerequisite 2 with version requirement]

### Installation

[Installation commands with copy-paste-ready code blocks]

### Basic Usage

[Minimal working example that demonstrates core functionality]

## Documentation

- [Link to full API reference if separate]
- [Link to architecture docs if separate]
- [Link to examples directory if applicable]

## API Reference

[Inline API reference for smaller projects OR link to generated docs]

## Configuration

[Environment variables, config files, or runtime options]

## Examples

[2-3 practical examples covering common use cases]

## Development

### Setup

[How to set up a development environment]

### Testing

[How to run tests]

### Building

[How to build the project]

## Contributing

[Contribution guidelines or link to CONTRIBUTING.md]

## License

[License information]
Step 2.2: API Reference Generation

For each public API surface, document:

Function / Method Documentation:

markdown
### `functionName(param1, param2, options?)`

Brief description of what this function does.

**Parameters:**

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `param1` | `string` | Yes | — | Description of param1 |
| `param2` | `number` | Yes | — | Description of param2 |
| `options` | `Object` | No | `{}` | Configuration options |
| `options.timeout` | `number` | No | `5000` | Timeout in milliseconds |

**Returns:** `Promise<Result>` — Description of return value

**Throws:**
- `ValidationError` — When param1 is empty
- `TimeoutError` — When the operation exceeds the timeout

**Example:**

\`\`\`javascript
const result = await functionName("hello", 42, { timeout: 10000 });
console.log(result.data);
\`\`\`

Class Documentation:

markdown
### `ClassName`

Brief description of the class and its purpose.

**Constructor:**

\`\`\`javascript
new ClassName(config)
\`\`\`

| Parameter | Type | Description |
|-----------|------|-------------|
| `config.option1` | `string` | Description |
| `config.option2` | `boolean` | Description |

**Methods:**

- [`method1()`](#method1) — Brief description
- [`method2(param)`](#method2) — Brief description

**Properties:**

| Property | Type | Description |
|----------|------|-------------|
| `property1` | `string` | Description |
| `property2` | `number` | Read-only. Description |
Step 2.3: Architecture Documentation

For medium-to-large projects, include architecture documentation:

markdown
# Architecture Overview

## System Diagram

[Include a Mermaid diagram showing the high-level architecture]

\`\`\`mermaid
graph TD
    A[Client] --> B[API Gateway]
    B --> C[Service A]
    B --> D[Service B]
    C --> E[(Database)]
    D --> E
\`\`\`

## Component Overview

### Component Name
- **Purpose**: What this component does
- **Location**: `src/components/name/`
- **Dependencies**: What it depends on
- **Public API**: Key exports or interfaces

## Data Flow

[Describe how data flows through the system for key operations]

## Design Decisions

### Decision Title
- **Context**: What situation led to this decision
- **Decision**: What was decided
- **Rationale**: Why this approach was chosen
- **Trade-offs**: What was sacrificed
Step 2.4: Inline Code Documentation

Generate language-appropriate inline documentation:

Python (Docstrings — Google style):

python
def process_data(input_path: str, options: dict | None = None) -> ProcessResult:
    """Process data from the given file path.

    Reads the input file, applies transformations based on the provided
    options, and returns a structured result object.

    Args:
        input_path: Absolute path to the input data file.
            Supports CSV, JSON, and Parquet formats.
        options: Optional configuration dictionary.
            - "validate" (bool): Enable input validation. Defaults to True.
            - "format" (str): Output format ("json" or "csv"). Defaults to "json".

    Returns:
        A ProcessResult containing the transformed data and metadata.

    Raises:
        FileNotFoundError: If input_path does not exist.
        ValidationError: If validation is enabled and data is malformed.

    Example:
        >>> result = process_data("/data/input.csv", {"validate": True})
        >>> print(result.row_count)
        1500
    """

TypeScript (JSDoc / TSDoc):

typescript
/**
 * Fetches user data from the API and transforms it for display.
 *
 * @param userId - The unique identifier of the user
 * @param options - Configuration options for the fetch operation
 * @param options.includeProfile - Whether to include the full profile. Defaults to `false`.
 * @param options.cache - Cache duration in seconds. Set to `0` to disable.
 * @returns The transformed user data ready for rendering
 * @throws {NotFoundError} When the user ID does not exist
 * @throws {NetworkError} When the API is unreachable
 *
 * @example
 * ```ts
 * const user = await fetchUser("usr_123", { includeProfile: true });
 * console.log(user.displayName);
 * ```
 */

Go (GoDoc):

go
// ProcessData reads the input file at the given path, applies the specified
// transformations, and returns the processed result.
//
// The input path must be an absolute path to a CSV or JSON file.
// If options is nil, default options are used.
//
// ProcessData returns an error if the file does not exist or cannot be parsed.
func ProcessData(inputPath string, options *ProcessOptions) (*Result, error) {
Phase 3: Quality Assurance
Step 3.1: Documentation Completeness Check

Verify the documentation covers:

  • What it is — Clear project description that a newcomer can understand
  • Why it exists — Problem it solves and value proposition
  • How to install — Copy-paste-ready installation commands
  • How to use — At least one minimal working example
  • API surface — All public functions, classes, and types documented
  • Configuration — All environment variables, config files, and options
  • Error handling — Common errors and how to resolve them
  • Contributing — How to set up dev environment and submit changes
Step 3.2: Quality Standards
StandardCheck
AccuracyEvery code example must actually work with the described API
CompletenessNo public API surface left undocumented
ConsistencySame formatting and structure throughout
FreshnessDocumentation matches the current code, not an older version
AccessibilityNo jargon without explanation, acronyms defined on first use
ExamplesEvery complex concept has at least one practical example
Show full SKILL.md (346 more words)Show less
Step 3.3: Cross-reference Validation

Ensure:

  • All mentioned file paths exist in the project
  • All referenced functions and classes exist in the code
  • All code examples use the correct function signatures
  • Version numbers match the project's actual version
  • All links (internal and external) are valid

Documentation Style Guide

Writing Principles
  1. Lead with the "why" — Before explaining how something works, explain why it exists
  2. Progressive disclosure — Start simple, add complexity gradually
  3. Show, don't tell — Prefer code examples over lengthy explanations
  4. Active voice — "The function returns X" not "X is returned by the function"
  5. Present tense — "The server starts on port 8080" not "The server will start on port 8080"
  6. Second person — "You can configure..." not "Users can configure..."
Formatting Rules
  • Use ATX-style headers (#, ##, ###)
  • Use fenced code blocks with language specification (```python, ```bash)
  • Use tables for structured information (parameters, options, configuration)
  • Use admonitions for important notes, warnings, and tips
  • Keep line length readable (wrap prose at ~80-100 characters in source)
  • Use code formatting for function names, file paths, variable names, and CLI commands
Language-Specific Conventions
LanguageDoc FormatStyle Guide
PythonGoogle-style docstringsPEP 257
TypeScript/JavaScriptTSDoc / JSDocTypeDoc conventions
GoGoDoc commentsEffective Go
RustRustdoc (///)Rust API Guidelines
JavaJavadocOracle Javadoc Guide
C/C++DoxygenDoxygen manual

Output Handling

After generation:

  • Save documentation files to /mnt/user-data/outputs/
  • For multi-file documentation, maintain the project directory structure
  • Present generated files to the user using the present_files tool
  • Offer to iterate on specific sections or adjust the level of detail
  • Suggest additional documentation that might be valuable

Notes

  • Always analyze the actual code before writing documentation — never guess at API signatures or behavior
  • When existing documentation exists, preserve its structure unless the user explicitly asks for a rewrite
  • For large codebases, prioritize documenting the public API surface and key abstractions first
  • Documentation should be written in the same language as the project's existing docs; default to English if none exist
  • When generating changelogs, use the Keep a Changelog format
  • This skill works well in combination with the deep-research skill for documenting third-party integrations or dependencies

© bytedance, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/public/code-documentation of bytedance/deer-flow.

Open the folder on GitHubat commit 35cdcab

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in bytedance/deer-flow, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Code Documentation Writer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Code Documentation Writer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Code Documentation Writer this skillbytedance/deer-flow83k1 repos~3.5kAutomated safety check: PassMIT
Release Documentation Auditgarrytan/gstack136k—~9.5kAutomated safety check: NotesMIT
Docs Interfacesjh941213/my-cc-harness126—~863Automated safety check: NotesNone
Technical Writingcitypaul/.dotfiles739—~2.5kAutomated safety check: PassMIT
Diagram Designcathrynlavery/diagram-design44k1 repos~7.5kAutomated safety check: PassMIT
Simple Englishmoeru-ai/airi50k2 repos~4.6kAutomated safety check: PassMIT

Similar skills

  • Audits project docs against what shipped, updating README, ARCHITECTURE, CONTRIBUTING and CLAUDE.md, tidying the changelog and listing documentation debt in the PR.

    136k GitHub stars~9.5k tokensUpdated today
    DevelopmentAuto-check: notes
  • Docs Interfaces

    jh941213/my-cc-harness

    Generate interface/API docs — OpenAPI 3.1/AsyncAPI 3.0 specs, API topology diagrams, interface flow (sequence) diagrams, API changelog.

    126 GitHub stars~863 tokensUpdated 2 mo ago
    Backend & APIsAuto-check: notes
  • Technical Writing

    citypaul/.dotfiles

    Writing developer-facing prose that can be skimmed first and trusted enough to finish — READMEs, guides, tutorials, reference docs, proposals, PR descriptions, release notes.

    739 GitHub stars~2.5k tokensUpdated 5 days ago
    Writing & ContentAuto-check passed
  • Diagram Design

    cathrynlavery/diagram-design

    Creates branded diagrams, from architecture, flowchart and sequence to charts and maps, as self-contained HTML with inline SVG, with import from draw.io, Mermaid and Excalidraw.

    44k GitHub starsUsed in 1 repo~7.5k tokens
    DevelopmentAuto-check passed
  • Simple English

    moeru-ai/airi

    Write or rewrite technical text with the rules of ASD-STE100 Simplified Technical English so it is clear, unambiguous, and free of AI slop.

    50k GitHub starsUsed in 2 repos~4.6k tokens
    DevelopmentAuto-check passed
  • Draw.io Diagram Studio

    Agents365-ai/drawio-skill

    Creates and edits editable draw.io diagrams from descriptions, code, infrastructure files, SQL and API schemas, with sync, review, test and export tools.

    10k GitHub stars~2.4k tokensUpdated 5 days ago
    DevelopmentAuto-check: notes

More from bytedance/deer-flow

All 23 skills in this repo
  • Vercel Deploy

    bytedance/deer-flow

    Deploys a project to Vercel with one script and no login, then returns a live preview URL and a claim link for moving the deployment into your own Vercel account.

    83k GitHub starsUsed in 10 repos~797 tokens
    Auto-check passed
  • Chart Visualization

    bytedance/deer-flow

    Picks a suitable chart type from 26 options for your data, maps the data to that chart's parameters and generates a chart image through a JavaScript script.

    83k GitHub starsUsed in 2 repos~840 tokens
    Auto-check passed
  • GitHub Deep Research

    bytedance/deer-flow

    Researches a GitHub repository over four rounds using the GitHub API and web search, then writes a structured markdown report with timeline, metrics and Mermaid diagrams.

    83k GitHub starsUsed in 5 repos~1.3k tokens
    Auto-check passed
  • Structured Image Generation

    bytedance/deer-flow

    Turns an image request into a structured JSON prompt and runs a bundled Python script to generate the picture, optionally guided by reference images.

    83k GitHub starsUsed in 5 repos~2.9k tokens
    Auto-check passed
  • Excel and CSV Data Analysis

    bytedance/deer-flow

    Analyzes uploaded Excel and CSV files with SQL through DuckDB, producing schema inspections, statistical summaries and exports to CSV, JSON or Markdown.

    83k GitHub starsUsed in 4 repos~2.2k tokens
    Auto-check passed
  • DeerFlow Smoke Test

    bytedance/deer-flow

    Walks through an end-to-end smoke test of a DeerFlow deployment: pull the latest code, deploy with Docker or locally, verify services, run health checks and write a report.

    83k GitHub stars~2.5k tokensUpdated today
    Auto-check: notes

Categories

Questions about Code Documentation Writer

What does Code Documentation Writer do?

Writes READMEs, API references, architecture notes, developer guides, changelogs and inline comments after first mapping the codebase. toml`, the frameworks in the dependencies, the build system and package manager, the directory layout, entry points and any docs already present. That survey decides how large the documentation should be, from a single README up to a set of linked guides.

When should I use Code Documentation Writer?

Code Documentation Writer fits situations like: creating a README for a repository that has none; generating API reference pages from the source of a library; adding docstrings or JSDoc comments across a module; writing a contribution or onboarding guide for new developers.

How do I install Code Documentation Writer in Claude Code?

Run `npx skills add bytedance/deer-flow --skill code-documentation -a claude-code`. Or copy the skill folder (skills/public/code-documentation in bytedance/deer-flow) into .claude/skills/code-documentation in your project. Claude Code loads it when a task matches its description.

How do I install Code Documentation Writer in Codex?

Run `npx skills add bytedance/deer-flow --skill code-documentation -a codex`. Or copy the skill folder (skills/public/code-documentation in bytedance/deer-flow) into .agents/skills/code-documentation in your project. Codex loads it when a task matches its description.

Can I use Code Documentation Writer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add bytedance/deer-flow --skill code-documentation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/code-documentation, .gemini/skills/code-documentation, .github/skills/code-documentation and .opencode/skills/code-documentation in your project.

What does Code Documentation Writer need to run?

SKILL.md names no scripts, command-line tools or credentials: Code Documentation Writer is instructions for the agent only.

Does Code Documentation Writer access the network?

SKILL.md names 1 domain. As links in the text: keepachangelog.com. This is read from the text; nothing was executed.

Is Code Documentation Writer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Code Documentation Writer use?

Code Documentation Writer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Code Documentation Writer use?

About 3.5k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Code Documentation Writer?

Skills that share tags, products or a category with Code Documentation Writer: Release Documentation Audit (garrytan/gstack, 136k stars), Docs Interfaces (jh941213/my-cc-harness, 126 stars), Technical Writing (citypaul/.dotfiles, 739 stars) and Diagram Design (cathrynlavery/diagram-design, 44k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Code Documentation Writer?

bytedance (a GitHub organization) maintains it in bytedance/deer-flow, which has 83,441 GitHub stars. The repository holds 23 skills in this directory. The repository was last updated on October 7, 2026.

Source: bytedance/deer-flow on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.