-
-
Notifications
You must be signed in to change notification settings - Fork 0
Doc Generator
Auto-generate JSDoc, README, and API documentation from code.
Doc Generator automatically creates comprehensive documentation from your code, including JSDoc comments, README files, API documentation, and changelogs from git history.
- JSDoc Generation - Complete function and class documentation
- README Creation - Professional project documentation
- API Docs - OpenAPI/Swagger specs from code
- Changelog Generation - From git commit history
- Markdown Tables - Clean documentation formatting
- Full Suite - Generate all docs at once
npx @j0kz/mcp-agents@latest
Claude Code:
claude mcp add doc-generator "npx @j0kz/doc-generator-mcp@latest" --scope user
Cursor/Windsurf: Add to mcp_config.json
:
{
"mcpServers": {
"doc-generator": {
"command": "npx",
"args": ["-y", "@j0kz/doc-generator-mcp@latest"]
}
}
}
You: "Add JSDoc comments to all functions in auth.ts"
AI: Generated comprehensive JSDoc with:
- Function descriptions
- @param tags with types
- @returns documentation
- @throws for error cases...
You: "Generate README for this project"
AI: Created professional README with:
- Installation instructions
- Usage examples
- API reference
- Contributing guidelines
- Badges and TOC...
You: "Create API docs from all TypeScript files in src/"
AI: Generated API documentation with:
- All exported functions
- Class documentation
- Interface definitions
- Type aliases
- Examples for each API...
You: "Generate changelog from v1.0.0 to v1.1.0"
AI: Created changelog with:
- 5 new features
- 3 bug fixes
- 2 performance improvements
- Grouped by type and author...
Generate JSDoc comments for a TypeScript/JavaScript file.
Parameters:
-
filePath
(required): Path to the source file -
config
(optional): JSDoc generation configuration-
style
:'standard' | 'google' | 'typescript'
-
inferTypes
: Infer types from TypeScript -
includePrivate
: Include private members -
addTodoTags
: Add @todo tags for missing documentation
-
Generate a comprehensive README.md file from project source code and package.json.
Parameters:
-
projectPath
(required): Path to the project root directory -
config
(optional): README generation configuration-
projectName
: Project name -
version
: Project version -
author
: Author information -
license
: License type -
includeTOC
: Include table of contents -
includeInstallation
: Include installation section -
includeUsage
: Include usage examples -
includeAPI
: Include API reference -
includeBadges
: Include badges -
includeContributing
: Include contributing guidelines
-
Generate comprehensive API documentation from TypeScript/JavaScript source files.
Parameters:
-
projectPath
(required): Path to the project source directory -
config
(optional): API documentation configuration-
includeTOC
: Include table of contents -
sortAlphabetically
: Sort members alphabetically -
includeTypes
: Include type definitions -
includeInterfaces
: Include interfaces -
includeEnums
: Include enums -
includeSourceLinks
: Include source code links -
groupByCategory
: Group documentation by category -
repositoryUrl
: Repository URL for source links
-
Generate a changelog from git commit history using conventional commit format.
Parameters:
-
projectPath
(required): Path to the git repository -
config
(optional): Changelog generation configuration-
fromTag
: Starting version tag -
toTag
: Ending version tag -
conventionalCommits
: Parse conventional commit format -
groupByType
: Group changes by type (feat, fix, etc.) -
includeAuthors
: Include commit authors -
includeMerges
: Include merge commits -
linkCommits
: Link to commit URLs -
commitLimit
: Number of commits to include
-
Generate complete documentation suite including JSDoc, README, API documentation, and changelog.
Parameters:
-
projectPath
(required): Path to the project root -
sourceFiles
(optional): Array of source files for JSDoc -
config
(optional): Combined configuration for all doc types
/**
* Calculate the total price with tax
* @param {number} price - The base price
* @param {number} taxRate - The tax rate (0-1)
* @returns {number} The total price including tax
* @throws {Error} If price is negative
*/
function calculateTotal(price, taxRate) {
if (price < 0) throw new Error('Price cannot be negative');
return price * (1 + taxRate);
}
/**
* Calculate the total price with tax
*
* @param {number} price The base price
* @param {number} taxRate The tax rate (0-1)
* @return {number} The total price including tax
* @throws {Error} If price is negative
*/
function calculateTotal(price, taxRate) {
if (price < 0) throw new Error('Price cannot be negative');
return price * (1 + taxRate);
}
/**
* Calculate the total price with tax
* @param price - The base price
* @param taxRate - The tax rate (0-1)
* @returns The total price including tax
* @throws If price is negative
*/
function calculateTotal(price: number, taxRate: number): number {
if (price < 0) throw new Error('Price cannot be negative');
return price * (1 + taxRate);
}
-
feat:
- New feature -
fix:
- Bug fix -
docs:
- Documentation changes -
style:
- Code style changes -
refactor:
- Code refactoring -
perf:
- Performance improvements -
test:
- Test changes -
chore:
- Build/tooling changes
feat: add user authentication
fix: resolve login timeout issue
docs: update API documentation
refactor: simplify payment processing
Generate JSDoc for all public interfaces:
"Add JSDoc comments to all exported functions"
Regenerate after major changes:
"Update README with new features"
Generate changelog for each release:
"Create changelog from v1.0.0 to v1.1.0"
Follow commit conventions for better changelogs:
"feat: add dark mode support"
Generate complete documentation suite:
"Create full docs with README, API docs, and changelog"
Document internal APIs:
"Generate JSDoc for all exported functions in src/"
Track changes between versions:
"Create changelog from v2.0.0 to v2.1.0"
Help new developers:
"Generate comprehensive README with usage examples"
- Ensure TypeScript files have type annotations
- Set
inferTypes: true
in config - Verify TypeScript version compatibility
- Check package.json exists
- Provide config with required sections
- Manually add domain-specific content
- Verify git repository exists
- Check commit range (fromTag/toTag)
- Ensure commits follow conventional format
- Verify all files are exported
- Check file glob patterns
- Ensure files are valid TypeScript/JavaScript
1. Generate API documentation
2. Use test-generator to create tests matching docs
3. Keep tests and docs synchronized
1. Design API with api-designer
2. Generate OpenAPI spec
3. Use doc-generator for markdown docs
1. Review code quality
2. Add JSDoc where missing
3. Verify documentation completeness
- API Designer - API specifications
- Smart Reviewer - Code quality
- Test Generator - Test documentation
- DB Schema Designer - Database documentation
Need help? Open an issue or check the Troubleshooting Guide