Good documentation makes code usable. These prompts help you generate professional docs without the pain of writing them from scratch.
README Files
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.
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 to these functions:
[paste JavaScript code]
Include @param, @returns, @example, and @throws where appropriate. Keep descriptions concise but informative.
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
Add Google-style docstrings to these Python functions:
[paste Python code]
Include Args, Returns, Raises sections. Add usage examples for complex functions.
API Documentation
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.
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
Write a CHANGELOG entry for version [version number].
Changes made:
[list your changes]
Format using Keep a Changelog style (Added, Changed, Fixed, Removed sections).
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
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