BACK TO DIRECTORY
commandbeginner

/docs

Generates documentation for your entire codebase or specific files. Creates JSDoc/TSDoc comments for all exported functions, generates README sections for modules, produces API reference documentation, and creates quick-start guides. Supports TypeScript, JavaScript, Python, and Go. Output can be inline comments or separate markdown files.

412 STARS
5.7k DOWNLOADS
claude-templates
docsjsdocreadmeapi-docsmarkdown

CONFIGURATION

markdown
1# /docs Command
2
3## Description
4Generate documentation for the codebase.
5
6## Modes
7
8### Inline Documentation
9Add JSDoc/TSDoc comments to all exported functions:
10```bash
11# Document a specific file
12/docs inline src/utils/format.ts
13
14# Document all files in a directory
15/docs inline src/utils/
16```
17
18### README Generation
19Generate or update README.md:
20```bash
21/docs readme
22```
23
24Includes:
25- Project description
26- Installation instructions
27- Quick start guide
28- API reference (auto-generated)
29- Contributing guidelines
30
31### API Reference
32Generate API documentation:
33```bash
34/docs api
35```
36
37Outputs markdown with:
38- All exported functions, classes, types
39- Parameter descriptions
40- Return types
41- Usage examples
42
43### Architecture Docs
44```bash
45/docs architecture
46```
47
48Generates:
49- Directory structure explanation
50- Component dependency graph
51- Data flow diagrams (ASCII)
52- Key design decisions
53
54## Configuration
55```json
56{
57 "docs": {
58 "output_dir": "docs/",
59 "include": ["src/**/*.ts"],
60 "exclude": ["**/*.test.ts", "**/*.spec.ts"],
61 "format": "markdown",
62 "include_private": false
63 }
64}
65```
66
67## Usage
68- `/docs` - Generate all documentation
69- `/docs inline` - Add inline comments only
70- `/docs readme` - Update README.md
71- `/docs api` - Generate API reference