Skip to content

refactor(skill-parity): own canonical↔copies body rule in one module#87

Merged
derek-palmer merged 1 commit into
mainfrom
feat/skill-body-parity-module
May 30, 2026
Merged

refactor(skill-parity): own canonical↔copies body rule in one module#87
derek-palmer merged 1 commit into
mainfrom
feat/skill-body-parity-module

Conversation

@derek-palmer
Copy link
Copy Markdown
Owner

Closes #81.

What

Promotes a Skill Body Parity module (src/codeforerunner/skill_parity.py) that owns:

  • frontmatter parsing (split_frontmatter, body_of)
  • the canonical-vs-distributed-copies body comparison (check_skill_body_parityParityResult)

sourcing artifact paths from the Distribution Inventory. The rule previously lived in three places; now there is one owner:

  • installer.pystrip_frontmatter/extract_frontmatter delegate to the module (names kept for callers/tests).
  • doctor.py_check_skill_body_parity maps ParityResultFindings.
  • scripts/validate_skill_copies.py — calls the module; its own strip+compare removed.

Leaky seam deleted

doctor.py no longer dynamically loads scripts/validate_skill_copies.py via importlib + a uuid-suffixed module name to borrow strip_frontmatter. Because parity now only reads files (no target-repo code executed), the body-parity check runs without --run-scripts. That flag still gates the marketplace check, which does load a repo script. No other observable behavior changes.

Tests (TDD)

  • tests/test_skill_parity.py — 9 tests: frontmatter split/body (incl. CRLF), parity ok, drift, missing copy, missing canonical.
  • Existing installer, doctor, and validator suites pass unchanged.

282 pytest + node green locally; validate_skill_copies.py green.

🤖 Generated with Claude Code

Promote a Skill Body Parity module that owns frontmatter stripping and the
canonical-vs-distributed-copies body comparison, sourcing paths from the
Distribution Inventory. installer (strip/extract_frontmatter), doctor
(_check_skill_body_parity), and scripts/validate_skill_copies.py now call
it instead of re-implementing the rule.

Deletes doctor's importlib+uuid dynamic load of validate_skill_copies.py:
since parity now only reads files (no target-repo code executed), the
check runs without --run-scripts. Observable behavior is otherwise
unchanged; --run-scripts still gates the marketplace script load.

Closes #81
@derek-palmer derek-palmer merged commit c7ec8dd into main May 30, 2026
12 checks passed
@derek-palmer derek-palmer deleted the feat/skill-body-parity-module branch May 30, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deepen Skill Body Parity behind one seam

1 participant