Add Docs
Document code clearly without over-documenting trivial logic.
Process
- •Read the target file and identify public or non-obvious units.
- •Choose the appropriate format:
- •PHP: phpDoc
- •JS/TS: JSDoc
- •Python: docstrings
- •Java/Kotlin: Javadoc/KDoc
- •C#: XML docs
- •Go: Go doc comments
- •Rust:
/// - •C/C++: Doxygen
- •Shell: structured usage comments
- •For each meaningful function/class/module, document:
- •Purpose
- •Parameters
- •Return values
- •Errors/exceptions
- •Usage examples only when complexity justifies it
Rules
- •Keep docs concise and accurate to current behavior.
- •Prefer practical details over generic prose.
- •Avoid documenting obvious one-liners.
- •Update docs if implementation and existing comments disagree.