Goal
A file a new developer can understand without asking the author, with documentation fit for a public repository.
Inputs
- Language and docstring style: [e.g. Python with Google style, TypeScript with TSDoc, Java with Javadoc, PHP with PHPDoc]
- Code: [paste the module]
- What the module is for: [one or two lines]
- Audience: [team members, open-source contributors, or both]
Steps
- Write a module-level summary: what the file provides and how it fits in.
- For every public function, method and class, write a docstring with a summary, parameters, return value, errors raised and a short example where useful.
- Add inline comments only where the reason for the code is not obvious, such as a workaround, a performance choice or a business rule.
- Remove or rewrite comments that are wrong, outdated or that only repeat the code.
Output format
- The full module with documentation added, in one code block.
- | Function | What was documented | Notes |
- Questions for the author: places where the intent is unclear or the behaviour looks like a bug.
Check before answering
- Not a single character of executable code is changed, including formatting.
- Comments explain what and why, never repeat the line ("increment i").
- Comments contain no names of people, internal tickets, credentials, server names or private URLs.
- Types and parameter names in docstrings match the code exactly.






