Docs Creator
Generate concise, scannable documentation with code examples.
Quick Reference
| Task | Reference |
|---|---|
| README files | readme-patterns.md |
| REST API docs | api-docs.md |
| Java comments | javadoc.md |
| TypeScript comments | tsdoc.md |
Workflow
1. Identify Documentation Type
Determine what the user needs:
- •README → Project overview, setup, usage
- •API docs → Endpoints, parameters, responses
- •Code comments → Javadoc/TSDoc for functions, classes, interfaces
2. Analyze Existing Code
When documenting existing code:
- •Read the file(s) to understand purpose and interface
- •Identify public APIs, exported functions, key types
- •Note parameters, return types, exceptions
- •Check for existing documentation to preserve/update
3. Generate Documentation
Apply the appropriate pattern from references.
For READMEs:
- •Start with template: README-template.md
- •Focus on: Setup → Usage → API/Configuration
- •Omit: Lengthy intros, tutorials, changelogs
For API docs:
- •Start with template: API-template.md
- •Document: Method, path, parameters, request/response, errors
- •Include: curl example for each endpoint
For code comments:
- •First sentence summarizes action ("Creates...", "Finds...")
- •Document parameters only if purpose isn't obvious
- •Always document return values
- •Document all thrown exceptions
Auto-Generation
When asked to "document this code" or "add docs":
- •Scan for undocumented items - Find functions/methods without comments
- •Preserve existing docs - Don't overwrite unless asked
- •Generate based on signatures - Use parameter names, types, return types
- •Match language convention - Javadoc for Java, TSDoc for TypeScript
Javadoc Pattern
java
/**
* {Action verb} {what it does}.
*
* @param {name} {description}
* @return {description}
* @throws {Type} {when}
*/
TSDoc Pattern
typescript
/**
* {Action verb} {what it does}.
*
* @param {name} - {description}
* @returns {description}
*/
Style Guidelines
- •Concise: Minimal prose, maximum code examples
- •Scannable: Use tables, bullet lists, code blocks
- •Actionable: Copy-paste ready commands and examples
- •Consistent: Match existing documentation style in project