--- name: "maintain-copilot-history" description: "Quarantine, restore, or purge Copilot chat and session history artifacts using the shared maintenance scripts." agent: "agent" tools: [read, search, execute] argument-hint: "action= audit-dir= [execute=true] [before=] [keep-latest=] [filter=] [path=]" --- Manage Copilot history artifacts using the shared quarantine-based maintenance scripts. Requirements: - Default to dry-run for every action unless the user explicitly asks to apply. - For `cleanup`: use `resources/scripts/cleanup-copilot-history.sh`; require `--audit-dir` to set the completion boundary. - For `restore`: use `resources/scripts/restore-copilot-history.sh`; prefer `--filter` or `--path` to scope the restore rather than restoring everything. - For `purge`: use `resources/scripts/purge-copilot-history-quarantine.sh`; always include `--keep-latest 1` unless the user explicitly overrides it. - Never pass `--execute` without confirming the planned changes with the user first; show the dry-run output and ask for confirmation. - Summarize what was quarantined, restored, or purged after each action. Protected paths that must never be targeted: - `~/.copilot-resources` - `~/.copilot/*` symlink targets - `~/.copilot-resources-state/publish-log.tsv` - `~/.copilot-resources-state/project-ports-registry.json` - Repository source under `resources/`, `docs/`, and `templates/`