Process pending documentation gap reports and generate missing documentation
Processes pending documentation gap reports and generates missing documentation
/plugin marketplace add RasmusGodske/dev-agent-workflow/plugin install project-roles@dev-agent-workflowdocs/You are processing documentation gap reports generated by the research agent to create or improve project documentation.
Review pending research reports, verify their findings, decide what documentation changes are needed, and implement those changes following project conventions.
This command is part of the research-driven documentation system. Here's how it fits:
docs/_research/lacking/pending/Report lifecycle you manage:
pending/ # New reports (you start here)
↓
in-progress/ # Currently processing (you create plan.md)
↓
processed/ # Complete (you create resolution.md)
Your responsibilities:
Use Glob to find all pending reports:
Glob: docs/_research/lacking/pending/*/report.md
If no reports found:
If reports found:
If user says no, stop.
For EACH report (one at a time, don't batch):
Read: docs/_research/lacking/pending/{timestamp}_{slug}/report.md
Parse the report to understand:
Don't redo the entire research, but quickly verify:
If findings seem wrong:
Use Glob to find: .claude/rules/documentation/**/*.md
Read all files found
Key files to load:
structure.md - Documentation organizationfile-mapping.md - Where to place documentationtemplates.md - What structure to usewriting-style.md - How to write quality contentindex-maintenance.md - How to update INDEX.mdThese tell you:
Based on the report and conventions, decide:
Create a plan.md file:
Write: docs/_research/lacking/{same-directory}/plan.md
Format:
# Documentation Plan: {Topic}
Generated: {current timestamp}
## Proposed Changes
### 1. Create docs/domains/{domain}/features/{feature}.md
**Why:** {Reason based on research report}
**Content:**
- Section 1: {What will be documented}
- Section 2: {What will be documented}
### 2. Update docs/domains/{domain}/README.md
**Why:** {Reason}
**Changes:**
- Add feature to feature list
- Link to new documentation
### 3. Update docs/INDEX.md
**Why:** Ensure discoverability
**Changes:**
- Add entry: [{Topic}](path/to/doc.md) - {brief description}
## Estimated Impact
- {N} files created
- {N} files modified
- ~{N} lines of documentation added
## Code References Used
- `{path}:{line}` - {description}
- `{path}:{line}` - {description}
Present the plan clearly:
Report: {topic}
Priority: {priority}
I plan to:
- Create {N} new documentation file(s)
- Update {N} existing file(s)
- Add {N} INDEX.md entries
Details in: docs/_research/lacking/{directory}/plan.md
Proceed with this plan? [yes/no/skip]
If user says:
Bash: mv docs/_research/lacking/pending/{directory} docs/_research/lacking/in-progress/
This prevents processing the same report twice if something goes wrong.
Follow the plan you created:
For each new file to create:
.claude/rules/documentation/templates.mdwriting-style.md)For each file to update:
Always update INDEX.md:
Write: docs/_research/lacking/in-progress/{directory}/resolution.md
Format:
# Resolution: {Topic}
Processed: {timestamp}
## Actions Taken
- ✅ Created `{path}` ({N} lines)
- ✅ Updated `{path}` (added {description})
- ✅ Updated `docs/INDEX.md` (added {N} entries)
## Files Created
- {path}
## Files Modified
- {path}
- {path}
## Documentation Generated
Brief summary of what was documented and where to find it.
## Processed By
Claude Code documentation agent
## Notes
{Any relevant notes, issues encountered, or future improvements needed}
Bash: mv docs/_research/lacking/in-progress/{directory} docs/_research/lacking/processed/
Tell the user:
✅ Processed: {topic}
Created: {N} files
Updated: {N} files
{N} reports remaining.
Then continue to the next report.
After processing all reports (or when user stops):
Documentation Processing Complete
Processed: {N} reports
Created: {N} new documentation files
Updated: {N} existing files
All pending reports have been addressed.
All quality guidelines, templates, and style rules are defined in .claude/rules/documentation/README.md.
When generating documentation:
.claude/rules/documentation/README.mdThe conventions file is the single source of truth for documentation standards.
If the report doesn't provide enough information:
If you discover docs exist that the research agent missed:
If after review, the existing documentation is actually sufficient:
If code references in the report are outdated:
If errors occur during processing:
User: /docs/process-reports
Claude: Found 2 pending documentation reports:
1. 2025-11-20_143022_auth-jwt-validation - Authentication JWT Validation
2. 2025-11-20_150135_payment-flow - Payment Processing Flow
Process these reports? [yes/no]
User: yes
Claude:
Report 1: Authentication JWT Validation (priority: high)
After reviewing the research findings, I plan to:
- Create docs/domains/authentication/features/jwt-validation.md
- Update docs/domains/authentication/README.md
- Create docs/layers/backend/services/auth-service.md
- Update docs/INDEX.md (3 new entries)
Details in: docs/_research/lacking/pending/2025-11-20_143022_auth-jwt-validation/plan.md
Proceed with this plan? [yes/no/skip]
User: yes
Claude:
[Creates documentation files...]
✅ Processed: Authentication JWT Validation
Created: 2 files (jwt-validation.md, auth-service.md)
Updated: 2 files (authentication/README.md, INDEX.md)
1 report remaining.
Report 2: Payment Processing Flow (priority: medium)
...
.claude/rules/documentation/README.mdYour goal is to systematically eliminate documentation gaps while maintaining high quality and consistency across all documentation.