← Back to AI Resources
📝

AI Prompts for Documentation

Generate READMEs, comments, and docs

Good documentation makes code usable. These prompts help you generate professional docs without the pain of writing them from scratch.

README Files

Full README from Code
Generate a comprehensive README.md for this project: Project name: [name] Main code file: [paste main code] Include: - Project description - Features list - Installation instructions - Usage examples - Configuration options (if any) - License section Format it as proper Markdown.
Quick README
Create a minimal README.md for a [type of project, e.g., "React component" or "CLI tool"]. It does: [one sentence description] Just include: description, install command, one usage example. Keep it short.

Code Comments

Add JSDoc Comments
Add JSDoc comments to these functions: [paste JavaScript code] Include @param, @returns, @example, and @throws where appropriate. Keep descriptions concise but informative.
Inline Comments
Add helpful inline comments to this code: [paste code] Guidelines: - Comment the "why", not the "what" - Explain non-obvious logic - Don't over-comment obvious things - Keep comments short
Python Docstrings
Add Google-style docstrings to these Python functions: [paste Python code] Include Args, Returns, Raises sections. Add usage examples for complex functions.
Pro tip: Always review and edit AI-generated docs. They might miss context or add incorrect assumptions about your code.

API Documentation

API Endpoint Docs
Document this API endpoint: [paste route handler code] Create docs including: - Endpoint URL and method - Description - Request parameters/body - Response format with example - Possible error responses - Authentication requirements (if any) Format as Markdown.
OpenAPI/Swagger
Generate OpenAPI 3.0 specification for this endpoint: [paste route handler code] Include request/response schemas, parameters, and example values. Output as YAML.

Other Documentation

CHANGELOG Entry
Write a CHANGELOG entry for version [version number]. Changes made: [list your changes] Format using Keep a Changelog style (Added, Changed, Fixed, Removed sections).
Contributing Guide
Write a CONTRIBUTING.md file for a [type of project] project. Tech stack: [languages/frameworks used] Include: - How to set up dev environment - Code style guidelines - How to submit issues - PR process - Code of conduct summary
Component Documentation
Document this React component: [paste component code] Include: - What the component does - Props table (name, type, default, description) - Usage examples (basic and advanced) - Notes on styling/customization