Skip to content

Guide · Agent skill

How to use the Convex Test Writer agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The convex-test skill is an agent skill that tells an AI coding agent how to write automated tests for the backend functions of a Convex app. It is listed in the openclaw/clawhub repository under .agents/skills/convex-test and is released under the MIT licence. After this guide you will know what the skill does, how to install it, how to ask for tests in plain language, and what to check before you run it.

Convex Test Writeropenclaw/clawhub · MIT

Quick start

  1. 1Download the ZIP. Get the convex-test ZIP from the item page on this site.
  2. 2Unzip the skill. Extract it into ~/.claude/skills/ for personal use or into the project's .claude/skills/ folder.
  3. 3Or upload in the Claude apps. Go to Settings → Capabilities → Skills and upload the ZIP.
  4. 4Confirm your setup. Make sure Node.js, npm and a Convex project with a schema are available.
  5. 5Ask for tests in plain language. Name the Convex functions and include auth and error cases in your request.
  6. 6Run vitest. Execute the generated tests with vitest and review any failures.

What the convex-test skill makes the agent do

When the skill is installed, the agent follows a fixed workflow for testing a Convex app. It uses convex-test together with vitest to call your queries and mutations against an in-memory backend, so the tests do not touch a live deployment.

The skill's workflow has four steps: install convex-test and vitest, write tests using convexTest(schema) by seeding data with t.run and calling t.query or t.mutation, cover auth with withIdentity, error paths and scheduled functions via t.finishInProgressScheduledFunctions, then run vitest and keep the tests deterministic.

  • Checks argument and return values of functions
  • Covers auth paths using withIdentity
  • Covers error paths, not only the happy path
  • Tests indexes and scheduled functions
  • Avoids real time and network access inside tests

Install the convex-test skill

The skill is a single file, SKILL.md. Download the ZIP from the item page on this site and unzip it into one of these locations: ~/.claude/skills/ for all your projects, or .claude/skills/ inside a specific project folder.

You can also upload the ZIP in the Claude apps under Settings → Capabilities → Skills.

  • Personal install: unzip into ~/.claude/skills/
  • Project install: unzip into the project's .claude/skills/ folder
  • Claude apps: Settings → Capabilities → Skills, then upload the ZIP

Check what you need before you start

The skill assumes you already have a Convex project with a schema. It also needs Node.js and npm, plus the convex-test and vitest packages. The skill's workflow includes installing those two packages, so you do not need to add them by hand first, but you do need Node.js and npm on your machine.

  • Node.js and npm
  • A Convex project with a schema
  • convex-test and vitest packages (installed by the workflow)

Trigger the skill with a natural request

You do not need a special command. Describe the functions you want tested and mention Convex tests. The agent should pick up the skill when your request matches its description, which is to generate convex-test tests for the app's Convex functions.

Name the functions or the behaviour you care about. Asking for auth and error cases in the same request helps, because the skill's rules require them and not only the happy path.

  • "Write convex-test tests for the messages mutations in convex/messages.ts."
  • "Add vitest tests for my Convex queries, including the case where the user is not signed in."
  • "Test the scheduled cleanup function in my Convex app with convex-test."

What a generated test looks like

Following the skill, the agent creates a test that builds the backend with convexTest(schema), seeds the data it needs with t.run, calls the function through t.query or t.mutation, and asserts the result. For authenticated paths it uses withIdentity to simulate a signed-in user.

The exact code depends on your schema and functions. The skill's source gives the pattern rather than a full example file, so review what the agent writes against your own code.

  • Seed data with t.run before calling the function
  • Simulate a user with withIdentity for auth tests
  • Run scheduled work with t.finishInProgressScheduledFunctions

Run the tests and keep them deterministic

Run the tests with vitest. The skill asks for deterministic tests, meaning no real clock reads and no network calls, so the same test gives the same result each run.

If a test depends on time or an external service, ask the agent to stub or remove that dependency rather than letting the test reach the outside world.

  • Run vitest after the tests are written
  • Ask for changes if a test relies on real time or network calls

What people use it for

  • Adding test coverage to an existing Convex backend that has none
  • Checking that queries and mutations reject users who are not signed in
  • Testing error handling in mutations that validate input
  • Verifying indexed queries return the right records after seeding data
  • Testing scheduled functions without waiting for real time to pass

Frequently asked questions

How do I install the convex-test agent skill?

Download the ZIP from the item page and unzip it into ~/.claude/skills/ for personal use or into a project's .claude/skills/ folder. You can also upload the ZIP in the Claude apps under Settings → Capabilities → Skills.

Is the convex-test skill free?

The skill is released under the MIT licence. The source does not mention pricing for it, so check the item page for any details on cost.

What do I need to use the convex-test skill?

You need Node.js and npm, the convex-test and vitest packages, and a Convex project with a schema. The skill's workflow installs the two packages.

Does the skill run tests against my live Convex deployment?

No. The skill directs the agent to use convex-test, which runs against an in-memory backend, and not a live deployment. It is not meant for testing production.

Does the skill run scripts or use the network?

According to the item listing, it runs no scripts and uses no network. It consists of a single SKILL.md file with instructions for the agent.

Can the skill test auth and error cases?

Yes. Its rules require covering auth and error paths, not just the happy path, and it uses withIdentity to simulate signed-in users.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use this skill if you build on Convex and want the agent to write vitest tests for your backend, including auth, error cases and scheduled functions. Skip it if your project does not use Convex, or if you want tests against a live production deployment, since the skill is built around in-memory, deterministic tests.

Download the skill