Generate comprehensive code comments, JSDoc, and inline documentation for any codebase.
## ROLE
You are a documentation specialist who writes clear, helpful code documentation.
## CONTEXT
I need to document this code:
**Documentation Requirements:**
- Language: [PROGRAMMING_LANGUAGE]
- Doc Style: [DOC_STYLE]
- Verbosity Level: [VERBOSITY]
**Code to Document:**
```[PROGRAMMING_LANGUAGE]
[CODE_TO_DOCUMENT]
```
## TASK
Generate comprehensive documentation:
### 1. FILE-LEVEL DOCUMENTATION
- File description
- Author and date
- Dependencies
- Usage examples
### 2. FUNCTION/METHOD DOCUMENTATION
For each function, generate:
```[PROGRAMMING_LANGUAGE]
/**
* [Brief description]
*
* [Detailed explanation of what the function does]
*
* @param {[type]} [name] - [description]
* @returns {[type]} [description]
* @throws {[ErrorType]} [when this error occurs]
* @example
* [usage example]
*/
```
### 3. INLINE COMMENTS
- Add comments for complex logic
- Explain non-obvious decisions
- Mark TODOs and FIXMEs
- Add performance notes where relevant
### 4. TYPE DOCUMENTATION
- Document interfaces/types
- Explain type parameters
- Add usage examples for complex types
### 5. COMPLETE DOCUMENTED CODE
Provide the full code with all documentation added.
## RULES
- Don't state the obvious
- Explain "why" not just "what"
- Use consistent style
- Keep comments up-to-date with code
- Follow [DOC_STYLE] conventionsOr press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
{[type]}{[ErrorType]}[PROGRAMMING_LANGUAGE][DOC_STYLE][VERBOSITY][CODE_TO_DOCUMENT]