# Sync Prd

> Update PRD docs based on discrepancies report. Use this skill after running analyze-gaps to sync PRD documentation with codebase implementation. Handles IMPLEMENTED_NOT_DOCUMENTED, DIVERGED, and OUTDATED gaps.

- Skill: `majiayu000/sync-prd` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add majiayu000/sync-prd`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/sync-prd/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Product & Planning
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/sync-prd

---


# Sync PRD

Updates PRD documentation based on the discrepancies report generated by `analyze-gaps`.

## Prerequisites

- Run `analyze-gaps` skill first
- `docs/1-prd/99-discrepancies.md` must exist with `Status: COMPLETE`

## When to Use

- After `analyze-gaps` identifies 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`:

1. Verify `Status: COMPLETE` (abort if still ANALYZING)
2. Parse the discrepancies report
3. Filter for PRD-related gaps:
   - IMPLEMENTED_NOT_DOCUMENTED
   - DIVERGED
   - OUTDATED
4. Ignore DOCUMENTED_NOT_IMPLEMENTED gaps

If no PRD updates needed, report and exit.

### Step 2: Plan Updates

Group updates by target PRD file:

1. For each gap, determine target PRD file:
   - Existing PRD file if feature relates to documented area
   - New PRD file if entirely new feature area
2. Group changes by file
3. 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:

1. Read existing file (if updating)
2. Apply changes following PRD conventions:
   - Match existing format and structure
   - Add clear section headers for new content
   - Preserve existing valid content
3. Write updated/new file

**Rules:**
- Only modify `docs/1-prd/*.md` files
- Never modify `99-discrepancies.md` during this step
- Follow existing PRD naming conventions

### Step 4: Verify

Check all PRD files are valid:

1. All PRD files exist and not empty
2. No syntax errors in markdown
3. New files follow naming convention

If verification fails, fix issues and re-verify.

### Step 5: Commit

Stage and commit PRD changes:

```bash
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.md` remains 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
```

