Index of every page on this site: llms.txt
All skills
ccheney avatar

/postgres-drizzle

@0eea7b0
Run it yourself

Write or review PostgreSQL schemas, queries, migrations, and Drizzle ORM code. Use for Postgres/Drizzle relations, indexing, pooling, or query performance; not for unrelated databases or generic backend work.

Use this Skill: https://skilld.dev/gh/ccheney/robust-skills/postgres-drizzle

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈57 tokens for metadata: the name and description. ≈744 when used: this file. ≈25k more on demand in 7 files.

Description uses 2.8% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈227 characters, or 2.8%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

PostgreSQL and Drizzle ORM

Match database work to the project's installed API and deployment context. The user's explicit instructions take precedence over this skill's guidelines.

Establish the database contract

Use the relevant schema/query, migration history, and requested behavior as input. For Drizzle code, inspect installed drizzle-orm/drizzle-kit versions and the driver; for SQL, establish the PostgreSQL version when a version-specific feature matters.

The references cover PostgreSQL 17/18 and distinguish Drizzle's 0.x relations() API from the v1 defineRelations() API. Do not mix them or infer the installed API from an npm dist-tag. When the version is unknown, use imports/lockfiles or ask for the missing version before giving version-dependent code.

Keep changes consistent

  • Declare database foreign keys separately from ORM relation metadata. Match nullability, uniqueness, and delete behavior to the actual relationship.
  • Use the transaction handle for every statement in that transaction; a query through the outer connection can escape it.
  • Diagnose slow queries from plans and workload evidence. Evaluate indexes on referencing columns; PostgreSQL does not create them automatically.
  • Generate and inspect migration SQL for schema changes. Preserve applied migration history; use a new migration for subsequent changes.
  • Establish the target before applying migrations or push. Authoring or reviewing SQL does not itself require executing it against a database. Continue execution when the user has already authorized that target and action.
  • Treat EXPLAIN ANALYZE as query execution, including writes. Use a suitable test target or non-executing plan when execution is outside the task.

Deliver the requested SQL/code, migration, or diagnosis, with compatibility assumptions and relevant verification. If execution is requested but the target is missing, prepare the change and ask only for that missing target.

References

Read the topic required for the current operation.

Task Reference
Tables, types, constraints, indexes, generated columns SCHEMA.md
Reads, writes, joins, transactions, prepared queries QUERIES.md
Relationships and version-specific relational query APIs RELATIONS.md
drizzle-kit configuration, migration generation and rollout MIGRATIONS.md
PostgreSQL features, RLS, partitioning, JSONB, full-text search POSTGRES.md
Query plans, indexing, pooling, pagination, bulk work PERFORMANCE.md
Compact syntax or connection setup lookup CHEATSHEET.md

For APIs or support not established by the installed project and references, consult version-matched Drizzle and PostgreSQL documentation.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning2mo5 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The analyzed skill is a comprehensive reference guide for writing and reviewing PostgreSQL and Drizzle ORM code. No security vulnerabilities, malicious patterns, or obfuscation techniques were detected.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

  • Runlayer9mo

    9/9 files flagged

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 0eea7b0. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 2 months ago

README badge

README badge for ccheney/robust-skills/postgres-drizzle