About convex-runtime
convex-runtime is a development skill for implementing Convex runtime features such as HTTP actions, file storage, search, and scheduling. It provides operational guidance and constraints for configuring routes, uploads, indexes, scheduled functions, and cron jobs.
Key features
- 01Configure HTTP actions and routes
- 02Upload, serve, and inspect stored files
- 03Set up full-text and vector search
- 04Schedule functions and cron jobs
- 05Follow runtime limits and API rules
Use cases
- 01Expose an HTTP endpoint from a Convex app
- 02Handle file upload and serving flows
- 03Add text or vector search
- 04Run delayed tasks or recurring jobs
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ igorwarzocha/ opencode-workflows --skill convex-runtimeAfter installing, type/convex-runtimein Claude Code to confirm it loaded.
Details
From the project README
Implement Convex runtime features: HTTP actions, file storage, search (full text + vector), and scheduling.
- **HTTP actions**: https://docs.convex.dev/functions/http-actions
- **File storage**: https://docs.convex.dev/file-storage
- **Uploading files**: https://docs.convex.dev/file-storage/upload-files
- **Serving files**: https://docs.convex.dev/file-storage/serve-files
- **File metadata**: https://docs.convex.dev/file-storage/file-metadata
- **Full text search**: https://docs.convex.dev/search/text-search
- **Vector search**: https://docs.convex.dev/search/vector-search
- **Scheduling**: https://docs.convex.dev/scheduling
- **Scheduled functions**: https://docs.convex.dev/scheduling/scheduled-functions
- **Cron jobs**: https://docs.convex.dev/scheduling/cron-jobs
- Full text search: `searchIndex` with `searchField` and optional `filterFields`; relevance-ordered; prefix matching on final term; fuzzy matches are deprecated; limits 16 terms, 8 filters, 1024 scanned.
- Vector search: `vectorIndex` with `vectorField` and `dimensions` (2-4096); vector field is `v.array(v.float64())`; actions-only; limits 256 results, 64 filters, 4 vector indexes per table.
- Scheduling: scheduled functions are durable and stored in DB; cron jobs run on fixed schedules; auth not propagated, You MUST pass identity explicitly.
- File storage: upload URLs for large files; HTTP action uploads limited to 20MB; metadata in `_storage`.
Runtime Operations
- HTTP actions: define handlers with
httpAction, register inconvex/http.tsviahttpRouter(default export REQUIRED). - HTTP Syntax:
http.route({ path: "/api/echo", // Exact path method: "POST", handler: httpAction(async (ctx, req) => { const body = await req.bytes(); return new Response(body, { status: 200 }); }), }); - HTTP actions MUST be exposed at
https://<deployment>.convex.site. - Upload URL flow: generate URL mutation → client POST → store
storageId; URLs expire after 1 hour. - HTTP upload flow:
ctx.storage.store(blob)then mutation. Uploads via HTTP actions are limited to 20MB. - Serving files:
ctx.storage.getUrl(storageId)in queries/mutations; returns signed URL ornull. - File metadata:
ctx.db.system.get("_storage", id)orquery("_storage");storage.getMetadata()is deprecated. - Scheduling:
ctx.scheduler.runAfter/runAt; cron jobs inconvex/crons.tsusingcronJobs(). - Cron Scheduling: You MUST use
crons.intervalorcrons.cron. You MUST NOT use deprecated helpers likecrons.hourly,crons.daily, orcrons.weekly. - Cron internal calls: If a cron calls an internal function, You MUST import the
internalobject from_generated/apito reference it, even if defined in the same file.
Core Rules
- HTTP actions MUST be routed only via
convex/http.tsdefault export. - HTTP actions MUST parse
Requestmanually as they do not support validators. - Search Example:
const messages = await ctx.db.query("messages") .withSearchIndex("search_body", (q) => q.search("body", "hello hi").eq("channel", "#general") ).take(10); - Vector search MUST be actions-only; results are non-reactive.
- Search behavior: full text search is relevance-ordered and uses prefix matching on the final term; fuzzy matches are deprecated.
- You SHOULD prefer search/vector filters in index definitions and query filters.
- Scheduled functions MUST remain backward compatible with args.
Comments
Markdown supported