Get the FREE Ultimate OpenClaw Setup Guide →

add-documentation

npx machina-cli add skill gologo13/agent-skills/add-documentation --openclaw
Files (1)
SKILL.md
1.6 KB

Add Documentation

Overview

Add comprehensive documentation for the current code/feature and format it according to the project's documentation standards, including it in the appropriate location (README, docs folder, or inline comments).

Steps

  1. Overview
    • What this code/feature does
    • Why it exists and its purpose
    • Key concepts and terminology
  2. API Documentation
    • Function/method signatures
    • Parameters and return values
    • Example usage with code snippets
    • Error handling and edge cases
  3. Implementation Details
    • Architecture overview
    • Important design decisions
    • Dependencies and integrations
  4. Examples
    • Common use cases with full examples
    • Best practices and patterns
    • Common pitfalls to avoid

Add Documentation Checklist

  • Explained what this code/feature does
  • Documented why it exists and its purpose
  • Defined key concepts and terminology
  • Documented function/method signatures
  • Documented parameters and return values
  • Included example usage with code snippets
  • Documented error handling and edge cases
  • Provided architecture overview
  • Documented important design decisions
  • Included common use cases with full examples
  • Documented best practices and patterns
  • Documented common pitfalls to avoid

Source

git clone https://github.com/gologo13/agent-skills/blob/main/skills/add-documentation/SKILL.mdView on GitHub

Overview

This skill generates comprehensive documentation for the current code or feature, formatted to project standards and placed in the appropriate location (README, docs folder, or inline comments). It covers an overview, API details, implementation insights, examples, and a completion checklist to ensure consistency and maintainability.

How This Skill Works

The skill analyzes the target code or feature, extracts key details such as function signatures, parameters, return values, usage examples, errors, and architecture notes, then assembles them into standard sections (Overview, API Documentation, Implementation Details, Examples, Checklist). It formats content to match project documentation standards and outputs publish-ready content.

When to Use It

  • Before releasing a new feature to ensure complete documentation.
  • When API changes occur (signatures, parameters, return values, or errors).
  • During onboarding or handover to new team members.
  • To document complex architecture, dependencies, and design decisions.
  • When addressing technical debt and improving overall docs quality.

Quick Start

  1. Step 1: Gather code, tests, and any existing docs for the target feature.
  2. Step 2: Write sections (Overview, API Documentation, Implementation Details, Examples, Checklist) and add code snippets.
  3. Step 3: Validate against project standards and publish to the appropriate docs location.

Best Practices

  • Follow the project's documentation standards and structure.
  • Document function/method signatures, parameters, and return values.
  • Include working code examples and usage snippets.
  • Capture architecture decisions, dependencies, and error handling.
  • Review and keep documentation up to date with code changes.

Example Use Cases

  • Documenting a new REST API endpoint with request/response schemas and error codes.
  • Annotating a library function with parameter types, return values, and edge-case examples.
  • Generating inline docs for a core feature that integrates with external services.
  • Adding error-handling paths and failure modes to the documentation.
  • Updating a module README to reflect API changes and usage patterns.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers