Skip to content

Derive marketplace.json from skills/ (generator sync + CI drift check)#70

Merged
leggetter merged 1 commit into
mainfrom
claude/sync-marketplace-manifest
Jul 2, 2026
Merged

Derive marketplace.json from skills/ (generator sync + CI drift check)#70
leggetter merged 1 commit into
mainfrom
claude/sync-marketplace-manifest

Conversation

@leggetter

Copy link
Copy Markdown
Collaborator

Problem

.claude-plugin/marketplace.json is the plugin manifest, but it was hand-maintained and duplicated data already derivable from skills/ (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 a SKILL.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 short description/keywords on current entries are preserved and the diff stays purely additive. Also reports orphans (entries whose source dir no longer exists).
  • sync-marketplace generator command./scripts/generate-skills.sh sync-marketplace (write) and --check (report drift, exit non-zero for CI).
  • Generator wiringgenerateSkill now runs the sync after producing a skill and stages .claude-plugin/marketplace.json in the same feat: add <provider>-webhooks skill commit. This is the root-cause fix: previously only the skills/<provider>-webhooks dir was staged.
  • CI / validation
    • validate-provider.sh now fails a provider if it isn't registered in the manifest (zero-dep grep check; runs in the existing --detect-new PR gate).
    • A new manifest job in validate-provider-pr.yml runs sync-marketplace --check to catch orphans and any drift, and the workflow trigger now also fires on .claude-plugin/**.
  • Docs — AGENTS.md and CONTRIBUTING.md reference the tool in the add-a-provider and review checklists.

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:

  • --check passes 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.
  • Write mode adds the missing entry in the correct alphabetical position, produces a purely additive diff (no existing lines changed), valid JSON, and is idempotent (re-running is a no-op).
  • tsc --noEmit passes; validate-provider.sh still 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

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
@leggetter leggetter merged commit 52a4fac into main Jul 2, 2026
5 checks passed
@leggetter leggetter deleted the claude/sync-marketplace-manifest branch July 2, 2026 19:16
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.

2 participants