Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
skillcreatorai avatar

Code Documentation

  • 502 installs
  • 1.1k repo stars
  • Updated May 5, 2026
  • skillcreatorai/ai-agent-skills

code-documentation is an agent skill that generates consistent API references, README files, inline comments, and developer guides from existing source code for developers who need maintainable technical documentation wi

About

code-documentation is a Documentation skill (version 4.1.0, MIT, sourced from wshobson/agents) that teaches agents how to write effective project documentation from live code. The skill ships a standard README template with Quick Start, Installation, Usage, and API Reference sections, plus patterns for inline comments and technical guides. Agents apply the templates to produce markdown API docs, README files, and developer-facing guides that match common open-source conventions. Developers reach for code-documentation when onboarding contributors, publishing package docs, or backfilling documentation debt on APIs, libraries, and services where comments and READMEs have drifted from the implementation.

  • Generates complete READMEs using the provided standard template structure
  • Produces JSDoc/TSDoc style comments with parameters, returns, throws, and examples
  • Creates detailed API reference sections with function signatures and usage examples
  • Outputs configuration tables and contributing guidelines automatically
  • Maintains consistent documentation tone and formatting across large codebases

Code Documentation by the numbers

  • 502 all-time installs (skills.sh)
  • +6 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #387 of 1,879 Documentation skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/skillcreatorai/ai-agent-skills --skill code-documentation

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs502
repo stars1.1k
Last updatedMay 5, 2026
Repositoryskillcreatorai/ai-agent-skills

How do you generate API docs and READMEs from code?

Generate consistent, high-quality API references, READMEs, inline comments, and developer guides from existing code.

Who is it for?

Developers documenting APIs, libraries, or services who want agents to produce consistent README and reference material from existing source files.

Skip if: Teams that only need auto-generated OpenAPI or JSDoc HTML sites without narrative README or guide content should use dedicated doc generators instead.

When should I use this skill?

A developer asks to document a codebase, write or update a README, generate API reference sections, or add inline comments and technical guides.

What you get

Structured README markdown, API reference sections with typed signatures, inline code comments, and developer guide documents aligned to a standard template.

  • README markdown
  • API reference sections
  • Developer guide documents

By the numbers

  • Version 4.1.0
  • README template includes 4 core sections: Quick Start, Installation, Usage, API Reference

Files

SKILL.mdMarkdownGitHub ↗

Code Documentation

README Structure

Standard README Template

# Project Name

Brief description of what this project does.

## Quick Start

\`\`\`bash
npm install
npm run dev
\`\`\`

## Installation

Detailed installation instructions...

## Usage

\`\`\`typescript
import { something } from 'project';

// Example usage
const result = something.doThing();
\`\`\`

## API Reference

### `functionName(param: Type): ReturnType`

Description of what the function does.

**Parameters:**
- `param` - Description of parameter

**Returns:** Description of return value

**Example:**
\`\`\`typescript
const result = functionName('value');
\`\`\`

## Configuration

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `option1` | `string` | `'default'` | What it does |

## Contributing

How to contribute...

## License

MIT

API Documentation

JSDoc/TSDoc Style

/**
 * Creates a new user account.
 *
 * @param userData - The user data for account creation
 * @param options - Optional configuration
 * @returns The created user object
 * @throws {ValidationError} If email is invalid
 * @example
 * ```ts
 * const user = await createUser({
 *   email: 'user@example.com',
 *   name: 'John'
 * });
 * ```
 */
async function createUser(
  userData: UserInput,
  options?: CreateOptions
): Promise<User> {
  // Implementation
}

/**
 * Configuration options for the API client.
 */
interface ClientConfig {
  /** The API base URL */
  baseUrl: string;
  /** Request timeout in milliseconds @default 5000 */
  timeout?: number;
  /** Custom headers to include in requests */
  headers?: Record<string, string>;
}

OpenAPI/Swagger

openapi: 3.0.0
info:
  title: My API
  version: 1.0.0

paths:
  /users:
    post:
      summary: Create a user
      description: Creates a new user account
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserInput'
      responses:
        '201':
          description: User created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '400':
          description: Invalid input

components:
  schemas:
    UserInput:
      type: object
      required:
        - email
        - name
      properties:
        email:
          type: string
          format: email
        name:
          type: string
    User:
      type: object
      properties:
        id:
          type: string
        email:
          type: string
        name:
          type: string
        createdAt:
          type: string
          format: date-time

Inline Comments

When to Comment

// GOOD: Explain WHY, not WHAT

// Use binary search because the list is always sorted and
// can contain millions of items - O(log n) vs O(n)
const index = binarySearch(items, target);

// GOOD: Explain complex business logic
// Users get 20% discount if they've been members for 2+ years
// AND have made 10+ purchases (per marketing team decision Q4 2024)
if (user.memberYears >= 2 && user.purchaseCount >= 10) {
  applyDiscount(0.2);
}

// GOOD: Document workarounds
// HACK: Safari doesn't support this API, fallback to polling
// TODO: Remove when Safari adds support (tracking: webkit.org/b/12345)
if (!window.IntersectionObserver) {
  startPolling();
}

When NOT to Comment

// BAD: Stating the obvious
// Increment counter by 1
counter++;

// BAD: Explaining clear code
// Check if user is admin
if (user.role === 'admin') { ... }

// BAD: Outdated comments (worse than no comment)
// Returns the user's full name  <-- Actually returns email now!
function getUserIdentifier(user) {
  return user.email;
}

Architecture Documentation

ADR (Architecture Decision Record)

# ADR-001: Use PostgreSQL for Primary Database

## Status
Accepted

## Context
We need a database for storing user data and transactions.
Options considered: PostgreSQL, MySQL, MongoDB, DynamoDB.

## Decision
Use PostgreSQL with Supabase hosting.

## Rationale
- Strong ACID compliance needed for financial data
- Team has PostgreSQL experience
- Supabase provides auth and realtime features
- pgvector extension for future AI features

## Consequences
- Need to manage schema migrations
- May need read replicas for scale
- Team needs to learn Supabase-specific features

Component Documentation

## Authentication Module

### Overview
Handles user authentication using JWT tokens with refresh rotation.

### Flow
1. User submits credentials to `/auth/login`
2. Server validates and returns access + refresh tokens
3. Access token used for API requests (15min expiry)
4. Refresh token used to get new access token (7d expiry)

### Dependencies
- `jsonwebtoken` - Token generation/validation
- `bcrypt` - Password hashing
- `redis` - Refresh token storage

### Configuration
- `JWT_SECRET` - Secret for signing tokens
- `ACCESS_TOKEN_EXPIRY` - Access token lifetime
- `REFRESH_TOKEN_EXPIRY` - Refresh token lifetime

Documentation Principles

1. Write for your audience - New devs vs API consumers 2. Keep it close to code - Docs in same repo, near relevant code 3. Update with code - Stale docs are worse than none 4. Examples over explanations - Show, don't just tell 5. Progressive disclosure - Quick start first, details later

Related skills

How it compares

Pick code-documentation when you need narrative README and guide content drafted from code, not just schema-driven OpenAPI or static-site generator output.

FAQ

What documentation types does code-documentation cover?

code-documentation covers API references, README files, inline comments, and technical developer guides. The skill provides a standard README template with Quick Start, Installation, Usage, and API Reference sections agents fill from source code.

What version is the code-documentation skill?

code-documentation is version 4.1.0, licensed MIT, and sourced from wshobson/agents. Agents apply its README structure and API reference patterns when documenting codebases, APIs, or writing developer guides.

Documentationdocsintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.