Discover Database
rand/cc-polymath
Automatically discover database skills when working with SQL, PostgreSQL, MongoDB, Redis, database schema design, query optimization, migrations, connection pooling, ORMs, or database selection.
A skill your agent uses when PostgreSQL engine behaviour decides the answer — schema and type design, index choice, reading EXPLAIN on a slow query, zero-downtime DDL and backfills, or ops (roles…
$ npx skills add ericrisco/rsc-harness --skill postgresdb -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install ericrisco/rsc-harness postgresdb --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/ericrisco/rsc-harness.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/postgresdb .claude/skills/postgresdb && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "postgresdb" agent skill from https://github.com/ericrisco/rsc-harness/tree/main/skills/postgresdb into .claude/skills/postgresdb/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "postgresdb", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/ericrisco/rsc-harness/tree/main/skills/postgresdbType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add ericrisco/rsc-harness --skill postgresdb -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install ericrisco/rsc-harness postgresdb --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ericrisco/rsc-harness.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/postgresdb .agents/skills/postgresdb && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "postgresdb" agent skill from https://github.com/ericrisco/rsc-harness/tree/main/skills/postgresdb into .agents/skills/postgresdb/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "postgresdb", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ericrisco/rsc-harness --skill postgresdb -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install ericrisco/rsc-harness postgresdb --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ericrisco/rsc-harness.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/postgresdb .cursor/skills/postgresdb && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "postgresdb" agent skill from https://github.com/ericrisco/rsc-harness/tree/main/skills/postgresdb into .cursor/skills/postgresdb/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "postgresdb", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/ericrisco/rsc-harness.git --path skills/postgresdb--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add ericrisco/rsc-harness --skill postgresdb -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install ericrisco/rsc-harness postgresdb --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ericrisco/rsc-harness.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/postgresdb .gemini/skills/postgresdb && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "postgresdb" agent skill from https://github.com/ericrisco/rsc-harness/tree/main/skills/postgresdb into .gemini/skills/postgresdb/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "postgresdb", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install ericrisco/rsc-harness postgresdbInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add ericrisco/rsc-harness --skill postgresdb -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/ericrisco/rsc-harness.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/postgresdb .github/skills/postgresdb && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "postgresdb" agent skill from https://github.com/ericrisco/rsc-harness/tree/main/skills/postgresdb into .github/skills/postgresdb/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "postgresdb", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ericrisco/rsc-harness --skill postgresdb -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install ericrisco/rsc-harness postgresdb --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ericrisco/rsc-harness.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/postgresdb .opencode/skills/postgresdb && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "postgresdb" agent skill from https://github.com/ericrisco/rsc-harness/tree/main/skills/postgresdb into .opencode/skills/postgresdb/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "postgresdb", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
postgresdbA skill your agent uses when PostgreSQL engine behaviour decides the answer — schema and type design, index choice, reading EXPLAIN on a slow query, zero-downtime DDL and backfills, or ops (roles…
Postgresdb is an agent skill from ericrisco/rsc-harness. Use when PostgreSQL engine behaviour decides the answer — schema and type design, index choice, reading EXPLAIN on a slow query, zero-downtime DDL and backfills, or ops (roles, RLS, pooling, vacuum, partitioning, PITR). PG16, ORM-agnostic. NOT portable query logic (that is sql), NOT a managed provider's platform surface (that is neon).
Its SKILL.md is about 4.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 10 other files, including scripts and reference files (for example `evals/README.md`, `evals/cases.yaml` and `references/migrations.md`).
It sits in Databases, covering ORMs and data access, Query optimization and Database administration. It works with PostgreSQL and SQL. The repository describes itself as: Your agent invents things because it has no memory, and can't touch your database because it has no arms. rsc is the meta-harness that gives it both, plus the trade to know the… The licence is MIT.
4 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 92fde8f. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 1 file in scripts/ (Shell), which the agent can run.
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Postgresdb loads about 4.4k tokens when it runs, and up to ~17k if it reads all its reference files. Until then it costs about 88 tokens; SKILL.md has 1,484 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from ericrisco/rsc-harness at commit 92fde8f, republished under its MIT licence (© ericrisco). 1,484 words, ~4,403 tokens.
.claude/skills/postgresdb/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.Engine-level PostgreSQL 16 guidance: design correct schemas, pick the right index, read EXPLAIN and fix slow SQL, run zero-downtime migrations, and operate/secure the database. Tooling-agnostic; every example is runnable.
New, non-trivial feature with no approved spec + plan under 02-DOCS/wiki/sdd/? Hand off to
specify before writing feature code (method: sdd); build
straight from here only for a genuinely one-line, low-risk change.
Deep dives: schema-and-indexing (types, constraints, every index kind, bloat) · query-optimization (EXPLAIN, joins, concurrency, JSONB/FTS/pgvector) · migrations (zero-downtime DDL, per-ORM) · operations-and-security (roles, RLS, pooling, vacuum, partitioning, backups).
Not this skill. ORM-API ergonomics (Prisma updateMany count trap, SQLAlchemy session lifecycle)
and per-runner migration wiring → that tool's own docs; this skill owns the SQL the ORM emits and
the engine behavior underneath. Other engines → mysql,
sqlite-turso, clickhouse-analytics
(different MVCC, locking, planner). App-layer caching / Redis / Kafka as products are out — only
Postgres-as-queue via SKIP LOCKED is in scope. Cloud-vendor console clicks →
deployment; we give the SQL and params, not the RDS/Cloud SQL UI path.
Fast lookups; runnable DDL lives in the references.
| Use case | Correct type | Avoid | Why |
|---|---|---|---|
| Surrogate PK (internal) | bigint GENERATED ALWAYS AS IDENTITY | serial, int | identity is SQL-standard, no sequence-ownership gotchas; bigint avoids 2.1B overflow |
| Surrogate PK (public/distributed) | uuid v7 | uuid v4 | v7 is time-ordered → less B-tree fragmentation than random v4 |
| Natural text id (slug, sku) | text + UNIQUE + CHECK | varchar(n) | length via CHECK; no rewrite to widen later |
| Money / exact decimal | numeric(19,4) | float8, money | binary floats drift; money has locale issues |
| Timestamp (event) | timestamptz | timestamp | stores a UTC instant; naive timestamp loses zone |
| Duration | interval | int seconds | self-documenting, arithmetic-safe |
| Small closed set, stable | enum | text w/o CHECK | type safety; but see lookup-table note |
| Evolving set, joinable | lookup table + FK | enum | ALTER TYPE ... ADD VALUE is awkward; FK gives joins + soft-retire |
| Flag | boolean | int, varchar | three-valued NULL still possible — add NOT NULL DEFAULT |
| Tags (read-mostly) | text[] + GIN | comma string | array ops + GIN containment |
| Tags (relational) | join table | text[] | when you need FK integrity / per-tag rows |
| Semi-structured | jsonb | json, text | binary, indexable, dedup keys; promote hot keys to columns |
| IP / CIDR | inet / cidr | text | validation + operators |
| Time range (booking) | tstzrange + GiST | two columns | && overlap + exclusion constraint |
| Access pattern | Index | DDL | Notes |
|---|---|---|---|
= / < > / range / ORDER BY | btree (default) | CREATE INDEX ix_orders_status ON orders (status) | also enforces uniqueness |
LIKE 'prefix%' | btree + text_pattern_ops | CREATE INDEX ix_users_email_pat ON users (email text_pattern_ops) | only for C-locale/prefix; not %suffix |
| Case-insensitive eq | expr index or citext | CREATE INDEX ix_users_lemail ON users (lower(email)) | query must use lower(email) too |
@> jsonb / array containment | GIN | CREATE INDEX ix_orders_meta ON orders USING gin (meta) | jsonb_path_ops if only @> |
Full-text @@ | GIN on tsvector | CREATE INDEX ix_orders_search ON orders USING gin (search) | index a generated tsvector column |
| Range overlap / exclusion / geo | GiST | CREATE INDEX ix_book_during ON bookings USING gist (during) | also PostGIS geometry |
| Huge append-only time-series | BRIN | CREATE INDEX ix_events_ts ON events USING brin (created_at) | needs physical correlation |
| Vector similarity | hnsw (pgvector) | CREATE INDEX ix_docs_embed ON docs USING hnsw (embedding vector_cosine_ops) | see query-optimization |
| Dedup only | unique btree | CREATE UNIQUE INDEX uq_users_email ON users (email) | constraint = index |
Hash indexes: almost never — equality-only, no multicolumn, rarely beats btree even though WAL-logged since PG10.
Read the plan before adding an index — EXPLAIN (ANALYZE, BUFFERS) or it didn't happen. An index
the planner never picks is pure write tax on every insert and update, forever.
status with few distinct values (planner ignores it; seq scan wins).UNIQUE constraint — the constraint already created an index.-- GOOD: identity PK, public uuid, FK with action, numeric money, timestamptz,
-- status via lookup FK, generated tsvector, CHECK constraints.
CREATE TABLE orders (
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
public_id uuid NOT NULL DEFAULT gen_random_uuid(), -- v4; see schema ref for v7
user_id bigint NOT NULL REFERENCES users (id) ON DELETE RESTRICT,
status text NOT NULL REFERENCES order_statuses (code) ON UPDATE CASCADE,
amount numeric(19,4) NOT NULL CHECK (amount >= 0),
currency text NOT NULL CHECK (length(currency) = 3),
note text,
search tsvector GENERATED ALWAYS AS (to_tsvector('simple', coalesce(note, ''))) STORED,
created_at timestamptz NOT NULL DEFAULT now(),
updated_at timestamptz NOT NULL DEFAULT now(),
UNIQUE (public_id)
);
CREATE INDEX ix_orders_user_id ON orders (user_id); -- FKs are NOT auto-indexed
CREATE INDEX ix_orders_status ON orders (status);-- BAD: every column is a future migration or a bug.
CREATE TABLE orders (
id serial PRIMARY KEY, -- sequence-ownership gotchas; use IDENTITY
user_id int REFERENCES users(id), -- int overflows at 2.1B; no FK index
status varchar(20), -- length hack; no constraint on values
amount float, -- money drift
created_at timestamp DEFAULT now() -- naive: loses the zone
);updated_at is not auto-maintained — add a BEFORE UPDATE trigger (see schema ref) or set it in the
app; Postgres has no ON UPDATE clause.
Equality columns first, then the range/sort column.
-- Query: WHERE user_id = $1 AND created_at >= $2 ORDER BY created_at DESC
-- GOOD: equality (user_id) then range (created_at)
CREATE INDEX ix_orders_user_created ON orders (user_id, created_at DESC);
-- BAD: range-first index cannot satisfy the equality efficiently for this query
CREATE INDEX ix_orders_created_user ON orders (created_at, user_id);Confirm with EXPLAIN that the plan shows Index Cond: (user_id = ... AND created_at >= ...), not a
Filter:.
-- Partial: index only the rows you query (smaller, hotter)
CREATE INDEX ix_orders_active ON orders (user_id, created_at DESC)
WHERE status <> 'cancelled';
-- Covering: INCLUDE non-key columns to enable an index-only scan
CREATE INDEX ix_orders_user_cover ON orders (user_id) INCLUDE (amount, created_at);Index-only scan requires a recently-VACUUMed table; confirm Heap Fetches: 0 in EXPLAIN (ANALYZE).
-- GOOD: keyset on a stable composite sort; uses ix_orders_user_created
SELECT id, amount, created_at
FROM orders
WHERE user_id = $1
AND (created_at, id) < ($2, $3) -- row-value comparator = last row of prev page
ORDER BY created_at DESC, id DESC
LIMIT 20;
-- BAD: OFFSET scans and discards 100000 rows every page (O(n))
SELECT * FROM orders WHERE user_id = $1 ORDER BY created_at DESC LIMIT 20 OFFSET 100000;The index must match the ORDER BY direction exactly; include the tiebreaker (id).
-- GOOD: insert-or-update; EXCLUDED is the row that failed to insert
INSERT INTO inventory (sku, qty)
VALUES ($1, $2)
ON CONFLICT (sku)
DO UPDATE SET qty = inventory.qty + EXCLUDED.qty
WHERE inventory.qty + EXCLUDED.qty >= 0 -- guard
RETURNING id, qty;
-- DO NOTHING returns no row on conflict; wrap to always get the row:
WITH ins AS (
INSERT INTO tags (name) VALUES ($1)
ON CONFLICT (name) DO NOTHING
RETURNING id
)
SELECT id FROM ins
UNION ALL
SELECT id FROM tags WHERE name = $1 LIMIT 1;-- GOOD: contention-free job claim; concurrent workers never block each other
UPDATE jobs
SET status = 'processing', locked_at = now()
WHERE id = (
SELECT id FROM jobs
WHERE status = 'pending'
ORDER BY created_at
FOR UPDATE SKIP LOCKED
LIMIT 1
)
RETURNING id, payload;SKIP LOCKED skips rows another txn holds; FOR UPDATE alone would serialize all workers.
-- BAD: application loops, one query per order (N+1)
-- for o in orders: SELECT * FROM order_items WHERE order_id = o.id
-- GOOD: one set-based query
SELECT o.id, json_agg(i.*) AS items
FROM orders o
JOIN order_items i ON i.order_id = o.id
WHERE o.user_id = $1
GROUP BY o.id;
-- Top-N-per-group: JOIN LATERAL, not a window-filter scan
SELECT u.id, recent.*
FROM users u
JOIN LATERAL (
SELECT id, amount, created_at FROM orders
WHERE user_id = u.id ORDER BY created_at DESC LIMIT 3
) recent ON true;An ORM emitting N queries is the same bug — fix it at the SQL boundary, not with a cache.
EXPLAIN (ANALYZE, BUFFERS, SETTINGS, FORMAT TEXT)
SELECT * FROM orders WHERE user_id = $1 AND created_at >= $2;Read these four first:
ANALYZE.actual time × loops.Seq Scan on a big table where you expected an index.Rows Removed by Filter — the predicate was not pushed to an index.Full method in query-optimization.
Full sequences (zero-downtime expand-contract, batched backfills, per-ORM runners) in migrations. These four are absolute because each one is a lock you cannot take back once traffic is on the table:
CONCURRENTLY — plain CREATE INDEX holds ACCESS
EXCLUSIVE for the entire build and blocks every writer. It therefore cannot run inside a txn.ADD COLUMN ... NOT NULL without a default/backfill plan, and never add a volatile
default (now(), gen_random_uuid()) on a large table without a batched backfill — a volatile
default rewrites the whole table under ACCESS EXCLUSIVE. A non-volatile constant is instant (PG11+).SET lock_timeout + SET statement_timeout around DDL on hot tables, so a blocked statement fails
fast instead of parking an ACCESS EXCLUSIVE request that every reader behind it then queues on.Lock modes: CREATE INDEX CONCURRENTLY takes SHARE UPDATE EXCLUSIVE (allows writes); plain
CREATE INDEX, ALTER TABLE ... TYPE, ADD COLUMN with a volatile default, and VACUUM FULL take
ACCESS EXCLUSIVE (blocks everything). Full table in
migrations.
| Claim | Reality |
|---|---|
| "I'll add the FK index later, the query works now" | Unindexed FK = seq scan + heavy lock cascade on parent DELETE/UPDATE. Index it now. |
| "UUID PK is fine everywhere" | Random v4 fragments the B-tree and bloats WAL. Use IDENTITY internally or uuid v7. |
"SELECT count(*) to check existence" | Counts the whole match. Use EXISTS (SELECT 1 ...). |
| "CTEs are just for readability" | Pre-12 they were optimization fences; PG12+ inlines unless MATERIALIZED. Know which you want. |
"NOT IN (subquery)" | NULL-unsafe (one NULL → empty result) and slow. Use NOT EXISTS. |
| "Store money as float, round on display" | Silent drift across arithmetic. numeric(19,4). |
"ADD COLUMN ... NOT NULL DEFAULT now()" | Volatile default rewrites the table under ACCESS EXCLUSIVE. Non-volatile constant is instant (PG11+). |
"One big jsonb blob beats columns" | No constraints, no per-key stats, GIN bloat. Promote hot keys to typed columns. |
| "RLS is on, so the table is protected" | RLS is opt-in per table and the table owner bypasses it. Verify with a non-owner role; add FORCE ROW LEVEL SECURITY to cover the owner too. |
"RLS policy calling auth.uid() per row" | Re-evaluated per row. Wrap: (SELECT auth.uid()) so it runs once. |
"CREATE INDEX in the migration is fine" | Blocks writes for the whole build. CREATE INDEX CONCURRENTLY (outside a txn). |
"VACUUM FULL will fix bloat" | Takes ACCESS EXCLUSIVE, rewrites the table. Use autovacuum tuning / REINDEX CONCURRENTLY. |
| Level | Prevents | Use when | Note |
|---|---|---|---|
| Read Committed (default) | dirty reads | most OLTP | each statement sees a fresh snapshot |
| Repeatable Read | + non-repeatable / phantom (snapshot) | multi-statement consistent read | may raise 40001; retry |
| Serializable (SSI) | + write skew | invariants across rows | retry 40001 with backoff |
Retry the txn on SQLSTATE 40001 (serialization_failure) and 40P01 (deadlock_detected).
-- Unindexed foreign keys
SELECT c.conrelid::regclass AS tbl, a.attname AS col
FROM pg_constraint c
JOIN pg_attribute a ON a.attrelid = c.conrelid AND a.attnum = ANY (c.conkey)
WHERE c.contype = 'f'
AND NOT EXISTS (
SELECT 1 FROM pg_index i
WHERE i.indrelid = c.conrelid AND (i.indkey::int2[])[0] = a.attnum
);
-- Top slow queries (needs pg_stat_statements)
SELECT calls, round(mean_exec_time::numeric, 2) AS mean_ms,
round(total_exec_time::numeric, 2) AS total_ms, query
FROM pg_stat_statements ORDER BY total_exec_time DESC LIMIT 20;
-- Dead tuples / bloat candidates
SELECT relname, n_dead_tup, n_live_tup, last_autovacuum
FROM pg_stat_user_tables WHERE n_dead_tup > 1000 ORDER BY n_dead_tup DESC;
-- Blocking locks
SELECT blocked.pid AS blocked_pid, blocking.pid AS blocking_pid, blocked.query AS blocked_query
FROM pg_stat_activity blocked
JOIN pg_locks bl ON bl.pid = blocked.pid AND NOT bl.granted
JOIN pg_locks gl ON gl.locktype = bl.locktype AND gl.database IS NOT DISTINCT FROM bl.database
AND gl.relation IS NOT DISTINCT FROM bl.relation AND gl.granted
JOIN pg_stat_activity blocking ON blocking.pid = gl.pid;
-- Cache hit ratio (aim > 0.99)
SELECT sum(heap_blks_hit) / nullif(sum(heap_blks_hit + heap_blks_read), 0) AS ratio
FROM pg_statio_user_tables;
-- Unused indexes
SELECT relname, indexrelname, idx_scan
FROM pg_stat_user_indexes WHERE idx_scan = 0 ORDER BY relname;Run scripts/verify.sh from your project root: it lints discovered SQL with sqlfluff (if
configured), syntax-sanity-checks migration files (the quote/paren balance check is dollar-quote and
block-comment aware), flags foot-guns (CREATE INDEX without CONCURRENTLY in a migration,
ADD COLUMN ... NOT NULL without DEFAULT, VACUUM FULL), and — only if DATABASE_URL and psql
are present — checks that pg_stat_statements is enabled. It exits non-zero only on a real
sqlfluff lint error; everything else (missing tools, heuristic warnings, DB unreachable) is advisory
[skip]/[warn]. Runs on stock macOS bash 3.2; never writes, never connects without DATABASE_URL.
In a project with a 02-DOCS/ layer (the harness Karpathy wiki), read
02-DOCS/wiki/stack/postgresdb.md first and stay consistent with it. Missing or stale? Write the
project's real choices there — schema and naming conventions, migration tool, indexing/partitioning
decisions, pooling setup, RLS policies — index it in 02-DOCS/wiki/index.md (the Knowledge map; root
CLAUDE.md keeps only a pointer), and bump its Updated date in the same change, so the next agent
inherits the conventions instead of re-deriving them. No 02-DOCS/ layer? Skip silently (optionally
suggest harness) — technical conventions are recorded, not gated; never block the task on this.
© ericrisco, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 7 other files (scripts, references) in skills/postgresdb of ericrisco/rsc-harness.
Open the folder on GitHubat commit 92fde8f
Postgresdb next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Postgresdb this skillericrisco/rsc-harness | 156 | — | ~4.4k | Automated safety check: Pass | MIT | |
| Discover Databaserand/cc-polymath | 181 | — | ~2k | Automated safety check: Pass | MIT | |
| PostgreSQL Documentation Reference2025Emma/vibe-coding-cn | 23k | 1 repos | ~19k | Automated safety check: Pass | MIT | |
| DB SculptorEliasOulkadi/shokunin | 114 | — | ~3.1k | Automated safety check: Notes | MIT | |
| Dsqlawslabs/agent-plugins | 912 | — | ~6.9k | Automated safety check: Pass | Apache-2.0 | |
| Matlab Use Databasematlab/matlab-agentic-toolkit | 1.1k | — | ~3.1k | Automated safety check: Pass | Custom licence |
rand/cc-polymath
Automatically discover database skills when working with SQL, PostgreSQL, MongoDB, Redis, database schema design, query optimization, migrations, connection pooling, ORMs, or database selection.
2025Emma/vibe-coding-cn
PostgreSQL database documentation - SQL queries, database design, administration, performance tuning, and advanced features. Use when working with PostgreSQL…
EliasOulkadi/shokunin
Design database schemas with Prisma/Drizzle, PostgreSQL index strategy (B-tree, GIN, GiST, BRIN, Hash), query optimization (EXPLAIN ANALYZE), migration safety (expand/contract, zero-downtime), and…
awslabs/agent-plugins
Build with Aurora DSQL — manage schemas, execute queries, handle migrations, diagnose query plans, diagnose cluster performance, load data, and develop applications with a serverless, distributed…
matlab/matlab-agentic-toolkit
Reads from, writes to, and manages relational databases using MATLAB Database Toolbox.
LeoYeAI/openclaw-master-skills
Query, design, migrate, and optimize SQL databases. An agent skill from LeoYeAI/openclaw-master-skills.
ericrisco/rsc-harness
A skill your agent uses when designing or analyzing a controlled experiment — falsifiable hypothesis, sample size from an MDE, reading significance/CI/power, CUPED, or rescuing tests that won't go…
ericrisco/rsc-harness
A skill your agent uses when making a web UI conform to WCAG 2.2 Level AA — axe-core or Lighthouse a11y violations, keyboard operability, focus management, ARIA roles/names/live regions, contrast…
ericrisco/rsc-harness
A skill your agent uses when running or fixing paid acquisition on Google or Meta — campaign structure (Performance Max, Demand Gen, Search, Advantage+), platform-fit creative, budget/scaling rules…
ericrisco/rsc-harness
A skill your agent uses when measuring whether an LLM or agent system actually got better and gating merges on it: golden sets, fixing an inflated LLM-as-judge, scoring RAG (faithfulness, contextual…
ericrisco/rsc-harness
A skill your agent uses when a creative goal must become a finished media file: pick and order generative-media models per modality — AI voiceover, image-to-video clips, score — then glue them with…
ericrisco/rsc-harness
A skill your agent uses when instrumenting product or web analytics — GA4/PostHog SDK wiring, event taxonomy, funnels, double-counted events, consent gating, PII scrubbing.
Works with
Categories
A skill your agent uses when PostgreSQL engine behaviour decides the answer — schema and type design, index choice, reading EXPLAIN on a slow query, zero-downtime DDL and backfills, or ops (roles…. Postgresdb is an agent skill from ericrisco/rsc-harness. Use when PostgreSQL engine behaviour decides the answer — schema and type design, index choice, reading EXPLAIN on a slow query, zero-downtime DDL and backfills, or ops (roles, RLS, pooling, vacuum, partitioning, PITR).
Postgresdb fits situations like: postgreSQL engine behaviour decides the answer — schema and type design; reading EXPLAIN on a slow query; zero-downtime DDL and backfills.
Run `npx skills add ericrisco/rsc-harness --skill postgresdb -a claude-code`. Or copy the skill folder (skills/postgresdb in ericrisco/rsc-harness) into .claude/skills/postgresdb in your project. Claude Code loads it when a task matches its description.
Run `npx skills add ericrisco/rsc-harness --skill postgresdb -a codex`. Or copy the skill folder (skills/postgresdb in ericrisco/rsc-harness) into .agents/skills/postgresdb in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ericrisco/rsc-harness --skill postgresdb -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/postgresdb, .gemini/skills/postgresdb, .github/skills/postgresdb and .opencode/skills/postgresdb in your project.
Going by SKILL.md and its folder, Postgresdb needs a shell for the scripts in its folder. Our summary lists: A Bash shell.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Postgresdb is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 4.4k tokens (SKILL.md is roughly 18k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 13k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Postgresdb: Discover Database (rand/cc-polymath, 181 stars), PostgreSQL Documentation Reference (2025Emma/vibe-coding-cn, 23k stars), DB Sculptor (EliasOulkadi/shokunin, 114 stars) and Dsql (awslabs/agent-plugins, 912 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
ericrisco (a GitHub user) maintains it in ericrisco/rsc-harness, which has 156 GitHub stars. The repository holds 229 skills in this directory. The repository was last updated on October 6, 2026.
Source: ericrisco/rsc-harness on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.