Skills Agentes

Convex Verify

Demuestra que una feature de Convex funciona: seedea datos, la ejecuta como varios usuarios simulados vía convex-test y afirma el comportamiento, incluidos los casos negativos de autorización.

Oficial

Reemplaza a: Confiar en un typecheck en verde como prueba de que la feature funciona

Estrellas
59

en todo el repo

Actividad
55

0–100, la ruta de este skill

Actualizado
el mes pasado

último commit aquí

Commits
1

últimos 90 días

Contexto
1.2k tok

45 tok en reposo

Paquete
1 archivo

5 KB

Instalar

Funciona con cualquier agente que lea SKILL.md

npx -y skills add get-convex/agent-skills --skill convex-verify --agent claude-code

Se instala solo en este repositorio.

Qué hace

  • Seeda datos realistas usando las propias funciones de la app más fixtures directos vía t.run
  • Ejecuta la función objetivo como owner, otro usuario autenticado y usuario no autenticado con t.withIdentity
  • Afirma casos positivos y, sobre todo, negativos (llamador equivocado rechazado, data-scope respetado)
  • Configura vitest.config.ts con environment 'edge-runtime' y convex-test inlined si falta
  • Emite un finding en el bus (authz/correctness) para cualquier aserción fallida, con la llamada exacta

Úsalo cuando

  • El usuario acaba de construir o cambiar una query/mutation/action de Convex y quiere probarla
  • Se necesita comprobar que un no-owner es realmente rechazado, no solo que el código compila
  • Se requiere validar que una lista/query devuelve solo las filas del caller y no las de otro usuario

No lo uses cuando

  • La petición es configurar un framework de test en general, no probar una feature concreta (eso es la capability `test`)

Qué lo activa

Di cualquiera de estas frases y el agente debería cargar este skill.

  • “Verifica que esta mutation de Convex rechaza a usuarios que no son el owner”
  • “Prueba con convex-test que mi query de listado solo devuelve las filas del usuario actual”
  • “Demuestra que esta acción falla para un caller no autenticado”

SKILL.md

En inglés

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, evidence: the failing probe call) so a composite pass or self-heal can pick it up.
  • This drives a SPECIFIC built feature; a request to set up a test framework generally is the test capability.

Reproducido de get-convex/agent-skills bajo licencia Apache-2.0. Leer esta página en markdown.

Archivos

1 archivo en el paquete. Solo se lee SKILL.md al activarse — las referencias se cargan si el skill decide que las necesita.

Antes de instalar

Requiere convex-test y vitest como dev deps, @edge-runtime/vm instalado, y un vitest.config.ts con test.environment: 'edge-runtime' y server.deps.inline: ['convex-test'].

Detalles

Creador
get-convex
Categoría
Testing y QA
Licencia
Apache-2.0
Recursos incluidos
Solo SKILL.md
Código fuente
Ver SKILL.md

Más de get-convex/agent-skills

Este repo incluye 33 skills. Si instalas uno, normalmente ya tienes los demás. Ver el pack agent-skills entero y su comando de instalación

Audita y refuerza la autorización de una app Convex: impersonación por identity-from-arg, checks de ownership por documento faltantes, queries públicas que filtran datos por un id del cliente y escrituras en un contenedor ajeno.

Costo de contexto al activarse
2.3k tok
Tamaño del paquete
1 archivo
Última actualización
hace 22 días
Oficialseguridad

Diseña y construye backends reactivos y type-safe de nivel producción en Convex: schema, queries/mutations/actions, índices, auth, storage, scheduling, multiplayer en tiempo real y workflows LLM/agentes.

Costo de contexto al activarse
972 tok
Tamaño del paquete
1 archivo
Última actualización
hace 22 días
Oficialdesarrollo apis

Levanta un template Next.js + Convex barebones a partir de una idea en una frase.

Costo de contexto al activarse
1.1k tok
Tamaño del paquete
3 archivos
Última actualización
hace 22 días
Oficialdesarrollo apis

Especialista en el backend de Convex: código dentro de convex/ (funciones, schemas, índices, queries, mutations, actions, endpoints HTTP, cron jobs, storage, auth y componentes).

Costo de contexto al activarse
1.1k tok
Tamaño del paquete
1 archivo
Última actualización
hace 22 días
Oficialbases de datos

Añade un backend de agente de IA / RAG (@convex-dev/agent) a la app Convex.

Costo de contexto al activarse
430 tok
Tamaño del paquete
1 archivo
Última actualización
hace 29 días
Oficialdesarrollo apis

Construye componentes Convex reutilizables con tablas aisladas y APIs de cara a la app. Útil para nuevos componentes, módulos de backend reutilizables, integraciones o límites de componentes.

Costo de contexto al activarse
2.6k tok
Tamaño del paquete
7 archivos
Última actualización
el mes pasado
Oficialherramientas desarrollo

Skills relacionados

Úsalo al recibir feedback de code review, antes de implementar sugerencias, sobre todo si el feedback parece poco claro o técnicamente cuestionable: exige rigor técnico y verificación, no acuerdo performativo ni implementación ciega.

Costo de contexto al activarse
1.6k tok
Tamaño del paquete
1 archivo
Última actualización
hace 2 meses
testing qa

Úsalo al completar tareas, implementar features mayores, o antes de mergear, para verificar que el trabajo cumple los requisitos.

Costo de contexto al activarse
739 tok
Tamaño del paquete
2 archivos
Última actualización
el mes pasado
testing qa

Úsalo ante cualquier bug, fallo de test o comportamiento inesperado, antes de proponer arreglos.

Costo de contexto al activarse
2.4k tok
Tamaño del paquete
11 archivos
Última actualización
hace 2 meses
testing qa