arch-sentry
Purpose
Arch Linux health audits for pacman cache, orphan packages, and pacnew drift.
Runbook
- Confirm
pacman,jq, and the helper scripts inscripts/are available. - Abort before continuing if the current user cannot escalate with
sudo; package cleanup and pacnew reconciliation are intentionally gated. - Run
scripts/audit.shto collect:- pacman package cache size
- orphan package count and package list
.pacnewand.pacsavedrift under/etc
- Use
scripts/run.shas the convenience alias when you want the audit plus markdown summary in one step. - Review the JSON output and summarize high-signal findings with
scripts/report.sh. - Ask for explicit approval before any cleanup action such as cache pruning, orphan removal, or config-file replacement.
- If a pacnew file exists, compare it against the active config before recommending merge or replacement steps.
Stop conditions
- Abort if
pacmanorjqis missing. - Abort if the active variant is marked
unsupported. - Abort if
sudo -n truefails and the next step would require privileges. - Abort before any cleanup or file replacement that has not been explicitly approved.
Output format
- Audit JSON with
cache_size,orphan_packages, andpacnew_files - A markdown summary of immediate issues
- Recommended next actions grouped into safe / needs approval
Example output
{
"cache_size": "3.4G",
"orphan_count": 2,
"orphan_packages": ["python-jaraco.functools", "qt5-webkit"],
"pacnew_count": 1,
"pacnew_files": ["/etc/pacman.conf.pacnew"]
}
## arch-sentry report
- pacman cache size: 3.4G
- orphan packages: 2
- pacnew / pacsave files: 1
### Recommended next actions
- Review orphan packages before removal.
- Review pacnew and pacsave files before replacing active configs.
Example invocations
skills/arch-sentry/scripts/audit.shskills/arch-sentry/scripts/report.shskills/arch-sentry/scripts/run.sh- "Run arch-sentry and tell me whether pacman cache cleanup is worth doing today."