Database Migration
Dokhacgiakhoa/Agent-Skills-4-Vibe-Coding-CLI
MASTER DB: Zero-Downtime, Schema Design (3NF), SQL/NoSQL. An agent skill from Dokhacgiakhoa/Agent-Skills-4-Vibe-Coding-CLI.
Database design and migration patterns for Alembic migrations, schema design (SQL/NoSQL), and database versioning.
$ npx skills add yonatangross/orchestkit --skill database-patterns -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install yonatangross/orchestkit database-patterns --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/yonatangross/orchestkit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/src/skills/database-patterns .claude/skills/database-patterns && 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 "database-patterns" agent skill from https://github.com/yonatangross/orchestkit/tree/main/src/skills/database-patterns into .claude/skills/database-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "database-patterns", 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/yonatangross/orchestkit/tree/main/src/skills/database-patternsType 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 yonatangross/orchestkit --skill database-patterns -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install yonatangross/orchestkit database-patterns --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/yonatangross/orchestkit.git skills-src && mkdir -p .agents/skills && cp -r skills-src/src/skills/database-patterns .agents/skills/database-patterns && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "database-patterns" agent skill from https://github.com/yonatangross/orchestkit/tree/main/src/skills/database-patterns into .agents/skills/database-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "database-patterns", 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 yonatangross/orchestkit --skill database-patterns -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install yonatangross/orchestkit database-patterns --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/yonatangross/orchestkit.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/src/skills/database-patterns .cursor/skills/database-patterns && 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 "database-patterns" agent skill from https://github.com/yonatangross/orchestkit/tree/main/src/skills/database-patterns into .cursor/skills/database-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "database-patterns", 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/yonatangross/orchestkit.git --path src/skills/database-patterns--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 yonatangross/orchestkit --skill database-patterns -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install yonatangross/orchestkit database-patterns --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/yonatangross/orchestkit.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/src/skills/database-patterns .gemini/skills/database-patterns && 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 "database-patterns" agent skill from https://github.com/yonatangross/orchestkit/tree/main/src/skills/database-patterns into .gemini/skills/database-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "database-patterns", 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 yonatangross/orchestkit database-patternsInstalls 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 yonatangross/orchestkit --skill database-patterns -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/yonatangross/orchestkit.git skills-src && mkdir -p .github/skills && cp -r skills-src/src/skills/database-patterns .github/skills/database-patterns && 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 "database-patterns" agent skill from https://github.com/yonatangross/orchestkit/tree/main/src/skills/database-patterns into .github/skills/database-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "database-patterns", 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 yonatangross/orchestkit --skill database-patterns -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install yonatangross/orchestkit database-patterns --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/yonatangross/orchestkit.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/src/skills/database-patterns .opencode/skills/database-patterns && 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 "database-patterns" agent skill from https://github.com/yonatangross/orchestkit/tree/main/src/skills/database-patterns into .opencode/skills/database-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "database-patterns", 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.
database-patternsDatabase design and migration patterns for Alembic migrations, schema design (SQL/NoSQL), and database versioning.
Database Patterns is an agent skill from yonatangross/orchestkit. Database design and migration patterns for Alembic migrations, schema design (SQL/NoSQL), and database versioning. Use when creating migrations, designing schemas, normalizing data, managing database versions, or handling schema drift.
Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 26 other files, including scripts and reference files (for example `metadata.json`, `references/cost-comparison.md` and `references/db-migration-paths.md`). Compatibility notes: Claude Code 2.1.277+.
It sits in Databases, covering Database schema design, Database migrations and NoSQL databases. It works with SQL. The repository describes itself as: The Complete AI Development Toolkit for Claude Code. 106 skills, 36 agents, 171 hooks. Install ork for stable (v9.x), or ork-alpha for the v10 line, which ships daily. The licence is MIT.
Read from SKILL.md and the folder at commit 0ef71d2. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
ReadGlobGrepWebFetchWebSearchFrom allowed-tools in the SKILL.md frontmatter.
Ships 1 file in scripts/, which the agent can run.
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
postgresql.orgalembic.sqlalchemy.orggithub.comFrom 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.
Claude Code 2.1.277+.
From compatibility in the SKILL.md frontmatter.
Database Patterns loads about 2.5k tokens when it runs, and up to ~7.6k if it reads all its reference files. Until then it costs about 63 tokens; SKILL.md has 665 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 yonatangross/orchestkit at commit 0ef71d2, republished under its MIT licence (© yonatangross). 665 words, ~2,531 tokens.
.claude/skills/database-patterns/SKILL.md (or your agent's skills folder). This skill also uses 24 other files; get the full folder from GitHub.<!-- directive-density: intentional (teaches migration anti-patterns; NEVER markers describe real production-break conditions, not aspirational guidance) -->
Comprehensive patterns for database migrations, schema design, and version management. Each category has individual rule files in rules/ loaded on-demand.
| Category | Rules | Impact | When to Use |
|---|---|---|---|
| Alembic Migrations | 2 | CRITICAL | Data migrations, branch management |
| Schema Design | 3 | HIGH | Normalization, indexing strategies, NoSQL patterns |
| Versioning | 2 | HIGH | Changelogs, schema drift detection |
| Zero-Downtime Migration | 2 | CRITICAL | Expand-contract, pgroll, rollback monitoring |
| Database Selection | 1 | HIGH | Choosing the right database, PostgreSQL vs MongoDB, cost analysis |
Total: 10 rules across 5 categories
This skill is a wrap around Alembic and PostgreSQL, not a replacement for their
docs. Read references/ork-delta.md first: it holds the
version floors, corrections and house conventions that upstream does not carry.
Everything in the table below was removed on purpose.
These topics are vendor documentation. Fetch them from the source instead of re-teaching them here.
| Topic | First-party source |
|---|---|
Alembic autogenerate, async env.py template, revision/upgrade/downgrade/history CLI | https://alembic.sqlalchemy.org/en/latest/autogenerate.html (our one correction to the async template is in references/ork-delta.md) |
Migration branches, merge revisions, tuple down_revision, branch labels | https://alembic.sqlalchemy.org/en/latest/branches.html |
Multi-database env.py, batched backfill recipes, migration hooks, environment-conditional migrations | https://alembic.sqlalchemy.org/en/latest/cookbook.html |
| Rollback and data-integrity test harnesses | references/migration-testing.md |
| JSONB operators, indexing and storage tradeoffs | https://www.postgresql.org/docs/current/datatype-json.html (normal forms and the house denormalization call stay in rules/schema-normalization.md) |
Full index-type reference and syntax (B-tree, GIN, partial, covering, CREATE INDEX CONCURRENTLY, REINDEX) | https://www.postgresql.org/docs/current/sql-createindex.html (the house subset we actually apply stays in rules/schema-indexing.md) |
lock_timeout, statement_timeout, advisory locks during migration | https://www.postgresql.org/docs/current/runtime-config-client.html and rules/versioning-drift.md |
| Enum type changes | https://www.postgresql.org/docs/current/datatype-enum.html |
| Table partitioning | https://www.postgresql.org/docs/current/ddl-partitioning.html |
| Trigger functions | https://www.postgresql.org/docs/current/plpgsql-trigger.html |
| Foreign-key cascade semantics | https://www.postgresql.org/docs/current/ddl-constraints.html |
| Temporal and audit-trail tables, CDC change logs, stored-procedure and view versioning | https://www.postgresql.org/docs/18/sql-createtable.html (read references/ork-delta.md before assuming these give row history) |
HNSW and vector index tuning (m, ef_construction, hnsw.ef_search) | https://github.com/pgvector/pgvector |
| Generic pre-deployment, backup and schema-review checklists | https://alembic.sqlalchemy.org/en/latest/tutorial.html |
| Async SQLAlchemy sessions, FastAPI wiring, connection pool tuning | ork:python-backend skill |
# Alembic: Auto-generate migration from model changes
# alembic revision --autogenerate -m "add user preferences"
def upgrade() -> None:
op.add_column('users', sa.Column('org_id', UUID(as_uuid=True), nullable=True))
op.execute("UPDATE users SET org_id = 'default-org-uuid' WHERE org_id IS NULL")
def downgrade() -> None:
op.drop_column('users', 'org_id')-- Schema: Normalization to 3NF with proper indexing
-- PG18: prefer uuidv7() (time-ordered, better B-tree locality) over gen_random_uuid() (random v4)
CREATE TABLE orders (
id UUID PRIMARY KEY DEFAULT uuidv7(),
customer_id UUID NOT NULL REFERENCES customers(id),
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE INDEX idx_orders_customer_id ON orders(customer_id);Migration management with Alembic for SQLAlchemy 2.0 async applications.
| Rule | File | Key Pattern |
|---|---|---|
| Data Migration | rules/alembic-data-migration.md | Batch backfill, two-phase NOT NULL, zero-downtime |
| Branching | rules/alembic-branching.md | Feature branches, merge migrations, conflict resolution |
Autogenerate setup is upstream. Our one deviation from Alembic's async env.py
template (the in_greenlet() guard) is in references/ork-delta.md.
SQL and NoSQL schema design with normalization, indexing, and constraint patterns.
| Rule | File | Key Pattern |
|---|---|---|
| Normalization | rules/schema-normalization.md | 1NF-3NF, when to denormalize, JSON vs normalized |
| Indexing | rules/schema-indexing.md | B-tree, GIN, HNSW, partial/covering indexes |
| NoSQL Patterns | rules/schema-nosql.md | Embed vs reference, document design, sharding |
Database version control and change management across environments.
| Rule | File | Key Pattern |
|---|---|---|
| Changelog | rules/versioning-changelog.md | Schema version table, semantic versioning, audit trails |
| Drift Detection | rules/versioning-drift.md | Environment sync, checksum verification, migration locks |
Rollback testing lives in references/migration-testing.md;
the docstring convention for lossy downgrades is in
references/ork-delta.md.
Decision frameworks for choosing the right database. Default: PostgreSQL.
| Rule | File | Key Pattern |
|---|---|---|
| Selection Guide | rules/db-selection.md | PostgreSQL-first, tier-based matrix, anti-patterns |
| Decision | Recommendation | Rationale |
|---|---|---|
| Async dialect | postgresql+asyncpg | Native async support for SQLAlchemy 2.0 |
| NOT NULL column | Two-phase: nullable first, then alter | Avoids locking, backward compatible |
| Large table index | CREATE INDEX CONCURRENTLY | Zero-downtime, no table locks |
| Normalization target | 3NF for OLTP | Reduces redundancy while maintaining query performance |
| Primary key strategy | UUID for distributed, INT for single-DB | Context-appropriate key generation |
| Soft deletes | deleted_at timestamp column | Preserves audit trail, enables recovery |
| Migration granularity | One logical change per file | Easier rollback and debugging |
| Production deployment | Generate SQL, review, then apply | Never auto-run in production |
# NEVER: Add NOT NULL without default or two-phase approach
op.add_column('users', sa.Column('org_id', UUID, nullable=False)) # LOCKS TABLE!
# NEVER: Use blocking index creation on large tables
op.create_index('idx_large', 'big_table', ['col']) # Use CONCURRENTLY
# NEVER: Skip downgrade implementation
def downgrade():
pass # WRONG - implement proper rollback
# NEVER: Modify migration after deployment - create new migration instead
# NEVER: Run migrations automatically in production
# Use: alembic upgrade head --sql > review.sql
# NEVER: Run CONCURRENTLY inside transaction
op.execute("BEGIN; CREATE INDEX CONCURRENTLY ...; COMMIT;") # FAILS
# NEVER: Delete migration history
command.stamp(alembic_config, "head") # Loses history
# NEVER: Skip environments (Always: local -> CI -> staging -> production)| Resource | Description |
|---|---|
references/ork-delta.md | Our corrections and house conventions. Read this first |
references/migration-testing.md | Upgrade/downgrade cycle and data-integrity test harnesses |
references/postgres-vs-mongodb.md | Head-to-head comparison behind the PostgreSQL-first default |
references/db-migration-paths.md | Cross-engine migration risk matrix |
references/cost-comparison.md | Managed database cost analysis |
references/storage-and-cms.md | Object storage and CMS selection |
scripts/ | Migration template, model change detector |
Safe database schema changes without downtime using expand-contract pattern and online schema changes.
| Rule | File | Key Pattern |
|---|---|---|
| Expand-Contract | rules/migration-zero-downtime.md | Expand phase, backfill, contract phase, pgroll automation |
| Rollback & Monitoring | rules/migration-rollback.md | pgroll rollback, lock monitoring, replication lag, backfill progress |
sqlalchemy-2-async - Async SQLAlchemy session patternsork:testing-integration - Integration testing patterns including migration testingcaching - Cache layer design to complement database performanceork:performance - Performance optimization patterns© yonatangross, 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 24 other files (scripts, references) in src/skills/database-patterns of yonatangross/orchestkit.
Open the folder on GitHubat commit 0ef71d2
Database Patterns 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 |
|---|---|---|---|---|---|---|
| Database Patterns this skillyonatangross/orchestkit | 289 | — | ~2.5k | Automated safety check: Pass | MIT | |
| Database MigrationDokhacgiakhoa/Agent-Skills-4-Vibe-Coding-CLI | 507 | — | ~227 | Automated safety check: Pass | Custom licence | |
| DatabasesMicrock/ordinary-claude-skills | 403 | — | ~1.9k | Automated safety check: Notes | MIT | |
| DB Migrationskurealnum/dotfiles | 290 | — | ~820 | Automated safety check: Pass | None | |
| Migrationkortix-ai/suna | 20k | — | ~1.2k | Automated safety check: Pass | Custom licence | |
| Database Designeralirezarezvani/claude-skills | 28k | — | ~3.2k | Automated safety check: Pass | MIT |
Dokhacgiakhoa/Agent-Skills-4-Vibe-Coding-CLI
MASTER DB: Zero-Downtime, Schema Design (3NF), SQL/NoSQL. An agent skill from Dokhacgiakhoa/Agent-Skills-4-Vibe-Coding-CLI.
Microck/ordinary-claude-skills
Work with MongoDB (document database, BSON documents, aggregation pipelines, Atlas cloud) and PostgreSQL (relational database, SQL queries, psql CLI, pgAdmin).
kurealnum/dotfiles
A skill your agent uses when generating or regenerating Drizzle migration files, changing database schema tables or columns, resolving migration sequence conflicts after rebase, reviewing migration…
kortix-ai/suna
How to change the database schema in this repo. An agent skill from kortix-ai/suna.
alirezarezvani/claude-skills
A skill your agent uses when the user asks to design database schemas, plan data migrations, optimize queries, choose between SQL and NoSQL, or model data relationships.
PrepLabsAI/InterviewMentor
A Principal Database Engineer interviewer. An agent skill from PrepLabsAI/InterviewMentor.
yonatangross/orchestkit
API contract design for REST and GraphQL, covering resource shape, URL and header versioning with deprecation windows, RFC 9457 Problem Details error handling, and OpenAPI specs.
yonatangross/orchestkit
ADR templates in the Nygard format with context, decision, consequences, and alternatives.
yonatangross/orchestkit
Single-pass codebase analysis leveraging a 1M-token context window for comprehensive security scanning, architecture review, and dependency auditing.
yonatangross/orchestkit
Structured review processes, conventional comments, language-specific checklists, and feedback templates.
yonatangross/orchestkit
Creates GitHub pull requests with pre-flight validation, conventional title formatting, and structured summary generation.
yonatangross/orchestkit
Multi-angle codebase exploration spawning 3-5 parallel agents for code structure, data flow, architecture patterns, and health assessment.
Works with
Categories
Database design and migration patterns for Alembic migrations, schema design (SQL/NoSQL), and database versioning. Database Patterns is an agent skill from yonatangross/orchestkit. Database design and migration patterns for Alembic migrations, schema design (SQL/NoSQL), and database versioning.
Database Patterns fits situations like: creating migrations; designing schemas; normalizing data; managing database versions.
Run `npx skills add yonatangross/orchestkit --skill database-patterns -a claude-code`. Or copy the skill folder (src/skills/database-patterns in yonatangross/orchestkit) into .claude/skills/database-patterns in your project. Claude Code loads it when a task matches its description.
Run `npx skills add yonatangross/orchestkit --skill database-patterns -a codex`. Or copy the skill folder (src/skills/database-patterns in yonatangross/orchestkit) into .agents/skills/database-patterns 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 yonatangross/orchestkit --skill database-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/database-patterns, .gemini/skills/database-patterns, .github/skills/database-patterns and .opencode/skills/database-patterns in your project.
SKILL.md names no scripts, command-line tools or credentials: Database Patterns is instructions for the agent only. Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Glob, Grep, WebFetch, WebSearch. Compatibility (from SKILL.md): Claude Code 2.1.277+..
SKILL.md names 3 domains. As links in the text: postgresql.org, alembic.sqlalchemy.org and github.com. 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.
Database Patterns is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.5k tokens (SKILL.md is roughly 10k 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 5.1k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Database Patterns: Database Migration (Dokhacgiakhoa/Agent-Skills-4-Vibe-Coding-CLI, 507 stars), Databases (Microck/ordinary-claude-skills, 403 stars), DB Migrations (kurealnum/dotfiles, 290 stars) and Migration (kortix-ai/suna, 20k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
yonatangross (a GitHub user) maintains it in yonatangross/orchestkit, which has 289 GitHub stars. The repository holds 108 skills in this directory. The repository was last updated on October 7, 2026.
Source: yonatangross/orchestkit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.