fix(validate-plugin): kind-aware content check for code-class plugins #38
Reference in New Issue
Block a user
Delete Branch "fix/validate-plugin-kind-aware-content"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Root cause
validate-plugin.pycheck #5 ("Has content") only accepted skill-class markers(
SKILL.md/hooks//skills//rules/) and was unaware ofplugin.yamlkind.molecule-ai/molecule-ai-plugin-gh-identityis a Gokind: env-mutatorplugin whose content is a Go module (
go.mod) wired through anentrypoint(
pluginloader.BuildRegistry) plus an embeddedwrapper.sh— none of theskill markers. So its
CI / validatejob hard-failed on:This was a documented true-positive-of-the-wrong-contract (see that repo's
ci.yml header) blocked on the validator-semantics gap. It turned the plugin's
CI / validate (push)red on main HEAD.Fix
Make check #5 kind-aware:
skill/agent-skill/claude-skill):unchanged — must ship at least one skill marker.
kind, e.g.env-mutator):content =
go.modand a declaredentrypoint. Both are required sosetting
kind:alone can't let an empty repo pass.Verified: the new validator returns exit 0 against the real gh-identity
checkout and still fails an empty repo / a
kind:-only repo with nogo.mod.Both copies of the script are updated (
scripts/and.molecule-ci/scripts/—the gh-identity CI fetches the latter; they are kept byte-identical).
Tests
New
scripts/test_validate_plugin.py(runs in the existingpytestjob):11 subprocess-driven cases covering skill-class accept, code-class accept,
kind:-only / missing-go.mod/ missing-entrypointrejects, and therequired-field/version/runtimes shape checks. All green locally.
Follow-up (not in this PR)
Once merged,
molecule-ai-plugin-gh-identity'sCI / validategoes green onits next run (it fetches this script fresh each run). The
CI / validatecontext can then be made BP-required there per RFC internal#476 P1.
🤖 Generated with Claude Code
Reviewed for correctness and contract integrity.
kindrequiresgo.modANDentrypoint→ else (skill kind, no markers) the original error. Backward compatible: unset/skill/agent-skill/claude-skillstay skill-class.kind:alone cannot let an empty repo pass — go.mod + entrypoint are both required for the code-class path. Good fail-closed posture.scripts/and.molecule-ci/scripts/) updated identically; gh-identity CI fetches the latter.test_validate_plugin.pyis subprocess-driven (the validator isn't import-safe / calls sys.exit), exercising the exact CI entrypoint, and covers skill-accept, code-accept, the three reject branches, and the shape checks. CIValidator pytest suitesis green.Sound, minimal, no weakening of any existing check. Approve.
Security review.
kind:.os.path.isfile("go.mod")is cwd-relative as before).No security concerns. Approve.