create-migration
Skill1 starsChanged 27 days agoMITView on GitHub
Generate a Supabase PostgreSQL database migration with proper schema, RLS policies, indexes, triggers, and grants. Follows DaaS naming conventions and includes standard audit columns. Use when the user needs a database migration, table creation, schema change, or wants to add columns to a collection. Supabase projects only — on an Engine project it writes no file, stops, and names the skills that change structure and access there.
- Reads credentials
11 other projects use a version of this.
Adopted by
Most recently taken up by
- anotherben/claude-harnesstheir own version, first seen Nov 8, 2026
- tale-project/taletheir own version, first seen Nov 1, 2026
- GoogleCloudPlatform/database-migration-agentstheir own version, first seen Nov 1, 2026
- GoogleCloudPlatform/database-migrationtheir own version, first seen Nov 1, 2026
- drferdi/Monorepo-safrstheir own version, first seen Oct 20, 2026
- owid/owid-graphertheir own version, first seen Oct 8, 2026
Other versions11 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 11
- OpenCTI-Platform/opencti★ 10ksame name
- fullstackhero/dotnet-starter-kit★ 6.9ksame name
- Notifuse/notifuse★ 2.3ksame name
- c9s/bbgo★ 1.7ksame name
- owid/owid-grapher★ 1.6ksame name
- tale-project/tale★ 42same name
- drferdi/Monorepo-safrs★ 9same name
- anotherben/claude-harness★ 7same name
- GoogleCloudPlatform/database-migration-agents★ 3same name
- GoogleCloudPlatform/database-migration★ 2same name
1 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository66 other files it gives its agents.
- add-ai-chatSkill
- add-buildpadSkill
- add-commentsSkill
- add-cronSkill
- add-external-oauthSkill
- add-filesSkill
- add-i18nSkill
- add-mcp-serverSkill
- add-microappSkill
- add-microfrontendSkill
- add-microfrontend-zonesSkill
- add-mobile-appSkill
- add-multitenancySkill
- add-usersSkill
- add-workflowsSkill
- amplify-env-varsSkill
- authentication-proxySkill
- buildpad-debugSkill
- buildpad-discoverySkill
- buildpad-implSkill
- buildpad-referenceSkill
- buildpad-reviewSkill
- buildpad-spec-batchSkill
- buildpad-spec-designSkill
- buildpad-spec-initSkill
- buildpad-spec-quickSkill
- buildpad-spec-requirementsSkill
- buildpad-spec-statusSkill
- buildpad-spec-tasksSkill
- buildpad-steering-customSkill
- buildpad-steeringSkill
- buildpad-validate-designSkill
- buildpad-validate-gapSkill
- buildpad-validate-implSkill
- buildpad-verify-completionSkill
- code-simplificationSkill
- context-engineeringSkill
- create-api-routeSkill
- create-collectionSkill
- create-componentSkill
- create-cronSkill
- create-featureSkill
- create-form-builderSkill
- create-projectSkill
- create-rbacSkill
- create-serviceSkill
- create-testsSkill
- create-workflowSkill
- daas-platformSkill
- debugging-and-error-recoverySkill
- generate-docsSkill
- git-workflow-and-versioningSkill
- grant-module-accessSkill
- hooks-extensionsSkill
- idea-refineSkill
- incremental-implementationSkill
- manage-scopeSkill
- migrate-to-engineSkill
- performance-optimizationSkill
- planning-and-task-breakdownSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Read .buildpad/project.json at the project root.
- Very specific: line 19
If a folder named supabase at the project root holds a file named config.toml, or holds a folder named migrations that holds a file whose …
“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Create Database Migration
<!-- backend-gate:begin v1 -->Establish the backend first. A Buildpad project's backend is either the Buildpad Engine or Supabase, and some parts of this file hold for one of them only. Before you act on anything in this file, find the backend with these steps, in order, and stop at the first step that answers:
- Read
.buildpad/project.jsonat the project root. If it is JSON and its fieldbackendis"engine"or"supabase", that is the backend. If.buildpad/backend-answer.jsonnames the other backend, tell the developer the two files disagree, and follow.buildpad/project.json. - Otherwise read
.buildpad/backend-answer.jsonin the same way; if itsbackendis"engine"or"supabase", that is the backend. - If a folder named
supabaseat the project root holds a file namedconfig.toml, or holds a folder namedmigrationsthat holds a file whose name ends in.sql, the backend is Supabase. - Otherwise ask the developer once: "Is this project's backend the Buildpad Engine or
Supabase?" Write the answer to
.buildpad/backend-answer.jsonas{"buildpadBackendAnswer": 1, "backend": "engine"}or{"buildpadBackendAnswer": 1, "backend": "supabase"}, and ask the developer to commit that file. Do not add it to.gitignore. Never write.buildpad/project.json.
To find the backend, do not open an environment file (.env, .env.*) or an MCP configuration
file, and do not call a tool that returns project credentials.
Then follow only the parts for that backend. A part starts at a line that holds only a comment
whose text is buildpad + -backend: engine or buildpad + -backend: supabase, and ends at the
next line that holds only a comment whose text is /buildpad + -backend. A comment that merely
mentions a backend is not a part. A file whose first line, after any front matter, holds only a
comment whose text is buildpad + -backend-file: engine (or supabase) holds for that backend
only, and so does every file in a folder named engine-only or supabase-only. Skip the other
backend's parts and copy no code from them; everything else holds for both. On an Engine project, when this file says that
something is not available, tell the developer so and stop: do not build a substitute.
<!-- backend-gate:end --><!-- buildpad-backend: engine -->On an Engine project: there are no migrations
An Engine project has no database migrations, and nothing reads a migration file there. Write no file. Tell the developer that structure and access are changed through the Engine, and stop here:
- a table, a column, a relation or an index: the
create-collectionskill; - who may read or change it: the
create-rbacskill, andrelational-permissionsfor nested writes; - a workflow column: the
create-workflowskill; multi-level data separation:manage-scope.
<!-- /buildpad-backend --><!-- buildpad-backend: supabase -->Generate a Supabase PostgreSQL migration with proper schema, RLS policies, and indexes.
Migration File Location
supabase/migrations/[YYYYMMDDHHMMSS]_[description].sqlNaming Conventions
- Tables:
snake_case, plural (user_profiles,blog_posts) - Columns:
snake_case(date_created,user_id) - Primary keys:
id(UUID) - Foreign keys:
[referenced_table]_id(category_id) - Junction tables:
[table1]_[table2](products_tags)
Standard Columns
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
date_created timestamptz DEFAULT now(),
date_updated timestamptz,
user_created uuid REFERENCES auth.users(id),
user_updated uuid REFERENCES auth.users(id)Migration Sections (Required)
- Header Comment — description, author, date
- CREATE TABLE — with data types and constraints
- Enable RLS —
ALTER TABLE ... ENABLE ROW LEVEL SECURITY - RLS Policies — SELECT, INSERT, UPDATE, DELETE
- Indexes — FK columns, filtered columns, sorted columns
- Triggers —
date_updatedauto-update, audit logging - GRANT — permissions for
authenticatedandanonroles
Data Types
| Use Case | PostgreSQL Type |
| ID | uuid |
| Short text | text or varchar(n) |
| Long text | text |
| Integer | integer or bigint |
| Decimal | numeric(precision, scale) |
| Boolean | boolean |
| Timestamp | timestamptz |
| JSON | jsonb |
| Array | text[], uuid[] |
| Enum | text with CHECK |
Relationships
One-to-Many
category_id uuid REFERENCES public.categories(id) ON DELETE SET NULLMany-to-Many (junction table)
CREATE TABLE public.products_tags (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
products_id uuid NOT NULL REFERENCES public.products(id) ON DELETE CASCADE,
tags_id uuid NOT NULL REFERENCES public.tags(id) ON DELETE CASCADE,
UNIQUE(products_id, tags_id)
);RLS Policy Patterns
-- Owner can CRUD their own
CREATE POLICY "users_own_data" ON public.[table]
FOR ALL USING (auth.uid() = user_created);
-- Published items are public
CREATE POLICY "published_public" ON public.[table]
FOR SELECT USING (status = 'published' OR auth.uid() = user_created);Commands
supabase migration new [description]
supabase db push
supabase db resetReferences
- Special fields
<!-- /buildpad-backend -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

