update-schema

update-schema is a skill for Claude Code, Codex from KhaledSaeed18/node-express-boilerplate. It costs 56 tokens per session (795 once invoked), scanned A, original, MIT.

A database-structure update guide for Prisma, a tool that connects a TypeScript or JavaScript app to its database. It covers adding models, fields, and relationships, then applying the database migration and rebuilding the generated client.

In plain words
What is it for?
Use it when adding a database model, changing a field, or modifying how records relate to one another in a Prisma project.
Why use it?
It reduces the risk of changing the app's code without bringing the database structure and generated database code into agreement. It also explains how to handle existing records when adding required fields.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/khaledsaeed18/node-express-boilerplate/update-schema
Any agent
npx skills add KhaledSaeed18/node-express-boilerplate --skill update-schema
Clone the repo
git clone --depth 1 https://github.com/KhaledSaeed18/node-express-boilerplate

Made for: Claude Code, Codex.

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 update-schema

README.md
[![agentmods](https://agentmods.dev/badge/skills/khaledsaeed18/node-express-boilerplate/update-schema.svg)](https://agentmods.dev/skills/khaledsaeed18/node-express-boilerplate/update-schema)
Your own site
<a href="https://agentmods.dev/skills/khaledsaeed18/node-express-boilerplate/update-schema"><img src="https://agentmods.dev/badge/skills/khaledsaeed18/node-express-boilerplate/update-schema.svg" alt="Measured on agentmods" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 795 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00056 $0.00795
Opus 5 $0.00028 $0.00398
Sonnet 5 $0.00011 $0.00159
Haiku 4.5 $0.00006 $0.00080

Measured 4d ago against content hash 12fc2bd81024, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

update-schema 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 4d 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.

.agents/skills/update-schema/SKILL.md · 104 lines

How it starts

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

When the user asks to modify the Prisma schema, follow this sequence.

Step 1 — Edit prisma/schema.prisma

Adding a new model:

model <Name> {
    id        String   @id @default(cuid())
    // required fields
    // optional fields (mark with ?)
    createdAt DateTime @default(now())
    updatedAt DateTime @updatedAt

    // relations
    userId String
    user   User   @relation(fields: [userId], references: [id], onDelete: Cascade)

    @@index([userId])
    @@index([/* other commonly filtered fields */])
    @@map("<snake_case_table_name>")
}

Adding fields to an existing model:

  • Nullable new fields (safest for existing data): fieldName Type?
  • Non-nullable with a default: fieldName Type @default(value)
  • Non-nullable without a default: requires a migration with a --create-only step to backfill data before applying

Changing relations:

  • Adding a one-to-many: add the array field on the "one" side and the FK field + scalar on the "many" side
  • Always set onDelete: explicitly — use Cascade for child records that must not outlive the parent, Restrict or SetNull otherwise

Naming conventions:

  • Table names: @@map("snake_case") on every model
  • Column names: @map("snake_case") on every field that differs from the Prisma field name
  • All IDs: @id @default(cuid())
  • Always add @@index on foreign key columns

Step 2 — Run the migration

pnpm prisma:migrate

This creates a new migration file in prisma/migrations/ and applies it to the dev database.

If the migration involves a non-nullable column without a default (data backfill needed):

pnpm exec prisma migrate dev --create-only   # generate SQL without applying
# edit the generated SQL to add UPDATE statement for existing rows
pnpm exec prisma migrate deploy              # apply the edited migration

Step 3 — Regenerate the Prisma client

pnpm prisma:generate

This must run after every schema change. The generated client lives in src/generated/prisma/.

Read the full file on GitHub · 104 lines

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. 4d ago First seen · 104 lines · 56 tokens per session scan A 12fc2bd81024

Subscribe to this mod's changes

update-schema is a skill published in the GitHub repository KhaledSaeed18/node-express-boilerplate (33 stars, last pushed 4d ago), licensed MIT. It adds 56 tokens to every session and 795 once invoked, about $0.0003 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-30.

Related

Other skills, from other repositories

saas-builder

Clone, verify, map, and build on top of ixartz/SaaS-Boilerplate for a user's SaaS idea. Use when a user wants to reuse SaaS Boilerplate, evaluate how their product fits it, or build product-specific pages, database schema, roles, permissions, MVP features, and launch scope on top of the boilerplate.

ixartz/SaaS-Boilerplate · 75 tokens

db

Database schema and query conventions for ThunderID. Use when changing schema scripts, defining SQL queries, updating store constants, or reviewing deployment-scoped persistence rules.

thunder-id/thunderid · 33 tokens

prisma-orm

Use when modeling data or writing type-safe queries with Prisma ORM in TypeScript — schema.prisma, prisma.config.ts, the generated Prisma Client, and Prisma Migrate, including the v6 to v7 upgrade. NOT schema-as-TS with a SQL builder (that is drizzle-orm), NOT ORM-agnostic zero-downtime migration (that is…

ericrisco/rsc-harness · 101 tokens

mail-time

Use when building, wiring, reviewing, or debugging MailTime and ostrio:mailer email queues for horizontally scaled Node.js, Bun, or Meteor apps. Trigger on MailTime, MongoQueue, RedisQueue, PostgresQueue, mailTimePreset, JoSk email scheduling, Redis Cluster / KeyDB Cluster / Valkey useHashTags, KeyDB…

veliovgroup/mail-time · 179 tokens

webiny-api-key-value-store-catalog

Name: GlobalKeyValueStore Import: import { GlobalKeyValueStore } from "webiny/api/key-value-store" Source: @webiny/api-core/features/keyValueStore/index.ts Description: Global (non-tenant-scoped) key-value store.

webiny/webiny-js · 19 tokens

faasjs-pg

Use when working with @faasjs/pg or PostgreSQL in FaasJS: Tables declaration merging, QueryBuilder, select aliases, parameterized sql expressions, raw SQL, numeric/decimal/bigint boundaries, transaction isolation and read-only modes, row locks, concurrency, migrations, SchemaBuilder, TableBuilder, faasjs-pg CLI…

faasjs/faasjs · 97 tokens