convex-expert
できること
このスキルは、convexフォルダのコードに詳しいConvexの専門家です。プラットフォームのルールに従い、よくある誤りを避けたバックエンドのコードがほしい開発者向けです。
使う場面
- ✓Convexのプロジェクトで関数、スキーマ、インデックスを書いたり編集したりしているとき。
- ✓Convexのアプリに、HTTPのエンドポイント、定期ジョブ、ファイルの保存を加えるとき。
- ✓Convexの上にAIのチャットや複数ステップのワークフローを作る必要があるとき。
スキルのリンク
https://github.com/openclaw/clawhub/blob/main/.agents/skills/convex-expert/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“タスクのテーブルを追加し、各ユーザーのタスクを一覧にする関数を、Convexのアプリに作ってください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、まず既存のスキーマを読み、必要な形式で、入力と出力の確認付きの関数を書き、検索にはインデックスを使い、コードがエラーなしでデプロイできることを確かめます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Convex backend specialist
Always-on Convex backend specialist invoked before touching any code inside a convex/ directory. Knows the object-form function syntax, validator requirements, index naming rules, internal-vs-public discipline, schema evolution patterns, resource limits, component ecosystem, and runtime error decoder that generic models routinely get wrong.
Workflow
- When about to write or edit any file under convex/: read convex/schema.ts first (and convex/_generated/ai/guidelines.md if present).
- Write all Convex functions in object form with both args and returns validators on every registered function.
- Use withIndex(...) for every read path — never .filter() for anything that would be a SQL WHERE clause.
- Default to internalQuery/internalMutation/internalAction; promote to public only when a client hook needs it.
- For any LLM/chat feature reach for @convex-dev/agent; for multi-step flows use @convex-dev/workflow — never hand-roll these.
- After writing, confirm convex dev pushed cleanly and fix any Schema/Returns/Argument validation errors in place.
Rules
- DATA ACCESS + IMPORTS — read before writing any convex/*.ts (front-loaded, not a post-hoc lint):
- Never an unbounded
.collect()on a table that can grow — use.withIndex(...)and.paginate(paginationOptsValidator)/.take(n)instead. This is the single most common Convex deploy-blocking and perf defect. - Index, don't filter — add
.index(...)in schema.ts for every read path and query it with.withIndex(...);.filter()is a full table scan, never a substitute for a WHERE. - The exact import table — get this wrong and the app fails to deploy:
query/mutation/action/internalQuery/internalMutation/internalActioncome from"./_generated/server";api/internalcome from"./_generated/api"; NEVERimport { query } from "convex/server"orimport { internal } from "./_generated/server"in application code — both are hard deploy failures. v.literal("exact value")for a fixed string/enum member (e.g.v.union(v.literal("open"), v.literal("closed"))) — not a barev.string()when the set of values is fixed."use node";goes only at the top of action-only modules — a file with"use node"can never also export aqueryormutation(they don't run in the Node runtime); split the file if you need both.- Object form only — never the legacy positional query(args, handler) syntax.
- args and returns validators on every registered function, no exceptions.
- v.id(tableName) for IDs, never v.string(); undefined is not a Convex value (use null).
- Never add a required field to a populated table — add v.optional(...) first, backfill, then tighten.
- Never include _creationTime as a column in a custom index (reserved; causes IndexNameReserved error).
- Never store storage URLs in tables — store the Id<'_storage'> and call ctx.storage.getUrl(id) on read.
- Mutations cannot fetch — all external IO goes in actions; persist via ctx.runMutation(internal.x.y).
- Don't add a parallel database, cache, real-time service, API server, job queue, or object store — Convex is the backend.
- Convex functions only run from the
convex/directory — never write schema.ts/queries/mutations/actions at the project root. - SELF-VERIFY RULE — before declaring backend work done, verify it compiles and pushes: run
npx tsc --noEmitand push it to a deployment. Prefer the project's existing one; otherwisenpx convex dev --oncewhennpx convex whoamisucceeds, andCONVEX_AGENT_MODE=anonymous npx convex dev --onceONLY when it does not. Forcing anonymous on a signed-in user rebinds.env.localand costs them the persistent, publishable cloud deployment they expect. Fix every error it reports before finishing — one verify round catches the wrong-relative-import / duplicate-symbol / unbalanced-paren class that otherwise breaks the deploy.
よくある質問
なぜスキーマを先に読むのですか?
新しいコードが、プロジェクトに既にあるデータに合うようにするためです。
どんなルールに従いますか?
読み取りにはインデックスを使い、クライアントが必要としない限り関数は内部に保ち、入力と出力の確認を求めます。
プロジェクトは先に設定されている必要がありますか?
はい。Convexのプロジェクトの中のコードで動くので、プロジェクトが既に存在している必要があります。
詳細
作者による元の説明
Convex backend specialist. Use this agent for any code inside a `convex/` directory — function definitions, schemas, indexes, queries, mutations, actions, HTTP endpoints, cron jobs, file storage, auth wiring, and component installation. Knows the object-form function syntax, validator patterns, resource limits, and component ecosystem that generic Claude routinely gets wrong.
repo: openclaw/clawhub
人気
- GitHubのスター
- 9.5k
- ランキング
- #12244
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
axiom-alerting
9.5kエージェントが、Axiom APIを通じてAxiomのモニターと通知のルートを作って管理し、アラートが期待どおり動くかを確認できるよう支援します。
axiom-sre
9.5kエージェントが、本番のインシデントやバグを段階的に調べ、各推測をAxiomのログに照らして検証してから結論を出せるよう支援します。
building-dashboards
9.5kエージェントが、何の判断を支えるべきかという点から始めて、適切なグラフ、クエリ、フィルターを使ったAxiomのダッシュボードを設計できるよう支援します。
controlling-costs
9.5kエージェントが、Axiomで誰も使っていないデータを見つけ、ログのコストを追跡して抑えるダッシュボードとモニターを作れるよう支援します。
似ているスキル
api-connector-builder
280kエージェントが既存のパターンに従って、新しいAPI連携を構築します。新しい方式を作らずに、もう一つ連携を追加したいときに使います。
api-design
280kエージェントがベストプラクティスに沿ってREST APIを設計できるようにします。APIの通信方法、エラーの表示方法、データの整理方法を決めるのに役立ちます。
backend-patterns
280kエージェントのサーバーサイドのアーキテクチャパターンとデータベースの最適化を支援します。サーバー上で動くコードを作成またはレビューするときに役立ちます。