Back to list
IgorWarzocha

convex-runtime

by IgorWarzocha

An ever evolving repository of Opencode workflow examples that might enhance your experience with it. I only left the stuff that actually works. YMMV.

51🍴 6📅 Jan 22, 2026

SKILL.md


name: convex-runtime description: |- Implement Convex runtime features: HTTP actions, file storage, search (full text + vector), scheduling (crons + scheduled functions), and RAG patterns. Use for webhooks, uploads, search indexes, vectorSearch actions, and background workflows. Use proactively when users mention HTTP endpoints, files, search, embeddings, or cron/schedule.

Examples:

  • user: "Add full text search" → define searchIndex + withSearchIndex query
  • user: "Upload files" → generate upload URL and persist storageId
  • user: "Vector search" → action with ctx.vectorSearch and doc fetch
  • user: "Run cleanup nightly" → cronJobs + function reference

Runtime Operations

  • HTTP actions: define handlers with httpAction, register in convex/http.ts via httpRouter (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 or null.
  • File metadata: ctx.db.system.get("_storage", id) or query("_storage"); storage.getMetadata() is deprecated.
  • Scheduling: ctx.scheduler.runAfter/runAt; cron jobs in convex/crons.ts using cronJobs().
  • Cron Scheduling: You MUST use crons.interval or crons.cron. You MUST NOT use deprecated helpers like crons.hourly, crons.daily, or crons.weekly.
  • Cron internal calls: If a cron calls an internal function, You MUST import the internal object from _generated/api to reference it, even if defined in the same file.

Core Rules

  • HTTP actions MUST be routed only via convex/http.ts default export.
  • HTTP actions MUST parse Request manually 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.

Score

Total Score

60/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon