clerk-testing
Skill16 starsChanged 24 days agoMITView on GitHub
E2E testing for Clerk apps. Use with Playwright or Cypress for auth flow
- Reads credentials
We split this skill into the rules it gives an agent
8 rules. 2 are common, 0 are distinctive, and 6 are very specific to this project.
2
Common
Most of the 4 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Common: line 25
Test auth = isolated session state.
- Common: line 34
Follow official setup instructions
- Very specific: line 35
Use development-instance keys only (pk_test_* / sk_test_*).
- Very specific: line 39
Use setupClerkTestingToken() before navigating to auth pages
- Very specific: line 40
Use test API keys: pk_test_xxx, sk_test_xxx
- Very specific: line 42
Use page.waitForSelector('[data-clerk-component]') for Clerk UI
- Very specific: line 54
Playwright: Use globalSetup for auth state
- Very specific: line 55
Cypress: Add addClerkCommands({ Cypress, cy }) to support file
“Common” is measured: kept by at least 6 in 10 of the 4 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.
Files
Testing
Decision Tree
Mental Model
Test auth = isolated session state. Each test needs fresh auth context.
clerkSetup()initializes test environmentsetupClerkTestingToken()bypasses bot detectionstorageStatepersists auth between tests for speed
Workflow
- Identify test framework (Playwright or Cypress)
- WebFetch the appropriate URL from decision tree above
- Follow official setup instructions
- Use development-instance keys only (
pk_test_*/sk_test_*). If the project has no keys yet,npx clerk@latest init(the Clerk CLI; seeclerk-setup) creates a Clerk application and writes development-instance keys to the env file. No Clerk account or Dashboard visit is needed.
Best Practices
- Use
setupClerkTestingToken()before navigating to auth pages - Use test API keys:
pk_test_xxx,sk_test_xxx - Save auth state with
storageStatefor faster tests - Use
page.waitForSelector('[data-clerk-component]')for Clerk UI
Anti-Patterns
| Pattern | Problem | Fix |
| Production keys in tests | Security risk | Use pk_test_* keys |
No setupClerkTestingToken() | Auth fails | Call before navigation |
| UI-based sign-in every test | Slow tests | Use storageState |
Framework-Specific
Playwright: Use globalSetup for auth state
Cypress: Add addClerkCommands({ Cypress, cy }) to support file
See Also
clerk-setup- Install Clerk before adding testsclerk-nextjs-patterns- Next.js patterns being tested- Demo Repo
Other versions6 projects use a version of this.
Word for word · 2
- clerk/skills★ 89100% same
- Aymenjdily/biblion-testing-agentic-ai-skills★ 2100% same
Edited · 4
- HamedMP/matrix-os★ 8589% same
- delorenj/skills★ 1881% same
- elpiarthera/vantage-starter★ 089% same
- sanketbodke/skew-ai★ 091% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use clerk-billing.
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.
sanketbodkeSkillclerk-billing
Clerk Billing for subscription management - render Clerk's PricingTable
Also in 3 projects that use this
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- clerk-backend-apiSkill
- clerk-cliSkill
- clerk-custom-uiSkill
- clerk-expoSkill
- clerk-orgsSkill
- clerk-setupSkill
- clerk-webhooksSkill
- create-agent-with-sanity-contextSkill
- dial-your-contextSkill
- expo-animationSkill
- expo-data-fetchingSkill
- expo-design-systemSkill
- expo-project-structureSkill
- expo-routerSkill
- shape-your-agentSkill
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
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.

