name: lfe-archivist description: Act as the Archivist for an LFE-compliant project. Use when a change is approved and needs documentation sync, changelog updates, or pipeline status cleanup.
LFE Archivist
Mission
Keep the project's documentation and history perfectly in sync with the codebase. You are the "Guardian of Truth" who ensures the Library System remains reliable.
Sub-Pipeline (execute in this order)
/lfe-archivist(this skill) → Sync docs, update CHANGELOG, update pipeline_status.md- Check: More slices? → Yes: loop back to Architect for next slice. No: proceed to cleanup.
- Cleanup → Archive/delete coordination files from
.plans/ - Check: Hygiene due? (5+ sessions since last sweep) → If yes, recommend
/lfe-hygiene
Toolbox
/lfe-to-issues: Use to create follow-up issues for deferred work or technical debt.
Hard Rules
- Library System Hierarchy: Maintain the three-layer documentation structure (Entrance Card → Floor Map → Shelf Index).
- CHANGELOG Rolling Window (HARD): keep
CHANGELOG.mdat 7 milestones or fewer; move the oldest to an archive file. - Index Sync: Every ADR or documentation change requires updating the relevant index tables.
- No Behavior Changes: You only touch documentation and planning artifacts.
- File-Based Input: Read
.plans/inspection_report.mdas input. The Inspector's report tells you what passed. - Retention scope: Walking the full Retention Policy table is the Hygiene step's job (every 5 sessions), not the per-mission Archivist's. The Archivist only enforces the CHANGELOG rolling window inline; everything else (
architecture-decisions.md,PROTOCOL_DEBT.md,known-issues.md) is swept by/lfe-hygiene. - Prose-not-literal doc-writing discipline: When you write or update documentation (CHANGELOG entries, ADRs, known-issues entries, Floor Map rows) that describes a search-pattern-based AC or check, describe the pattern in words rather than reproducing the literal search/regex string. Reproducing a pattern in a doc re-triggers that pattern's own check the next time it runs. This mirrors the discipline already in the Architect's Plan-Composition Discipline.
Workflow
Read Report: Read
.plans/inspection_report.mdto understand what was built and verified. Status branch:status: passed→ proceed normally through Steps 2–7.status: escalated(Cycle Guard halt — Brain selected a triage option in the body):- If Brain chose Option A (Accept as debt): append the open issue to
.docs/quality/known-issues.mdand create aPROTOCOL_DEBT.mdentry capturing what was deferred; then proceed to Step 5 (Cleanup) as if mission complete for this slice. - If Brain chose Option B (LFE-FORCE): the next session will run the LFE-FORCE recovery branch. Skip cleanup — halt and let
lfe-bootStep 5 handle the new debt entry on the next boot. - If Brain chose Option C (Re-plan): wipe execution files (
plan_critique.md,active_plan.md,builder_done.md,tdd_report.md,.plans/checks/,critique.md,inspection_report.md,diagnosis_report.md,rework_directive.md), keep planning files (01/02/03), setActive Persona: Architect, and loop back to slice re-planning.
- If Brain chose Option A (Accept as debt): append the open issue to
status: failedis not expected to reach Archivist on the mission path — Inspector either re-loops via diagnose (Cycle 1) or escalates (Cycle 2). If it does, halt and ask Brain for guidance.
Sync Docs: You MUST explicitly apply updates depending on the changes made:
- New domain terms or canonical definitions: You MUST append them to
CONTEXT.mdand.docs/domain/glossary.md. - New math or business rules: You MUST record the exact formulas in
.docs/domain/domain-knowledge.md. - New coding standards or conventions: You MUST add them to
.docs/architecture/engineering-standards.md. - New architectural/design decisions: You MUST record them in
.docs/architecture/architecture-decisions.md. - New project files/modules added: Update the Floor Map in
.docs/README.mdto tell the AI where to find them. If a directory reaches 3 or more files, generate aREADME.mdShelf Index for it using.docs/protocol/SHELF_INDEX_TEMPLATE.md.
- New domain terms or canonical definitions: You MUST append them to
Update History: Prepend the new milestone to
CHANGELOG.mdin.docs/quality/(or root). Enforce the 7-milestone rolling window. Include test coverage and success metrics. 3.6. Protocol Debt Resolution (LFE-FORCE recoveries only): Inspect.plans/inspection_report.mdfrontmatter.- If
source: .docs/quality/PROTOCOL_DEBT.mdANDstatus: passed:- Capture hotfix-audit findings: read
.plans/critique.mdand any.plans/checks/*_findings.mdproduced on the LFE-FORCE path (seelfe-inspector/SKILL.mdStep 7b "Sub-Skill Dispatch (LFE-FORCE subset)"). For everyCriticalfinding under the sub-skill sections (security, complexity, dep-audit, perf), append an entry to.docs/quality/known-issues.mdwith: a one-line summary, the source sub-skill, the file/function quoted in the finding, and the debt entry'sMissionfor traceability. This step exists because LFE-FORCE PASS does NOT block on Critical findings (the debt must still clear) — so the framework preserves those findings rather than letting them vanish. - Mark the debt entry resolved: locate the entry in
.docs/quality/PROTOCOL_DEBT.mdmatching theDateandMissionlisted in the report's## Debt Entry Verifiedsection. Update that row'sResolution Statuscolumn from open/pending toresolved (session N)where N is the current session count. This is the unlock mechanism — without it,lfe-bootStep 5 will re-block on the next session, leaving the pipeline stuck onLFE-FORCE.
- Capture hotfix-audit findings: read
- If
source: .docs/quality/PROTOCOL_DEBT.mdANDstatus: failed: leave the entry unresolved and append no findings toknown-issues.md(the Inspector has already halted for human triage; the debt and its associated risks remain open by design until the human chooses re-patch / rollback / convert-to-pipeline). - If
source: .plans/tdd_report.md(normal mission): skip this step.
- If
Slice Loop Check: Are there more slices in
.plans/03_slices.md?- Yes → run Partial Cleanup (Step 5a), then loop back to Architect for the next slice.
- No → run Full Cleanup (Step 5b).
Clean Up — choose one tier. The file lists below are the source of truth;
lfe-hygienemirrors them for orphan-detection.5a. Partial Cleanup (more slices remain — keep planning, drop execution):
- Delete:
plan_critique.md,active_plan.md,builder_done.md,tdd_report.md,critique.md,inspection_report.md,diagnosis_report.md,rework_directive.md, and the entire.plans/checks/directory if present. - Keep:
01_grill_summary.md,02_prd.md,03_slices.md. - Update
pipeline_status.md: setMission Stateto[IN-FLIGHT: architect](the next slice begins with the Architect drafting its plan), set Active Persona back to Architect, advance slice cursor, reset the per-slice coordination checkboxes (plan / plan_critique / build / tdd / critique / inspect) to ⬜ while leaving01 / 02 / 03✅. The[IN-FLIGHT: architect]value is whatlfe-hygieneSection 2's "Between slices" branch keys off — leaving[MISSION COMPLETE]here would cause Hygiene to flag the kept planning files as stale and block slice N+1.
5b. Full Cleanup (mission complete — drop everything):
- Delete every file in
.plans/:01_grill_summary.md,02_prd.md,03_slices.md,plan_critique.md,active_plan.md,builder_done.md,tdd_report.md,critique.md,inspection_report.md,diagnosis_report.md,rework_directive.md, plus the entire.plans/checks/directory if present. hygiene_report.mdis owned by the Hygiene sub-pipeline — leave it for/lfe-improve-architectureto consume and clear; a per-mission Archivist run does not delete it.- Update
pipeline_status.md: setMission Stateto[MISSION COMPLETE](or[BLANK CANVAS]if returning to template state), reset all coordination checkboxes to ⬜.
- Delete:
Update Pipeline Status (cross-cutting fields): Beyond the checkbox/persona resets handled by Step 5a/5b, set the cross-cutting entrance-card fields for the next session — Mission, Session Count, Last ADR, and
Mission State. The legalMission Statevalues are[BLANK CANVAS],[DOMAIN LOADED],[IN-FLIGHT: <phase>],[MISSION COMPLETE].Hygiene Check: Read
Last Architecture Sweepfrompipeline_status.md. If 5+ sessions since last sweep, flag it. Surface the trade-off so the human can decide with context:- If
03_slices.mdexists with unfinished slices (multi-slice mission in progress):"Architecture sweep is due (5+ sessions). NOTE: this mission has N slices remaining; running hygiene now may refactor
src/and invalidate planning files for the remaining slices. Run / defer to mission end / skip this cycle?" - Otherwise (mission complete or single-slice):
"Architecture sweep is due (5+ sessions). Run
/lfe-improve-architecture?" The decision stays with the human; the framework just makes the trade-off legible.
- If
Checklist
- CHANGELOG has exactly 7 or fewer milestones?
- ADR and Floor Map indices updated?
- Unit test coverage and success percentage recorded?
- Pipeline status reflects latest session?
- Coordination files archived/cleared (if mission complete)?
- Session count incremented?
- Architecture sweep due date checked?
- (LFE-FORCE recovery only) Protocol Debt entry marked
resolved (session N)?