/no-mistakes-rules:postgresql-rulesfrom no-mistakes-rules
Provides PostgreSQL best practices for queries, locks, transactions, schema, migrations, and partitioning. Loads automatically when writing or reviewing SQL sent through pg, Kysely, Drizzle, Prisma, or psql.
Ships in no-mistakes-rules. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
MUST NOT is a defect. SHOULD NOT needs a stated, measured reason.
SELECT, UPDATE, or DELETE in a job or endpoint; add a LIMIT or required predicates.OFFSET; its cost grows with page depth and concurrent inserts shift rows between pages. Use keyset (key, id) < ($1, $2) ordered the same way.LIMIT n + 1 before filtering).NOT IN (SELECT …); NULLs silently drop rows. Use NOT EXISTS.random(), clock_timestamp()) in predicates unless per-row evaluation is intended; they are evaluated per row.INSERTs on retried paths; use ON CONFLICT on a key the retry repeats, not a freshly generated one.COUNT(expr) as a count of true rows; it counts non-NULL values. Use COUNT(*) FILTER (WHERE expr).COUNT(*) > 0 or GROUP BY to test existence or dedupe; use EXISTS.MATERIALIZED CTEs, LATERAL, UNION, DISTINCT, or candidate pools unless EXPLAIN ANALYZE at realistic size beats the plain query.DO UPDATE SET on the columns you own, or DO NOTHING then read the row.ORDER BY the key, or use SKIP LOCKED for competing workers.finally.Promise.all statements on one transaction client expecting parallelism; merge them into one statement.BEGIN/COMMIT inside a migration whose runner already wraps it in a transaction.EXPLAIN ANALYZE on a write outside a rolled-back transaction.FOR KEY SHARE during the foreign-key check, then deadlock when each update needs FOR UPDATE strength. Update the parent first, or acquire the stronger parent lock before the insert.25P02.SERIALIZABLE to stop a racing writer unless each transaction reads rows the other writes. A guard (hold, ban, cancel) must read the rows the writer would change; otherwise SSI orders the writer first with no 40001.FOR UPDATE to a subquery or pre-select whose rows the same UPDATE or DELETE already locks and whose values you do not read; it only adds a second lock order. A SKIP LOCKED claim subquery is fine.NOT VALID constraint without a later VALIDATE CONSTRAINT.now() or timestamptz + interval in generated or index expressions; they are not immutable.statement_timeout or idle timeouts to make slow work fit when you can split, reorder, or shrink the work. An indivisible step, such as building an index on a large table, may use a higher timeout scoped to that step.NOT NULL, unique, or check constraint to an existing table without checking whether existing rows satisfy it.CONCURRENTLY, outside the migration's transaction; a failed build leaves an INVALID index to drop before retrying. A partitioned parent cannot build concurrently: build each partition's index concurrently, then create the parent index ON ONLY and attach them.What SKILL.md sets; muted values are Claude Code's defaults
15 skills in this plugin
/dependency-rulesLoad before adding, upgrading, or removing a dependency, or editing package.json, a lockfile (pnpm-lock.yaml, package-lock.json), a Dependabot config, or an npm publish step. Lists the defects to avoid and the patterns that need a stated reason./github-actions-rulesLoad before writing, reviewing, or debugging anything under .github/workflows (ci.yml, release.yml, publish.yml), a composite action, a required check, or a CI failure. Lists the defects to avoid and the patterns that need a stated reason: pinning, permissions, untrusted input, timeouts, gating on other workflows, required checks, concurrency, runners, masked failures in CI output./infra-rulesLoad before writing or reviewing infrastructure and ops code: OpenTofu or Terraform, IAM policies, secrets stores, provisioning or cleanup scripts, shell scripts, health probes, or code whose correctness depends on how many instances run. Lists the defects to avoid and the patterns that need a stated reason./integrations-rulesLoad before writing or reviewing code that calls, parses, or receives a third-party API or webhook (Stripe, Twilio, Slack, a partner REST API). Lists the defects to avoid and the patterns that need a stated reason: response classification, retries and idempotency, delivery records, payload mapping, timestamps and units, batch failures, signature verification./native-app-rulesLoad before writing or reviewing Swift or SwiftUI (iOS, macOS) or C# and .NET MAUI app code. Lists the defects to avoid and the patterns that need a stated reason: concurrency, localization, secure storage, release config./observability-rulesLoad before adding or reviewing a log line, a metric, an alert, or a monitor (pino, winston, OpenTelemetry, Datadog, Sentry), or making claims about production behavior or reporting measured results. Lists the defects to avoid and the patterns that need a stated reason: personal data, metric cardinality, fields monitors depend on, absence alerts, bound context, metrics clients across forks, evidence for claims.npx claudepluginhub jonathanong/no-mistakes --plugin no-mistakes-rulesOther plugins' skills for the same job