Automated summary
Walks through creating a Ghost database migration, from generating the empty migration file through schema.js updates, rollback testing and the required test suites.
Strengths
- Requires generating the file with `pnpm migrate:create` instead of hand-writing it, and flags the core/admin RC version bump.
- Covers the whole loop: migrate forward, test `down()` via rollback, then the integration test that also checks idempotency.
- Reminds you of easy-to-miss companion files (schema.js, the exporter's table-lists.js) and their focused tests.
- Explicitly demands the migration passes against both MySQL and SQLite.
Limitations
- Tightly coupled to the Ghost monorepo layout (ghost/core paths, knex-migrator, pnpm scripts); not reusable outside it.
- Defers code patterns and rules to docs/practices/database-migrations.md, rules.md and examples.md, which are not included here.
- Gives no guidance on backfill performance or safety on large tables.
Use it whenever a Ghost change alters the schema — new table, column, index, setting or data update — and a migration file under ghost/core is required.
Don't use it for non-Ghost projects, or for changes that don't touch the database schema, such as API or theme work.
Security analysis
SafeThis is a documentation/checklist skill for creating Ghost CMS database migrations. All commands are standard repo-local tooling (pnpm migrate:create, knex-migrator, tests) with no network exfiltration, destructive filesystem operations, obfuscated payloads, or safety-disabling instructions. No allowed-tools are declared and referenced files are relative in-repo docs.
No concerns found
How this analysis is madeExamples
Add a nullable `featured_at` datetime column to the Ghost posts table and update schema.js to match.Add a new `members_anniversary_enabled` setting to Ghost — it needs a database migration.Write a migration that backfills the `visibility` column on the posts table for existing rows, and test the rollback.name: Create database migration description: Create a database migration to add a table, add columns to an existing table, add a setting, or otherwise change the schema of Ghost's MySQL database. Use this skill whenever the task involves modifying Ghost's database schema — including adding, removing, or renaming columns or tables, adding new settings, creating indexes, updating data, or any change that requires a migration file in ghost/core. Also use when the user references schema.js, knex-migrator, the migrations directory, or asks to "add a field" or "add a column" to any Ghost model/table. Even if the user frames it as a feature or Linear issue, if the implementation requires a schema change, this skill applies.
Create Database Migration
Read the canonical human guidance in
docs/practices/database-migrations.md
before making a migration. This skill is the executable checklist that
accompanies it.
Instructions
- Create a new, empty migration file:
cd ghost/core && pnpm migrate:create <kebab-case-slug>. IMPORTANT: do not create the migration file manually; always use this script to create the initial empty migration file. The slug must be kebab-case (e.g.add-column-to-posts). - The above command will create a new directory in
ghost/core/core/server/data/migrations/versionsif needed, create the empty migration file with the appropriate name, and bump the core and admin package versions to RC if this is the first migration after a release. - Update the migration file with the changes you want to make in the database, following the existing patterns in the codebase. Where appropriate, prefer to use the utility functions in
ghost/core/core/server/data/migrations/utils/*. - Update the schema definition file in
ghost/core/core/server/data/schema/schema.js, and make sure it aligns with the latest changes from the migration. - Test the migration manually:
cd ghost/core && pnpm knex-migrator migrate --v {version directory} --force - Roll the migration back to test
down():cd ghost/core && pnpm knex-migrator rollback --v {previous version} --force, then migrate forward again. - Run the migration integration test, which covers initialization, rollback, forward migration, and idempotency:
cd ghost/core && pnpm test:single test/integration/migrations/migration.test.js. Migrations must pass the database-backed suites against both MySQL and SQLite. - If adding or dropping a table, update
ghost/core/core/server/data/exporter/table-lists.jsas appropriate. The consistency assertion inghost/core/test/unit/server/data/exporter/index.test.jschecks that every schema table is classified in the exporter lists. - Run the focused exporter unit test when the table lists change:
cd ghost/core && pnpm test:single test/unit/server/data/exporter/index.test.js. - Run the schema integrity test, and update the hash:
cd ghost/core && pnpm test:single test/unit/server/data/schema/integrity.test.js - Run unit tests in Ghost core, and iterate until they pass:
cd ghost/core && pnpm test:unit
Examples
See examples.md for example migrations.
Rules
See rules.md for rules that should always be followed when creating database migrations.
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/create-database-migration-mte1livc/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/create-database-migration-mte1livc' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/create-database-migration-mte1livc/download' --output '.skill-downloads/create-database-migration-mte1livc/SKILL.md.part' && mv '.skill-downloads/create-database-migration-mte1livc/SKILL.md.part' '.skill-downloads/create-database-migration-mte1livc/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
This file does not provide a usable name/description header for this native procedure. It remains available to download and inspect; use the manual method below.
Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/create-database-migration-mte1livc/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
React Hook Form Best Practices
Development
Master React Hook Form: avoid anti-patterns, manage subscriptions, and handle reset, dirty state, and controlled inputs correctly.
Emotion to Mantine Migration
Development
Migrate Emotion styled-components to Mantine components with style props and CSS modules. Use when converting .styled.tsx files or removing @emotion imports.
Scope Creep Detector
Development
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad PRs, and oversized changes, then suggests keep, split, or justify actions.