使い方
- インストールコマンドをコピーし、自分の環境へ導入する前にソースを確認します。
- 必要なツール、認証情報、対応環境を原文で確認します。
- 入力と成果物を指定し、出力を資料と照合します。
npx skills add https://github.com/melvynx/ai-maxxing-skills --skill convex開始前の確認
- 導入にはモデル契約、API枠、ファイルへのアクセス許可は含まれません。
- スター数や導入数は活動の指標であり、独立した品質・安全性試験ではありません。
見出し、例、コード、表、リンク、参照画像を含む原文を表示しています。
Set up a project with two deployments, dev (break anything) and prod (real users), and never point local dev at prod data:
npx convex login # the user approves in the browser
npx convex dev --once # creates the project + dev deployment, writes .env.local
npx convex env set KEY value # server secrets (dev); add --prod for production
npx convex deploy # production deployWrite every function so it is safe and cheap:
- Every public
query,mutationandactionis callable by anyone who has the deployment URL. Check the user (ctx.author the Better Auth helper) and ownership inside each one; useinternalQuery/internalMutationfor anything only the server calls. - Validate every argument with
v.*validators. - Read with
.withIndex(...)on a selective index, never.filteron a large table. Define the index inschema.tsfor each access pattern (by_userId,by_courseId_order, ...). - Bound reads:
.take(n)or.paginate()before enriching rows; never.collect()a table that grows. - Return only the fields the client needs.
- Secrets live in Convex env vars, never in client code.
To optimize, start from live evidence:
npx convex insights --prod --detailsExtract function name, warning type, per-table docs/bytes, and whether it failed or only neared a limit. Prioritize high Documents Read with low Documents Returned.
Map each hot export to convex/** and its client callsites, then diagnose before patching:
.filter/.collectwithout a selective.withIndex, or an index that narrows only by tenant and still scans thousands of rows;- per-row related fetches (N+1); recount helpers on hot mutations;
- jobs or crons that scan every row on every run;
- concurrent patches on the same document (OCC conflicts).
Apply the smallest change: add the index used by the query; .take/paginate before enrichment; denormalize list previews and fetch full rows only on detail; incremental counters instead of full recounts; cursor + per-run limit for jobs; skip no-op patches and merge same-document writes; move high-churn state to a narrower table.
Verify with the project's typecheck, tests and build, plus npx convex codegen. Re-run insights after deploy and report: hot functions, root cause, change, expected read/byte/OCC impact, validation.




