بنقرة واحدة
archive-prd
Archives completed stories from prd.json to reduce token usage.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Archives completed stories from prd.json to reduce token usage.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Show token / tool usage stats from the local telemetry log. Use when you want to know "which tools am I burning context on", "which skills are expensive", or "was yesterday's session mostly Read/Grep or actually productive".
Parallel quality audit with 7 specialized agents (Opus). Finds bugs, violations, and quality issues. Use audit for fixes, brainstorm for features.
Manage environment variables with Doppler — auto-install CLI, login, link projects, wrap commands with `doppler run`. Replaces scattered .env files with a hub/spoke architecture.
Scaffolds new projects or onboards existing ones. Detects stack, creates monorepo/single-app, configures strict tooling. Use for greenfield or first-time setup.
Autonomous task execution with testing and security. Works through all tasks without stopping.
Removes temporary screenshots, old backups, stale handoffs, and auto-active flags. Use when project has accumulated temp files.
| name | archive-prd |
| description | Archives completed stories from prd.json to reduce token usage. |
| triggers | ["archive","compact prd","prd too large"] |
| allowed-tools | Read, Write, Edit, Bash |
| model | haiku |
| user-invocable | true |
| argument-hint | [status|S-ID|unarchive S-ID] |
Archive completed stories to keep prd.json fast and small. Keep only last 3 sprints active.
1. Read prd.json
2. Separate stories:
- ACTIVE: passes=false OR passes=null OR type="qa"
- COMPLETED: passes=true AND type!="qa"
3. Create archive file: .claude/archives/prd-archive-YYYY-MM.json
4. Update main prd.json with summary
5. Report: "Archived X stories, Y remain active"
{
"project": "Project Name",
"version": "1.3.2",
"lastUpdated": "2026-01-22",
"roadmapPhase": "Current Phase",
"archived": {
"totalCompleted": 41,
"lastArchived": "2026-01-22",
"files": [".claude/archives/prd-archive-2026-01.json"],
"summary": {
"S01-S10": "Core foundation - registry, funnels, OAuth, caching",
"S11-S20": "Navigation, QA, dashboard, exports, favorites",
"S21-S30": "Time granularity, GA4 schema, accessibility, mobile",
"S31-S41": "Token refresh, metrics, documentation, scope rules"
}
},
"stories": [
// Only active/pending stories here
]
}
{
"archivedAt": "2026-01-22T10:00:00Z",
"project": "Project Name",
"version": "1.3.2",
"stories": [
// Full story objects for reference
]
}
| Condition | Action |
|---|---|
| 4+ total sprints | Auto-suggest archive |
| prd.json > 500 lines | Suggest archive |
| prd.json > 50KB | Force archive |
| User says "archive" | Manual archive |
| All stories complete | Archive and start fresh |
Keep only the last 3 sprints in prd.json. Archive everything older.
1. BACKUP
mkdir -p .claude/archives
cp prd.json .claude/archives/prd-backup-$(date +%Y%m%d).json
2. EXTRACT COMPLETED
Filter: passes=true AND type!="qa"
3. CREATE ARCHIVE
Write to: .claude/archives/prd-archive-YYYY-MM.json
4. GENERATE SUMMARY
Group stories by ID range (10 per group)
Write 1-line summary per group
5. UPDATE MAIN PRD
Remove archived stories
Add "archived" section with summary
Keep all QA stories (even passed ones for re-testing)
6. VALIDATE
Ensure main prd.json < 1500 lines
Ensure all story IDs accounted for
If you need details on an archived story:
User: "What was S15 about?"
Claude:
1. Check archived.summary for S15 range
2. Read .claude/archives/prd-archive-2026-01.json if needed
3. Report story details
| Say | Action |
|---|---|
archive | Archive completed stories |
archive status | Show archive stats |
archive S15 | Show archived story S15 |
unarchive S15 | Restore story to active |
| State | Estimated Tokens |
|---|---|
| Full prd.json (70+ stories, 10 sprints) | ~25,000+ |
| After archive (current sprint + 2) | ~3,000-5,000 |
| With summary | +500 |
| Total Savings | ~80% |
Real example: a long-running project can grow to 800+ rows / 10 sprints / ~20K tokens. After archiving to keep only the current sprint + 2 prior, prd.json drops to ~150 rows / ~3K tokens.