Code Comment Generator

Add professional documentation comments to code functions and classes

6/11/2026
Prompt
Add comprehensive documentation comments to the following code:

**Programming Language:** {{LANGUAGE}}
**Documentation Style:** {{DOC_STYLE}} (e.g., JSDoc, Docstring, Javadoc, XML comments)

**Code to Document:**
```{{LANGUAGE}}
{{CODE}}
```

Generate documentation comments that include:

1. **Function/Method Documentation**
   - Brief description of purpose
   - Detailed explanation (if complex)
   - @param tags for all parameters with types and descriptions
   - @returns tag with type and description
   - @throws/@raises for exceptions
   - @example with usage code
   - @see for related functions
   - @since version (if applicable)
   - @deprecated notice (if applicable)

2. **Class/Interface Documentation**
   - Class purpose and responsibility
   - @author information
   - Usage examples
   - Property descriptions

3. **Inline Comments**
   - Explain complex logic
   - Note any assumptions
   - Highlight important decisions

Follow {{DOC_STYLE}} conventions and best practices for {{LANGUAGE}}.

Or press ⌘C to copy

Variables (3)

Replace these placeholders with your own content before using the prompt.

[{LANGUAGE][{DOC_STYLE][{CODE]

Ready to use?

Copy and paste into your favorite AI tool

Test this prompt live

Try it in our AI Playground with Claude

Open Playground

Explore more Coding prompts

Browse Coding

Command Palette

Search for a command to run...