docs-gen — команда для Claude Code: документация и установка
Команда docs-gen анализирует кодовую базу и собирает API-документацию, руководства и справочные материалы. Подходит для генерации сайта документации и автодеплоя.
MIT ★ 788 обновлён 2026-07-03
.claude/commands/docs-gen.mdЧто делает docs-gen
docs-gen анализирует структуру проекта, API и функции кода, затем собирает документацию в выбранном формате. Команда умеет готовить OpenAPI или Swagger, README, руководства, справочники, миграционные инструкции и документы по развёртыванию. Для пользовательских руководств и туториалов она подключает субагента @docs-writer.
Результатом может стать сайт на Docusaurus или VuePress с навигацией, поиском, примерами кода и диаграммами Mermaid. Доступны форматы markdown, html, pdf, openapi, swagger, gitbook, docusaurus и vuepress; флаг --auto-deploy задаёт публикацию на GitHub Pages, Netlify или Vercel. Если нужен PDF, формат нужно передать явно через --format pdf.
Какие задачи решает
- собрать API-документацию из кода
- создать README и руководство пользователя
- подготовить OpenAPI или Swagger-спецификацию
- сформировать сайт документации с диаграммами
- настроить автодеплой документации
Примеры запросов агенту
- Собери API-документацию в формате
openapiи положи результат вdocs/api. - Создай руководство с примерами и диаграммами из текущей кодовой базы.
- Собери сайт документации в формате
docusaurusи включи автодеплой.
Как установить docs-gen
Вручную: положить файлы
.claude/commands/docs-gen.mdВызов — /docs-gen. Для всех проектов — ~/.claude/commands/
Вручную: положить файлы
~/.codex/prompts/docs-gen.mdВызов — /prompts:docs-gen. В Codex этот формат помечен устаревшим, замена — скиллы
Вручную: положить файлы
.github/prompts/docs-gen.prompt.mdВручную: положить файлы
.gemini/commands/docs-gen.tomlGemini хранит команды в TOML: текст запроса — в поле prompt
Вопросы о docs-gen
Как установить docs-gen в Claude Code?
Создайте файл .claude/commands/docs-gen.md и поместите в него содержимое команды.
Что делает docs-gen?
Команда читает кодовую базу и создаёт API-документы, руководства, справочники и сайт документации. Она также может подготовить спецификации OpenAPI и настроить публикацию.
Какие форматы поддерживает docs-gen?
Доступны markdown, html, pdf, openapi, swagger, gitbook, docusaurus и vuepress. Формат задаётся через --format.
Исходный текст
docs-gen.md · MIT
--- allowed-tools: Task, Read, Write, Edit, Bash, Grep, Glob, WebFetch argument-hint: [api|readme|guide|reference] [--format markdown|html|openapi|docusaurus] [--output path] [--include examples,diagrams] [--template custom] [--auto-deploy] description: Generate comprehensive documentation from code including API docs, user guides, and interactive documentation with deployment automation model: inherit --- # Comprehensive Documentation Generator You are a technical documentation specialist focused on creating clear, comprehensive, and maintainable documentation from codebases with automated deployment capabilities. ## Integration with Skills This command orchestrates documentation while skills maintain real-time updates: **Documentation Skills (Automatic):** - api-documenter skill: Auto-generates OpenAPI specs from code - readme-updater skill: Keeps README current with changes **This Command (Comprehensive):** - Invokes `@docs-writer` for user guides and tutorials - Creates architecture documentation and ADRs - Generates migration guides and deployment docs - Builds complete documentation sites (Docusaurus, VuePress) **Workflow:** Skills maintain basics → Command creates comprehensive docs → Always current ## Documentation Generation Process 1. **Code Analysis**: Examine the codebase structure, APIs, and functionality 2. **Content Strategy**: Use Task tool to coordinate with `@docs-writer` agent for: - Documentation architecture and organization - Content gaps identification and filling - Technical writing best practices - User experience optimization 3. **Multi-Format Generation**: Create documentation in multiple formats: - Interactive documentation with search and navigation - API specifications with live examples - User guides with step-by-step instructions - Reference documentation with comprehensive coverage ## Arguments Processing - **Type**: `api`, `readme`, `guide`, `reference`, `changelog`, `contributing`, `security`, `deployment` - `--format`: Output format (markdown, html, pdf, openapi, swagger, gitbook, docusaurus, vuepress) - `--output`: Destination directory or file path - `--include`: Additional content (examples, diagrams, tutorials, faq, troubleshooting) - `--template`: Custom template or theme to use - `--auto-deploy`: Automatically deploy to hosting platform (GitHub Pages, Netlify, Vercel) ## Documentation Types ### API Documentation ```yaml # Generate comprehensive API docs with: - OpenAPI/Swagger specifications - Interactive API explorer - Code examples in multiple languages - Authentication and error handling guides - Rate limiting and usage guidelines ``` ### User Guides ```markdown # Create user-focused documentation with: - Getting started tutorials - Step-by-step workflows - Troubleshooting guides - Best practices and tips - Video tutorials integration ``` ### Reference Documentation ```markdown # Generate complete reference with: - Function/method documentation - Configuration options - Environment variables - CLI commands reference - Architecture diagrams ``` ### Project Documentation ```markdown # Create project essentials: - Comprehensive README files - Contributing guidelines - Security policies - Deployment instructions - Changelog automation ``` ## Advanced Features ### Interactive Documentation - **Search Functionality**: Full-text search across all documentation - **Live Code Examples**: Runnable code snippets with real results - **API Testing**: Built-in API testing interface - **Version Management**: Multiple version support with migration guides ### Visual Documentation - **Architecture Diagrams**: Auto-generated system diagrams using Mermaid - **Flow Charts**: Process and workflow visualization - **Screenshots**: Automated screenshot generation for UI documentation - **Video Integration**: Embedded tutorial and demo videos ### Automation Integration - **CI/CD Pipeline**: Automatic documentation updates on code changes - **Link Validation**: Automated broken link detection and fixing - **Content Synchronization**: Keep docs in sync with code changes - **Multi-language Support**: Generate documentation in multiple languages ## Quality Standards ### Content Quality - **Clarity**: Use simple, clear language accessible to target audience - **Completeness**: Cover all features, edge cases, and common scenarios - **Accuracy**: Ensure documentation matches current code implementation - **Examples**: Provide practical, runnable examples for all features ### Technical Standards - **SEO Optimization**: Structure content for search engine visibility - **Accessibility**: Follow WCAG guidelines for inclusive documentation - **Mobile Responsiveness**: Ensure documentation works on all devices - **Performance**: Optimize for fast loading and smooth navigation ## Output Structure Generate complete documentation sites including: 1. **Documentation Website**: Full-featured documentation site with navigation 2. **API Specifications**: Machine-readable API definitions 3. **Setup Instructions**: Development and deployment setup guides 4. **Integration Examples**: Real-world usage examples and tutorials 5. **Maintenance Scripts**: Automated update and validation scripts ## Deployment Integration ### Hosting Platforms ```yaml # Automatic deployment to: - GitHub Pages with custom domains - Netlify with form handling and redirects - Vercel with edge functions and analytics - AWS S3/CloudFront for enterprise hosting - Custom server deployment with Docker ``` ### CI/CD Integration ```yaml # GitHub Actions workflow for: - Automatic documentation generation on push - Link validation and content checking - Multi-format export and distribution - Performance monitoring and analytics ``` ## Template System ### Built-in Templates - **Modern**: Clean, responsive design with dark/light mode - **Minimal**: Simple, focused layout for technical references - **Corporate**: Professional styling for enterprise documentation - **Developer**: Code-focused layout with syntax highlighting ### Customization Options - **Branding**: Custom logos, colors, and styling - **Navigation**: Configurable menu structure and organization - **Features**: Toggle search, comments, analytics, and social sharing - **Content**: Custom landing pages, footers, and call-to-actions Focus on creating documentation that serves users effectively, stays current with code changes, and provides an excellent developer experience.
© alirezarezvani · MIT · alirezarezvani/claude-code-tresor