migrating-supabase

migrating-supabase is a skill for Claude Code from careerchain-ys/stdd. It costs 173 tokens per session (2,935 once invoked), scanned A, original, Apache-2.0.

A guide for creating, running, and correcting Supabase database migrations. Supabase is a service that provides a hosted database; migrations are tracked SQL changes such as new tables, columns, permissions, and access policies.

In plain words
What is it for?
Creating tables and columns, changing database structure, writing row-level security policies, setting permissions, resetting local databases, and regenerating TypeScript types.
Why use it?
It provides project-specific rules for changing the database safely, including row-level security, permissions, naming, local testing, and fixing failed migrations.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Creating tables and columns, changing database structure, writing row-level security policies, setting permissions, resetting local databases, and regenerating TypeScript types.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/careerchain-ys/stdd/migrating-supabase
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add careerchain-ys/stdd --skill migrating-supabase
Clone the repo
git clone --depth 1 https://github.com/careerchain-ys/stdd

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 migrating-supabase

README.md
[![agentmods](https://agentmods.dev/badge/skills/careerchain-ys/stdd/migrating-supabase.svg)](https://agentmods.dev/skills/careerchain-ys/stdd/migrating-supabase)
Your own site
<a href="https://agentmods.dev/skills/careerchain-ys/stdd/migrating-supabase"><img src="https://agentmods.dev/badge/skills/careerchain-ys/stdd/migrating-supabase.svg" alt="Measured on agentmods" height="20"></a>
Per session 173 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,935 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.00173 $0.02935
Opus 5 $0.00086 $0.01468
Sonnet 5 $0.00035 $0.00587
Haiku 4.5 $0.00017 $0.00294

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

Security

Grade A, and why

migrating-supabase 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 7d 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.

plugins/nextjs-supabase/skills/migrating-supabase/SKILL.md · 296 lines

How it starts

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

Supabase Migration Skill

対象プロジェクトにおけるSupabaseマイグレーションの作成・実行・修正ガイド。

Quick Start

新テーブル作成

cd supabase
# ファイル名は必ず現在時刻の時分秒まで含める
touch supabase/migrations/$(date +%Y%m%d%H%M%S)_add_table_name.sql

テーブル作成テンプレートに従い、以下を必ず全て記述:

  1. CREATE TABLE
  2. インデックス作成(RLSで使うカラム)
  3. RLS有効化
  4. authenticatedユーザー用ポリシー
  5. service_role用ポリシー
  6. GRANT ALL TO service_role

既存テーブルの変更

touch supabase/migrations/$(date +%Y%m%d%H%M%S)_alter_table_name.sql

カラム追加・変更 セクション参照

ローカルでテスト

# 実際のコマンドは .stdd.config.yml に従う
<commands.db_reset>   # マイグレーション再実行(DBリセット)
<commands.db_types>   # 型定義を再生成(全 apps[] 分)

主要コマンド

実際のコマンドは .stdd.config.ymlcommands.* に従う。

用途 config キー
DBリセット(migration + seed再実行) commands.db_reset
TypeScript型定義生成(全 apps[] 分) commands.db_types

ローカル環境の起動・停止やフルセットアップ(起動 + 型生成)など、上記以外のプロジェクト固有コマンドは各プロジェクトの npm scripts 等を参照すること。

ファイル命名規則

時分秒まで含める(000000はファイル名衝突の原因になる):

20251225103045_add_user_preferences.sql   -- OK
20251225000000_add_user_preferences.sql   -- NG: 衝突する

プレフィックス:

  • add_: テーブル・カラム追加
  • update_: カラム変更・型変更
  • alter_: テーブル構造変更
  • create_: インデックス・関数作成
  • fix_: RLSポリシー修正・バグ修正
  • drop_: 削除操作

新テーブル作成チェックリスト

□ 1. CREATE TABLE(id, user_id, created_at, updated_at, deleted_at を検討)
□ 2. RLSで使うカラムにインデックス作成
□ 3. ENABLE ROW LEVEL SECURITY
□ 4. authenticatedユーザー用RLSポリシー作成
□ 5. service_role用RLSポリシー作成
□ 6. GRANT ALL ON ... TO service_role(忘れると403エラー)
□ 7. `commands.db_reset`(.stdd.config.yml)でエラーなし
□ 8. `commands.db_types`(.stdd.config.yml)で型が生成される

詳細は テーブル作成テンプレート を参照。

カラム追加・変更(ALTER TABLE)

プロジェクトで頻出する変更パターン:

カラム追加

-- NULL許容のカラム追加(既存データに影響なし)
ALTER TABLE public.table_name ADD COLUMN new_column TEXT;

-- NOT NULLカラムの追加(既存行にはデフォルト値が入る)
ALTER TABLE public.table_name ADD COLUMN new_column TEXT DEFAULT '' NOT NULL;

カラム名変更

ALTER TABLE public.table_name RENAME COLUMN old_name TO new_name;

Read the full file on GitHub · 296 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 7d ago First seen · 296 lines · 173 tokens per session scan A aaa7f01077e2

Subscribe to this mod's changes

migrating-supabase is a skill published in the GitHub repository careerchain-ys/stdd (2 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 173 tokens to every session and 2,935 once invoked, about $0.0009 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

alloydb-basics

Manages clusters, instances, and backups for AlloyDB for PostgreSQL, and integrates with AlloyDB Model Context Protocol (MCP) tools for automated database operations. Use when creating, configuring, or administering AlloyDB databases. Do NOT use for general PostgreSQL instances (e.g. Cloud SQL) or other GCP databases.

google/skills · 72 tokens

postgresql-table-design

Use this skill when designing or reviewing a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features.

wshobson/agents · 37 tokens

db-repair

Auto-fix gbrain's Postgres access so the brain stays available. When any gbrain command or MCP tool result carries a GBRAINDBACCESS marker (or an operator reports the brain database is down), run the hardcoded gbrain db-repair ladder: diagnose, apply the safe tier, verify. The action is ALWAYS the hardcoded command …

garrytan/gbrain · 96 tokens

dsql

Build with Aurora DSQL — manage schemas, execute queries, handle migrations, diagnose query plans, diagnose cluster performance, load data, and develop applications with a serverless, distributed SQL database. Covers IAM auth, multi-tenant patterns, MySQL-to-DSQL and PostgreSQL-to-DSQL schema conversion, foreign key…

awslabs/agent-plugins · 229 tokens

volcengine-rds-postgresql

A tool for operating PostgreSQL databases hosted by Volcano Engine's managed database service. PostgreSQL is a relational database used to store structured application data.

bytedance/agentkit-samples · 63 tokens

polar-local-environment

This skill should be used when setting up or managing Polar local development environment with Docker.

fcakyon/claude-codex-settings · 22 tokens