Prompt lesson · 16 prompts
Documentation Best Practices prompts for Software Developers
16 ready-to-use prompts from our AI for Software Developers course. Copy one, fill in the {{placeholders}}, and paste it into ChatGPT, Claude, Gemini or any other AI.
API Documentation Generation
Use this when you need to create or improve API documentation that clearly explains endpoints, request/response formats, and usage examples for developers.
Role You are a technical writer specializing in API documentation. Your goal is to produce clear, developer-friendly documentation that reduces integration time and support requests.
Context you provide
- {{api_name}}: The name of the API.
- {{endpoint}}: The specific endpoint to document (e.g., GET /users).
- {{auth_method}}: Authentication method (e.g., OAuth2, API key).
- {{sample_request}}: An example request (curl or code snippet).
- {{sample_response}}: An example response (JSON or XML).
- {{error_codes}}: Common error codes and their meanings.
Instructions
- If any inputs are missing, ask for them before starting.
- For the given endpoint, document the URL, HTTP method, required and optional parameters, and authentication requirements.
- Provide a clear explanation of the request and response formats, including data types and possible error codes.
- Include at least one realistic usage example with input and output.
- Follow best practices: use consistent formatting, include code blocks, and highlight edge cases.
- Suggest how to keep the documentation up to date with API changes.
Output format A structured document with sections for Endpoint, Request, Response, Error Codes, and Example Usage. Use tables and code blocks for clarity. Tone should be concise and technical.
Guardrails
- Do not invent endpoints or parameters; use only provided information.
- Flag any assumptions about authentication or data formats.
- Stay focused on the API documentation; do not include unrelated marketing content.
Example API: User Service; Endpoint: GET /users/{id}; Auth: Bearer token; Sample request: curl -H "Authorization: Bearer token" https://api.example.com/users/123; Sample response: {"id":123,"name":"John Doe"}; Error codes: 404, 401.
Open this prompt Writing · Intermediate
Code Commenting Conventions
Use this when you need to establish or refine best practices for writing clear and effective comments in your codebase.
Role You are a software engineering coach and code quality expert. Your goal is to help developers write comments that enhance code readability and maintainability without adding noise.
Context you provide
- {{language}}: The programming language(s) used.
- {{codebase_type}}: The type of codebase (e.g., web app, library, microservices).
- {{team_size}}: The size of the development team.
- {{existing_style}}: Any existing commenting style or guidelines.
- {{challenging_areas}}: Specific areas where comments are needed (e.g., complex algorithms, business logic).
Instructions
- If any inputs are missing, ask for them before proceeding.
- Explain the key reasons for using comments, with examples of situations where they significantly enhance understanding.
- Provide best practices for comment length, tone, and formatting to improve readability.
- Describe different comment types (single-line, multi-line, docstrings) and when to use each, especially in larger codebases.
- Offer guidelines for maintaining consistency across the team, including strategies for organizing comments within functions or classes.
- Suggest tools or practices to enforce commenting standards automatically.
Output format A structured guide with sections for Why Comment, Best Practices, Comment Types, Consistency Guidelines, and Enforcement Tools. Use bullet points and code examples. Tone should be instructive and practical.
Guardrails
- Do not invent language-specific syntax; use generic examples or ask for the language.
- Flag any assumptions about team workflow or tools.
- Stay focused on commenting conventions; do not cover broader coding standards unless relevant.
Example Language: Python; Codebase type: web app; Team size: 10; Existing style: minimal comments; Challenging areas: data processing pipelines.
Open this prompt Writing · Intermediate
Code Structure Documentation
Use this when you need to document the high-level architecture and organization of a codebase to help developers navigate and understand it.
Open this prompt Writing · Intermediate
Coding Standards Documentation
Use this when you need to document coding standards and conventions for a codebase, including naming, organization, and review guidelines.
Open this prompt Writing · Intermediate
Create Troubleshooting Guides
Use this when you need to document common issues and their solutions to help developers and users resolve problems efficiently.
Open this prompt Writing · Beginner
Design Interactive Documentation
Use this when you want to plan or improve interactive documentation that lets users try code examples and see immediate results.
Open this prompt Planning · Intermediate
Document Deployment Processes
Use this when you need to create or update step-by-step documentation for deploying software, including server configurations, scripts, and environment variables.
Open this prompt Writing · Intermediate
Document Error Handling Best Practices
Use this when you need to create or improve documentation for error handling in your software, including error codes, messages, and resolution strategies.
Open this prompt Writing · Intermediate
Document Function Return Values
Use this when you need to create or improve documentation for function return values, including data types, errors, and additional context.
Open this prompt Writing · Intermediate
Document Performance Optimizations
Use this when you need to document performance optimizations in your codebase, including techniques, their impact, and trade-offs.
Open this prompt Writing · Advanced
Document Security Measures
Use this when you need to create or update documentation of security measures in your software, such as authentication, encryption, and secure coding practices.
Open this prompt Writing · Intermediate
Document Software Dependencies
Use this when you need to create or update clear documentation of all software dependencies, including libraries, frameworks, and external services.
Open this prompt Writing · Intermediate
Document Version Control Practices
Use this when you need to explain or create guidelines for documenting changes in a codebase using version control systems like Git.
Open this prompt Writing · Beginner
Integrate Documentation with Git
Use this when you need to set up version control for documentation files, track changes, and manage revisions effectively.
Open this prompt Planning · Intermediate
Standardize Documentation Templates
Use this when you need to create or customize standardized templates for different types of documentation, such as API references, user guides, or release notes.
Open this prompt Creating · Intermediate
Write Clear Software User Guides
Use this when you need user-friendly documentation, tutorials, or troubleshooting guides for a software application.
Open this prompt Creating · Intermediate