Skip to content

Compress Next.js quickstart prompt for Cursor deeplink limit#3169

Merged
manovotny merged 3 commits intomainfrom
mw/compress-nextjs-prompt-deeplink-limit
Mar 5, 2026
Merged

Compress Next.js quickstart prompt for Cursor deeplink limit#3169
manovotny merged 3 commits intomainfrom
mw/compress-nextjs-prompt-deeplink-limit

Conversation

@mwickett
Copy link
Copy Markdown
Member

@mwickett mwickett commented Mar 3, 2026

Summary

  • Compresses prompts/nextjs-quickstart.md from 10,805 → 4,969 URL-encoded chars (limit is 8,000)
  • Same sections preserved: keyless mode, code samples, rules, verification, after-setup steps
  • All grader keywords retained
  • Adds scripts/check-prompt-deeplink-length.ts CI check that fails if any prompt in prompts/ exceeds the 8,000 encoded char limit
  • Adds lint:check-prompt-deeplink-length script and CI workflow step

Related

Context

Cursor's "Open in Cursor" deeplink has an 8,000 char limit on the URL-encoded text. The previous prompt was 7,375 raw chars but 10,805 encoded — always exceeding the limit and causing "Invalid text for prompt" errors.

Test plan

  • pnpm run lint:check-prompt-deeplink-length passes locally
  • Verify "Open in Cursor" button works on the Next.js quickstart docs page
  • CI lint job passes

@mwickett mwickett requested a review from a team as a code owner March 3, 2026 21:36
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-docs Ready Ready Preview Mar 4, 2026 10:51pm

Request Review

Cursor's 8,000 char limit applies to URL-encoded text. The previous
prompt was 10,805 encoded, always exceeding the limit. Compressed to
5,467 encoded chars while preserving all grader keywords.

Updated for Core 3: <Show> replaces <SignedIn>/<SignedOut>,
ClerkProvider moves inside <body>.

Also adds a CI check that validates quickstart prompts stay under the
encoded limit (warns on other prompts like upgrade guides).
@mwickett mwickett force-pushed the mw/compress-nextjs-prompt-deeplink-limit branch from 561d272 to 9010bf9 Compare March 3, 2026 22:16
@SarahSoutoul SarahSoutoul self-assigned this Mar 4, 2026
- Fail CI by default when any prompt exceeds the 8000 char limit
- Add EXCLUDED_PROMPTS array for explicitly bypassing the check
- Measure full deeplink URL length instead of just encoded content
- Improve output with colored status and accurate summary counts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@manovotny
Copy link
Copy Markdown
Contributor

manovotny commented Mar 4, 2026

I updated the prompt deeplink length check to be stricter and more flexible. 02b1eb1

  • Improved output — Color-coded results (green/yellow/red), accurate summary counts that account for excluded files, and actionable failure messages that explain how to fix or bypass.
  • Accurate URL measurement — Now measures the full deeplink URL length (using URLSearchParams) instead of just the encoded content length, matching what's actually generated on the site. + works just fine, and is two characters less per space than encodeURIComponent's %20, giving us more of our own characters to work with.
  • Fail by default — All prompts now fail CI if they exceed the 8,000 char deeplink URL limit (they were silently failing). Previously, only quickstart prompts were enforced while others just warned. The "Open in Cursor" button won't render for prompts over the limit, so failures should be explicit. There is logic on the clerk.com side that will auto-hide the button if the prompt is over 8,000 characters, but we want an early indicator here stating that's what will happen.
    CleanShot 2026-03-04 at 16 47 17@2x
  • Exclusion list — Added an EXCLUDED_PROMPTS array for prompts that intentionally exceed the limit (e.g., core-3-upgrade.md). This keeps the check strict while allowing deliberate opt-outs.
    CleanShot 2026-03-04 at 16 47 30@2x

@manovotny manovotny merged commit b4ddf2a into main Mar 5, 2026
8 checks passed
@manovotny manovotny deleted the mw/compress-nextjs-prompt-deeplink-limit branch March 5, 2026 15:52
SarahSoutoul added a commit to ivancernja/clerk-docs that referenced this pull request Mar 23, 2026
)

Co-authored-by: Sarah Soutoul <sarah@clerk.dev>
Co-authored-by: Michael Novotny <manovotny@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

3 participants