Skip to content

Keep generated plugin slugs off the static routes under /plugins/ - #479

Open
deanrie wants to merge 1 commit into
cursor:mainfrom
deanrie:fix/reserved-plugin-slugs
Open

deanrie wants to merge 1 commit into
cursor:mainfrom
deanrie:fix/reserved-plugin-slugs

Conversation

@deanrie

@deanrie deanrie commented Oct 29, 2026

Copy link
Copy Markdown

Problem

generate_plugin_slug derives the slug from the plugin name, and the app always inserts without a slug (apps/cursor/src/lib/plugins/insert.ts). A plugin named New (or new!, NEW) gets the slug new, and /plugins/new is the submission form (apps/cursor/src/app/plugins/new/page.tsx). Next.js resolves the static segment before [slug], so every link to that plugin, including the one the submitter is redirected to after creating it, opens the form instead of the listing. opengraph-image is the other static sibling under apps/cursor/src/app/plugins/. next.config.mjs already carves new out of the /mcp/:slug redirect for the same reason, so the name is a known hazard on the routing side but not on the slug side.

Fix

One migration that replaces generate_plugin_slug: when the derived slug is new or opengraph-image, append -plugin before the existing duplicate check. Explicit slugs, existing rows and every other name are unchanged. No TypeScript change is needed because the app never sets plugins.slug itself.

Verification

Ran the base-schema function and the migration against a scratch table in postgres:16:

name slug before slug after
New new new-plugin (or new-plugin-<6 hex> when taken)
new!, NEW new-<6 hex> new-plugin-<6 hex>
Opengraph Image opengraph-image opengraph-image-plugin
New Relic, Hello World unchanged unchanged
explicit slug = 'new-explicit' unchanged unchanged

No open PR or issue touches generate_plugin_slug or the /plugins/new route.

A plugin named "New" gets the slug `new`, and /plugins/new is the
submission form, which Next.js resolves before [slug]; the listing is
unreachable. Same for `opengraph-image`. Append `-plugin` to those two
derived slugs in generate_plugin_slug before the duplicate check.

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