convex-verify
Fungsinya
Skill ini memeriksa bahwa fitur Convex yang baru berperilaku sebagaimana mestinya. Skill ini ditujukan untuk pembangun yang menginginkan bukti, bukan hanya kode yang bisa dikompilasi.
Kapan dipakai
- βSaat Anda baru membangun fitur Convex dan ingin bukti bahwa fitur itu berfungsi.
- βSaat Anda perlu memastikan satu pengguna tidak bisa melihat data pengguna lain.
- βSaat Anda ingin tes yang jelas untuk menunjukkan apa yang bisa dan tidak bisa dilakukan setiap jenis pengguna.
Link skill
https://github.com/openclaw/clawhub/blob/main/.agents/skills/convex-verify/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βBuktikan bahwa fitur tugas Convex saya berfungsi, dan bahwa satu pengguna tidak bisa melihat tugas pengguna lain.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent memuat data contoh, mensimulasikan beberapa pengguna, menjalankan fitur sebagai masing-masing pengguna, lalu memeriksa hasilnya. Skill memberi bobot lebih pada kasus ketika akses seharusnya ditolak.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
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
- 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.
- SET UP
convex-test: ensureconvex-test+vitestare dev deps AND avitest.config.tssetstest.environment: "edge-runtime"withserver.deps.inline: ["convex-test"]β WITHOUT that config,convexTest(schema)fails at runtime withimport.meta.glob is not a function(verified). Also install@edge-runtime/vm. ThenconvexTest(schema)gives athandle. Reuse the project's existing test setup if present (compose with thetestcapability, don't fork it). - 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. - 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 (twith no identity). Use the real identity shape the app's auth uses (subject/tokenIdentifier), matching how ownership is resolved. - 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).
- positive: the owner gets the expected rows / the mutation made the expected change (
- 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. - 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
testcapability'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
Pertanyaan umum
Apakah pemeriksaan tipe yang lolos membuktikan fitur berfungsi?
Tidak. Skill menjelaskan bahwa pemeriksaan tipe hanya menunjukkan kode valid, jadi ditambahkan tes perilaku yang sebenarnya.
Apakah perlu deployment yang aktif?
Tidak. Skill berjalan di dalam lingkungan tes, jadi tidak perlu deployment.
Mengapa berfokus pada kasus yang ditolak?
Karena bug paling serius sering membiarkan orang yang salah masuk, dan demo biasa tidak akan menangkapnya.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 9.5k
- Peringkat
- #12261
- Lisensi
- MIT
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
axiom-alerting
9.5kMembantu agen Anda membuat dan mengelola monitor Axiom serta rute notifikasi melalui API Axiom, dan memeriksa apakah peringatan berperilaku sesuai harapan.
axiom-sre
9.5kMembantu agen Anda menyelidiki insiden dan bug produksi langkah demi langkah, menguji setiap dugaan terhadap log Axiom sebelum menarik kesimpulan.
building-dashboards
9.5kMembantu agen Anda mendesain dasbor Axiom dengan grafik, kueri, dan filter yang sesuai, dimulai dari keputusan yang harus didukung dasbor tersebut.
controlling-costs
9.5kMembantu agen Anda menemukan data yang tidak terpakai di Axiom dan membangun dasbor serta monitor yang melacak dan memangkas biaya logging.
Skill serupa
test-driven-development
311kMengajari agent Anda menulis tes yang gagal dulu, melihatnya gagal, lalu menulis kode terkecil yang lulus, sebelum membangun fitur atau perbaikan apa pun.
verification-before-completion
311kMengajari agent Anda menjalankan pemeriksaan nyata dan membaca keluarannya sebelum menyatakan tugas, perbaikan, atau build sudah selesai atau lulus.
migrate-to-shoehorn
310kMengganti type cast berisiko di file tes Anda dengan pustaka shoehorn, sehingga tes bisa memakai data parsial dan tetap lulus pemeriksaan tipe.