Skip to content

fix(marketplace): key plugin skill dirs by id, not shortId - #308

Open
Peetee06 wants to merge 4 commits into
PostHog:mainfrom
Peetee06:fix/wrong-skill-publishing
Open

fix(marketplace): key plugin skill dirs by id, not shortId#308
Peetee06 wants to merge 4 commits into
PostHog:mainfrom
Peetee06:fix/wrong-skill-publishing

Conversation

@Peetee06

@Peetee06 Peetee06 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Fixes #309.

shortId is unique only within a skill group, but a plugin aggregates many groups — so two skills collapsed into one directory. Keyed by id instead, which the mega-plugin already does.

Also fixes the log line that hid it: it counted skills offered rather than copied, so the build reported 40 while writing 39.

Blast radius

Grouped-plugin skill dirs get their full id (allomnibus-instrument-integration, djangointegration-django). Nothing reads those names:

  • Skills resolve by frontmatter name:, which has always been the full id — integration/skills/django/SKILL.md reads name: integration-django today. No invocation name changes; this fixes a skill going missing.
  • plugin.json carries no skill list, and nothing in the repo hardcodes skills/<name>
  • posthog-all already ships these exact names, so the two plugins converge
  • The ai-plugin sync reads posthog-all/skills, already keyed by id — untouched
pnpm build | grep 'posthog-integration'                          # 40 skills, and now 40 on disk
ls dist/marketplace/plugins/posthog-integration/skills | wc -l   # 39 before, 40 after

Won't reach PostHog/skills yet

PostHog/skills is stale since March — the release workflow's push step is skipped after Generate skills repo token fails (latest run), and recent syncs came from releaser-skills[bot] instead.

So #309's reproduction keeps returning the wrong name: until that sync runs again — you'll know which path owns it.

`shortId` is a skill's variant id within its group, so it is unique only
per-group. A plugin aggregates many groups, so keying its skill dirs by
`shortId` puts a group-scoped key into a plugin-scoped namespace.

Two skills collide today: `omnibus/instrument-integration` and
`omnibus/instrument-product-analytics` both declare `category: integration`
with a single variant `id: all`, so both resolve to
`plugins/posthog-integration/skills/all`. `copyDirSync` merges file-by-file
without clearing, so the survivor also inherits the loser's leftover
references.

Use the globally-unique `id`, matching what the mega-plugin already does,
and throw on a duplicate id the way `writeBundles` already does for
duplicate variant ids.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SGVmnRUtrXyxgpwxUtoarr
Peetee06 and others added 3 commits August 2, 2026 12:18
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SGVmnRUtrXyxgpwxUtoarr
The `seen` set was scoped per plugin, so two skills sharing an id in
different plugins never met the guard and both landed in the mega-plugin,
which pools every plugin's skills — the same silent-overwrite failure as
grouped plugins had, one directory over.

Hoist the set to function scope so one id maps to one dir build-wide, and
widen the tests: a second plugin in the fixture (keying by `shortId` for
even one plugin now fails), plus an assertion on the mega-plugin's dirs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SGVmnRUtrXyxgpwxUtoarr
The per-plugin line reported the input array length, so a skill whose
source dir was missing — skipped with a warning just above — still counted
as shipped. That is what made PostHog#309 hard to spot: the build logged
40 skills for posthog-integration while writing 39.

Count the copies instead. The mega-plugin line and the returned skillCount
already derive from allSkillEntries, which is appended only after a
successful copy, so they were already truthful.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SGVmnRUtrXyxgpwxUtoarr
@Peetee06
Peetee06 marked this pull request as ready for review August 2, 2026 10:56
@Peetee06
Peetee06 requested a review from a team as a code owner August 2, 2026 10:56
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.

posthog-integration publishes the wrong skill under skills/all

1 participant