agentleFS
Ghost7802Ghost7802/awesome-api-skills/skills/clerk/SKILL.md

clerk

Skill13 starsChanged 27 days agoMITView on GitHub

  • Installs packages

16 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use clerk-custom-ui, clerk-nextjs-patterns and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • elpiartheraSkill

    clerk-custom-ui

    Customize Clerk component appearance - themes, layout, colors, fonts, CSS. Use for appearance styling, visual customization, branding.

    Also in 10 projects that use this

  • elpiartheraSkill

    clerk-nextjs-patterns

    Advanced Next.js patterns - middleware, Server Actions, caching with Clerk.

    Also in 8 projects that use this

  • sanketbodkeSkill

    clerk-billing

    Clerk Billing for subscription management - render Clerk's PricingTable

    Also in 4 projects that use this

  • AdiRishiSkill

    clerk-tanstack-patterns

    'TanStack React Start auth patterns with @clerk/tanstack-react-start

    Also in 4 projects that use this

  • oaknationalSkill

    clerk-backend-api

    Clerk Backend REST API explorer and executor. Browse tags, inspect endpoint schemas, and execute authenticated requests. Use when listing users, managing organizations, or calling any Clerk API endpoint.

    Also in 7 projects that use this

  • oaknationalSkill

    clerk-cli

    Operate the Clerk CLI (`clerk` binary) for authentication, user/org/session management, impersonation, local webhook testing, deploy verification, instance config, env keys, feature toggles, and any Clerk Backend, Platform, or Frontend API call. Use when the user mentions Clerk management tasks, "list clerk users", "impersonate a user", "test webhooks locally", "enable orgs", "enable billing", "clerk env pull", "clerk doctor", "clerk deploy", "clerk api", or any ad-hoc Clerk API request. Prefer the CLI over raw HTTP: it handles auth, key resolution, app/instance targeting, and formatting automatically.

    Also in 5 projects that use this

  • +4 more from elpiarthera

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 16 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Do not continuously query Clerk for user data.

    line 12
  2. Distinctive:

    Always verify the Svix signature on incoming webhooks to ensure the payload actually originated from Clerk.

    line 22
  3. Very specific:

    If auth() returns null in a Next.js App Router setup, ensure your middleware.ts is configured correctly and the route isn't accidentally …

    line 31
  4. Distinctive:

    Use this when your agent works with clerk — structured patterns beat pasted docs and prevent common hallucinations.

    line 42

“Common” is measured: kept by at least 6 in 10 of the 16 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Clerk API Skill

Quick Start

Clerk provides comprehensive authentication UIs and a powerful backend API. Install the specific SDK for your framework (e.g., @clerk/nextjs).

npm install @clerk/nextjs

Common Workflows

Webhook Synchronization

Do not continuously query Clerk for user data. Instead, configure Clerk Webhooks (user.created, user.updated) to push data to your primary database (Neon, Supabase). Rely on your local database for JOINs.

Production Patterns

JWT Verification

For microservices (Go, Python) communicating with a Clerk-secured frontend, extract the Bearer token and verify the JWT signature using Clerk's public JWKS endpoint. Do not rely solely on the frontend session state.

Error Recovery

Handle webhook delivery failures gracefully. Clerk webhooks include built-in Svix retry logic. Your webhook handler must be idempotent (e.g., using INSERT ... ON CONFLICT DO UPDATE).

Security Notes

Always verify the Svix signature on incoming webhooks to ensure the payload actually originated from Clerk. Never trust unverified JWTs in backend routes.

Performance Considerations

Clerk heavily optimizes the Auth object on the Edge. Use auth() or getAuth() in server components to avoid unnecessary network round trips when extracting the userId.

Testing Guidance

For E2E testing (Playwright/Cypress), utilize Clerk's dedicated Testing Tokens to bypass the UI flow and programmatically authenticate test runners without hitting rate limits or triggering fraud detection.

Troubleshooting

If auth() returns null in a Next.js App Router setup, ensure your middleware.ts is configured correctly and the route isn't accidentally excluded from the clerkMiddleware matcher.

References

Related Skills

  • Neon
  • Supabase
  • Resend

Why use this skill

Use this when your agent works with clerk — structured patterns beat pasted docs and prevent common hallucinations.

AI pitfalls

  • Using outdated SDK or API versions from training data
  • Inventing environment variable names
  • Omitting error handling and retry logic

Production checklist

  • Secrets in environment variables, not source code
  • Error handling and logging in place
  • Rate limits and timeouts configured

Related skills

  • neon — related to
  • supabase — related to
  • resend — related to

Last Verified: 2026-07-02

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.