This was generated by AI from an Architecture Review (arch-review).
What to build
One rule — "a distributed skill copy's body (frontmatter stripped) must equal the canonical skill body" — is currently implemented three times: the installer owns strip_frontmatter/extract_frontmatter and does the parity compare in its install planning; scripts/validate_skill_copies.py re-implements the same strip + compare; and the doctor health check dynamically loads that validation script by file path (via importlib + a uuid-suffixed module name) just to borrow strip_frontmatter. The installer's own docstring admits the coupling ("Body extraction matching scripts/validate_skill_copies.py"). Change one, the other two silently drift.
Promote a single Skill Body Parity module that owns frontmatter stripping and the canonical-vs-copies comparison, sourcing artifact paths from the Distribution Inventory. The installer's install planning, the doctor parity check, and the skill-copy validator all consult it instead of re-deriving the logic. The doctor's importlib/uuid script-loading seam is deleted.
This is a deepening refactor: observable behavior (install body-parity abort, doctor finding, validator exit code) is unchanged — only the owner of the rule moves.
Acceptance criteria
Blocked by
None - can start immediately.
What to build
One rule — "a distributed skill copy's body (frontmatter stripped) must equal the canonical skill body" — is currently implemented three times: the installer owns
strip_frontmatter/extract_frontmatterand does the parity compare in its install planning;scripts/validate_skill_copies.pyre-implements the same strip + compare; and the doctor health check dynamically loads that validation script by file path (viaimportlib+ auuid-suffixed module name) just to borrowstrip_frontmatter. The installer's own docstring admits the coupling ("Body extraction matching scripts/validate_skill_copies.py"). Change one, the other two silently drift.Promote a single Skill Body Parity module that owns frontmatter stripping and the canonical-vs-copies comparison, sourcing artifact paths from the Distribution Inventory. The installer's install planning, the doctor parity check, and the skill-copy validator all consult it instead of re-deriving the logic. The doctor's
importlib/uuidscript-loading seam is deleted.This is a deepening refactor: observable behavior (install body-parity abort, doctor finding, validator exit code) is unchanged — only the owner of the rule moves.
Acceptance criteria
scripts/validate_skill_copies.pyall call this module; no duplicate strip/compare implementations remain.scripts/validate_skill_copies.py(noimportlib/uuidscript loader) for body parity.--run-scriptspath or a full installer write.Blocked by
None - can start immediately.