Skip to content

fix(github-plugin): keep same-named components from different sub-plugins instead of dropping the later one - #476

Open
deanrie wants to merge 1 commit into
cursor:mainfrom
deanrie:fix/subplugin-slug-collisions
Open

deanrie wants to merge 1 commit into
cursor:mainfrom
deanrie:fix/subplugin-slug-collisions

Conversation

@deanrie

@deanrie deanrie commented Oct 26, 2026

Copy link
Copy Markdown

What

When two sub-plugins in one repository ship a component with the same file or directory name, the GitHub import now keeps both. The first occurrence keeps its slug; the later one gets its sub-plugin directory as a slug prefix, the way the hooks component already does.

Why

parseGitHubPlugin walks the repo root and every sub-plugin dir and derives component slugs from the file or directory name only (rules/<file>.mdc, skills/<dir>/SKILL.md, agents/<file>.md, commands/<file>.md). The final dedup keeps the first type:slug and silently drops every later one. In a monorepo, alpha/skills/setup/SKILL.md and beta/skills/setup/SKILL.md import as one skill; beta's copy disappears without an error.

cursor/plugins itself has two such collisions today: skills/pr-review-canvas exists in both cursor-team-kit and pr-review-canvas, and skills/thermo-nuclear-code-quality-review in both cursor-team-kit and thermos. An import of that repo, or of a fork used as a personal marketplace, loses one copy of each.

Change

parse.ts records which prefix each component came from. In the dedup, a component whose type:slug is already taken and that came from a sub-plugin dir gets slugify("<dir> <slug>") (capped at 80 by slugify); only a key that still collides after that is dropped. Components from the repo root, and every component of a single-plugin repo, keep exactly the slug they have today, so existing listings and the rescan diff keys in update-plugin.ts do not move for them.

Checked

@vercel

vercel Bot commented Oct 26, 2026

Copy link
Copy Markdown

@deanrie is attempting to deploy a commit to the Anysphere Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

1 participant