Agent skill

Planetscale

by ericrisco in ericrisco/rsc-harness

A skill your agent uses when operating PlanetScale (Vitess serverless MySQL) — branches and the pscale CLI, schema changes through deploy requests (Online DDL cutover, ~30-min revert window), tables…

MITAuto-check passedDatabases

Install Planetscale

skills CLI
$ npx skills add ericrisco/rsc-harness --skill planetscale -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ericrisco/rsc-harness planetscale --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ericrisco/rsc-harness.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/planetscale .claude/skills/planetscale && rm -rf skills-src

Use ~/.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/

Facts

Skill name
planetscale
GitHub stars
156
Token cost
~2.8k tokens
SKILL.md length
999 words
Files
6 (incl. scripts, references)
Skills in repo
229
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when operating PlanetScale (Vitess serverless MySQL) — branches and the pscale CLI, schema changes through deploy requests (Online DDL cutover, ~30-min revert window), tables…

  • Operating PlanetScale (Vitess serverless MySQL) — branches and the pscale CLI
  • SKILL.md covers Mental model, The deploy-request workflow, Design without foreign keys and Connecting, plus 2 more sections
  • Runs Shell scripts from its folder; calls brew; needs PLANETSCALE_SERVICE_TOKEN
  • Schema changes through deploy requests (Online DDL cutover

What it does

Planetscale is an agent skill from ericrisco/rsc-harness. Use when operating PlanetScale (Vitess serverless MySQL) — branches and the pscale CLI, schema changes through deploy requests (Online DDL cutover, ~30-min revert window), tables without foreign keys, or the edge HTTP driver. NOT MySQL engine work like EXPLAIN or index choice (that is mysql), NOT generic migration theory (that is db-migrations).

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including scripts and reference files (for example `evals/README.md`, `evals/cases.yaml` and `references/deploy-requests.md`).

It sits in Databases, covering Serverless, Database migrations and ORMs and data access. It works with PlanetScale, MySQL and PostgreSQL. The repository describes itself as: Your agent invents things because it has no memory, and can't touch your database because it has no arms. rsc is the meta-harness that gives it both, plus the trade to know the… The licence is MIT.

When your agent uses it

  • Operating PlanetScale (Vitess serverless MySQL) — branches and the pscale CLI
  • Schema changes through deploy requests (Online DDL cutover
  • ~30-min revert window)
  • Tables without foreign keys

Example prompts

  • “/planetscale”

Requirements

  • A Bash shell
  • A credential in PLANETSCALE_SERVICE_TOKEN

What it can do on your machine

Read from SKILL.md and the folder at commit 92fde8f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • brew

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • PLANETSCALE_SERVICE_TOKEN

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Planetscale loads about 2.8k tokens when it runs, and up to ~4.8k if it reads all its reference files. Until then it costs about 91 tokens; SKILL.md has 999 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~91
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.8k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from ericrisco/rsc-harness at commit 92fde8f, republished under its MIT licence (© ericrisco). 999 words, ~2,814 tokens.

Download SKILL.mdSave it as .claude/skills/planetscale/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
planetscale
description
Use when operating PlanetScale (Vitess serverless MySQL) — branches and the `pscale` CLI, schema changes through deploy requests (Online DDL cutover, ~30-min revert window), tables without foreign keys, or the edge HTTP driver. NOT MySQL engine work like EXPLAIN or index choice (that is `mysql`), NOT generic migration theory (that is `db-migrations`).
tags
planetscale, vitess, mysql, deploy-requests, serverless-db
recommends
mysql, db-migrations, prisma-orm, drizzle-orm, github-actions, postgresdb
origin
risco

PlanetScale — Vitess serverless MySQL: branches, deploy requests, no FKs

PlanetScale is serverless, MySQL-compatible database-as-a-service built on Vitess — the same horizontal-scaling layer that runs YouTube. You do not ALTER TABLE against production. Schema changes live on an isolated branch (a full copy of the schema), reach production through a deploy request (a pull request for your schema), and apply via Online DDL: Vitess builds a shadow table holding the new schema, replicates rows and in-flight writes old→new with VReplication, then cuts over with no table lock. Because Online DDL and sharding are the platform's center of gravity, you design without foreign keys (FKs are now an opt-in but unsharded-only feature). This skill owns that workflow — not MySQL the engine.

Heuristic for the boundary: would this answer be identical on RDS MySQL? Then it is not this skill.

When the question is really aboutRoute to
A slow query, an EXPLAIN plan, an index decision, JSON columns, locking../mysql/SKILL.md for MySQL-engine work; ../postgresdb/SKILL.md when you want the transferable engine reasoning
PostgreSQL engine/design — even PlanetScale's own managed Postgres SQL semantics../postgresdb/SKILL.md. PlanetScale sells Postgres too; this skill is strictly the Vitess/MySQL branch+deploy-request flow
Engine-agnostic migration theory (expand-contract, backfill ordering)../db-migrations/SKILL.md. Here you get the concrete PlanetScale realization, not the theory
Postgres copy-on-write branches../neon/SKILL.md. Postgres BaaS → ../supabase/SKILL.md
ORM client ergonomics (Prisma updateMany, Drizzle query builder)../prisma-orm/SKILL.md / ../drizzle-orm/SKILL.md. This skill owns only the PlanetScale-specific knobs those ORMs expose (relationMode, serverless driver adapter)

Mental model

PlanetScale conceptGit analogueWhat it actually is
BranchbranchA full, isolated copy of the schema. main is your production branch.
Deploy requestpull requestThe gate that carries schema from a dev branch to production.
Schema diffthe PR diffThe exact DDL the deploy will run, computed by PlanetScale.
Online DDL(no git analogue)Shadow table + VReplication + non-blocking cutover. No ALTER lock.
Schema revertrevert commitA ~30-minute window after deploy to undo while preserving post-deploy writes.

The revert window is the one thing people get wrong: it is not forever, and it has carve-outs (dropped tables/columns and FK-constraint changes are not cleanly revertible). After ~30 minutes the deploy is permanent. Plan rollbacks as new forward deploys, not as "I'll just revert later."

The deploy-request workflow

Production branches should have safe migrations enabled — that is what forces every schema change through a deploy request instead of letting a raw ALTER hit main. Production branches are protected by default. The full lifecycle (numbered steps, real pscale commands):

bash
# 0. Install + authenticate (once)
brew install planetscale/tap/pscale   # or scoop / apt — see pscale docs
pscale auth login

# 1. Create the database (region close to your app)
pscale database create my_app --region us-east

# 2. Create a dev branch off production to hold the change
pscale branch create my_app add-orders-table

# 3. Apply your DDL on the BRANCH, never on main.
#    Open a MySQL shell scoped to the branch and run your CREATE/ALTER:
pscale shell my_app add-orders-table
#    mysql> CREATE TABLE orders (id BIGINT PRIMARY KEY AUTO_INCREMENT, ...);
#    mysql> ALTER TABLE users ADD COLUMN last_seen_at TIMESTAMP NULL;

# 4. Open a deploy request from the branch back to production.
#    --disable-auto-apply gates the cutover behind a manual apply (recommended for risky drops).
pscale deploy-request create my_app add-orders-table --disable-auto-apply

# 5. Inspect the exact schema diff the deploy will run. ALWAYS read this.
pscale deploy-request diff my_app 42

# 6. Review / approve (the schema-PR review step)
pscale deploy-request review my_app 42 --approve

# 7. Deploy. PlanetScale runs Online DDL: shadow table -> VReplication -> cutover.
pscale deploy-request deploy my_app 42

# 8. If you disabled auto-apply, the change waits gated until you apply the cutover:
pscale deploy-request apply my_app 42

# 9. Verify on production. If wrong, REVERT within the ~30-minute window:
pscale deploy-request revert my_app 42

Auto-apply is ON by default. With it on, step 7 deploys and cuts over in one motion. For anything destructive — dropping a column/table, narrowing a type — pass --disable-auto-apply at step 4 so the cutover sits gated (step 8) until a human applies it. That gap is your last cheap exit before the revert window starts ticking.

For queued/gated deploys that won't move, lint errors that block a deploy, declarative vs imperative schema, and the exact revert carve-outs, see deploy-requests.

Design without foreign keys

Vitess's first-class features are Online DDL and horizontal sharding. Native foreign keys fight both: a cross-shard FK is meaningless once a table is sharded, and FK constraint checks degrade high-concurrency writes. PlanetScale historically disallowed FKs entirely; they are now an opt-in but unsharded-only feature. The scale-safe default is app-level referential integrity with emulated relations, not database-enforced FKs.

sql
-- Bad on PlanetScale at scale: a DB-enforced FK with ON DELETE CASCADE.
-- Blocks sharding, conflicts with Online DDL, and the cascade is a hidden write amplifier.
CREATE TABLE orders (
  id        BIGINT PRIMARY KEY AUTO_INCREMENT,
  user_id   BIGINT NOT NULL,
  CONSTRAINT fk_user FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);

-- Good: no DB FK. Index the relation column, enforce integrity in the app/ORM,
-- and do cascades explicitly in a transaction or background job.
CREATE TABLE orders (
  id        BIGINT PRIMARY KEY AUTO_INCREMENT,
  user_id   BIGINT NOT NULL,
  KEY idx_orders_user_id (user_id)   -- the relation still needs its index
);

With Prisma, declare relationMode = "prisma" so the client emulates relations and adds the implicit indexes instead of emitting DB-level FKs:

prisma
datasource db {
  provider     = "mysql"
  url          = env("DATABASE_URL")
  relationMode = "prisma"
}

With Drizzle, model the relation in app code (relations()), index the join column, and skip the references()-backed FK constraint at the DB layer.

Will this table shard?FK strategyNotes
Yes, or unsureNo DB FK — emulate in app/ORMDefault. Index the relation column; cascade in code.
Never (small, bounded, unsharded)Unsharded FK opt-in is acceptableAccept Online DDL friction; document why it won't shard.

See no-foreign-keys for emulated cascades, ORM specifics, and the opt-in caveats.

Show full SKILL.md (354 more words)Show less

Connecting

Two connection paths. Pick by runtime, not by preference.

ts
// Direct MySQL string — for Node/long-lived servers that can open a TCP socket.
// DATABASE_URL=mysql://user:pass@host/db?ssl-mode=require   (TLS required)

// Serverless HTTP driver — for edge/serverless where raw TCP MySQL is blocked.
import { connect } from "@planetscale/database";

const conn = connect({ url: process.env.DATABASE_URL });
const result = await conn.execute("SELECT id FROM users WHERE email = ?", [email]);

@planetscale/database is Fetch-API compatible: it speaks HTTP, so it works where you cannot open a MySQL socket — Cloudflare Workers, Vercel Edge, Lambda. The spelling is exactly @planetscale/database; there is no other official package name. Drizzle ships a matching adapter, drizzle-orm/planetscale-serverless, that wraps this driver — see ../drizzle-orm/SKILL.md for the query-builder side.

RuntimeConnection pathWhy
Node server, long-lived processDirect mysql://…?ssl-mode=requireTCP socket available; pool it.
Vercel Edge / Cloudflare Workers@planetscale/database (HTTP)No raw TCP; the Fetch-based driver works.
AWS Lambda / short-lived serverless@planetscale/database (HTTP)Avoids per-invocation connection churn.
Drizzle on edgedrizzle-orm/planetscale-serverlessWraps the HTTP driver; same constraints.

CI/CD

Wire the deploy-request flow into CI so schema changes are reviewed like code. A GitHub Actions job installs pscale, authenticates with a service token (PLANETSCALE_SERVICE_TOKEN / PLANETSCALE_SERVICE_TOKEN_ID as secrets), then drives the same verbs you run locally:

yaml
# .github/workflows/schema.yml — open + diff a deploy request on PR
- run: |
    pscale deploy-request create "$DB" "${{ github.head_ref }}" --disable-auto-apply
    pscale deploy-request diff   "$DB" "$DR_NUMBER"   # surface the schema diff in the PR

For a branch-per-PR preview database, create a PlanetScale branch named after the PR head, run the app's migrations against it, and tear the branch down when the PR closes. The orchestration (matrix, secrets, cleanup-on-close) is generic CI — defer the Actions plumbing to ../github-actions/SKILL.md and keep the PlanetScale verbs here.

Anti-patterns

Anti-patternWhy it bitesDo instead
ALTER TABLE on the main production branchSkips the gate; no diff, no review, no revert windowBranch → DDL → deploy request → diff → deploy
Relying on DB-enforced foreign keys at scaleBlocks sharding, fights Online DDL, degrades high-concurrency writesApp/ORM-level integrity; relationMode="prisma"; index the relation column
Leaving auto-apply ON for a destructive changeDeploy + cutover happen in one motion; no gated last-look before the drop--disable-auto-apply, inspect, then deploy-request apply
Opening a direct mysql:// connection from Vercel Edge / WorkersRaw TCP MySQL is blocked on edge runtimes → connection timeoutsUse @planetscale/database HTTP driver
Treating revert as available foreverThe window is ~30 min and excludes dropped tables/cols and FK changesPlan rollbacks as new forward deploys
Deploying without reading deploy-request diffYou ship DDL you never saw; surprise table rewritesAlways run the diff before deploy
Inventing a driver name (@planetscale/serverless, planetscale-js)There is no such package; install failsThe package is exactly @planetscale/database

© ericrisco, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (scripts, references) in skills/planetscale of ericrisco/rsc-harness.

  • SKILL.md
  • evals/README.md
  • evals/cases.yaml
  • references/deploy-requests.md
  • references/no-foreign-keys.md
  • scripts/verify.sh

Open the folder on GitHubat commit 92fde8f

Compare with similar skills

Planetscale 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.

Planetscale compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Planetscale this skillericrisco/rsc-harness156—~2.8kAutomated safety check: PassMIT
Dsqlawslabs/agent-plugins912—~6.9kAutomated safety check: PassApache-2.0
Database Migrationsaffaan-m/ECC274k3 repos~1.9kAutomated safety check: PassMIT
Database Migrationsaffaan-m/ECC274k1 repos~2.4kAutomated safety check: PassMIT
Safe Database Migration Patternsaffaan-m/ECC274k—~3.3kAutomated safety check: PassMIT
Database Migrationsaffaan-m/ECC274k—~335Automated safety check: PassMIT

Similar skills

  • Dsql

    awslabs/agent-plugins

    Official

    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…

    912 GitHub stars~6.9k tokensUpdated yesterday
    DatabasesAuto-check passed
  • 数据库迁移最佳实践,涵盖模式变更、数据迁移、回滚以及零停机部署,适用于PostgreSQL、MySQL及常用ORM(Prisma、Drizzle、Django、TypeORM、golang-migrate)。

    274k GitHub starsUsed in 3 repos~1.9k tokens
    DatabasesAuto-check passed
  • Şema değişiklikleri, veri migration'ları, rollback'ler ve PostgreSQL, MySQL ve yaygın ORM'ler (Prisma, Drizzle, Django, TypeORM, golang-migrate) arasında sıfır kesinti deployment'ları için…

    274k GitHub starsUsed in 1 repo~2.4k tokens
    DatabasesAuto-check passed
  • Rules and examples for safe, reversible schema changes in production: zero-downtime column and index changes, large data backfills and ORM migration workflows.

    274k GitHub stars~3.3k tokensUpdated 2 days ago
    DatabasesAuto-check passed
  • PostgreSQL、MySQL、一般的なORM(Prisma、Drizzle、Kysely、Django、TypeORM、golang-migrate)全体のスキーマ変更、データマイグレーション、ロールバック、ゼロダウンタイムデプロイメントのためのデータベースマイグレーションベストプラクティス。

    274k GitHub stars~335 tokensUpdated 2 days ago
    DatabasesAuto-check passed
  • Database Migrations

    xu-xiang/everything-claude-code-zh

    跨 PostgreSQL、MySQL 及常用 ORM(Prisma、Drizzle、Django、TypeORM、golang-migrate)的模式变更(schema changes)、数据迁移、回滚及零停机部署(zero-downtime deployments)的数据库迁移最佳实践。

    2k GitHub stars~1.7k tokensUpdated 7 mo ago
    DatabasesAuto-check passed

More from ericrisco/rsc-harness

All 229 skills in this repo
  • Ab Testing

    ericrisco/rsc-harness

    A skill your agent uses when designing or analyzing a controlled experiment — falsifiable hypothesis, sample size from an MDE, reading significance/CI/power, CUPED, or rescuing tests that won't go…

    156 GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Accessibility

    ericrisco/rsc-harness

    A skill your agent uses when making a web UI conform to WCAG 2.2 Level AA — axe-core or Lighthouse a11y violations, keyboard operability, focus management, ARIA roles/names/live regions, contrast…

    156 GitHub stars~3.4k tokensUpdated today
    Auto-check passed
  • Ads

    ericrisco/rsc-harness

    A skill your agent uses when running or fixing paid acquisition on Google or Meta — campaign structure (Performance Max, Demand Gen, Search, Advantage+), platform-fit creative, budget/scaling rules…

    156 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Agent Eval

    ericrisco/rsc-harness

    A skill your agent uses when measuring whether an LLM or agent system actually got better and gating merges on it: golden sets, fixing an inflated LLM-as-judge, scoring RAG (faithfulness, contextual…

    156 GitHub stars~3.2k tokensUpdated today
    Auto-check passed
  • AI Media

    ericrisco/rsc-harness

    A skill your agent uses when a creative goal must become a finished media file: pick and order generative-media models per modality — AI voiceover, image-to-video clips, score — then glue them with…

    156 GitHub stars~3.3k tokensUpdated today
    Auto-check passed
  • Analytics

    ericrisco/rsc-harness

    A skill your agent uses when instrumenting product or web analytics — GA4/PostHog SDK wiring, event taxonomy, funnels, double-counted events, consent gating, PII scrubbing.

    156 GitHub stars~2.8k tokensUpdated today
    Auto-check passed

Questions about Planetscale

What does Planetscale do?

A skill your agent uses when operating PlanetScale (Vitess serverless MySQL) — branches and the pscale CLI, schema changes through deploy requests (Online DDL cutover, ~30-min revert window), tables…. Planetscale is an agent skill from ericrisco/rsc-harness. Use when operating PlanetScale (Vitess serverless MySQL) — branches and the pscale CLI, schema changes through deploy requests (Online DDL cutover, ~30-min revert window), tables without foreign keys, or the edge HTTP driver.

When should I use Planetscale?

Planetscale fits situations like: operating PlanetScale (Vitess serverless MySQL) — branches and the pscale CLI; schema changes through deploy requests (Online DDL cutover; ~30-min revert window); tables without foreign keys.

How do I install Planetscale in Claude Code?

Run `npx skills add ericrisco/rsc-harness --skill planetscale -a claude-code`. Or copy the skill folder (skills/planetscale in ericrisco/rsc-harness) into .claude/skills/planetscale in your project. Claude Code loads it when a task matches its description.

How do I install Planetscale in Codex?

Run `npx skills add ericrisco/rsc-harness --skill planetscale -a codex`. Or copy the skill folder (skills/planetscale in ericrisco/rsc-harness) into .agents/skills/planetscale in your project. Codex loads it when a task matches its description.

Can I use Planetscale in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ericrisco/rsc-harness --skill planetscale -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/planetscale, .gemini/skills/planetscale, .github/skills/planetscale and .opencode/skills/planetscale in your project.

What does Planetscale need to run?

Going by SKILL.md and its folder, Planetscale needs a shell for the scripts in its folder, the command-line tools its instructions call (brew) and credentials named PLANETSCALE_SERVICE_TOKEN. Our summary lists: A Bash shell; A credential in PLANETSCALE_SERVICE_TOKEN.

Does Planetscale access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Planetscale safe to install?

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.

What licence does Planetscale use?

Planetscale is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Planetscale use?

About 2.8k tokens (SKILL.md is roughly 11k 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 2k tokens, read only when the agent opens those files.

What are the alternatives to Planetscale?

Skills that share tags, products or a category with Planetscale: Dsql (awslabs/agent-plugins, 912 stars), Database Migrations (affaan-m/ECC, 274k stars), Database Migrations (affaan-m/ECC, 274k stars) and Safe Database Migration Patterns (affaan-m/ECC, 274k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Planetscale?

ericrisco (a GitHub user) maintains it in ericrisco/rsc-harness, which has 156 GitHub stars. The repository holds 229 skills in this directory. The repository was last updated on October 6, 2026.

Source: ericrisco/rsc-harness on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.