Agent skill

documentation-templates

Generates README files, API documentation, and inline code comments following best practices. Use when creating project documentation, writing READMEs, documenting APIs, or explaining complex code.

Stars 9
Forks 1

Install this agent skill to your Project

npx add-skill https://github.com/benshapyro/cadre-devkit-claude/tree/main/skills/documentation-templates

SKILL.md

Documentation Templates Skill

Create clear, maintainable documentation for projects and code.

Resources

For full templates, see:

  • references/readme-template.md - Complete README template
  • references/api-docs-template.md - API documentation template

Core Principles

  1. Explain Why, Not What - Code shows what; docs explain why
  2. Keep it Updated - Outdated docs are worse than no docs
  3. Write for Humans - Clear, concise, jargon-free
  4. Progressive Disclosure - Start simple, provide details on demand
  5. Examples are King - Show, don't just tell

README Quick Structure

markdown
# Project Name
Brief description (1-2 sentences)

## Features
## Prerequisites
## Installation
## Configuration
## Usage
## Development
## Deployment
## Contributing
## License

Function Documentation

TypeScript (JSDoc)

typescript
/**
 * Fetches user data from the database.
 *
 * @param userId - The unique identifier of the user
 * @returns Promise resolving to the user object
 * @throws {NotFoundError} If user doesn't exist
 *
 * @example
 * const user = await fetchUserData('123');
 */
async function fetchUserData(userId: string): Promise<User> {
  // ...
}

Python (Docstring)

python
def fetch_user_data(user_id: str) -> User:
    """
    Fetch user data from the database.

    Args:
        user_id: The unique identifier of the user.

    Returns:
        User object containing user data.

    Raises:
        NotFoundError: If user doesn't exist.

    Example:
        >>> user = fetch_user_data('123')
    """

Inline Comments

typescript
// BAD: Obvious
// Increment counter
counter++;

// GOOD: Explain why
// Increment before checking because first request counts
counter++;

// Cache disabled for premium users after stale data issue (INC-5678)
if (!user.isPremium) {
  cache.set(key, value);
}

Architecture Decision Record (ADR)

markdown
# ADR-001: Use PostgreSQL for Primary Database

## Status
Accepted

## Context
We need ACID transactions, complex queries, strong consistency.

## Decision
Use PostgreSQL as the primary database.

## Consequences
**Positive:** ACID compliance, rich queries, strong ecosystem
**Negative:** Horizontal scaling requires more effort

Best Practices

Do

  • Start with clear, one-sentence description
  • Include practical examples
  • Document "why" decisions were made
  • Keep documentation close to code
  • Update docs when code changes

Don't

  • Write obvious comments
  • Let docs get out of sync
  • Use jargon without explanation
  • Skip examples
  • Document implementation details that change often

Documentation Checklist

  • Clear project description
  • Installation instructions work
  • Environment variables documented
  • API endpoints with examples
  • Common errors and solutions
  • Examples are runnable
  • No sensitive information exposed

Good documentation saves hours of debugging. Write for the developer who joins in 6 months.


Version

  • v1.1.0 (2025-12-05): Added allowed-tools restriction, enriched trigger keywords
  • v1.0.0 (2025-11-15): Initial version

Expand your agent's capabilities with these related and highly-rated skills.

benshapyro/cadre-devkit-claude

product-discovery

Methodology for discovering and specifying new software products. Use when starting greenfield projects, exploring new ideas, or defining MVP scope.

9 1
Explore
benshapyro/cadre-devkit-claude

error-handler

Provides battle-tested error handling patterns for TypeScript and Python. Use when implementing error handling, creating try/catch blocks, or handling exceptions.

9 1
Explore
benshapyro/cadre-devkit-claude

test-generator

Generates Jest or Pytest tests following Ben's testing standards. Use when creating tests, adding test coverage, writing unit tests, mocking dependencies, or when user mentions testing, test cases, Jest, Pytest, fixtures, assertions, or coverage.

9 1
Explore
benshapyro/cadre-devkit-claude

react-patterns

Modern React patterns for TypeScript applications including hooks, state management, and component composition. Use when building React components, managing state, or implementing React best practices.

9 1
Explore
benshapyro/cadre-devkit-claude

code-formatter

Formats code according to Ben's style guidelines for TypeScript, Python, and general best practices. Use when formatting code, fixing linting issues, checking naming conventions, organizing imports, or when user mentions formatting, style, linting, Prettier, Black, or ESLint.

9 1
Explore
benshapyro/cadre-devkit-claude

frontend-design

Create distinctive, memorable user interfaces that avoid generic AI aesthetics. Use when designing UI/UX, planning visual direction, or building pages and layouts.

9 1
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results