Agent skill · Databases

schema-design

Use when designing database schemas, creating or modifying tables, choosing column types, adding indexes, or working with the Butterbase declarative schema DSL

butterbase.ai2,831★ · +400/wk · 1 repos on radarProfile →
claude-codeMIT
Install
npx skills add butterbase-ai/butterbase-skills --skill schema-design --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 21 KB
Bundled scripts: none
Path: skills/schema-design/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 532

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

Review
written from the skill's own SKILL.md · Aug 5, 2026

What it does

Directs the agent to use Butterbase's declarative schema DSL to design and modify database schemas. It specifies describing end states for tables, columns, and indexes, and then using the single tool manage_schema with actions to read, preview, or apply changes.

How it works

  • Use the manage_schema tool with action: "get" to read the current schema.
  • Use action: "dry_run" with a schema payload to preview the SQL that would be executed.
  • Use action: "apply" with a schema payload to apply the declarative schema diffs (safe DDL) to the database.
  • Use action: "list_migrations" to list applied migrations.
  • When creating new tables or adding columns, include the table/column definitions and optional indexes in the schema payload and call action: "apply". Destructive operations require explicit _drop or _dropColumns in the schema payload.
  • The system enforces idempotence and transactional migrations; each migration runs in a single transaction.

When to use it

Use when designing schemas, creating or modifying tables, choosing column types, adding indexes, or working with the Butterbase declarative schema DSL. Use dry_run before apply to preview changes.

What it can touch

The agent uses the manage_schema tool with schema payloads that define tables, columns (with types, nullability, defaults, foreign keys), and indexes. It can reference tables and columns as described in the DSL (e.g., types like uuid, timestamptz, jsonb; foreign keys via references; index definitions).

Caveats

Dropping tables or columns is opt-in via _drop / _dropColumns and is irreversible; always run dry_run first. Errors include VALIDATION_INVALID_SCHEMA, STATE_PREREQUISITE_MISSING, QUOTA_TABLE_LIMIT, and RESOURCE_NOT_FOUND.

From the SKILL.md

# Schema Design Skill Reference guide for Butterbase's declarative schema DSL. Covers column types, constraints, indexes, and common data modeling patterns. --- ## 1. Overview Butterbase uses a **declarative schema DSL** — you describe the desired end state of your database, and the platform computes and applies the diff. You never write raw `ALTER TABLE` or `CREATE TABLE` SQL. Instead, call `manage_schema` with `action: "apply"` and a JSON payload describing your tables, columns, and indexes. The single `manage_schema` tool exposes four actions: | Action | Purpose | |--------|---------| | `"get"` | Read the current schema | | `"dry_run"` | Preview SQL that `apply` would execute, without running it | | `"apply"` | Apply a declarative schema (diffs against current, runs safe DDL) | | `"list_migrations"` | List applied migrations, most recent first | Key principles: - **Idempotent**: applying the same schema twice is safe — returns "Schema is up to date" if no changes needed - **Additive by default**: new columns and tables are created automatically - **Explicit drops**: destructive operations require opt-in via `_drop` / `_dropColumns` - **Preview first**: use `action: "dry_run"` to

What's inside
Steps it walks through
  1. 1. Overview
  2. 2. Column Types Reference
  3. 3. Column Properties
  4. Foreign keys — short or long form
  5. Default expressions
  6. 4. Standard Base Pattern
  7. 5. Index Types
  8. Index definition format
  9. Composite indexes
  10. 6. Using manageschema
  11. Creating new tables
  12. Adding columns to existing tables
  13. Destructive operations
  14. Preview before commit
More from butterbase-skills
All skills →
About this skill
What does the schema-design skill do?

Use when designing database schemas, creating or modifying tables, choosing column types, adding indexes, or working with the Butterbase declarative schema DSL

How do I install it?

Run `npx skills add butterbase-ai/butterbase-skills --skill schema-design --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From butterbase-ai/butterbase-skills, a repository with 532 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going