Agent skill

Prisma Migration

by openathleteorg in openathleteorg/openathlete

Change the OpenAthlete database schema safely with Prisma, covering the migration SQL, production safety, account deletion coverage and tests.

AGPL-3.0Auto-check passedDatabases

Install Prisma Migration

skills CLI
$ npx skills add openathleteorg/openathlete --skill prisma-migration -a claude-code

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

GitHub CLI
$ gh skill install openathleteorg/openathlete prisma-migration --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/openathleteorg/openathlete.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/prisma-migration .claude/skills/prisma-migration && 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
prisma-migration
GitHub stars
100
Token cost
~575 tokens
SKILL.md length
263 words
Files
1
Skills in repo
8
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Change the OpenAthlete database schema safely with Prisma, covering the migration SQL, production safety, account deletion coverage and tests.

  • Works in 6 steps: Edit the model. Map names to snake_case… → Create the migration without applying… → Read the generated SQL and make it safe… → …
  • A .prisma file in libs/database changes
  • SKILL.md covers Steps and Verify
  • Calls pnpm

What it does

Prisma Migration is an agent skill from openathleteorg/openathlete. Change the OpenAthlete database schema safely with Prisma, covering the migration SQL, production safety, account deletion coverage and tests. Use whenever a .prisma file in libs/database changes or a migration is needed.

Its SKILL.md is about 580 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Databases, covering ORMs and data access and Database schema design. It works with Prisma, SQL and Docker. The repository describes itself as: The open-source European alternative to TrainingPeaks. Self-hostable endurance training platform. Your data stays yours. The licence is AGPL-3.0.

When your agent uses it

  • A .prisma file in libs/database changes
  • A migration is needed

Example prompts

  • “/prisma-migration”

Requirements

  • Docker

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Edit the model. Map names to snake_case (@map, @@map), as the existing models do.
  2. Create the migration without applying it, against your dev database
  3. Read the generated SQL and make it safe for live data
  4. Apply and regenerate: pnpm database run db:migrate then pnpm database run db:generate.
  5. Account deletion: a new foreign key to user, athlete, event, event_activity or workout must be handled in…
  6. Update the Zod schemas in libs/shared if the API exposes the new fields.

What it can do on your machine

Read from SKILL.md and the folder at commit a3433f0. 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

    Shell commands in SKILL.md call:

    • pnpm

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

  • Network

    No URLs in SKILL.md. Its commands use pnpm, which can reach the network depending on how they are called.

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

  • Credentials

    Names no API keys, tokens, secrets or passwords.

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

Context cost

Prisma Migration loads about 575 tokens when it runs. Until then it costs about 60 tokens; SKILL.md has 263 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~60
When it runs · the whole SKILL.md, loaded when a task matches
~575

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); files beside SKILL.md are not scanned.

SKILL.md

The full file from openathleteorg/openathlete at commit a3433f0, republished under its AGPL-3.0 licence (© openathleteorg). 263 words, ~575 tokens.

Download SKILL.mdSave it as .claude/skills/prisma-migration/SKILL.md (or your agent's skills folder).
name
prisma-migration
description
Change the OpenAthlete database schema safely with Prisma, covering the migration SQL, production safety, account deletion coverage and tests. Use whenever a .prisma file in libs/database changes or a migration is needed.

Change the database schema

The schema is split by domain in libs/database/prisma/schema/*.prisma. Migrations are in libs/database/prisma/schema/migrations/. Production runs prisma migrate deploy when the API container starts (apps/api/scripts/docker-entrypoint.sh), including on self-hosted instances you don't control.

Steps

  1. Edit the model. Map names to snake_case (@map, @@map), as the existing models do.

  2. Create the migration without applying it, against your dev database:

    bash
    pnpm database exec prisma migrate dev --create-only --name <short_description>
  3. Read the generated SQL and make it safe for live data:

    • A new column on an existing table needs a default or must be nullable. Backfill it in the same migration if needed.
    • Never drop or rename a column that a running version still reads. Add the new one, deploy, migrate the reads, then drop it in a later release.
    • Enum values: ALTER TYPE ... ADD VALUE is fine. Removing a value needs a data migration.
    • Indexes on large tables (event, event_activity, record): consider CREATE INDEX CONCURRENTLY in a separate migration.
  4. Apply and regenerate: pnpm database run db:migrate then pnpm database run db:generate.

  5. Account deletion: a new foreign key to user, athlete, event, event_activity or workout must be handled in apps/api/src/modules/auth/services/account-deletion.service.ts. Then:

    • add it to HANDLED_RESTRICT_KEYS in account-deletion.int-spec.ts, if its delete rule is RESTRICT;
    • seed a row in account-deletion.fixture.ts.

    Prefer onDelete: Cascade for data that has no meaning without its parent.

  6. Update the Zod schemas in libs/shared if the API exposes the new fields.

Verify

bash
scripts/verify.sh --integration

It applies every migration to an empty database, then runs the integration tests, including the account deletion test that inspects foreign keys. Mention the migration in the commit body, as the deploy runs it.

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

Files

Just SKILL.md in .claude/skills/prisma-migration of openathleteorg/openathlete.

Open the folder on GitHubat commit a3433f0

Compare with similar skills

Prisma Migration 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.

Prisma Migration compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Prisma Migration this skillopenathleteorg/openathlete100—~575Automated safety check: PassAGPL-3.0
Database FundamentalsDanielPodolsky/ownyourcode2901 repos~1.6kAutomated safety check: PassMIT
DB SculptorEliasOulkadi/shokunin114—~3.1kAutomated safety check: NotesMIT
Drizzle Orm Expertdavila7/claude-code-templates32k3 repos~2.6kAutomated safety check: PassMIT
Database Schemaalinaqi/maggy707—~3.1kAutomated safety check: PassMIT
Data Model ExtractorEmeaAppGbb/spec2cloud100—~2.5kAutomated safety check: PassMIT

Similar skills

  • Database Fundamentals

    DanielPodolsky/ownyourcode

    Reviews schema design, SQL queries, ORM patterns. An agent skill from DanielPodolsky/ownyourcode.

    290 GitHub starsUsed in 1 repo~1.6k tokens
    DatabasesAuto-check passed
  • DB Sculptor

    EliasOulkadi/shokunin

    Design database schemas with Prisma/Drizzle, PostgreSQL index strategy (B-tree, GIN, GiST, BRIN, Hash), query optimization (EXPLAIN ANALYZE), migration safety (expand/contract, zero-downtime), and…

    114 GitHub stars~3.1k tokensUpdated 3 days ago
    DatabasesAuto-check: notes
  • Drizzle Orm Expert

    davila7/claude-code-templates

    Expert in Drizzle ORM for TypeScript — schema design, relational queries, migrations, and serverless database integration.

    32k GitHub starsUsed in 3 repos~2.6k tokens
    DatabasesAuto-check passed
  • Database Schema

    alinaqi/maggy

    Schema awareness - read before coding, type generation, prevent column errors

    707 GitHub stars~3.1k tokensUpdated 13 days ago
    DatabasesAuto-check passed
  • Data Model Extractor

    EmeaAppGbb/spec2cloud

    Extract database schemas, data models, and entity relationships from code.

    100 GitHub stars~2.5k tokensUpdated 5 mo ago
    DatabasesAuto-check passed
  • Tsh SQL And Database Understanding

    TheSoftwareHouse/copilot-collections

    SQL writing and database engineering patterns, standards, and procedures.

    284 GitHub stars~11k tokensUpdated 2 days ago
    DatabasesAuto-check passed

More from openathleteorg/openathlete

All 8 skills in this repo
  • API Endpoint

    openathleteorg/openathlete

    Add or change an OpenAthlete API endpoint end to end, from the shared Zod schema to the NestJS controller and service, the web API client, the React Query hook and the UI, with tests.

    100 GitHub stars~682 tokensUpdated today
    Auto-check passed
  • E2E

    openathleteorg/openathlete

    Run, debug or extend the OpenAthlete Playwright end-to-end tests, which exercise the production Docker images (API, worker, web, PostgreSQL, Redis) through the API and a real browser on desktop and…

    100 GitHub stars~675 tokensUpdated today
    Auto-check passed
  • I18n

    openathleteorg/openathlete

    Add or change user-facing text in OpenAthlete (web app Paraglide catalogs, API emails and push notifications, website) in every supported language.

    100 GitHub stars~512 tokensUpdated today
    Auto-check passed
  • Review PR

    openathleteorg/openathlete

    Review an external pull request on openathleteorg/openathlete, test it on top of current main, resolve trivial conflicts, and approve, request changes or merge with a clear, friendly review.

    100 GitHub stars~823 tokensUpdated today
    Auto-check passed
  • Triage Feedback

    openathleteorg/openathlete

    Gather OpenAthlete user feedback from GitHub (issues, PRs, discussions) and the local Discord export, deduplicate it, prioritize it, and draft replies.

    100 GitHub stars~552 tokensUpdated today
    Auto-check passed
  • Release

    openathleteorg/openathlete

    Cut and verify an OpenAthlete release, from choosing the version and running checks to the vX.Y.Z tag, GHCR images and GitHub release notes, including what self-hosters must know.

    100 GitHub stars~676 tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Prisma Migration

What does Prisma Migration do?

Change the OpenAthlete database schema safely with Prisma, covering the migration SQL, production safety, account deletion coverage and tests. Prisma Migration is an agent skill from openathleteorg/openathlete. Change the OpenAthlete database schema safely with Prisma, covering the migration SQL, production safety, account deletion coverage and tests.

When should I use Prisma Migration?

Prisma Migration fits situations like: A .prisma file in libs/database changes; A migration is needed.

How do I install Prisma Migration in Claude Code?

Run `npx skills add openathleteorg/openathlete --skill prisma-migration -a claude-code`. Or copy the skill folder (.claude/skills/prisma-migration in openathleteorg/openathlete) into .claude/skills/prisma-migration in your project. Claude Code loads it when a task matches its description.

How do I install Prisma Migration in Codex?

Run `npx skills add openathleteorg/openathlete --skill prisma-migration -a codex`. Or copy the skill folder (.claude/skills/prisma-migration in openathleteorg/openathlete) into .agents/skills/prisma-migration in your project. Codex loads it when a task matches its description.

Can I use Prisma Migration 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 openathleteorg/openathlete --skill prisma-migration -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/prisma-migration, .gemini/skills/prisma-migration, .github/skills/prisma-migration and .opencode/skills/prisma-migration in your project.

What does Prisma Migration need to run?

Going by SKILL.md and its folder, Prisma Migration needs the command-line tools its instructions call (pnpm). Our summary lists: Docker.

Does Prisma Migration 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 Prisma Migration 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. Review the folder before installing.

What licence does Prisma Migration use?

Prisma Migration is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Prisma Migration use?

About 575 tokens (SKILL.md is roughly 2.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Prisma Migration?

Skills that share tags, products or a category with Prisma Migration: Database Fundamentals (DanielPodolsky/ownyourcode, 290 stars), DB Sculptor (EliasOulkadi/shokunin, 114 stars), Drizzle Orm Expert (davila7/claude-code-templates, 32k stars) and Database Schema (alinaqi/maggy, 707 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Prisma Migration?

openathleteorg (a GitHub organization) maintains it in openathleteorg/openathlete, which has 100 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on October 7, 2026.

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