Sync PRD
Updates PRD documentation based on the discrepancies report generated by analyze-gaps.
Prerequisites
- Run
analyze-gapsskill first docs/1-prd/99-discrepancies.mdmust exist withStatus: COMPLETE
When to Use
- After
analyze-gapsidentifies PRD updates needed - When codebase has features not documented in PRD
- When PRD specs diverge from implementation
- When PRD contains outdated information
Gap Types Handled
| Gap Type | Action |
|---|---|
IMPLEMENTED_NOT_DOCUMENTED |
Add feature to appropriate PRD file |
DIVERGED |
Update PRD to match implementation |
OUTDATED |
Update PRD with current behavior |
NOT handled (use sync-planning instead):
DOCUMENTED_NOT_IMPLEMENTED- needs tickets, not PRD updates
Workflow
Step 1: Read Discrepancies
Read docs/1-prd/99-discrepancies.md:
- Verify
Status: COMPLETE(abort if still ANALYZING) - Parse the discrepancies report
- Filter for PRD-related gaps:
- IMPLEMENTED_NOT_DOCUMENTED
- DIVERGED
- OUTDATED
- Ignore DOCUMENTED_NOT_IMPLEMENTED gaps
If no PRD updates needed, report and exit.
Step 2: Plan Updates
Group updates by target PRD file:
- For each gap, determine target PRD file:
- Existing PRD file if feature relates to documented area
- New PRD file if entirely new feature area
- Group changes by file
- Prioritize by importance
Example grouping:
docs/1-prd/auth.md:
- Add OAuth2 support (IMPLEMENTED_NOT_DOCUMENTED)
- Update session timeout from 30m to 1h (OUTDATED)
docs/1-prd/api.md:
- Update rate limiting behavior (DIVERGED)
docs/1-prd/caching.md: [NEW]
- Add Redis caching documentation (IMPLEMENTED_NOT_DOCUMENTED)
Step 3: Apply Updates
For each target PRD file:
- Read existing file (if updating)
- Apply changes following PRD conventions:
- Match existing format and structure
- Add clear section headers for new content
- Preserve existing valid content
- Write updated/new file
Rules:
- Only modify
docs/1-prd/*.mdfiles - Never modify
99-discrepancies.mdduring this step - Follow existing PRD naming conventions
Step 4: Verify
Check all PRD files are valid:
- All PRD files exist and not empty
- No syntax errors in markdown
- New files follow naming convention
If verification fails, fix issues and re-verify.
Step 5: Commit
Stage and commit PRD changes:
git add docs/1-prd/*.md
git add -u docs/1-prd/ # For modified files
# Exclude 99-discrepancies.md from commit
git reset docs/1-prd/99-discrepancies.md
git commit -m "Sync PRD docs with codebase implementation"
Output
After running this skill:
- PRD files updated to reflect codebase implementation
- Changes committed with descriptive message
99-discrepancies.mdremains unchanged (for reference)
Example Usage
User: Sync PRD with implementation
Assistant: [Checks for 99-discrepancies.md, then uses sync-prd skill]
User: Update PRD docs from discrepancies report
Assistant: [Uses sync-prd skill]
Full Sync Workflow
1. analyze-gaps → generates 99-discrepancies.md
2. sync-prd → updates PRD docs (this skill)
3. sync-planning → creates tickets for unbuilt features