Review agent artifacts and manage lifecycle
Reviews agent artifacts for completeness, recommends extractions, and manages archival with user confirmation.
/plugin marketplace add levifig/loaf/plugin install loaf@levifig-loafReview ALL agent artifacts in .agents/ and provide hygiene recommendations.
CRITICAL: This command must review EVERY file, not samples or averages.
Never reference .agents/ files in output docs outside .agents/.
After user confirmation, auto-move archived artifacts and update .agents/ links (no manual steps).
Archived artifacts are retained indefinitely.
For EACH session file in .agents/sessions/ and .agents/sessions/archive/:
archived_at and archived_by when status is archivedarchived_by to be filled when archiving.agents/ referencesarchived? → Fix statusarchived_at or archived_by? → Add archive metadataarchived_at or archived_by? → Add timestamp + actor + update frontmatterarchived_by? → Add actor.agents/ referenceslessons_learned? → Extract to relevant docsdecisions not in ADRs? → Suggest ADR creationremaining_work or next_steps? → Check if tracked in Linearissues_discovered? → Check if tracked in Lineartechnical_debt? → Check if tracked in Linear.agents/? → Update .agents/ references to archived pathsFor each session, show:
.agents/sessions/archive/Never auto-archive. For each session flagged:
archived, set archived_at and archived_by.agents/ references to the archived path.agents/ references inside .agents/ onlyFor EACH council file in .agents/councils/ and .agents/councils/archive/:
archived_at, archived_by, move to .agents/councils/archive/) only after session summary existsarchived_by to be filled when archiving.agents/ references (update links inside .agents/ only; no manual steps)
Flag if:14 days old → Review for staleness
archived → Fix statusarchived_at or archived_by → Add archive metadataFor EACH file in .agents/reports/ and .agents/reports/archive/:
status, session_reference, processed_at, archived_at, archived_byarchived_at and archived_byarchived_by is always filled when archiving (required)archived → Fix statusarchived_at or archived_by → Add archive metadata.agents/ references (update links inside .agents/ only; no manual steps)---
report:
status: processed
session_reference: ".agents/sessions/YYYYMMDD-HHMMSS-title.md"
processed_at: "YYYY-MM-DDTHH:MM:SSZ"
archived_at: "YYYY-MM-DDTHH:MM:SSZ"
---
Archive location: .agents/reports/archive/ (move after processed + linked session archived + archived_at + archived_by set).
Present comprehensive summary:
SESSIONS (N total):
✓ Ready for archive (status + move): N (list titles)
⚠ Need extraction: N (list specific items)
○ Keep active: N
COUNCILS (N total):
✓ Clean: N
⚠ Orphaned/stale: N
⚠ Missing session summary: N
⚠ Pending archive: N
REPORTS (N total):
✓ Processed and archived (status + move): N
⚠ Missing frontmatter: N
⚠ Awaiting session summary: N
Retention: archived indefinitely (no deletion policy).
For each session with completed or near-complete work:
## CHANGELOG Draft section?CHANGELOG DRAFTS:
✓ Integrated: N sessions
⚠ Pending: N sessions (list titles)
○ No draft needed: N sessions
For sessions with unintegrated CHANGELOG drafts:
Session: [session-title]
Linear: [PLT-XXX]
Draft status: Not integrated
→ Run /update-changelog to integrate
For completed sessions without drafts:
Session: [session-title]
Linear: [PLT-XXX]
Has user-facing changes: [Yes/No]
→ Spawn Product agent to create draft? [Y/n]
If any sessions have pending CHANGELOG drafts, display:
─────────────────────────────────────────
CHANGELOG ACTION NEEDED
[N] session(s) have CHANGELOG drafts ready for integration.
Run /update-changelog to integrate pending entries.
─────────────────────────────────────────
No document outside .agents/ should reference .agents/ files.
Reference for extraction destinations:
| Information Type | Destination |
|---|---|
| Work tracking | Linear issues |
| Implementation details | Git commits |
| Architectural decisions | docs/decisions/ADR-XXX-*.md |
| Migration patterns | docs/DATABASE_ARCHITECTURE.md |
| API contracts | docs/api/ |
| Test patterns | docs/TESTING.md |
| Remaining work | Linear backlog |
| User-facing changes | CHANGELOG.md (via /update-changelog) |
| Council outcomes | Session summary (link council file) |
| Report conclusions | Session summary (link report file) |
| Archived artifacts | .agents/<type>/archive/ + status archived |