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
/**
* {Action verb} {what it does}.
*
* @param {name} {description}
* @return {description}
* @throws {Type} {when}
*/
TSDoc Pattern
/**
* {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
1---2name: docs-creator3description: Create and generate documentation for software projects including READMEs, API documentation, Javadoc (Java), and TSDoc (TypeScript). Use when: (1) Creating or updating README files, (2) Documenting REST APIs with endpoints and examples, (3) Adding or generating Javadoc comments for Java code, (4) Adding or generating TSDoc comments for TypeScript code, (5) User asks to document this code or add docs or generate documentation.4---5
6# Docs Creator
7
8Generate concise, scannable documentation with code examples.
9
10## Quick Reference
11
12| Task | Reference |
13|------|-----------|
14| README files | [readme-patterns.md](references/readme-patterns.md) |
15| REST API docs | [api-docs.md](references/api-docs.md) |
16| Java comments | [javadoc.md](references/javadoc.md) |
17| TypeScript comments | [tsdoc.md](references/tsdoc.md) |
18
19## Workflow
20
21### 1. Identify Documentation Type
22
23Determine what the user needs:
24- **README** → Project overview, setup, usage
25- **API docs** → Endpoints, parameters, responses
26- **Code comments** → Javadoc/TSDoc for functions, classes, interfaces
27
28### 2. Analyze Existing Code
29
30When documenting existing code:
311. Read the file(s) to understand purpose and interface
322. Identify public APIs, exported functions, key types
333. Note parameters, return types, exceptions
344. Check for existing documentation to preserve/update
35
36### 3. Generate Documentation
37
38Apply the appropriate pattern from references.
39
40**For READMEs:**
41- Start with template: [README-template.md](assets/README-template.md)
42- Focus on: Setup → Usage → API/Configuration
43- Omit: Lengthy intros, tutorials, changelogs
44
45**For API docs:**
46- Start with template: [API-template.md](assets/API-template.md)
47- Document: Method, path, parameters, request/response, errors
48- Include: curl example for each endpoint
49
50**For code comments:**
51- First sentence summarizes action ("Creates...", "Finds...")
52- Document parameters only if purpose isn't obvious
53- Always document return values
54- Document all thrown exceptions
55
56## Auto-Generation
57
58When asked to "document this code" or "add docs":
59
601. **Scan for undocumented items** - Find functions/methods without comments
612. **Preserve existing docs** - Don't overwrite unless asked
623. **Generate based on signatures** - Use parameter names, types, return types
634. **Match language convention** - Javadoc for Java, TSDoc for TypeScript
64
65### Javadoc Pattern
66```java
67/**
68 * {Action verb} {what it does}.
69 *
70 * @param {name} {description}
71 * @return {description}
72 * @throws {Type} {when}
73 */
74```
75
76### TSDoc Pattern
77```typescript
78/**
79 * {Action verb} {what it does}.
80 *
81 * @param {name} - {description}
82 * @returns {description}
83 */
84```
85
86## Style Guidelines
87
88- **Concise**: Minimal prose, maximum code examples
89- **Scannable**: Use tables, bullet lists, code blocks
90- **Actionable**: Copy-paste ready commands and examples
91- **Consistent**: Match existing documentation style in project