Communitygithub.com

ComeOnOliver/skillshub

Creates database migration files following project conventions for Prisma, Sequelize, Alembic, Knex, TypeORM, and other ORMs. Use when adding tables, modifying schemas, or when user mentions database changes.

skillshub란 무엇인가요?

skillshub is a Claude Code agent skill that creates database migration files following project conventions for Prisma, Sequelize, Alembic, Knex, TypeORM, and other ORMs. Use when adding tables, modifying schemas, or when user mentions database changes.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/aiskillstore/marketplace/crazydubya/database-migration-helper

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Database Migration Helper

This skill helps you create database migration files that follow your project's ORM conventions and naming patterns.

When to Use This Skill

  • User requests to create a database migration
  • Adding new tables or columns to the database
  • Modifying existing database schema
  • Creating indexes, constraints, or relationships
  • User mentions "migration", "schema change", or "database update"

Instructions

1. Detect the ORM/Migration Tool

First, identify which ORM or migration tool the project uses:

  • Prisma: Look for prisma/schema.prisma or @prisma/client in package.json
  • Sequelize: Look for .sequelizerc or sequelize-cli in package.json
  • Knex: Look for knexfile.js or knex in package.json
  • TypeORM: Look for ormconfig.json or typeorm in package.json
  • Alembic (Python): Look for alembic.ini or alembic/ directory
  • Django: Look for manage.py and Django migrations in */migrations/
  • Active Record (Rails): Look for db/migrate/ directory
  • Flyway: Look for flyway.conf or db/migration/
  • Liquibase: Look for liquibase.properties or changelog files

Use Glob to search for these indicator files.

2. Examine Existing Migrations

Read existing migration files to understand:

  • Naming conventions (timestamp format, description format)
  • Directory structure
  • Migration file format (SQL, JavaScript, TypeScript, Python, etc.)
  • Coding patterns (up/down functions, forwards/rollback, etc.)

Use Grep to find recent migrations: look in common directories like:

  • prisma/migrations/
  • db/migrate/
  • migrations/ or database/migrations/
  • alembic/versions/

3. Generate Migration File

Based on the detected ORM, create an appropriate migration file:

Prisma

  • Run npx prisma migrate dev --name <description> OR
  • Manually create migration SQL in prisma/migrations/<timestamp>_<name>/migration.sql

Sequelize

  • Generate: npx sequelize-cli migration:generate --name <description>
  • Then fill in the up/down functions with the schema changes

Knex

  • Generate: npx knex migrate:make <description>
  • Fill in exports.up and exports.down functions

TypeORM

  • Generate: npm run typeorm migration:create src/migrations/<Name>
  • Implement up() and down() methods

Alembic

  • Generate: alembic revision -m "<description>"
  • Fill in upgrade() and downgrade() functions

Django

  • Run: python manage.py makemigrations
  • Or manually create migration in <app>/migrations/

Rails

  • Generate: rails generate migration <ClassName>
  • Fill in the change method (or up/down for complex migrations)

4. Follow Naming Conventions

Use consistent, descriptive names:

  • Good: add_user_email_index, create_products_table, add_payment_status_to_orders
  • Bad: migration1, update, fix

Format based on project patterns:

  • Timestamp prefix: 20231215120000_add_email_to_users
  • Sequential: 001_create_users, 002_add_indexes

5. Include Both Up and Down/Rollback

Always provide both directions when supported:

  • Up/Upgrade/Forward: Apply the schema change
  • Down/Downgrade/Rollback: Revert the schema change

For ORMs that use reversible operations (Rails, some Sequelize), a single change method may be sufficient.

6. Migration Content Guidelines

Creating Tables:

  • Define all columns with appropriate types
  • Set NOT NULL constraints where appropriate
  • Add primary keys
  • Include timestamps (created_at, updated_at) if project uses them
  • Add foreign keys and indexes in the same migration or separate if project prefers

Altering Tables:

  • Be specific: ADD COLUMN, DROP COLUMN, MODIFY COLUMN
  • Handle existing data appropriately (defaults, backfills)
  • Consider backwards compatibility

Adding Indexes:

  • Name indexes clearly: idx_users_email, idx_orders_user_id_created_at
  • Use appropriate index types (B-tree, Hash, GIN, etc.)
  • Consider partial indexes for large tables

Data Migrations:

  • Separate schema migrations from data migrations if possible
  • Be cautious with large datasets (batch operations)
  • Test rollback with realistic data volumes

7. Validate Migration Safety

Before finalizing, check:

  • Reversibility: Can the migration be rolled back?
  • Data loss: Will any data be lost? Warn the user!
  • Downtime: Will this lock tables? Consider online migrations for large tables
  • Dependencies: Are there dependent migrations that must run first?

8. Testing Recommendations

Suggest to the user:

  • Run migration on a development database first
  • Test rollback functionality
  • For production: test on a staging environment
  • Review generated SQL (for ORMs that auto-generate)

ORM-Specific Templates

Reference the templates in templates/ directory:

  • prisma-migration.sql - Prisma migration example
  • sequelize-migration.js - Sequelize migration example
  • knex-migration.js - Knex migration example
  • typeorm-migration.ts - TypeORM migration example
  • alembic-migration.py - Alembic migration example
  • rails-migration.rb - Rails migration example

Best Practices

  1. One purpose per migration: Don't mix unrelated changes
  2. Descriptive names: Names should explain what the migration does
  3. Timestamps: Use the ORM's timestamp format for ordering
  4. Idempotent when possible: Safe to run multiple times
  5. Test rollbacks: Ensure down/rollback works correctly
  6. Document complex logic: Add comments for non-obvious operations
  7. Batch large operations: For data migrations affecting many rows
  8. Use transactions: Wrap operations in transactions when supported

Supporting Files

  • templates/: Migration templates for various ORMs
  • reference.md: Naming conventions and migration patterns

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Next.js 16+ uses App Router with Server Components by default. Client Components are only used when interactivity is needed (hooks, event handlers, browser APIs).

ComeOnOliver/skillshub

All TypeScript types are defined in `frontend/types/index.ts`. Types match backend API response structure and provide type safety across the frontend application.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

관련 스킬