Generates README files, API documentation, and inline code comments following best practices. Use when creating project documentation, writing READMEs, documenting APIs, or explaining complex code.
Create clear, maintainable documentation for projects and code.
For full templates, see:
references/readme-template.md - Complete README templatereferences/api-docs-template.md - API documentation template# Project Name
Brief description (1-2 sentences)
## Features
## Prerequisites
## Installation
## Configuration
## Usage
## Development
## Deployment
## Contributing
## License
/**
* Fetches user data from the database.
*
* @param userId - The unique identifier of the user
* @returns Promise resolving to the user object
* @throws {NotFoundError} If user doesn't exist
*
* @example
* const user = await fetchUserData('123');
*/
async function fetchUserData(userId: string): Promise<User> {
// ...
}
def fetch_user_data(user_id: str) -> User:
"""
Fetch user data from the database.
Args:
user_id: The unique identifier of the user.
Returns:
User object containing user data.
Raises:
NotFoundError: If user doesn't exist.
Example:
>>> user = fetch_user_data('123')
"""
// BAD: Obvious
// Increment counter
counter++;
// GOOD: Explain why
// Increment before checking because first request counts
counter++;
// Cache disabled for premium users after stale data issue (INC-5678)
if (!user.isPremium) {
cache.set(key, value);
}
# ADR-001: Use PostgreSQL for Primary Database
## Status
Accepted
## Context
We need ACID transactions, complex queries, strong consistency.
## Decision
Use PostgreSQL as the primary database.
## Consequences
**Positive:** ACID compliance, rich queries, strong ecosystem
**Negative:** Horizontal scaling requires more effort
Good documentation saves hours of debugging. Write for the developer who joins in 6 months.