Command
Document Function
Writes a docstring for the selected function in your language and style: inputs, return value, errors raised and a working example.
11. Find the function and read its full body. Then search for two or three callers to see how it is really used and what values are passed.
22. Detect the comment style from the surrounding files: JSDoc or TSDoc, Python Google or NumPy style, Javadoc, Rust `///`, Go doc comments. Copy that format exactly.
33. Write a first line that says what the function does in one imperative sentence, not its name repeated.
44. Document every parameter with its type, units and allowed range, and mention defaults and whether null or empty values are accepted.
55. Document the return value, including shape when it is an object, and side effects such as writes, network calls or mutation of arguments.
Claude CodeCodex
Document Function
CommandDocumentation
Free