skillsight: Skill for Claude Code

.claude/skills/drizzle-migrations/SKILL.md

drizzle-migrations is a skill for Claude Code from PackmindHub/skillsight. It costs 227 tokens per session (2,860 once invoked), scanned A, original, Apache-2.0.

A set of instructions for changing database tables safely with Drizzle, a tool that maps application code to PostgreSQL databases. It describes how to generate, review, commit, and test database migration files.

In plain words
What is it for?
Use it when changing the backend database schema, generating Drizzle SQL migrations, checking migration journals, making SQL repeatable, and verifying changes against a fresh database.
Why use it?
It prevents development and production databases from silently ending up with different structures. It also helps catch migration files that could skip changes or repeat operations incorrectly.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is PackmindHub/skillsight's own configuration. It tells Claude Code how to work on skillsight itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything skillsight configures →

Reuse

Borrowing it

Nothing to install: this file belongs to PackmindHub/skillsight. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/PackmindHub/skillsight/main/.claude/skills/drizzle-migrations/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/PackmindHub/skillsight

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for drizzle-migrations

README.md
[![agentmods](https://agentmods.dev/badge/skills/packmindhub/skillsight/drizzle-migrations/github.svg)](https://agentmods.dev/skills/packmindhub/skillsight/drizzle-migrations)
Your own site
<a href="https://agentmods.dev/skills/packmindhub/skillsight/drizzle-migrations"><img src="https://agentmods.dev/badge/skills/packmindhub/skillsight/drizzle-migrations/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for drizzle-migrations

Your own site · 80×15
<a href="https://agentmods.dev/skills/packmindhub/skillsight/drizzle-migrations"><img src="https://agentmods.dev/badge/skills/packmindhub/skillsight/drizzle-migrations.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 227 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,860 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00227 $0.02860
Opus 5 $0.00113 $0.01430
Sonnet 5 $0.00045 $0.00572
Haiku 4.5 $0.00023 $0.00286

Measured 9d ago against content hash 28134967cb87, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

drizzle-migrations scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/drizzle-migrations/SKILL.md · 134 lines

How it starts

The opening of the file, as written. The whole thing — 134 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Drizzle Migrations — skills-observability backend

This skill exists because we lost meaningful production time to a class of migration bug that produces no error, no warning, and no test failure — until prod and dev silently disagree about what tables exist. The rules below are designed to keep that from happening again. Where a rule looks heavy-handed, the Why explains the real failure it prevents, so you can apply judgment at the edges.

The Golden Path (schema-first)

When a database change is needed, follow this exact sequence. Do not deviate without reading the rest of this document first.

1. Edit backend/src/db/schema.ts        (the source of truth)
2. cd backend && bun run migrate:generate   (Drizzle writes the SQL + journal entry)
3. Open the generated *.sql and review it    (catch destructive ops, missing IF NOT EXISTS)
4. Optionally tighten the SQL for idempotency (see "SQL idempotency" below)
5. Commit BOTH the .sql file AND the updated meta/_journal.json + meta/*.json snapshot
6. Verify against a fresh DB before merging  (see "Verification" below)

If you find yourself hand-writing a .sql file under backend/src/db/migrations/ from scratch, stop and ask whether the change can be expressed in schema.ts instead. Hand-authored migrations are valid in special cases (data backfills, raw SQL Drizzle can't generate), but they are off the golden path and need extra care — see "Hand-authored migrations" below.

The invariant that bit us: journal monotonicity

The meta/_journal.json file is a list of entries with an idx, a tag, and a when (a Unix-epoch milliseconds timestamp). At runtime, drizzle-orm/postgres-js/migrator decides whether to apply a given migration like this:

Walk the journal entries in idx order. For each entry, apply it only if its when is strictly greater than the maximum created_at currently recorded in the __drizzle_migrations table. Otherwise, skip it.

Read that sentence twice. The consequence is non-obvious and catastrophic: if you add a new entry whose when is <= any already-applied entry's when, that entry will be silently skipped forever. No error. No warning. No log line. The migration just doesn't run, and the production DB diverges from the schema your code expects.

Read the full file on GitHub · 134 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 134 lines · 227 tokens per session scan A 28134967cb87

Subscribe to this mod's changes

drizzle-migrations is a skill published in the GitHub repository PackmindHub/skillsight (9 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 227 tokens to every session and 2,860 once invoked, about $0.0011 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

azure-database-postgresql

Expert knowledge for Azure Database for PostgreSQL development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when using Flexible Server, replicas, PgBouncer, Query Store, Redis…

MicrosoftDocs/Agent-Skills · 133 tokens

azure-horizondb

Expert knowledge for Azure Horizondb development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when using azureai SQL/embeddings, pgvector tuning, Apache AGE graphs, hybrid…

MicrosoftDocs/Agent-Skills · 95 tokens

creating-oracle-to-postgres-master-migration-plan

Discovers all projects in a .NET solution, classifies each for Oracle-to-PostgreSQL migration eligibility, and produces a persistent master migration plan. Use when starting a multi-project Oracle-to-PostgreSQL migration, creating a migration inventory, or assessing which .NET projects contain Oracle dependencies.

boshi-xixixi/TraeSkill · 71 tokens

creating-oracle-to-postgres-migration-integration-tests

Creates integration test cases for .NET data access artifacts during Oracle-to-PostgreSQL database migrations. Generates DB-agnostic xUnit tests with deterministic seed data that validate behavior consistency across both database systems. Use when creating integration tests for a migrated project, generating test…

boshi-xixixi/TraeSkill · 83 tokens

creating-oracle-to-postgres-migration-bug-report

Creates structured bug reports for defects found during Oracle-to-PostgreSQL migration. Use when documenting behavioral differences between Oracle and PostgreSQL as actionable bug reports with severity, root cause, and remediation steps.

boshi-xixixi/TraeSkill · 52 tokens

postgres-patterns

PostgreSQL database patterns for query optimization, schema design, indexing, and security. Based on Supabase best practices.

shahidshabbir-se/my-pi-setup · 28 tokens