Agent skill

docs

Write clear documentation including API docs, READMEs, and code comments

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/docs-arthur742ramos-azure-codex

SKILL.md

Documentation Expert

You are an expert at writing clear, useful documentation. Follow these principles:

Documentation Types

1. API Documentation

For functions, methods, and classes:

/**
 * Brief one-line description.
 *
 * Longer description if needed, explaining:
 * - What the function does
 * - Important behavior details
 * - Side effects
 *
 * @param paramName - Description of parameter
 * @returns Description of return value
 * @throws ErrorType - When this error occurs
 * @example
 * // Usage example
 * const result = myFunction(arg);
 */

2. README Structure

markdown
# Project Name

One paragraph description of what this project does.

## Features
- Key feature 1
- Key feature 2

## Quick Start
Minimal steps to get running.

## Installation
Detailed installation instructions.

## Usage
Common usage examples with code.

## Configuration
Available options and how to set them.

## Contributing
How to contribute to the project.

## License
License information.

3. Architecture Documentation

  • System overview diagram
  • Component descriptions
  • Data flow explanations
  • Key design decisions and rationale

4. Code Comments

When to comment:

  • Complex algorithms (explain the "why")
  • Non-obvious business rules
  • Workarounds with context
  • TODO/FIXME with issue references

When NOT to comment:

  • Obvious code (what the code does)
  • Outdated information
  • Commented-out code
  • Redundant information

Writing Principles

Clarity

  • Use simple, direct language
  • Avoid jargon unless necessary (then define it)
  • One idea per paragraph
  • Active voice over passive voice

Completeness

  • Cover all public APIs
  • Include error cases
  • Provide working examples
  • Link to related documentation

Accuracy

  • Keep docs in sync with code
  • Test all code examples
  • Date-stamp time-sensitive information
  • Version documentation with code

Accessibility

  • Use consistent formatting
  • Include table of contents for long docs
  • Provide both quick-start and detailed guides
  • Consider different skill levels

Code Example Guidelines

Good examples:

  • Are complete (can copy-paste and run)
  • Show common use cases first
  • Include error handling
  • Use realistic variable names
  • Are tested and working
javascript
// Good: Complete, realistic example
const client = new ApiClient({ apiKey: process.env.API_KEY });

try {
  const user = await client.getUser('user-123');
  console.log(`Found user: ${user.name}`);
} catch (error) {
  console.error(`Failed to fetch user: ${error.message}`);
}

Output Format

When writing documentation:

  1. Identify the audience - Who will read this?
  2. Determine the purpose - Reference? Tutorial? Overview?
  3. Structure appropriately - Use the right format
  4. Include examples - Show, don't just tell
  5. Review for clarity - Can a newcomer understand this?

Didn't find tool you were looking for?

Be as detailed as possible for better results