Derive marketplace.json from skills/ (generator sync + CI drift check)#70
Merged
Conversation
The plugin manifest (.claude-plugin/marketplace.json) was hand-maintained and silently drifted from skills/. Make it a derived, drift-checked artifact: - Add lib/marketplace.ts: non-destructive sync that adds a plugin entry for any skill directory missing one (seeded from SKILL.md frontmatter + conventions), inserted alphabetically within the provider section. Existing entries are never rewritten or reordered, so curated descriptions/keywords are preserved. - Add a 'sync-marketplace' generator command (with --check for CI/reporting). - Wire the sync into skill generation so a newly generated skill registers itself and marketplace.json is staged in the same commit. - validate-provider.sh now fails if a provider is not registered in the manifest; add a 'manifest' CI job that runs sync-marketplace --check and widen the workflow trigger to .claude-plugin/**. - Document the tool in AGENTS.md and CONTRIBUTING.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TkRuaGgYUz9q4k3yokqWKm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
.claude-plugin/marketplace.jsonis the plugin manifest, but it was hand-maintained and duplicated data already derivable fromskills/(name, description) plus pure boilerplate (source, homepage, author, license). Nothing kept it in sync, so it silently drifted — a newly generated skill would ship without a manifest entry and nobody would notice until someone tried to install it.Approach
Make the manifest a derived, drift-checked artifact instead of a hand-maintained one — without churning the existing file.
lib/marketplace.ts— a non-destructive sync. It adds a plugin entry for any skill directory (one with aSKILL.md) that lacks one, seeded from the skill's SKILL.md frontmatter + repo conventions, spliced in alphabetically within the provider section as text. Existing entries are never rewritten or reordered, so the curated shortdescription/keywordson current entries are preserved and the diff stays purely additive. Also reports orphans (entries whosesourcedir no longer exists).sync-marketplacegenerator command —./scripts/generate-skills.sh sync-marketplace(write) and--check(report drift, exit non-zero for CI).generateSkillnow runs the sync after producing a skill and stages.claude-plugin/marketplace.jsonin the samefeat: add <provider>-webhooks skillcommit. This is the root-cause fix: previously only theskills/<provider>-webhooksdir was staged.validate-provider.shnow fails a provider if it isn't registered in the manifest (zero-dep grep check; runs in the existing--detect-newPR gate).manifestjob invalidate-provider-pr.ymlrunssync-marketplace --checkto catch orphans and any drift, and the workflow trigger now also fires on.claude-plugin/**.Why non-destructive (not a full regenerate)
The current manifest mixes curated one-line descriptions and keyword sets that are intentionally richer than the SKILL.md discovery blurbs, and it carries curated non-provider plugins (
webhook-handler-patterns,hookdeck-event-gateway,outpost, …). A full regenerate would reword those and normalize incidental formatting (the file even has inconsistent Unicode escaping between entries). Additive sync keeps curation and human control while guaranteeing no skill is left unregistered.Testing
Verified locally against the generator's own repo state:
--checkpasses on an in-sync tree; exits non-zero and lists the offender when a skill is added without an entry, or when an entry is orphaned.tsc --noEmitpasses;validate-provider.shstill passes for existing providers with the new manifest check.Note
This is intentionally scoped to the tooling only (branched from
main) so it reviews independently of the "add 17 skills" PR (#69). Once both land, the 17 skills added there are already registered in the manifest; this tool keeps them — and everything future — from drifting again.🤖 Generated with Claude Code
https://claude.ai/code/session_01TkRuaGgYUz9q4k3yokqWKm
Generated by Claude Code