convex-test — Claude Code skill: what it does, how to install
Generates deterministic vitest tests for Convex backend functions using convex-test. Runs against an in-memory backend without live deployments.
npx skills add convex/agent-skills --skill convex-test -a claude-codeWhat convex-test does
This skill guides your coding agent to write tests for Convex functions with vitest. The test suite runs against an in-memory backend provided by convex-test, which eliminates the need for live deployments or network calls.
The workflow relies on convexTest(schema). Tests seed initial state via t.run, execute t.query or t.mutation, and assert expected outputs. The prompt enforces coverage for error cases, auth flows via withIdentity, and scheduled background jobs handled by t.finishInProgressScheduledFunctions.
Your project must have convex-test and vitest installed beforehand.
What it helps with
- generate vitest test suites for Convex queries and mutations
- test authentication logic using withIdentity mock identities
- assert scheduled functions run correctly without real timers
- validate database indexes and error paths in memory
Example prompts for the agent
- Write convex-test vitest tests for our user profile mutation
- Generate tests covering auth error paths using withIdentity for convex/tasks.ts
- Create in-memory tests that verify scheduled functions finish with t.finishInProgressScheduledFunctions
How to install convex-test
1Skills CLI (Vercel)
npx skills add convex/agent-skills --skill convex-test -a claude-code2Manually: put the files in place
~/.claude/skills/convex-test/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/convex-test/
1Skills CLI (Vercel)
npx skills add convex/agent-skills --skill convex-test -a codex2Manually: put the files in place
.agents/skills/convex-test/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add convex/agent-skills --skill convex-test -a cursor2Manually: put the files in place
.cursor/skills/convex-test/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install convex/agent-skills convex-test2Manually: put the files in place
.github/skills/convex-test/SKILL.md1Skills CLI (Vercel)
npx skills add convex/agent-skills --skill convex-test -a gemini-cli2Platform CLI
gemini skills install https://github.com/convex/agent-skills --path skills/convex-testManually: put the files in place
.devin/skills/convex-test/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add convex/agent-skills --skill convex-test -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about convex-test
How to install convex-test in Claude Code?
Run npx skills add convex/agent-skills --skill convex-test -a claude-code in your project terminal.
What does the convex-test skill do?
It prompts the assistant to produce deterministic in-memory tests for Convex functions. It handles args, returns, indexes, auth checks, and scheduled jobs.
Does convex-test require a running Convex deployment?
No, tests execute against an in-memory backend. You do not need network access or a live project.
Source text
SKILL.md · Apache-2.0
--- name: convex-test description: "Generate convex-test tests for the app's Convex functions." --- <!-- GENERATED from convex-agents content/capabilities/test.json — do not edit by hand. --> # Generate Convex tests Use convex-test + vitest to test functions against an in-memory backend: args/returns, auth paths, indexes, and scheduled functions. ## Workflow 1. Install convex-test + vitest. 2. Write tests using convexTest(schema): seed via t.run, call t.query/t.mutation, assert. 3. Cover auth (withIdentity), error paths, and scheduled functions (t.finishInProgressScheduledFunctions). 4. Run vitest; keep tests deterministic. ## Rules - Use convex-test (in-memory), not a live deployment. - Cover auth + error paths, not just the happy path. - Keep tests deterministic (no real time/network).
© convex · Apache-2.0 · convex/agent-skills