Generate comprehensive documentation for the current feature from requirements, plans, code changes, and session logs
Generate a documentation file for the feature, synthesizing requirements, plans, implementation decisions, and code changes into a structured document ready to be merged into the project's documentation.
$ARGUMENTS — Feature name (optional, detected from branch)feature/<name>) or $ARGUMENTSproject_flow__settings_get to resolve docs pathFEATURE_DIR = <resolved_path>/features/<feature_name>/project_flow__feature_getRead all available feature documentation:
FEATURE_DIR/requirements/requirements.md — what was requiredFEATURE_DIR/plans/*.md — how it was planned (active + completed plans)FEATURE_DIR/context/session-log.md — what happened during developmentFEATURE_DIR/context/discoveries.md — patterns and libraries discoveredFEATURE_DIR/context/.plans-status.json — plan completion stateFEATURE_DIR/context/.requirements-status.json — requirements coverageFEATURE_DIR/feature-definition.md — original feature descriptionAlso gather code context:
8. git diff <merge-base>..HEAD --stat — all files changed
9. git log <merge-base>..HEAD --oneline — commit history
Before generating docs, verify:
.requirements-status.json).plans-status.json)If incomplete, warn:
Attenzione: La feature non risulta completata:
- Requisiti: X% copertura
- Piano "Y": 3/5 step completati
Vuoi generare la documentazione comunque? (verrà annotata come parziale)
Create FEATURE_DIR/docs/feature-doc.md:
# <Feature Name>
> Project: <project_name> | Branch: `feature/<name>` | Status: implemented
> Created: <date> | Completed: <date>
## Overview
<!-- 3-5 sentences synthesized from feature-definition.md and requirements -->
<!-- What the feature does, why it was needed, key design decisions -->
## What was implemented
### Components
<!-- List of main components/modules created or modified -->
- **<component>** (`path/to/file`) — <what it does>
### API / Interface changes
<!-- New or modified public interfaces, endpoints, commands, tools -->
- `<interface>` — <description>
### Key decisions
<!-- Architectural decisions made during implementation, from session logs and discoveries -->
- <decision and rationale>
## Dependencies
<!-- New dependencies introduced, from discoveries.md -->
- **<package>** (version) — <why it was added>
## Patterns introduced
<!-- New patterns, from discoveries.md. Only those marked as project convention -->
- **<pattern name>** — <description and where it's used>
## Configuration
<!-- Any new configuration, settings, environment variables -->
## Usage
<!-- How to use the feature: commands, examples, workflows -->
## Files changed
<!-- Summary from git diff stat -->
| File | Change |
|------|--------|
| `src/...` | <what changed> |
## Known limitations
<!-- From requirements "Out of Scope" + any open items from session logs -->
- <limitation>
Present to the user for review and incorporate feedback.
Look for project-level documentation:
FEATURE_DIR/../../docs/ (project docs directory in the feature docs path)docs/, doc/, README.mdIf project docs directory exists, show:
La documentazione del progetto è in
<path>. Vuoi che prepari anche la sezione da aggiungere alla docs del progetto? (verrà integrata durante il merge)
If yes, generate a condensed version suitable for insertion:
FEATURE_DIR/docs/project-doc-section.mdCall project_flow__knowledge_index with:
path: FEATURE_DIR/docs/feature-doc.mdproject: project nameCall project_flow__feature_update with:
project: project namename: feature namestatus: documentedDocumentazione generata per {feature_name}:
docs/feature-doc.md— documentazione completadocs/project-doc-section.md— sezione per la docs del progetto (se richiesta)- Knowledge base: indicizzato
Prossimo passo:
/claude-project-flow:feature-mergeper integrare nel branch principale.