Context
Three drift-review scripts each re-implement the same engine: a tty guard (silent exit when non-interactive), a declared-vs-installed set diff, an interactive [a]dd / [r]emove / [i]gnore / [s]kip loop, and overlay-file appending. That's ~100+ duplicated lines per script; only the package parser and the overlay-append format genuinely differ.
This is a real seam with two-plus adapters: the interactive engine is one deep module, the per-tool parsing/appending are thin adapters over it.
Files
home/dot_scripts/executable_brew-review (333 lines)
home/dot_scripts/executable_choco-review (307 lines)
home/dot_scripts/executable_skills-review (266 lines)
What to do
- Load
homebrew-management (.agents/skills/homebrew-management/SKILL.md) and update-skills (.agents/skills/update-skills/SKILL.md) first — brew-review and skills-review are governed by them.
- Extract
home/dot_scripts/review-lib (a sourced shell library) holding the shared engine: tty guard, declared-vs-installed diff, the 4-choice prompt loop, ignored-set filtering, and overlay append.
- Reduce each
*-review script to: source the lib + provide adapters (extract_declared, extract_installed, append_overlay) + invoke the engine.
- Verify each script's interactive behaviour is unchanged (same prompts, same overlay edits) on a manual run.
Out of scope
- Adding new review tools.
- Changing the overlay file formats.
Context
Three drift-review scripts each re-implement the same engine: a tty guard (silent exit when non-interactive), a declared-vs-installed set diff, an interactive
[a]dd / [r]emove / [i]gnore / [s]kiploop, and overlay-file appending. That's ~100+ duplicated lines per script; only the package parser and the overlay-append format genuinely differ.This is a real seam with two-plus adapters: the interactive engine is one deep module, the per-tool parsing/appending are thin adapters over it.
Files
home/dot_scripts/executable_brew-review(333 lines)home/dot_scripts/executable_choco-review(307 lines)home/dot_scripts/executable_skills-review(266 lines)What to do
homebrew-management(.agents/skills/homebrew-management/SKILL.md) andupdate-skills(.agents/skills/update-skills/SKILL.md) first — brew-review and skills-review are governed by them.home/dot_scripts/review-lib(a sourced shell library) holding the shared engine: tty guard, declared-vs-installed diff, the 4-choice prompt loop, ignored-set filtering, and overlay append.*-reviewscript to: source the lib + provide adapters (extract_declared,extract_installed,append_overlay) + invoke the engine.Out of scope