本文へ移動
cccskills
無料GitHub で公開

convex-doctor

Static analysis checklist for Convex backends covering 72 rules across security, performance, correctness, schema, architecture, configuration, and client-side patterns. Use when writing, reviewing, or auditing Convex code. Trigger on mentions of "convex-doctor", "health score", "static analysis", "anti-patterns", "audit convex", or before shipping backend changes.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md9.1 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Convex Doctor Skill

Run through these checks when writing or reviewing Convex backend and client code. Based on the convex-doctor CLI which scores projects 0-100 across 72 rules in 7 categories.

How to use this skill

  1. Before shipping backend changes, scan the affected files against the rules below.
  2. Flag violations by severity: error (must fix), warning (should fix), info (consider fixing).
  3. Suggest the fix inline when flagging.
  4. If the user has convex-doctor installed, recommend running npx convex-doctor -v for a full report.

Security (13 rules, 1.5x weight)

IDSeverityRule
missing-arg-validatorserrorAll query/mutation/action and internal variants must have args validators
missing-return-validatorswarningPublic functions should have returns validators
missing-auth-checkwarningPublic functions should call ctx.auth.getUserIdentity()
internal-api-misuseerrorServer-to-server calls must use internal.*, not api.*
hardcoded-secretserrorNo API keys, tokens, or secrets hardcoded in source
env-not-gitignorederror.env.local must be in .gitignore
spoofable-access-controlwarningDo not trust client args like userId or role for access control
missing-table-idwarningUse v.id("table") instead of v.string() for document references
missing-http-autherrorHTTP action endpoints must include authentication
conditional-function-exporterrorDo not conditionally export Convex functions based on environment
generic-mutation-argswarningDo not use v.any() in public mutation args
overly-broad-patchwarningDo not ctx.db.patch with spread args that bypass validation
http-missing-corswarningHTTP routes should include CORS headers

Performance (13 rules, 1.2x weight)

IDSeverityRule
unbounded-collecterror.collect() without .take(n) limit
filter-without-indexwarning.filter() scanning entire tables instead of using .withIndex()
date-now-in-queryerrorDate.now() in query functions breaks caching
loop-run-mutationerrorctx.runMutation/ctx.runQuery inside loops (N+1)
sequential-run-callswarningMultiple sequential ctx.run* calls in an action
unnecessary-run-actionwarningctx.runAction from within an action (same runtime)
helper-vs-runwarningctx.runQuery/ctx.runMutation inside a query or mutation
missing-index-on-foreign-keywarningv.id("table") schema field without a corresponding index
action-from-clientwarningClient calling actions directly instead of mutations
collect-then-filterwarning.collect() followed by JS .filter() instead of DB query filters
large-document-writeinfoInserting documents with 20+ fields
no-pagination-for-listwarningPublic query with .collect() returning unbounded results
missing-pagination-opts-validatorwarning.paginate(...) without paginationOptsValidator in args

Correctness (20 rules, 1.5x weight)

IDSeverityRule
unwaited-promiseerrorctx.db.insert, ctx.runMutation, etc. without await
old-function-syntaxwarningLegacy function registration syntax
db-in-actionerrorDirect ctx.db.* calls inside actions
deprecated-apiwarningDeprecated APIs like v.bigint()
wrong-runtime-importwarningIncompatible runtime imports
direct-function-refwarningDirect function refs instead of api.*/internal.*
missing-uniquewarning.first() where .unique() is appropriate
query-side-effecterrorSide effects (ctx.db.insert/patch/delete) inside queries
mutation-in-queryerrorctx.runMutation from within a query
cron-uses-public-apierrorCron jobs referencing api.* instead of internal.*
node-query-mutationerrorQueries/mutations in "use node" files
scheduler-return-ignoredinfoctx.scheduler.runAfter return value not captured
non-deterministic-in-querywarningMath.random(), new Date(), crypto in queries
replace-vs-patchinfoctx.db.replace semantics reminder
generated-code-modifiederrorManual edits to _generated/ files
unsupported-validator-typeerrorUnsupported validators (v.map(), v.set())
query-delete-unsupportederror.delete() on query chains
cron-helper-method-usagewarningDeprecated crons.hourly/daily/weekly
cron-direct-function-referenceerrorDirect function identifiers in cron methods
storage-get-metadata-deprecatedwarningDeprecated ctx.storage.getMetadata

Schema (9 rules, 1.0x weight)

IDSeverityRule
missing-schemawarningNo schema.ts in convex/
deep-nestingwarningValidators nested more than 3 levels deep
array-relationshipswarningv.array(v.id(...)) that may grow unbounded
redundant-indexwarningIndex that is a prefix of another on the same table
too-many-indexesinfoTable with 8+ indexes
missing-search-index-filterinfoSearch index without filterFields
optional-field-no-default-handlingwarning5+ optional fields without undefined handling
missing-index-for-querywarningQuery filters on a field with no matching index
index-name-includes-fieldswarningIndex name does not include all indexed fields in order

Architecture (8 rules, 0.8x weight)

IDSeverityRule
large-handlerwarningHandler exceeding 50 lines
monolithic-filewarningFile with 10+ exported functions
duplicated-authwarning3+ inline auth checks in the same file
action-without-schedulinginfoAction that could use ctx.scheduler instead
no-convex-errorinfothrow new Error(...) instead of throw new ConvexError(...)
mixed-function-typesinfoFile mixing public and internal exports
no-helper-functionsinfoMultiple large handlers with no shared helpers
deep-function-chainwarningAction with 5+ ctx.run* calls

Configuration (5 rules, 1.0x weight)

IDSeverityRule
missing-convex-jsonwarningNo convex.json in project root
missing-auth-configerrorFunctions use ctx.auth but no auth.config.ts exists
missing-generated-codewarningNo _generated/ directory
outdated-node-versionwarningNode version in config is outdated
missing-tsconfiginfoNo tsconfig.json in convex directory

Client-Side (4 rules, 1.0x weight)

IDSeverityRule
mutation-in-rendererrorMutation invocation during render
unhandled-loading-statewarninguseQuery result used without checking for undefined
action-instead-of-mutationinfouseAction where useMutation may suffice
missing-convex-providerinfoConvex hooks without ConvexProvider in component tree

Scoring

Health score is 0-100. Each finding deducts points based on severity and category weight, with per-rule caps.

ScoreLabelMeaning
85-100HealthyFew or no issues
70-84Needs attentionSome issues worth addressing
50-69UnhealthySignificant problems
0-49CriticalSerious issues requiring immediate attention

Common fix patterns

Replace .filter() with .withIndex()

// Bad
const docs = await ctx.db.query("tasks").filter((q) => q.eq(q.field("userId"), userId)).collect();

// Good (add index "by_userId" on ["userId"] in schema)
const docs = await ctx.db.query("tasks").withIndex("by_userId", (q) => q.eq("userId", userId)).collect();

Replace loop mutations with batch

// Bad
for (const id of ids) {
  await ctx.runMutation(internal.tasks.complete, { taskId: id });
}

// Good: single mutation that handles the batch
const updates = ids.map((id) => ctx.db.patch(id, { completed: true }));
await Promise.all(updates);

Fix Date.now() in queries

// Bad (in a query)
const cutoff = Date.now() - 86400000;

// Good: pass timestamp as an argument from the caller
args: { cutoff: v.number() },

Fix unbounded collect

// Bad
const all = await ctx.db.query("messages").collect();

// Good: paginate or limit
const recent = await ctx.db.query("messages").order("desc").take(50);

CLI reference

npx convex-doctor        # basic scan
npx convex-doctor -v     # verbose with file paths and line numbers
npx convex-doctor --format json  # JSON output for CI
npx convex-doctor --score        # score only (prints a number)
npx convex-doctor --diff main    # only files changed vs base branch

Source: https://github.com/nooesc/convex-doctor

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

adapt

無料

Adapt designs to work across different screen sizes, devices, contexts, or platforms. Implements breakpoints, fluid layouts, and touch targets. Use when the user mentions responsive design, mobile layouts, breakpoints, viewport adaptation, or cross-device compatibility.

日本語の概要は準備中です。原文の説明を表示しています。

waynesutton/agent-ready-component92026年8月28日 更新

Agent Ready project design context for navigation, docs links, and interface tone. Use when building or reviewing UI in this repo so patterns match the documented product feel.

日本語の概要は準備中です。原文の説明を表示しています。

waynesutton/agent-ready-component92026年8月28日 更新

animate

無料

Review a feature and enhance it with purposeful animations, micro-interactions, and motion effects that improve usability and delight. Use when the user mentions adding animation, transitions, micro-interactions, motion design, hover effects, or making the UI feel more alive.

日本語の概要は準備中です。原文の説明を表示しています。

waynesutton/agent-ready-component92026年8月28日 更新

arrange

無料

Improve layout, spacing, and visual rhythm. Fixes monotonous grids, inconsistent spacing, and weak visual hierarchy. Use when the user mentions layout feeling off, spacing issues, visual hierarchy, crowded UI, alignment problems, or wanting better composition.

日本語の概要は準備中です。原文の説明を表示しています。

waynesutton/agent-ready-component92026年8月28日 更新

audit

無料

Run technical quality checks across accessibility, performance, theming, responsive design, and anti-patterns. Generates a scored report with P0-P3 severity ratings and actionable plan. Use when the user wants an accessibility check, performance audit, or technical quality review.

日本語の概要は準備中です。原文の説明を表示しています。

waynesutton/agent-ready-component92026年8月28日 更新

bolder

無料

Amplify safe or boring designs to make them more visually interesting and stimulating. Increases impact while maintaining usability. Use when the user says the design looks bland, generic, too safe, lacks personality, or wants more visual impact and character.

日本語の概要は準備中です。原文の説明を表示しています。

waynesutton/agent-ready-component92026年8月28日 更新

waynesutton のスキルをすべて見る

このスキルの問題を報告する