generate-feature-doc
Skill1 starsChanged 59 days agoMITView on GitHub
Generate feature documentation after implementation by analyzing code changes. Use when documenting completed features, writing technical docs, creating developer guides, or when user wants to document what was built.
In this repository27 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- design-craft/CLAUDE.mdCLAUDE.md
- android-emulatorSkill
- audit-branchSkill
- brainstormSkill
- create-devtoolSkill
- create-featureSkill
- create-infrastructureSkill
- execute-tasksSkill
- finish-featureSkill
- frontend-testingSkill
- generate-prdSkill
- git-commitSkill
- ios-simulatorSkill
- modify-featureSkill
- pipeline-helpSkill
- plan-implementationSkill
- prd-clarifierSkill
- prd-to-uxSkill
- prototypeSkill
- react-clean-architectureSkill
- receiving-code-reviewSkill
- refactoring-uiSkill
- setup-daher-skillsSkill
- systematic-debuggingSkill
- test-mobile-appSkill
- writing-skillsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 7 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
After completing a feature implementation
- Distinctive: line 18
When documenting existing features
- Distinctive: line 24
Before generating documentation, gather information about:
- Distinctive: line 31
Tests and fixtures: - Test coverage
- Very specific: line 111
Do NOT create a separate docs/ folder.
- Distinctive: line 115
Identify the feature: - Ask for feature name or detect from recent changes
- Distinctive: line 120
Save documentation: - Write to appropriate location
- Distinctive: line 121
Clean up intermediate artifacts: - Delete pipeline artifacts that are no longer needed (see below)
- Very specific: line 125
After generating the README, delete intermediate pipeline .md files that served their purpose.
- Very specific: line 145
After writing the README, delete all intermediate files.
- Very specific: line 160
After completing documentation generation and artifact cleanup, invoke the git-commit skill to commit all changes (README updates, deleted …
- Very specific: line 164
Read the feature's existing artifacts (.claude/pipeline/{feature}/ and the feature folder: DESIGN.md, PRD.md, UX-spec.md, the …
- Very specific: line 168
Use the AskUserQuestion tool for the transition (never numbered text options), with a one-line summary of what was completed.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Project config:
{app}is the project's new-code root from.claude/rules/project-structure.md; project values (package manager, commands, base branch, error surface) come fromdocs/agents/project-conventions.md. Resolve both before writing any file — never assume. If a needed file is missing, stop: "Run/setup-daher-skillsfirst — missing<file>."
Generate Feature Documentation
Overview
Generate accurate technical documentation AFTER a feature has been implemented. This skill analyzes the actual code, so every claim in the doc traces to a file.
Match the doc's length to what the feature needs: cover every section below, but no filler, no boilerplate, no restating what the code already says plainly. A section that doesn't apply (no Zustand store, no external API) gets one line saying so rather than an invented subsection — readers skim these docs to find a file, and padding hides it.
When to Use
- After completing a feature implementation
- When documenting existing features
- Creating developer onboarding guides
- Updating documentation after refactoring
Context Gathering
Before generating documentation, gather information about:
- Git diff / changed files - What was added or modified
- New models and services - Domain layer additions
- New stores - Zustand state management
- New hooks and queries - Data fetching patterns
- New components - UI layer additions
- Tests and fixtures - Test coverage
- API endpoints - External integrations
Documentation Structure
Generate documentation with these sections:
# Feature: [Feature Name]
## 1. Overview
[Brief description of what this feature does]
## 2. Architecture
[How this feature is structured]
## 3. Data Flow
[How data moves through the feature]
## 4. Key Files
[Important files and their purposes]
## 5. API Reference
[External APIs consumed]
## 6. Data Models
[Zod schemas and types]
## 7. State Management
[TanStack Query + Zustand patterns]
## 8. Components
[UI components and their props]
## 9. Usage Examples
[How to use this feature]
## 10. Testing
[How to test this feature]
## 11. Known Limitations
[Current constraints and future work]Section Templates
For the complete section templates (11 sections with markdown output examples), read references/templates.md.
The sections are:
- Overview (feature name, status, capabilities)
- Architecture (directory structure, layer responsibilities)
- Data Flow (mermaid diagram, flow description)
- Key Files (file-to-purpose mapping)
- API Reference (endpoints, request/response examples)
- Data Models (Zod schemas, types, validation rules)
- State Management (TanStack Query, Zustand, react-hook-form usage)
- Components (props tables per component)
- Usage Examples (basic usage, hooks, mutations)
- Testing (file locations, MSW handlers, coverage)
- Known Limitations (constraints, future work, edge cases)
Output Location (Co-located)
Documentation lives next to the code it describes, not in a separate docs/ folder:
| Scope | Location |
| Feature doc | {features-root}/{feature}/README.md (features root per .claude/rules/project-structure.md) |
| Shared infrastructure doc | src/shared/{module}/README.md (e.g., shared/layouts/README.md) |
| Provider/utility doc | src/shared/{folder}/README.md |
Co-location ensures documentation is:
- Discoverable when browsing code
- Updated alongside code changes
- Included in feature-scoped PRs
Do NOT create a separate docs/ folder. Keep docs with the code.
Generation Process
- Identify the feature - Ask for feature name or detect from recent changes
- Read the code - Analyze all files in the feature directory
- Extract information - Types, hooks, components, patterns used
- Generate sections - Fill in each template section
- Review with user - Allow corrections before finalizing
- Save documentation - Write to appropriate location
- Clean up intermediate artifacts - Delete pipeline artifacts that are no longer needed (see below)
Spec-Driven Development: Artifact Cleanup
After generating the README, delete intermediate pipeline .md files that served their purpose. Only the spec files and README survive the pipeline.
What stays (co-located in feature folder)
| File | Why |
PRD.md | Source of truth — requirements reference for spec-driven development |
UX-spec.md | Design spec — UI reference for spec-driven development |
README.md | Generated documentation — developer onboarding |
What gets deleted
| Pattern | Why |
PRD-*-clarification-session.md | Intermediate — clarifications are already merged into the PRD |
PRD-*-implementation-plan.md | Intermediate — plan was executed, no longer needed |
DECISIONS.md | Intermediate — decisions absorbed into README |
PRD-*.md (iteration variants) | Intermediate — sub-PRDs for phases/iterations are absorbed into the main PRD and README |
DESIGN.md (in .claude/pipeline/{feature}/) | Intermediate — brainstorm output absorbed into PRD and README |
After writing the README, delete all intermediate files. Only PRD.md, UX-spec.md, and README.md survive:
# Delete all PRD variants and intermediate artifacts
rm -f {feature-dir}/PRD-*.md
rm -f {feature-dir}/DECISIONS.md
# Also clean brainstorm artifact from pipeline directory
rm -f .claude/pipeline/{feature-name}/DESIGN.mdImportant:
PRD-*.mdfiles (e.g.,PRD-v2.md,PRD-enrichment.md,PRD-order-status-card.md) are iteration artifacts from the pipeline. The originalPRD.mdis the authoritative requirements reference. Sub-PRDs served their purpose during implementation and are now captured in the README.
Commit
After completing documentation generation and artifact cleanup, invoke the git-commit skill to commit all changes (README updates, deleted intermediate files, etc.).
Resume After Context Cleanup
Read the feature's existing artifacts (.claude/pipeline/{feature}/ and the feature folder: DESIGN.md, PRD.md, UX-spec.md, the implementation plan, PROGRESS.md — whichever exist), then the feature code and any existing README.md draft, and continue from where they leave off — never restart from scratch.
Next Step
Use the AskUserQuestion tool for the transition (never numbered text options), with a one-line summary of what was completed. Options:
- finish-feature — finalize, commit, or create PR
- Something else — do something different
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

