Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

clerk-security-basics

Skill by jeremylongshore

Clerk Security Basics is a skill that guides hardening of Clerk authentication in an application. It covers environment variables, middleware, API routes, webhooks and session freshness. It is for developers securing or reviewing a Clerk setup before production.

  • Score 77
  • 3k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install clerk-security-basics

Built from the published package, never by AI.

git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace /tmp/tons-of-skills-marketplace && mkdir -p ~/.claude/skills && cp -r /tmp/tons-of-skills-marketplace/skills/.curated/clerk-security-basics ~/.claude/skills/clerk-security-basics

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install clerk-security-basics in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

Clerk Security Basics is an agent skill, defined in a SKILL.md file, that helps implement security best practices for Clerk authentication. It covers environment variable protection, hardened middleware with security headers, API route checks for authentication, authorization and input validation, Svix-based webhook signature verification, and session freshness checks for sensitive operations. It also lists Clerk Dashboard session settings to review.

The skill is written for Next.js code that uses the Clerk SDK, with examples based on clerkMiddleware, auth(), and svix. It lists prerequisites: an installed and configured Clerk SDK, an understanding of OWASP authentication practices, and a production deployment that is planned or active. The source suggests running clerk-prod-checklist next. It is intended for developers reviewing or hardening Clerk auth in their applications.

Written from the project's SKILL.md and checked against it.

What it can do

  • Environment variable protectionShows how to keep Clerk secret keys server-only and out of git.
  • Hardened middlewareProtects non-public routes with auth.protect() and sets security headers.
  • API route defenseChecks authentication, permission-based authorization and input length.
  • Webhook verificationVerifies Clerk webhook signatures with Svix and rejects missing headers.
  • Session freshness checksRejects sensitive actions when the session is older than five minutes.
  • Rate limiting exampleShows a sliding-window limiter per user using Upstash ratelimit.

What you need

  • Clerk SDK installed and configured
  • Clerk secret key and webhook secret
  • Next.js project using @clerk/nextjs
  • Svix package for webhook verification
  • Production deployment planned or active

Try asking

  • Review my Clerk middleware and add security headers
  • Harden my API route so only org admins can call it
  • Verify Clerk webhook signatures in my Next.js app

Good to know

  • Step 3 rate limiting is only a comment; the limiter is shown in a separate example
  • Code examples are written for Next.js and the Clerk Next.js SDK
  • Session lifetime and inactivity settings must be changed in the Clerk Dashboard

Security check

B
  • Allowed to use Write, Edit without limitsIn SKILL.md

Checked automatically: skills/.curated/clerk-security-basics/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

Allowed tools: ReadWriteEditGrep

Alternatives to clerk-security-basics

All alternatives →

Compare with function_health, windows-privilege-escalation or github-actions-advanced

clerk-security-basics: common questions

Does this skill change my Clerk settings automatically?

The source describes code examples and Clerk Dashboard settings to review. It lists the tools as Read, Write, Edit and Grep, and does not say it changes Dashboard settings.

Which frameworks does this skill cover?

The examples use Next.js with @clerk/nextjs, including middleware.ts and app route handlers. The source does not describe other frameworks.

What should I do after this skill?

The source says to proceed to clerk-prod-checklist for a production readiness review.

How do I install clerk-security-basics?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is clerk-security-basics free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is clerk-security-basics safe to use?

It scores 77 of 100. Grades: maintenance A, licence A, quality A. Security check: grade B (allowed to use write, edit without limits). Review the code before you install. How grades work.

What are alternatives to clerk-security-basics?

Similar skills: function_health, windows-privilege-escalation, github-actions-advanced, propose-security-hardening.

clerk-security-basics Install

Add to stack

Loading.