assets/bundled_skills/doc-gen/SKILL.md
Generate comprehensive documentation for code, APIs, and projects
npx skillsauth add 2233admin/cicada doc-genInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Automatically generate clear, comprehensive documentation for code, APIs, and projects.
/**
* Retries a failed operation up to 3 times with exponential backoff.
*
* @param operation - The async function to retry
* @param maxRetries - Maximum number of retry attempts (default: 3)
* @param baseDelay - Initial delay in ms (default: 1000)
* @returns The result of the successful operation
* @throws {Error} If all retry attempts fail
*
* @example
* ```typescript
* const data = await retryOperation(
* () => fetchUserData(userId),
* 3,
* 1000
* );
* ```
*/
async function retryOperation<T>(
operation: () => Promise<T>,
maxRetries = 3,
baseDelay = 1000
): Promise<T>
## POST /api/users
Create a new user account.
### Request
**Headers:**
- `Content-Type: application/json`
- `Authorization: Bearer <token>` (optional)
**Body:**
```json
{
"email": "[email protected]",
"name": "John Doe",
"role": "user"
}
Success (201 Created):
{
"success": true,
"data": {
"id": "usr_123",
"email": "[email protected]",
"name": "John Doe",
"role": "user",
"createdAt": "2026-03-15T10:30:00Z"
}
}
Error (400 Bad Request):
{
"success": false,
"error": "Invalid email format"
}
400 - Invalid input data401 - Unauthorized (missing/invalid token)409 - Email already exists500 - Internal server error
## Best Practices
### 1. Clarity
- Use simple, clear language
- Avoid jargon unless necessary
- Define technical terms
### 2. Completeness
- Document all parameters and return values
- Include error conditions
- Provide usage examples
### 3. Accuracy
- Keep docs in sync with code
- Update docs when code changes
- Test all examples
### 4. Structure
- Use consistent formatting
- Organize logically (overview → details → examples)
- Include table of contents for long docs
### 5. Examples
- Provide realistic examples
- Show common use cases
- Include error handling examples
## Documentation Checklist
Before marking documentation complete:
- [ ] All public functions/classes documented
- [ ] Parameters and return values described
- [ ] Usage examples provided
- [ ] Error conditions documented
- [ ] Code examples tested and working
- [ ] Links to related documentation included
- [ ] Formatting consistent throughout
## Language-Specific Formats
### TypeScript/JavaScript
Use JSDoc format with TypeScript types
### Python
Use docstrings (Google or NumPy style)
### Go
Use godoc format with examples
### Java
Use Javadoc format
## Related Resources
- Keep documentation close to code
- Use automated doc generators (JSDoc, Sphinx, godoc)
- Version documentation with code
tools
Generate comprehensive test cases following TDD principles
development
Identify code smells and suggest refactoring improvements
tools
Internationalization and localization assistance for multi-language applications
tools
Generate clear, conventional commit messages and manage Git workflows