Agent skill · software engineering · jeremylongshore

clerk-reference-architecture

Reference architecture patterns for Clerk authentication.

Why this skill is useful

Provides specific architectural patterns and code snippets for implementing Clerk authentication in various application contexts that the AI wouldn't reliably generate on its own.

What it needs

Requires clerk account access. About 4k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

Clerk Reference Architecture Overview Reference architectures for implementing Clerk in common application patterns: Next.js full-stack, microservices with shared auth, multi-tenant SaaS, and mobile + web with shared backend. Prerequisites Understanding of web application architecture Familiarity with authentication patterns (JWT, sessions, OAuth) Knowledge of your tech stack and scaling requirements Instructions Architecture 1: Next.js Full-Stack Application Architecture 2: Microservices with Shared Auth Architecture 3: Multi-Tenant SaaS Architecture 4: Mobile + Web with Shared Backend Output Next.js full-stack architecture with middleware, server/client components, and webhooks Microservices architecture with BFF proxy and JWT-based service auth Multi-tenant SaaS with organization-scoped data access Mobile + web with shared Express backend using @clerk/express Error Handling Pattern Common Issue Solution --------- ------------- ---------- Full-stack Middleware redirect loop Add sign-in route to public routes Microservices JWT template not configured Create JWT template in Dashboard per service Multi-tenant No org selected Redirect to org selector before tenant routes Mobile + Web Token not sent from mobile Include Authorization: Bearer <token> in mobile fetch Examples Database Schema for Clerk Integration Resources Clerk Architecture Patterns Clerk Organizations (Multi-Tenant) Clerk Express Integration Next Steps Proceed to clerk-multi-env-setup for multi-environment configuration.

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/clerk-reference-architecture

View the source on GitHub

Browse the @skills marketplace