# Maintain Mode

Use maintain mode for batch review and hygiene. Maintenance is agent review, not automatic page creation.

## Workflow

1. Inspect queue and health.
   - `llm-wiki memory --workspace <project> --section queue`
   - `llm-wiki maintenance --workspace <project> --apply-lifecycle --dry-run`
   - This also previews deprecated scaffold migration for `raw/inbox`, `raw/assets`, and `wiki/entities`.
   - `llm-wiki lint --workspace <project>`
   - When lint reports legacy or unknown frontmatter fields, preview `llm-wiki maintenance --workspace <project> --normalize-frontmatter --dry-run`. Apply only after reviewing collisions and attention items; hooks never run it automatically.

2. Batch related candidates.
   - Merge only explicit, repeated, or clearly reusable facts.
   - Prefer existing curated pages.
   - Mark low-signal or duplicate candidates `skipped`.
   - Let `--apply-lifecycle` move deprecated scaffold contents into the current layout; do not leave that migration as a manual user chore.

3. Apply queue actions.
   - Approve: `llm-wiki maintenance --workspace <project> --approve <id> --target wiki/<path>.md`
   - Done after merging: `llm-wiki maintenance --workspace <project> --done <id> --target wiki/<path>.md`
   - Skip: `llm-wiki maintenance --workspace <project> --skip <id> --note "<reason>"`

4. Refresh generated blocks when appropriate.
   - Preview: `llm-wiki consolidate --workspace <project> --dry-run`
   - Apply only when useful: `llm-wiki consolidate --workspace <project>`
   - Archive old live Q&A only with `llm-wiki archive-questions --workspace <project>`.

## Safety

- Do not promote ordinary tool-heavy work or one-off chat into durable wiki pages.
- Do not modify `raw/` source material except safe hook envelope append.
- Keep `wiki/memory.md` short and pointer-based.
