{"name":"audit-code-comments-prompt","description":"A prompt that checks code comments and docstrings against the code they describe - wrong parameters or return values, outdated references, stale TODOs, misleading claims, comments that only restate the code - and suggests a fix, rewrite or removal for each. Use when the user wants comments or docstrings verified, finds comment rot, or added docs before a review.","category":"coding-prompts","tags":["docs","code-review","quality"],"models":["any"],"proven":false,"passing_families":0,"model_testing":"Not yet model-tested; testing Jan 2027","url":"https://theskillvault.ai/skills/audit-code-comments-prompt","api_url":"https://theskillvault.ai/api/skills/audit-code-comments-prompt","raw_url":"https://theskillvault.ai/api/skills/audit-code-comments-prompt/raw","body":"# Audit code comments (prompt)\n\nA wrong comment is worse than no comment. People trust it, and it sends them the wrong way. This prompt checks every comment against the code it sits on and says what to fix, rewrite or delete.\n\n## When to use\n- You or an AI just wrote a lot of docstrings or comments and want them checked for accuracy.\n- Old code is full of comments and you suspect many no longer match.\n- Before a review, you want the comments added or changed in the diff checked.\n\n## When not to use\n- You want a README or user guide written. Use write-readme-prompt.\n- You want the code itself reviewed for bugs. Use review-code-prompt.\n- You want messy code tidied, including comments. Use turn-messy-diff-into-clean-code-prompt.\n\n## Steps\n1. Choose the scope: the comments changed in a diff, or a folder of older code.\n2. Paste the prompt below into your AI coding tool. Change the base branch or swap in the folder.\n3. Fix the critical issues first. A comment that states something false must change today.\n4. Apply the removals you agree with. Delete comments that only restate the code.\n5. Ask for rewrites of the rest one file at a time, and re-run the prompt on the result.\n\n## Prompt\n```text\nCheck the code comments and docstrings added or changed in this branch (git diff main...HEAD). Compare each one with the code it describes. Do not edit anything yet.\n\n1. Accuracy: do parameters, return values, types and thrown errors match the signature? Does the described behaviour match the logic? Do referenced functions, files and flags still exist? Are claimed edge cases and performance notes true?\n2. Completeness: are important assumptions, preconditions, side effects and error cases stated? Is the reason for a non-obvious choice explained?\n3. Value: does it explain why, not just what? Flag comments that repeat the code, describe a temporary state, or will go stale with the next likely change.\n4. Misleading parts: vague wording, old names from before a refactor, examples that no longer work, TODOs and FIXMEs that are already done.\n\nWrite for a new teammate reading this code a year from now.\nOutput:\n- Critical: comments that are false or misleading (file:line, problem, fix).\n- Improve: comments missing key context (file:line, what is missing, suggested wording).\n- Remove: comments that add nothing (file:line, reason).\n- Good examples worth copying, if any.\nGive suggested wording for each rewrite. Wait for my go-ahead before changing files.\n```\n\n## How to adapt\n- Auditing old code instead of a diff? Replace the git command with \"the comments in src/billing/\".\n- Have a doc style such as JSDoc, docstrings or rustdoc? Add \"follow <style> for public functions\".\n- Public API or library? Ask for every exported function without a docstring to be listed too.\n- Want it to apply the fixes? Reply \"apply the critical and remove sections only\".\n\n## Gotchas\n- Some \"obvious\" comments are there for legal or licence reasons. Do not delete those headers.\n- Comments that describe intended behaviour may reveal a code bug, not a comment bug. Check which is wrong.\n- Comments can hold secrets or internal URLs. Remove any keys, passwords or private links you find.\n\n## Portability\nWorks with any language and any AI coding tool or chat AI. In a chat without repo access, paste the files with their comments.\n\n## Done when\n- No comment states something the code does not do.\n- Stale TODOs, old names and broken examples are fixed or removed.\n- Remaining comments mostly explain why, and the code still builds and passes its tests.\n\n## Example prompt\n\"Check the comments and docstrings in my diff against the code. List the ones that are wrong, the ones missing context and the ones I should delete, with suggested wording.\"\n\n---\nModified from the \"comment-analyzer\" agent in anthropics/claude-plugins-official (pr-review-toolkit, by Anthropic; README credits Daisy). Licensed Apache-2.0 per the LICENSE file at commit a7ba5b9. Original: https://github.com/anthropics/claude-plugins-official/blob/a7ba5b93db0c7c8d17f3f1d25853adca79598a1a/plugins/pr-review-toolkit/agents/comment-analyzer.md. Changes by TheSkillVault are listed in the metadata above and in NOTICE.txt. See LICENSE.txt.","files":["LICENSE.txt","NOTICE.txt"],"license":"Apache-2.0","license_name":"Apache License 2.0","license_url":"https://www.apache.org/licenses/LICENSE-2.0","attribution":"Based on work by Anthropic (anthropics/claude-plugins-official, pr-review-toolkit, comment-analyzer; the plugin README credits Daisy, daisy@anthropic.com) (Anthropic (the upstream LICENSE keeps the blank Apache template line 'Copyright [yyyy] [name of copyright owner]'; no other copyright notice at this commit). Apache License 2.0 text in LICENSE.txt, attributions in NOTICE.txt, Apache License 2.0), https://github.com/anthropics/claude-plugins-official/blob/a7ba5b93db0c7c8d17f3f1d25853adca79598a1a/plugins/pr-review-toolkit/agents/comment-analyzer.md; adapted by TheSkillVault, https://theskillvault.ai","install":{"claude_code":"curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-code-comments-prompt/raw' -o ~/'.claude/skills/audit-code-comments-prompt/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-code-comments-prompt/files/LICENSE.txt' -o ~/'.claude/skills/audit-code-comments-prompt/LICENSE.txt' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-code-comments-prompt/files/NOTICE.txt' -o ~/'.claude/skills/audit-code-comments-prompt/NOTICE.txt'","cursor":"curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-code-comments-prompt/raw' -o '.cursor/skills/audit-code-comments-prompt/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-code-comments-prompt/files/LICENSE.txt' -o '.cursor/skills/audit-code-comments-prompt/LICENSE.txt' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-code-comments-prompt/files/NOTICE.txt' -o '.cursor/skills/audit-code-comments-prompt/NOTICE.txt'","agents":"curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-code-comments-prompt/raw' -o '.agents/skills/audit-code-comments-prompt/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-code-comments-prompt/files/LICENSE.txt' -o '.agents/skills/audit-code-comments-prompt/LICENSE.txt' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-code-comments-prompt/files/NOTICE.txt' -o '.agents/skills/audit-code-comments-prompt/NOTICE.txt'","mcp_url":"https://theskillvault.ai/mcp","cursor_mcp_deeplink":"cursor://anysphere.cursor-deeplink/mcp/install?name=theskillvault&config=eyJ1cmwiOiJodHRwczovL3RoZXNraWxsdmF1bHQuYWkvbWNwIn0%3D","mcp_config":{"mcpServers":{"theskillvault":{"url":"https://theskillvault.ai/mcp"}}}},"bundles":[],"tested_on":[{"family":"chatgpt","name":"ChatGPT","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"claude","name":"Claude","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"gemini","name":"Gemini","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"grok","name":"Grok","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"llama","name":"Llama","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"deepseek","name":"DeepSeek","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"mistral","name":"Mistral","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"qwen","name":"Qwen","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"kimi","name":"Kimi K","outcome":null,"date":null,"source":null,"counts":false,"stale":false}],"proven_rule":{"threshold":5,"window_days":365,"computed_at":"2026-11-03T21:40:06.669Z"}}