BestPromptFinder
Home › Documentation › Document Undocumented Code (No Behavior Change)

Document Undocumented Code (No Behavior Change)

Documentation · Claude Code, Cursor · coding
90AI Quality /100
93AI Usefulness est. /100
87Eval Confidence /100
No votes yetCommunity results

Quality, usefulness and confidence are AI evaluations out of 100 — not user ratings. Community results come from visitors' "worked / didn't work" votes below. How scoring works →

The prompt

Document [path/to/module or directory], which currently has little or no documentation. Do not change behavior. First read the code, its call sites, and its tests. Then: 1. Add doc comments in the project's existing style ([JSDoc / Google-style docstrings / rustdoc / godoc]) to every public function, class, and type: purpose, parameters, return value, errors raised, and side effects (I/O, network, global state). 2. Add inline comments only where the "why" isn't obvious: workarounds, invariants, ordering constraints, performance tricks. Don't narrate what the code plainly does. 3. Write or update [README.md in that directory]: what the module is for, how it fits into the system, a minimal usage example based on a real call site, the config or environment variables it reads, and known limitations. 4. Anything you can't determine from the code (unclear intent, possibly dead code, suspicious behavior) goes in a "Questions for maintainers" list in your reply — don't guess in the docs. Rules: no renames, reformatting, or refactors; only comments and documentation files may change. Afterwards run [lint / typecheck / docs build] to confirm nothing broke, then summarize what you documented and list the open questions.
Find similar in the app →
Did this prompt work for you?

Why this prompt

Source

Created by BestPromptFinder — editorial prompt, not user-generated. See our content & source policy.

Related Documentation prompts

README and API Reference Writer from Source Code
Quality 90 · ChatGPT, Claude, Gemini
Release Notes from Git History
Quality 90 · Claude Code, Cursor
Product Requirement Document (PRD) & User Journey Generator
Quality 84 · GPT-4o / Claude
Codebase Onboarding Guide
Quality 78 · Claude Code