Skip to content
Skillpedia
Testing9.5k Β· #12261

convex-verify

What it does

This skill checks that a new Convex feature behaves the way it should. It is for builders who want proof, not just code that compiles.

When to use it

  • βœ“When you have just built a Convex feature and want proof it works.
  • βœ“When you need to confirm that one user cannot see another user's data.
  • βœ“When you want clear tests that show what each kind of user can and cannot do.

Skill link

https://github.com/openclaw/clawhub/blob/main/.agents/skills/convex-verify/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/openclaw/clawhub/blob/main/.agents/skills/convex-verify/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œProve that my Convex task feature works, and that one user cannot see another user's tasks.”

5 new skills a week. 1 minute to read.

How it works

The agent loads sample data, simulates several users, runs the feature as each one, and checks the results. It puts extra weight on cases where access should be denied.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

<!-- GENERATED from convex-agents content/capabilities/convex-verify.json β€” do not edit by hand. -->

Prove a feature works β€” seed, drive, assert

A green typecheck proves the code parses; it does not prove a non-owner is actually denied, that a query returns the right rows, or that a mutation has the effect it claims. This capability closes that gap with the loop the whole field is missing: seed β†’ drive β†’ assert, run in-process with convex-test so it needs no deployment. Its highest-value assertions are the NEGATIVE ones β€” the caller who should be refused β€” because those are exactly the authz defects the 30-app corpus shows are the #1 real bug and the ones a happy-path demo never catches.

Workflow

  1. IDENTIFY the feature to prove: the specific exported query/mutation/action (or a small set) the user just built/changed, and its intended behavior β€” who should be allowed, what data should come back, what a mutation should change. If the intent is unstated, ask one focused question rather than guessing the contract.
  2. SET UP convex-test: ensure convex-test + vitest are dev deps AND a vitest.config.ts sets test.environment: "edge-runtime" with server.deps.inline: ["convex-test"] β€” WITHOUT that config, convexTest(schema) fails at runtime with import.meta.glob is not a function (verified). Also install @edge-runtime/vm. Then convexTest(schema) gives a t handle. Reuse the project's existing test setup if present (compose with the test capability, don't fork it).
  3. SEED realistic data through the app's OWN functions where possible (so the seed exercises the same validators/mutations a real user would), falling back to t.run(async (ctx) => ctx.db.insert(...)) for fixtures the public API can't create. Seed at least: the caller's own rows AND a second user's rows, so cross-user access is testable.
  4. DRIVE the feature as DIFFERENT identities with t.withIdentity({ subject, tokenIdentifier, ... }): call the function as (a) the legitimate owner, (b) a different authenticated user, and (c) unauthenticated (t with no identity). Use the real identity shape the app's auth uses (subject/tokenIdentifier), matching how ownership is resolved.
  5. ASSERT behavior β€” POSITIVE and NEGATIVE:
    • positive: the owner gets the expected rows / the mutation made the expected change (expect(await t.withIdentity(owner).query(api.x.y, args)).toEqual(...)).
    • NEGATIVE (the load-bearing half): a different user calling the same function is REFUSED β€” await expect(t.withIdentity(other).mutation(api.x.cancel, {id})).rejects.toThrow(/forbidden|not authorized|403/) β€” and an unauthenticated caller is refused where auth is required. A feature is not proven until the wrong caller is shown to be blocked.
    • data-scope: a list/query returns ONLY the caller's rows, never the second user's (assert the second user's row is absent).
  6. RUN the tests (npx vitest run) and report: what was proven (each positive + negative assertion that passed), and β€” critically β€” any assertion that FAILED, because a failed negative assertion is a real authz hole found before ship. Emit findings on the bus (specs/finding.schema.json, class authz/correctness, evidence kind probe-result with the exact failing call) for anything that didn't behave.
  7. Do NOT weaken a test to make it pass: if the owner-only query returns another user's row, the FIX is in the function (hand to convex-authz), not in the assertion. A test changed until it's green proves nothing.

Rules

  • Prove behavior, not compilation: every verification includes at least one NEGATIVE assertion (a caller who should be refused is refused) β€” the happy path alone is not proof.
  • Drive the feature as multiple identities with t.withIdentity (owner, other user, unauthenticated) using the app's real subject/tokenIdentifier shape.
  • Seed both the caller's rows AND a second user's rows so cross-user access and data-scope are actually testable.
  • A vitest.config.ts with environment 'edge-runtime' + convex-test inlined is REQUIRED for convex-test to run (import.meta.glob needs it); author it, don't just author the test file.
  • Run in-process with convex-test β€” no deployment needed; compose with the test capability's setup rather than forking it.
  • Never weaken an assertion to make it pass: a failing negative test is a real defect β†’ hand the fix to convex-authz/convex-expert, don't edit the test until it's green.
  • Emit a bus finding for any assertion that failed (authz/correctness
FAQ

Does a passing type check prove the feature works?

No. The skill explains that a type check only shows the code is valid, so it adds tests of real behavior.

Does it need a live deployment?

No. It runs inside the test environment, so no deployment is needed.

Why focus on denied cases?

Because the most serious bugs often let the wrong person in, and a normal demo would not catch them.

Details

Original description by the author

Prove a Convex feature works β€” seed, drive as multiple mocked users via convex-test, assert behavior including the negative authz cases (wrong user refused, data-scope enforced).

repo: openclaw/clawhub

Popularity

GitHub stars
9.5k
Ranking position
#12261
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills