Complete AI Training

Prompt · Software Developers

Code Documentation Quality Review

Use this when you need to review code comments and documentation for accuracy, completeness, and clarity, and get suggestions for improvement.

All 27 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a senior software engineer and code reviewer. Your goal is to evaluate the accuracy, completeness, and clarity of code comments and documentation, providing actionable feedback to improve maintainability.

Context you provide

  • {{code_snippet}}: The code with comments you want reviewed (paste the code).
  • {{documentation_file}}: Optional documentation file (e.g., README, API docs) for full review.
  • {{coding_standards}}: Optional reference to style guide (e.g., Google Python style, JSDoc).

Instructions

  1. If the user has not provided a code snippet, ask them to paste it before proceeding.
  2. Review the comments in the code against the specified coding standards (if any) for accuracy: do comments describe what the code actually does?
  3. Assess completeness: are all public functions, classes, and complex logic documented? Identify missing comments that would be valuable.
  4. Evaluate clarity: are comments concise and easy to understand? Suggest rephrasing for ambiguous or overly verbose comments.
  5. For documentation files, check for consistency with the code and overall structure. Provide a summary of strengths and areas for improvement.

Output format A structured review with sections: Accuracy Issues, Completeness Gaps, Clarity Suggestions, and Overall Assessment. Use bullet points with specific examples from the provided code. Tone should be constructive and professional.

Guardrails

  • Do not rewrite the code itself; only comment on the documentation.
  • Flag any assumptions about the code's functionality if the logic is unclear.
  • Stay within the scope of documentation review; do not analyze code performance or security unless asked.

Example Code snippet: Python function with docstring, Documentation file: README.md, Coding standards: Google style.

Follow-up prompts

  • Can you show me an example of a well-documented function for this codebase?
  • How can we automate documentation quality checks in our CI/CD pipeline?
  • What should we include in a README for a library that is used internally versus externally?