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.
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-basicsRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace /tmp/tons-of-skills-marketplace && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/tons-of-skills-marketplace/skills/.curated/clerk-security-basics ~/.gemini/antigravity-cli/skills/clerk-security-basicsAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install clerk-security-basics in Antigravity CLI
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 →Retrieves lab biomarker results and clinician notes from Function Health through its FHIR API. It is for people who want an AI assistant to review their own lab history and notes.
Gives an AI assistant a methodology for finding and exploiting privilege escalation weaknesses on Windows systems during authorized penetration tests. It is for security testers and defenders validating escalation paths.
Guides the assistant through designing, debugging and hardening GitHub Actions CI/CD workflows. It is aimed at teams that run production pipelines on GitHub.
Develops evidence-backed structural security hardening proposals from disclosures, findings, source code, or Codex Security scans. It is for teams that need systemic fixes and architectural tradeoffs.
Claude Security scans code for security issues with Claude Code. It covers whole repositories, branch or pull request diffs, single commits, and existing findings from SARIF files or earlier reports.
Turns vulnerability notes, disclosure reports, PoCs, source code, or Codex Security findings into self-contained vulnerability reports. Built for security researchers who need claims the evidence supports.
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.
