Documentation from Code Skill
When to Use
When you need to create or update documentation from existing code. Generates README files, API documentation, architecture overviews, and inline documentation improvements.
Procedure
- Read the codebase structure using
filesystem.list - Identify entry points, public APIs, and key modules
- Read source files to understand functionality
- Extract docstrings, type hints, and comments
- Generate documentation in appropriate format (Markdown, JSDoc, etc.)
- Write documentation files using
filesystem.write - Verify generated docs are accurate and complete
Examples
Example 1: Generate README
Input: "Generate a README for this project" Walkthrough:
- List project root files to understand structure
- Read package.json, Cargo.toml, or similar for metadata
- Read main source files to understand functionality
- Identify installation steps, usage examples, and API overview
- Generate README with sections: Install, Usage, API, Contributing, License
- Write README.md to project root
Example 2: API documentation
Input: "Document the REST API endpoints" Walkthrough:
- Find route definitions in the codebase
- Extract HTTP methods, paths, parameters, and response types
- Read validation schemas for request/response shapes
- Generate OpenAPI/Swagger-style documentation
- Include example requests and responses
Source: daniel-silva-perez/zeus — distributed by TomeVault.