Generates or rewrites technical documentation for a file or folder, creating README.md, architecture docs, and Mermaid diagrams.
From accnpx claudepluginhub dykyi-roman/awesome-claude-code --plugin acc<path> [-- additional instructions]opusGenerate high-quality technical documentation for a file, folder, or project.
Parse $ARGUMENTS to extract path and optional meta-instructions:
Format: <path> [-- <meta-instructions>]
Examples:
- /acc:generate-documentation ./
- /acc:generate-documentation src/ -- focus on API documentation
- /acc:generate-documentation ./ -- create architecture doc with C4 diagrams
- /acc:generate-documentation src/Domain/Order -- document only public interfaces
- /acc:generate-documentation ./ -- на русском языке
Parsing rules:
$ARGUMENTS by -- (space-dash-dash-space)$ARGUMENTS (before --)--) — use to customize outputIf meta-instructions provided, adjust documentation to:
Verify the path exists:
$ARGUMENTS is empty, ask user what they want to documentDetermine documentation type:
/acc:generate-documentation <path>
│
├─ Pre-flight: Validate path exists
│
├─ Phase 1: Analyze project scope
│ ├─ Read composer.json (if exists)
│ ├─ Identify project type (library/app/API)
│ └─ Determine audience
│
├─ Phase 2: Task → acc:documentation-writer
│ └─ Generate appropriate documentation
│
├─ Phase 3: Task → acc:diagram-designer (if architecture docs)
│ └─ Create Mermaid diagrams
│
└─ Output: Generated documentation files
Use the acc:documentation-writer agent to create documentation:
Generate complete documentation suite:
Generate contextual documentation:
| Directory Type | Output |
|---|---|
src/ | Architecture overview + API index |
src/Domain/ | Domain model documentation |
src/Api/ | API endpoint documentation |
docs/ | Improve existing docs |
Generate specific documentation:
| File Type | Output |
|---|---|
| Class file | Class documentation with examples |
| Interface | API documentation |
| Config file | Configuration reference |
For architecture documentation, invoke the diagram designer:
Task tool with subagent_type="acc:diagram-designer"
prompt: "Create diagrams for {target}. Include:
- System context (if project)
- Layer diagram (if DDD/Clean Architecture)
- Component interactions (if multiple services)"
# {Project Name}
{badges}
{one-line description}
## Features
{bullet list with benefits}
## Installation
{composer/setup commands}
## Quick Start
{minimal working example}
## Documentation
{links to docs}
## Contributing
{contributing link}
## License
{license}
# Architecture
## Overview
{high-level description}
## System Context
{C4 context diagram - Mermaid}
## Layers
{layer diagram - Mermaid}
## Components
{component descriptions}
## Technology Stack
{technology table}
# API Reference
## {ClassName}
### Overview
{class purpose}
### Methods
#### method(params): ReturnType
{description}
**Parameters:**
| Name | Type | Description |
|------|------|-------------|
**Returns:** {description}
**Example:**
```php
// usage example
## Documentation Quality Checklist
Generated documentation must have:
- [ ] Clear project description
- [ ] Installation instructions (if applicable)
- [ ] Working code examples
- [ ] Appropriate diagrams (for architecture)
- [ ] Links to related documentation
- [ ] Consistent formatting
## Usage Examples
```bash
# Document entire project
/acc:generate-documentation
# Document specific directory
/acc:generate-documentation src/Domain/Order
# Document specific file
/acc:generate-documentation src/Service/PaymentService.php
# Document API
/acc:generate-documentation src/Api/
After generating documentation, suggest:
/acc:audit-documentation for quality check