terrabase: Skill for Claude Code

.claude/skills/terrabase-db-changes/SKILL.md

terrabase-db-changes is a skill for Claude Code from Terrabase-in/terrabase. It costs 98 tokens per session (682 once invoked), scanned A, original, Apache-2.0.

A required workflow for PostgreSQL database structure changes in projects that declare a Terrabase database target. It routes proposed migrations through safety analysis and a planning step.

In plain words
What is it for?
Use it for creating or changing tables, columns, indexes, constraints, types, backfills, or migrations when the project has a Terrabase database URL.
Why use it?
It helps identify unsafe schema changes before they are applied and records the database change for review.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths.

This is Terrabase-in/terrabase's own configuration. It tells Claude Code how to work on terrabase itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything terrabase configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Terrabase-in/terrabase. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Terrabase-in/terrabase/main/.claude/skills/terrabase-db-changes/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/Terrabase-in/terrabase

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 terrabase-db-changes

README.md
[![agentmods](https://agentmods.dev/badge/skills/terrabase-in/terrabase/terrabase-db-changes/github.svg)](https://agentmods.dev/skills/terrabase-in/terrabase/terrabase-db-changes)
Your own site
<a href="https://agentmods.dev/skills/terrabase-in/terrabase/terrabase-db-changes"><img src="https://agentmods.dev/badge/skills/terrabase-in/terrabase/terrabase-db-changes/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for terrabase-db-changes

Your own site · 80×15
<a href="https://agentmods.dev/skills/terrabase-in/terrabase/terrabase-db-changes"><img src="https://agentmods.dev/badge/skills/terrabase-in/terrabase/terrabase-db-changes.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 98 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 682 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.00098 $0.00682
Opus 5 $0.00049 $0.00341
Sonnet 5 $0.00020 $0.00136
Haiku 4.5 $0.00010 $0.00068

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

Security

Grade A, and why

terrabase-db-changes 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 8d 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.

.claude/skills/terrabase-db-changes/SKILL.md · 59 lines

How it starts

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

terrabase DB changes

Route database schema/migration work through the terrabase MCP tools so every change gets a deterministic safety verdict, an advisory local-Qwen plan, and an activity record — instead of hand-writing and applying raw SQL.

When this applies

BOTH must hold:

  1. The task involves Postgres DDL/DML: CREATE/ALTER/DROP of tables, columns, indexes, constraints, types; backfills; or migrations.
  2. The calling project declares a terrabase target — a TERRABASE_DATABASE_URL entry in the project's .env (or .env.local).

If the project has no declared target, DO NOT use this skill — the target resolution will refuse (NO_TARGET) and you must not route the change to any other database. Proceed with the project's own workflow instead.

Procedure

  1. Propose. Call propose_migration with the change. Pass the absolute project root as projectPath so the change is attributed and resolved against this project's target — never a global one. Provide either:
    • sql: the migration SQL, or
    • intent: a natural-language description (terrabase drafts SQL with Qwen).
  2. Review. Read the returned report (the deterministic verdict is authoritative) and the Plan: summary. Surface to the user briefly: the verdict, one-line summary, and any block/warn diagnostics with their safe-rewrite suggestions.
  3. Apply only after explicit user approval. If the user approves, call apply_migration with the proposalId and approvalToken from step 1. A block verdict additionally requires force: true — never set it without the user's explicit say-so.
  4. Report. State what landed (or that it was proposed-only), and note that the activity is visible project-wise in the terrabase desktop app.

Rules

  • The deterministic safety engine — never the LLM — decides safety. Do not override a block verdict on the model's say-so.
  • Never pass an explicit dsn; rely on projectPath resolution so a change can only reach the project's own declared database.
  • Keep the user-facing summary short: verdict, summary, and the actionable diagnostics only.

Read the full file on GitHub · 59 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. 8d ago First seen · 59 lines · 98 tokens per session scan A d288dc764621

Subscribe to this mod's changes

terrabase-db-changes is a skill published in the GitHub repository Terrabase-in/terrabase (0 stars, last pushed 6d ago), licensed Apache-2.0. It adds 98 tokens to every session and 682 once invoked, about $0.0005 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