Skip to content

feat(repo): add clerk-monorepo Claude Code skill#8769

Open
jacekradko wants to merge 5 commits into
mainfrom
jacek/clerk-monorepo-skill
Open

feat(repo): add clerk-monorepo Claude Code skill#8769
jacekradko wants to merge 5 commits into
mainfrom
jacek/clerk-monorepo-skill

Conversation

@jacekradko

@jacekradko jacekradko commented Jun 6, 2026

Copy link
Copy Markdown
Member

Claude Code had nothing repo-specific beyond the 16-line AGENTS.md, while Cursor already has a full .cursor/rules/ set. This adds the Claude Code counterpart: a clerk-monorepo skill that loads on demand for setup, picking which package to change, the dev loop, and changesets/commits. AGENTS.md stays the authority on the rules; the skill restates them in actionable form and links back, with reference files for the things nothing documented before (setup footguns, the package map, and the clerk-js/ui breaking-change checklist).

Worth scrutiny: the rule restatements in SKILL.md. I grounded them in commitlint.config.ts, turbo.json, and the package manifests rather than the prose docs, which corrected a few things: it's 21 active packages not 27, commitlint runs on the PR title, and docs is a type, not a scope (validated by running commitlint against sample titles).

Companion edits are minimal: the two .cursor rules get a stale-version fix (Node 18 / pnpm 9 to 24.15 / 10.33) and a typo fix so both surfaces agree, and AGENTS.md gets a one-line pointer to the skill. Empty changeset since nothing here touches a published package.

Summary by CodeRabbit

  • Documentation

    • Added detailed monorepo developer docs: repo overview, setup & dev workflow, package mapping, breaking-change guidance, and contribution rules for AI-assistant skills.
    • Added skill README and several reference pages to clarify testing, release flow, and common pitfalls.
  • Chores

    • Bumped required Node.js and pnpm minimum versions.
    • Clarified commit-message/PR scope conventions and contribution guidance.

Note: Internal developer-facing updates; no user-facing features.

@changeset-bot

changeset-bot Bot commented Jun 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ade1868

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Jun 6, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Jun 12, 2026 12:50pm
swingset Ready Ready Preview, Comment Jun 12, 2026 12:50pm

Request Review

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR introduces comprehensive developer guidance for the Clerk JavaScript SDK monorepo. A new Claude skill document defines setup, package structure, dev workflows, hard rules, and breaking-change detection. Three reference guides provide detailed breakdowns of breaking changes, package routing, and setup troubleshooting. Existing rule documents are updated with clarified requirements and integrated with the new skill.

Changes

Monorepo Developer Guidance

Layer / File(s) Summary
Core monorepo skill document
.claude/skills/clerk-monorepo/SKILL.md
Establishes the central developer skill covering monorepo overview (23 packages, pnpm workspaces, Turborepo), fast-path setup sequence, key package map, dev-loop recipes for building/testing subsets, hard rules (Node/pnpm versions, changesets, conventional commits, backwards-compat for clerk-js/ui, major-version gating), end-to-end PR flow from branching through changeset verification, breaking-change quick-check for clerk-js/ui, and references to deeper docs and release skills.
Supporting reference guides
.claude/skills/clerk-monorepo/references/breaking-changes.md, package-map.md, setup-and-footguns.md
Three detailed references: breaking-changes.md explains stricter SemVer for clerk-js/ui runtime reach, provides a decision matrix for breaking vs. safe changes, covers internal escape hatches (__internal_, /experimental paths), and documents CI enforcement (break-check, major-version gating); package-map.md documents 23 active packages with categories and backwards-compat status, describes the dependency pyramid (shared/backend → adapters → UI/runtime), and maps specific change areas (hooks, UI, backend, adapters, types, localization, Clerk API, test helpers, codemods) to relevant packages and validation paths; setup-and-footguns.md details exact first-time setup order, pnpm dev* targets, common setup footguns with fixes, unit vs. integration test strategies, and internal credential retrieval instructions.
Rule updates and publication
.changeset/clerk-monorepo-skill.md, AGENTS.md, .cursor/rules/development.mdc, .cursor/rules/monorepo.mdc, .claude/skills/README.md, docs/CONTRIBUTING.md
AGENTS.md expands conventional commit guidance to clarify PR-title enforcement, add ci and * to allowed scopes, mark scope as mandatory, and reference the new skill; .cursor/rules/development.mdc updates prerequisites to Node.js >=24.15.0 and pnpm >=10.33.0; .cursor/rules/monorepo.mdc corrects a clerk-js name reference; .changeset/clerk-monorepo-skill.md records the skill addition; .claude/skills/README.md and docs/CONTRIBUTING.md add guidance about Claude skills and working with AI assistants.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • prestonwebdev
  • alexcarpenter

🐰 From the warren, a gleeful hop and bound,
We've mapped the monorepo, all twenty-three around,
With footguns and breaking changes sketched out so clear,
Now developers and Claudes can work without fear!
The skill is now written, the rules are all set—
This repo's well-guided as guide-books can get!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'feat(repo): add clerk-monorepo Claude Code skill' directly and clearly summarizes the main change: adding a new Claude Code skill for the Clerk monorepo. It is specific, concise, and accurately reflects the primary objective documented in the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new

pkg-pr-new Bot commented Jun 6, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@8769

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@8769

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@8769

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@8769

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@8769

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@8769

@clerk/express

npm i https://pkg.pr.new/@clerk/express@8769

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@8769

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@8769

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@8769

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@8769

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@8769

@clerk/react

npm i https://pkg.pr.new/@clerk/react@8769

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@8769

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@8769

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@8769

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@8769

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@8769

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@8769

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@8769

commit: ade1868

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (3)
.claude/skills/clerk-monorepo/references/package-map.md (3)

86-87: 💤 Low value

Hyphenate "client-side" in compound modifier.

Line 86–87 uses "client side" but should be "client-side" when used as a compound adjective.

📝 Proposed fix
- **Next.js middleware / route handlers / server components**: `packages/nextjs/src` (client side
-   reuses `@clerk/react` unchanged).
+ **Next.js middleware / route handlers / server components**: `packages/nextjs/src` (client-side
+   reuses `@clerk/react` unchanged).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/skills/clerk-monorepo/references/package-map.md around lines 86 -
87, Update the compound modifier in the sentence describing Next.js artifacts:
change "client side reuses `@clerk/react` unchanged" to "client-side reuses
`@clerk/react` unchanged" so "client-side" is hyphenated when used as an
adjective; locate the phrase following "Next.js middleware / route handlers /
server components" and replace "client side" with "client-side".

86-86: 💤 Low value

Hyphenate "client-side" in compound modifier.

Line 86 uses "client side" but should be "client-side" when used as a compound adjective before a noun.

📝 Proposed fix
- `react`/`astro`/`vue`/`chrome-extension` adapters; its compiled runtime is delivered alongside
+ `react`/`astro`/`vue`/`chrome-extension` adapters; its compiled runtime is delivered alongside

Actually, re-reading line 86-87:

`react`/`astro`/`vue`/`chrome-extension` adapters; its compiled runtime is delivered alongside
`clerk-js` (both are backwards-compat sensitive), though `clerk-js` does not declare it as a package

The phrase is in the middle of explaining that ui is consumed by adapters. Let me find the exact phrase. Looking at the context provided, line 86 context is:

- `react`/`astro`/`vue`/`chrome-extension` adapters; its compiled runtime is delivered alongside

So "client side" would need to be in a different part. Let me look at the original again... Actually looking at the LanguageTool hint:

[grammar] ~86-~86: Use a hyphen to join words.
Context: ...ponents**: `packages/nextjs/src` (client side   reuses `@clerk/react` unchanged)....

So it's on line 86 in the "Change X, touch Y" section under Next.js. The context shows "(client side reuses..." which should be "(client-side reuses...". Let me find where in the range this is. Looking at the provided code more carefully...

Looking at lines 86-87 in the provided code:

- **Next.js middleware / route handlers / server components**: `packages/nextjs/src` (client side
  reuses `@clerk/react` unchanged).

So "client side" spans lines 86-87 and should be "client-side". Let me correct my comment.

Actually, let me revert and fix the comment properly:

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/skills/clerk-monorepo/references/package-map.md at line 86, The
phrase "client side" in the Next.js section should be hyphenated as
"client-side"; update the text near the bullet "**Next.js middleware / route
handlers / server components**: `packages/nextjs/src` (client side reuses
`@clerk/react` unchanged)" to read "(client-side reuses `@clerk/react`
unchanged)" so the compound modifier is grammatically correct.

52-61: ⚡ Quick win

Add language identifier to fenced code block.

Line 52 starts a code block (three backticks) without specifying a language. This should have a language identifier (e.g., ```text) for consistency with Prettier formatting guidelines and markdown best practices.

📝 Proposed fix
 ## Dependency shape
 
-```
+```text
 
                 `@clerk/shared`            (≈20 dependents, the base of the pyramid)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/skills/clerk-monorepo/references/package-map.md around lines 52 -
61, Add a language identifier to the fenced code block that begins with the
three backticks before the ASCII diagram (the block containing "`@clerk/shared`",
"`@clerk/react`", "`@clerk/backend`", "`@clerk/ui`", and "`@clerk/clerk-js`") by
changing the opening fence to include a language token such as ```text so the
block is consistently formatted for Prettier/Markdown; update only the opening
backticks for that diagram block.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.claude/skills/clerk-monorepo/references/package-map.md:
- Around line 86-87: Update the compound modifier in the sentence describing
Next.js artifacts: change "client side reuses `@clerk/react` unchanged" to
"client-side reuses `@clerk/react` unchanged" so "client-side" is hyphenated
when used as an adjective; locate the phrase following "Next.js middleware /
route handlers / server components" and replace "client side" with
"client-side".
- Line 86: The phrase "client side" in the Next.js section should be hyphenated
as "client-side"; update the text near the bullet "**Next.js middleware / route
handlers / server components**: `packages/nextjs/src` (client side reuses
`@clerk/react` unchanged)" to read "(client-side reuses `@clerk/react`
unchanged)" so the compound modifier is grammatically correct.
- Around line 52-61: Add a language identifier to the fenced code block that
begins with the three backticks before the ASCII diagram (the block containing
"`@clerk/shared`", "`@clerk/react`", "`@clerk/backend`", "`@clerk/ui`", and
"`@clerk/clerk-js`") by changing the opening fence to include a language token
such as ```text so the block is consistently formatted for Prettier/Markdown;
update only the opening backticks for that diagram block.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Repository UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 7d112dcf-56ec-4d08-840d-1393b0eb43b4

📥 Commits

Reviewing files that changed from the base of the PR and between 8744728 and 75d8cf0.

📒 Files selected for processing (8)
  • .changeset/clerk-monorepo-skill.md
  • .claude/skills/clerk-monorepo/SKILL.md
  • .claude/skills/clerk-monorepo/references/breaking-changes.md
  • .claude/skills/clerk-monorepo/references/package-map.md
  • .claude/skills/clerk-monorepo/references/setup-and-footguns.md
  • .cursor/rules/development.mdc
  • .cursor/rules/monorepo.mdc
  • AGENTS.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/skills/README.md:
- Line 22: The README's statement that edits to SKILL.md "take effect
immediately, including in already-running sessions" is incorrect; update the
sentence in README.md to clarify that the skill instruction is loaded when a
skill is invoked and edits to SKILL.md will not affect an already-invoked skill
until the skill is re-invoked or a new session is started, e.g., replace the
claim with wording that changes take effect after re-invoking the skill or
starting a new session so readers understand the SKILL.md is not refreshed
mid-session.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Repository UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 311a363c-52dc-4e77-9b27-d853c1460f51

📥 Commits

Reviewing files that changed from the base of the PR and between 75d8cf0 and ade1868.

📒 Files selected for processing (2)
  • .claude/skills/README.md
  • docs/CONTRIBUTING.md
✅ Files skipped from review due to trivial changes (1)
  • docs/CONTRIBUTING.md

Comment thread .claude/skills/README.md
4. Files under `references/` are read only when the loaded skill points at them, so deep-dive
content stays out of context until it is needed.

Edits to a `SKILL.md` take effect immediately, including in already-running sessions.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
ls -la .claude/skills || true
sed -n '1,80p' .claude/skills/README.md
nl -ba .claude/skills/README.md | sed -n '15,35p'

Repository: clerk/javascript

Length of output: 2967


🌐 Web query:

Claude Code SKILL.md edits take effect already-running session re-read invoked skill content stays in session

💡 Result:

Claude Code features live change detection for SKILL.md files, which allows edits to take effect in an already-running session without requiring a full restart [1][2][3]. However, once a skill is invoked, its content is injected into the session as a single message and remains there for the duration of that session [1][2][3]. Claude Code does not re-read or refresh the SKILL.md file on subsequent turns within the same session after it has already been invoked [1][2][3]. Consequently, if you edit a SKILL.md file after having already triggered the skill during your current session, Claude will continue to use the version of the instructions it loaded during the initial invocation [1][3]. To ensure Claude uses the updated instructions, you must either start a new session or be aware that the changes will only apply if the skill is triggered for the first time after the file has been edited [1][2][3]. For changes to plugin-based skill components—such as hooks,.mcp.json, agents, or output-styles—you must use the /reload-plugins command to apply updates [1][2][3].

Citations:


Clarify when SKILL.md edits apply during an active session.

.claude/skills/README.md line 22 claims edits apply immediately in already-running sessions, but Claude Code keeps the already-invoked skill instructions loaded for the session and doesn’t refresh the SKILL.md on subsequent turns; updates take effect after re-invoking the skill (or starting a new session).

🔧 Suggested wording
-Edits to a `SKILL.md` take effect immediately, including in already-running sessions.
+Edits to a `SKILL.md` take effect for new invocations; re-invoke the skill or start a new session to pick up changes.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Edits to a `SKILL.md` take effect immediately, including in already-running sessions.
Edits to a `SKILL.md` take effect for new invocations; re-invoke the skill or start a new session to pick up changes.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/skills/README.md at line 22, The README's statement that edits to
SKILL.md "take effect immediately, including in already-running sessions" is
incorrect; update the sentence in README.md to clarify that the skill
instruction is loaded when a skill is invoked and edits to SKILL.md will not
affect an already-invoked skill until the skill is re-invoked or a new session
is started, e.g., replace the claim with wording that changes take effect after
re-invoking the skill or starting a new session so readers understand the
SKILL.md is not refreshed mid-session.

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