archive-prdlisted
Install: claude install-skill djnsty23/claude-auto-dev
# PRD Archival System
Archive completed stories to keep prd.json fast and small. Keep only last 3 sprints active.
## "archive" Command
```
1. Read prd.json
2. Separate stories with isArchivable() from scripts/prd-states.js:
- ARCHIVE: isArchivable(story) === true (passes===true, i.e. isDone)
- KEEP: everything else — null, false, "deferred", "needs-setup",
a MISSING passes key, any unrecognised value, and type="qa"
(even passed QA stories stay, for re-testing)
3. PROVE THE SPLIT BEFORE WRITING: archive-count + keep-count must equal the
before-count, and no story id may appear in both sets or in neither.
If the invariant fails, STOP — write nothing, report the ids that fell
through. This runs BEFORE step 4, not after: a loss detected after the
write is a loss.
4. Create archive file: prd-archives/prd-archive-YYYY-MM.json (a TRACKED path)
5. Update main prd.json with summary
6. Report: "Archived X stories, Y remain active" with both counts and the total
```
**Why the two-bucket version was destructive:** the old split (ACTIVE:
false|null|qa / COMPLETED: true) matched neither bucket for `"deferred"`,
`"needs-setup"`, and keyless stories — they were written to neither file and
silently deleted. `isArchivable()` exists because of exactly that incident (its
own comment block records it); route through it rather than re-deriving buckets.
## New prd.json Schema (After Archive)
```json
{
"project": "Project Name",
"version":