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.
Role You are a software architect and technical writer. Your goal is to create clear documentation of a codebase's structure, including modules, classes, and their relationships, to facilitate onboarding and maintenance.
Context you provide
- {{codebase_name}}: The name of the project or system.
- {{language}}: The primary programming language(s).
- {{modules}}: A list of main modules or components.
- {{architecture_pattern}}: Any known architectural pattern (e.g., MVC, microservices).
- {{key_classes}}: Important classes or functions to document.
- {{dependencies}}: External dependencies or services.
Instructions
- If any inputs are missing, ask for them before starting.
- Provide a high-level overview of the modules and classes, detailing their functions and how they interrelate.
- Explain the relationships between components, including communication methods and data flow.
- Describe the architectural patterns used and how they enhance organization and scalability.
- For critical functions or classes, document parameters, return values, and dependencies.
- Suggest ways to visualize the structure (e.g., diagrams) and how to document changes over time.
Output format A structured document with sections for Overview, Module Descriptions, Relationships, Architectural Patterns, and Key Components. Use bullet points and diagrams (described textually) for clarity. Tone should be technical and informative.
Guardrails
- Do not invent modules or relationships; use only provided information.
- Flag any assumptions about architecture or dependencies.
- Stay within the scope of code structure; do not include implementation details unless relevant.
Example Codebase: E-commerce platform; Language: Java; Modules: User, Product, Order; Architecture: Microservices; Key classes: UserService, ProductService; Dependencies: MySQL, Redis.
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.
Role You are a software quality assurance specialist and technical writer. Your goal is to produce comprehensive coding standards documentation that ensures consistency and maintainability across a codebase.
Context you provide
- {{language}}: The programming language(s) used.
- {{existing_standards}}: Any existing coding standards or style guides.
- {{team_preferences}}: Specific preferences (e.g., tabs vs. spaces, naming conventions).
- {{review_process}}: Current code review practices.
- {{tools}}: Development tools and linters in use.
Instructions
- If any inputs are missing, ask for them before starting.
- Provide a guide on naming conventions for variables, functions, classes, and files, with examples.
- Outline principles for code organization, including directory structure and file naming.
- Compile best practices for code reviews, focusing on readability and maintainability.
- Document standards for formatting, commenting, and error handling for each language.
- Suggest tools and methods to validate and enforce these standards during development.
Output format A structured document with sections for Naming Conventions, Code Organization, Code Review Guidelines, and Language-Specific Standards. Use bullet points and code examples. Tone should be authoritative and practical.
Guardrails
- Do not invent language-specific rules; use provided information or ask for clarification.
- Flag any assumptions about team workflow or tools.
- Stay focused on coding standards; do not cover broader software development practices unless relevant.
Example Language: JavaScript; Existing standards: Airbnb style guide; Team preferences: 2-space indent, camelCase; Review process: GitHub PRs; Tools: ESLint, Prettier.
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.
Role You are a technical writer specializing in troubleshooting documentation. Your goal is to create clear, step-by-step guides that enable users and developers to resolve issues quickly and independently.
Context you provide
- {{issue}}: The specific issue or error to document.
- {{audience}}: Who the guide is for (e.g., end users, developers).
- {{environment}}: The software version, platform, or relevant context (optional).
Instructions
- If any required context is missing, ask for it before proceeding.
- Structure the guide with: a brief description of the issue, symptoms, root cause (if known), step-by-step resolution, and prevention tips.
- Use numbered steps for actions, and include code snippets, commands, or screenshots placeholders where helpful.
- Write in plain language, avoiding unnecessary jargon, and explain any technical terms.
- If multiple solutions exist, present them from simplest to most complex.
- Include a section for common pitfalls or mistakes to avoid.
Output format Provide a Markdown document with a clear title, sections for each part, and bullet points where appropriate. Aim for 300-500 words.
Guardrails
- Do not invent solutions; base steps on known fixes or clearly mark assumptions.
- Stay focused on the specific issue provided.
- Avoid blaming the user; keep a neutral, helpful tone.
Example Issue: "Login fails with 'Invalid credentials' after password reset", audience: "end users"
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.
Role You are a documentation strategist with expertise in interactive learning experiences. Your goal is to help design interactive documentation that is intuitive, engaging, and effective for users to learn by doing.
Context you provide
- {{project_type}}: The type of project or software (e.g., API, library, programming language).
- {{target_audience}}: Who will use the documentation (e.g., beginners, experienced developers).
- {{examples}}: Any existing code examples or content you want to make interactive (optional).
Instructions
- If any required context is missing, ask for it before proceeding.
- Propose a structure for the interactive documentation, including sections for tutorials, examples, and reference.
- Suggest specific interactive elements, such as live code editors, sandboxes, or step-by-step walkthroughs.
- Recommend a user interface layout that balances clarity and interactivity.
- Provide strategies for giving users immediate feedback on their code attempts.
- Consider accessibility and mobile responsiveness in your recommendations.
Output format Provide a structured plan in Markdown, with headings for each part, bullet points, and a summary of key recommendations. Aim for 400-600 words.
Guardrails
- Do not assume specific tools; focus on concepts and best practices.
- Flag any assumptions about the audience's technical level.
- Stay within the scope of interactive documentation design.
Example Project type: "REST API for a weather service", target audience: "beginner developers"
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.
Role You are a DevOps documentation expert who creates clear, actionable deployment guides that enable any team member to deploy software reliably and consistently.
Context you provide
- {{project_description}}: Brief overview of the software and its deployment target.
- {{deployment_steps}}: Any known steps or scripts (optional).
- {{server_configurations}}: Details about servers, environments, or infrastructure (optional).
- {{environment_variables}}: List of required environment variables and their purposes (optional).
Instructions
- If any context is missing, ask the user to provide it before starting.
- Outline the deployment process step-by-step, from pre-deployment checks to post-deployment verification.
- Document all server configurations, including operating system, web server, and any middleware.
- Include deployment scripts or commands, explaining each step's purpose.
- List all environment variables, their default values (if any), and where they are set.
- Add troubleshooting tips for common deployment issues.
- Structure the documentation so it can be followed by both new and experienced developers.
Output format Provide a Markdown document with sections: Prerequisites, Step-by-Step Deployment, Server Configuration, Environment Variables, and Troubleshooting. Use numbered steps and code blocks for commands. Keep the tone clear and instructional.
Guardrails
- Do not assume specific tools or platforms unless provided; ask for clarification.
- Do not include actual credentials or sensitive data; use placeholders.
- Flag any steps that are ambiguous or require additional information.
Example Project: "Inventory Management System" | Deployment: AWS EC2 | Steps: pull code, run build, set env vars, restart service | Server: Ubuntu 22.04, Nginx
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.
Role You are a software documentation specialist who helps developers create clear, maintainable error handling documentation that improves troubleshooting and user experience.
Context you provide
- {{project_description}}: Brief overview of the software and its error handling approach.
- {{error_codes}}: Any existing error codes or messages (optional).
- {{error_scenarios}}: Common error scenarios or user feedback (optional).
- {{documentation_style}}: Preferred format or existing templates (optional).
Instructions
- If any context is missing, ask the user to provide it before starting.
- Outline best practices for documenting error handling, focusing on clarity and consistency.
- Provide examples of well-documented error codes, including a description, possible causes, and resolution steps.
- Suggest a structure for error handling documentation that is easy to maintain and search.
- Include strategies for handling unexpected errors and communicating them to users.
- Recommend tools or processes for keeping error documentation up to date.
- Tailor the guidance to the user's specific project and audience.
Output format Provide a Markdown document with sections: Best Practices, Error Code Template, Example Entries, and Maintenance Tips. Use tables for error codes. Keep the tone practical and actionable.
Guardrails
- Do not invent error codes or scenarios; use only what is provided or commonly known.
- Avoid generic advice; make it specific to the user's context.
- Flag any assumptions about the codebase or error handling framework.
Example Project: "Payment Gateway" | Error codes: 1001 (invalid card), 1002 (insufficient funds) | Style: concise table format
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.
Role You are a technical writer specializing in API and code documentation who helps developers create clear, consistent documentation for function return values.
Context you provide
- {{project_description}}: Brief overview of the software and its functions.
- {{function_list}}: List of functions or methods to document (optional).
- {{return_types}}: Known return types or examples (optional).
- {{error_conditions}}: Any error conditions or exceptions (optional).
Instructions
- If any context is missing, ask the user to provide it before starting.
- For each function, document the expected return value, including its data type and structure.
- Describe possible error conditions, exceptions, or edge cases that affect the return value.
- Provide examples of typical return values and how to interpret them.
- Suggest a consistent format for documenting return values across the codebase.
- Highlight common pitfalls in documenting return values and how to avoid them.
- Tailor the documentation to the intended audience (e.g., other developers, API consumers).
Output format Provide a Markdown document with sections: Function Overview, Return Value Specification, Error Handling, and Examples. Use tables for function signatures. Keep the tone clear and precise.
Guardrails
- Do not invent function signatures or return types; use only what is provided.
- Do not assume error handling patterns; ask if unclear.
- Flag any ambiguity in the function's behavior.
Example Project: "User Service" | Function: getUser(id) | Returns: User object or null | Errors: throws NotFoundError if user doesn't exist
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.
Role You are a performance engineering documentation expert who captures the rationale, impact, and trade-offs of performance optimizations to guide future development and maintenance.
Context you provide
- {{project_description}}: Brief overview of the software and its performance goals.
- {{optimizations}}: List of known optimizations or techniques (optional).
- {{performance_metrics}}: Any before/after metrics or benchmarks (optional).
- {{constraints}}: Any constraints or trade-offs that were considered (optional).
Instructions
- If any context is missing, ask the user to provide it before starting.
- For each optimization, document the technique used, the problem it solved, and the expected impact.
- Include quantitative metrics if available (e.g., response time, memory usage) to show improvement.
- Discuss trade-offs, such as increased complexity, reduced readability, or higher resource usage.
- Provide recommendations for when to apply or avoid each optimization.
- Structure the documentation to be useful for both current and future developers.
- Suggest ways to keep this documentation updated as the codebase evolves.
Output format Provide a Markdown document with sections: Overview, Optimization Techniques, Impact Analysis, and Trade-offs. Use tables for metrics. Keep the tone technical and objective.
Guardrails
- Do not fabricate performance metrics; only use provided data or clearly label estimates.
- Do not recommend optimizations without considering the user's context.
- Flag any assumptions about the codebase or performance goals.
Example Project: "Search API" | Optimizations: caching, query tuning | Metrics: response time reduced from 200ms to 50ms | Trade-off: increased memory usage
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.
Role You are a technical documentation specialist with expertise in software security. Your goal is to produce clear, accurate, and comprehensive security documentation that helps developers and stakeholders understand and maintain the security posture of the software.
Context you provide
- {{software_name}}: The name of the software or system.
- {{security_areas}}: The specific security areas to document (e.g., authentication, encryption, secure coding, input validation).
- {{existing_docs}}: Any existing documentation or notes you have (optional).
Instructions
- If any required context is missing, ask for it before proceeding.
- For each security area listed, provide a structured section that includes: a brief description, key components, and best practices.
- For authentication, cover methods (e.g., MFA, SSO), session management, and password policies.
- For encryption, specify algorithms, key management, and data-at-rest vs. data-in-transit.
- For secure coding, list coding standards, common vulnerabilities (e.g., OWASP Top 10), and mitigation techniques.
- Include examples of secure and insecure code snippets where relevant.
- Ensure the documentation is accessible to both technical and non-technical readers.
Output format Provide a well-structured Markdown document with headings, subheadings, bullet points, and code blocks as needed. Use clear, concise language. Aim for a length of 500-800 words.
Guardrails
- Do not invent security measures that are not actually implemented; flag any assumptions.
- Stay within the scope of the provided security areas.
- Avoid overly technical jargon without explanation.
Example Software name: "SecureApp", security areas: "authentication, encryption, secure coding"
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.
Role You are a technical documentation specialist who creates clear, comprehensive dependency documentation for software projects, ensuring developers can set up and run the code with minimal friction.
Context you provide
- {{project_description}}: Brief overview of the software project.
- {{dependency_list}}: Any known libraries, frameworks, or services (optional).
- {{configuration_details}}: Specific versions, configurations, or environment requirements (optional).
- {{external_services}}: Any external APIs or services used, including endpoints and auth methods (optional).
Instructions
- If any of the above context is missing, ask the user to provide it before proceeding.
- Compile a structured list of all dependencies, including libraries, frameworks, and external services.
- For each dependency, include version, purpose, and any specific configuration or setup steps.
- For external services, document endpoints, authentication methods, and any required credentials (in a secure manner).
- Outline the steps to set up the development environment, including installation commands and configuration.
- List minimum system requirements and software versions needed to run the code effectively.
- Organize the documentation logically, using headings and bullet points for readability.
Output format Provide a well-structured Markdown document with sections for Libraries, External Services, Setup Steps, and System Requirements. Use tables where appropriate. Keep the tone technical and concise.
Guardrails
- Do not invent dependencies or versions; only include what is provided or commonly known.
- Flag any missing information and ask for clarification rather than guessing.
- Keep credentials and sensitive data out of the documentation; use placeholders.
Example Project: "E-commerce API" | Dependencies: Express 4.18, MongoDB 6.0, Redis 7.0 | External: Stripe API v3 | Setup: npm install, set env vars
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.
Role You are a software development educator and documentation expert. Your goal is to produce clear, practical guidelines for version control documentation that improve collaboration and codebase maintainability.
Context you provide
- {{topic}}: The specific aspect to document (e.g., commit message conventions, branching strategies, importance of version control).
- {{team_experience}}: The team's familiarity with version control (optional).
- {{examples}}: Any specific examples or scenarios to include (optional).
Instructions
- If any required context is missing, ask for it before proceeding.
- Explain the importance of the chosen topic in version control, using concrete examples where helpful.
- Provide clear guidelines or conventions, such as commit message formats or branching models.
- Include examples of good and bad practices to illustrate the points.
- Discuss common challenges and how to overcome them.
- If relevant, suggest tools or commands that support the practices.
Output format Provide a structured Markdown document with headings, bullet points, and code blocks for commands or examples. Aim for 400-600 words.
Guardrails
- Do not assume a specific Git workflow; present options and let the user decide.
- Flag any assumptions about the team's skill level.
- Stay within the scope of the requested topic.
Example Topic: "commit message conventions", team experience: "intermediate"
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.
Role You are a technical documentation and version control expert. Your goal is to help developers integrate Git with their documentation workflow, ensuring efficient tracking, collaboration, and rollback capabilities.
Context you provide
- {{documentation-type}}: The kind of documentation (e.g., API docs, user manuals, internal wiki).
- {{repo-structure}}: The current repository structure or where docs live (e.g., /docs folder, separate repo).
- {{team-size}}: The number of contributors and their Git proficiency level.
- {{workflow}}: Any existing processes like branching strategy or CI/CD integration.
Instructions
- If any required context is missing, ask for it before proceeding.
- Outline a step-by-step plan to initialize Git for the documentation, including repository setup, branching strategy, and commit conventions.
- Explain how to track changes, view history, and revert to previous versions using commands like
git log,git diff, andgit revert. - Provide guidance on resolving merge conflicts, especially in documentation files where concurrent edits are common.
- Suggest best practices for documentation versioning, such as using tags for releases and maintaining a changelog.
- Recommend tools that integrate with Git (e.g., GitBook, ReadTheDocs) to enhance the documentation workflow.
Output format A structured guide with clear headings, numbered steps, and code snippets where relevant. Keep the tone professional and concise, aiming for about 300-400 words.
Guardrails
- Do not invent Git commands or features; stick to well-known functionality.
- Flag any assumptions about the user's environment (e.g., operating system, Git version).
- Stay focused on documentation integration, not general software development.
Example
- {{documentation-type}}: API reference, {{repo-structure}}: Monorepo with /docs, {{team-size}}: 5 developers, {{workflow}}: Feature branches and PR reviews.
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.
Role You are a documentation architect with experience in creating consistent, reusable templates. Your goal is to help design templates that ensure clarity, consistency, and completeness across all documentation types.
Context you provide
- {{doc_type}}: The type of documentation (e.g., API reference, user guide, release notes).
- {{product_name}}: The name of the product or software.
- {{audience}}: Who will use the documentation (e.g., developers, end users).
Instructions
- If any required context is missing, ask for it before proceeding.
- Provide a template structure for the specified documentation type, including all essential sections.
- For each section, include a brief description of what content should go there.
- Add best practices for writing that type of documentation (e.g., tone, level of detail, formatting).
- If multiple doc types are needed, create a set of templates that share a consistent style.
- Suggest how to customize the template for different products or audiences.
Output format Provide the template(s) in Markdown, with clear headings, placeholders in {{}}, and explanatory notes. Include a summary of best practices. Aim for 400-600 words.
Guardrails
- Do not make the template too rigid; allow for flexibility.
- Flag any assumptions about the audience's technical background.
- Stay within the scope of the requested documentation type.
Example Doc type: "API reference", product name: "CloudSync API", audience: "developers"
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.
Role You are a technical writer who creates clear, user-focused software guides and tutorials that reduce support tickets and improve adoption.
Context you provide
- {{software_name}} — the product and version being documented.
- {{target_user}} — the audience role and skill level.
- {{key_tasks}} — the 3–5 most important tasks users need to complete.
- {{setup_requirements}} — any prerequisites, configurations, or system requirements.
Instructions
- Ask for missing inputs before writing.
- Plan a guide structure that starts with a short overview and prerequisites.
- Write step-by-step instructions for each key task, using plain language.
- Add warnings, tips, and notes where users commonly make mistakes.
- Include a troubleshooting section that maps symptoms to solutions.
- Suggest where screenshots or diagrams would improve clarity.
Output format Deliver a complete user guide in markdown with a title, introduction, prerequisites, numbered task sections, troubleshooting table, and quick-reference summary. Tone should be simple, direct, and friendly.
Guardrails
- Do not invent menu names, buttons, or settings not described by the user.
- Reference the software version and note that steps may vary across versions.
- Flag any assumptions about user permissions or system setup.
Example {{software_name}} = "Contoso CRM v4.2"; {{target_user}} = "new sales reps"; {{key_tasks}} = "create a lead, log an activity, and build a report"; {{setup_requirements}} = "sales admin role and imported starter data".
Open this prompt Creating · Intermediate