Skip to content

Best-practice guide for documenting APIs and code interfaces, with per-language docstring examples.

CCM score
51 of 100
skills.sh installs
409
GitHub stars
79
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers core documentation principles, function and method docs, endpoint specs, class and module docs, and README structure
  • Includes docstring and JSDoc samples for Python, JavaScript, and Go, plus OpenAPI and GraphQL schemas
  • Lists documentation anti-patterns such as redundant comments and outdated docs that drift from code
  • Designed for agents writing or reviewing docs alongside code changes

Install

$ npx -y skills add bobmatnyc/claude-mpm-skills --skill api-documentation -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

API Documentation

Best practices for documenting APIs and code interfaces. Eliminates ~100-150 lines of redundant documentation guidance per agent.

Core Documentation Principles

  1. Document the why, not just the what - Explain intent and rationale
  2. Keep docs close to code - Inline documentation stays synchronized
  3. Document contracts, not implementation - Focus on behavior
  4. Examples are essential - Show real usage
  5. Update docs with code - Outdated docs are worse than no docs

Function/Method Documentation

Python (Docstrings)

def calculate_discount(price: float, discount_percent: float) -> float:
    """
    Calculate discounted price with percentage off.

    Args:
        price: Original price in dollars (must be positive)
        discount_percent: Discount percentage (0-100)

    Returns:
        Final price after discount, rounded to 2 decimals

    Raises:
        ValueError: If price is negative or discount > 100

    Examples:
        >>> calculate_discount(100.0, 20.0)
        80.0
        >>> calculate_discount(50.0, 50.0)
        25.0

Details

Repository
github.com/bobmatnyc/claude-mpm-skills
Category
Technical Documentation
First seen
Jun 3, 2026

Questions

What does the api-documentation skill do?

The api-documentation skill gives Claude Code best practices for documenting APIs and code interfaces. It covers docstrings and JSDoc comments, OpenAPI and GraphQL endpoint docs, class and module docs, and README structure, and it focuses on documenting the why and the contracts rather than the implementation.

How do I install the api-documentation skill?

Run npx -y skills add bobmatnyc/claude-mpm-skills --skill api-documentation -y in a project to install it. After that, the api-documentation skill is available to the agent in that project.

Which category does api-documentation belong to and what sets it apart?

The api-documentation skill is listed under Technical Documentation on Claude Marketplaces. Within that category it stands out by covering Python docstrings, JavaScript JSDoc, Go godoc, OpenAPI and GraphQL side by side, along with anti-pattern examples for redundant and outdated comments.

Is the api-documentation skill meant for a specific language or framework?

The api-documentation skill is not tied to one language. Its examples cover Python, JavaScript and Go, and it also covers REST and GraphQL interface documentation, so it suits API work in several stacks.

More from bobmatnyc/claude-mpm-skills

All 154

Similar to Api Documentation

More Technical Documentation