Agent skill

Database Design

by spencerpauly in spencerpauly/awesome-cursor-skills

Design database schemas — tables, relationships, indexes, constraints, and ORM setup.

CC0-1.0Auto-check passedDatabases

Install Database Design

skills CLI
$ npx skills add spencerpauly/awesome-cursor-skills --skill database-design -a claude-code

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

GitHub CLI
$ gh skill install spencerpauly/awesome-cursor-skills database-design --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/spencerpauly/awesome-cursor-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/resources/database-design .claude/skills/database-design && 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
database-design
GitHub stars
842
Token cost
~1k tokens
SKILL.md length
295 words
Files
1
Skills in repo
57
Repo updated
First seen
Licence
CC0-1.0

At a glance

Design database schemas — tables, relationships, indexes, constraints, and ORM setup.

  • Works in 6 steps: Identify Entities → Define Relationships → Design the Schema → …
  • Tasks that involve Database schema design
  • SKILL.md covers Workflow, Common Patterns and Tips
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Database Design is an agent skill from spencerpauly/awesome-cursor-skills. Design database schemas — tables, relationships, indexes, constraints, and ORM setup. Covers relational design, normalization, and common patterns.

Its SKILL.md is about 1k 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 Database schema design and ORMs and data access. The repository describes itself as: A curated list of awesome skills for Cursor. The licence is CC0-1.0.

When your agent uses it

  • Tasks that involve Database schema design
  • Tasks that involve ORMs and data access

Example prompts

  • “/database-design”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Identify Entities
  2. Define Relationships
  3. Design the Schema
  4. Apply Best Practices
  5. Add Indexes
  6. ORM Setup

What it can do on your machine

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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are sql, prisma and typescript).

    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 no API keys, tokens, secrets or passwords.

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

Context cost

Database Design loads about 1k tokens when it runs. Until then it costs about 41 tokens; SKILL.md has 295 words of instructions outside code blocks.

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

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 spencerpauly/awesome-cursor-skills at commit 99cd265, republished under its CC0-1.0 licence (© spencerpauly). 295 words, ~1,028 tokens.

Download SKILL.mdSave it as .claude/skills/database-design/SKILL.md (or your agent's skills folder).
name
database-design
description
Design database schemas — tables, relationships, indexes, constraints, and ORM setup. Covers relational design, normalization, and common patterns.
user-invocable
true

Database Design

Design a database schema from requirements.

Workflow

1. Identify Entities

From the requirements, extract the core entities (nouns):

  • Users, Teams, Projects, Tasks, Comments, etc.
  • Each entity becomes a table
2. Define Relationships
RelationshipImplementation
One-to-oneForeign key with unique constraint, or embed in same table
One-to-manyForeign key on the "many" side
Many-to-manyJunction/join table
Self-referentialForeign key pointing to same table (e.g. parent_id)
3. Design the Schema

For each table:

sql
CREATE TABLE users (
  id          UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  email       TEXT NOT NULL UNIQUE,
  name        TEXT NOT NULL,
  avatar_url  TEXT,
  created_at  TIMESTAMPTZ NOT NULL DEFAULT now(),
  updated_at  TIMESTAMPTZ NOT NULL DEFAULT now()
);

CREATE TABLE projects (
  id          UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  name        TEXT NOT NULL,
  owner_id    UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
  created_at  TIMESTAMPTZ NOT NULL DEFAULT now()
);
4. Apply Best Practices

Primary keys:

  • Use UUID for distributed systems or public-facing IDs
  • Use SERIAL/BIGSERIAL for internal-only IDs (faster joins)

Timestamps:

  • Always add created_at and updated_at
  • Use TIMESTAMPTZ (with timezone), never TIMESTAMP

Naming:

  • Tables: plural snake_case (users, project_members)
  • Columns: singular snake_case (user_id, created_at)
  • Indexes: idx_<table>_<columns> (idx_users_email)

Constraints:

  • NOT NULL on everything unless it's genuinely optional
  • UNIQUE on natural keys (email, slug, external IDs)
  • REFERENCES with ON DELETE behavior (CASCADE, SET NULL, RESTRICT)
  • CHECK constraints for enums or value ranges
5. Add Indexes
sql
-- For columns you filter/sort by frequently
CREATE INDEX idx_projects_owner_id ON projects(owner_id);

-- For unique lookups
CREATE UNIQUE INDEX idx_users_email ON users(email);

-- Composite for common query patterns
CREATE INDEX idx_tasks_project_status ON tasks(project_id, status);

When to index:

  • Foreign keys (almost always)
  • Columns in WHERE clauses
  • Columns in ORDER BY
  • Columns in JOIN conditions

When NOT to index:

  • Small tables (<1000 rows)
  • Columns with low cardinality (boolean, status with 3 values)
  • Columns that are rarely queried
6. ORM Setup

Prisma:

prisma
model User {
  id        String   @id @default(uuid())
  email     String   @unique
  name      String
  projects  Project[]
  createdAt DateTime @default(now()) @map("created_at")
  updatedAt DateTime @updatedAt @map("updated_at")
  @@map("users")
}

Drizzle:

typescript
export const users = pgTable('users', {
  id: uuid('id').primaryKey().defaultRandom(),
  email: text('email').notNull().unique(),
  name: text('name').notNull(),
  createdAt: timestamp('created_at', { withTimezone: true }).notNull().defaultNow(),
  updatedAt: timestamp('updated_at', { withTimezone: true }).notNull().defaultNow(),
});

Common Patterns

Soft deletes: Add deleted_at TIMESTAMPTZ instead of actually deleting rows Audit log: Separate audit_events table with entity_type, entity_id, action, actor_id, payload Tags/labels: Junction table (task_tags) with task_id + tag_id Tree/hierarchy: parent_id self-reference, or materialized path (/1/4/7/) Polymorphic associations: Use entity_type + entity_id columns (avoid if possible, prefer separate FKs)

Tips

  • Start normalized (3NF), denormalize only when you have measured performance problems
  • Don't store derived data unless you have a caching/invalidation strategy
  • Use database enums or check constraints for status fields, not free-text
  • Always think about what happens when you delete a parent record

© spencerpauly, CC0-1.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 resources/database-design of spencerpauly/awesome-cursor-skills.

Open the folder on GitHubat commit 99cd265

Compare with similar skills

Database Design 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.

Database Design compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Database Design this skillspencerpauly/awesome-cursor-skills842—~1kAutomated safety check: PassCC0-1.0
DB Migrationskurealnum/dotfiles290—~820Automated safety check: PassNone
Change Database Schemamartin-ueding/geo-activity-playground100—~225Automated safety check: PassCustom licence
Drizzlekurealnum/dotfiles290—~1.3kAutomated safety check: PassNone
Jpa Patternsaffaan-m/ECC275k5 repos~1.2kAutomated safety check: PassMIT
Prisma Expertdavila7/claude-code-templates32k7 repos~2.6kAutomated safety check: PassMIT

Similar skills

  • DB Migrations

    kurealnum/dotfiles

    A skill your agent uses when generating or regenerating Drizzle migration files, changing database schema tables or columns, resolving migration sequence conflicts after rebase, reviewing migration…

    290 GitHub stars~820 tokensUpdated 5 mo ago
    DatabasesAuto-check passed
  • Change Database Schema

    martin-ueding/geo-activity-playground

    How to change the SQLAlchemy data model and generate the matching Alembic migration.

    100 GitHub stars~225 tokensUpdated 10 days ago
    DatabasesAuto-check passed
  • Drizzle

    kurealnum/dotfiles

    Drizzle ORM schema and database guide. An agent skill from kurealnum/dotfiles.

    290 GitHub stars~1.3k tokensUpdated 5 mo ago
    DatabasesAuto-check passed
  • Jpa Patterns

    affaan-m/ECC

    JPA/Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and pooling in Spring Boot.

    275k GitHub starsUsed in 5 repos~1.2k tokens
    DatabasesAuto-check passed
  • Prisma Expert

    davila7/claude-code-templates

    Prisma ORM expert for schema design, migrations, query optimization, relations modeling, and database operations.

    32k GitHub starsUsed in 7 repos~2.6k tokens
    DatabasesAuto-check passed
  • Official

    Optimize and improve the performance of slow Entity Framework Core (EF Core) queries: make them generate less SQL, make fewer database round-trips, and return results faster.

    5.6k GitHub starsUsed in 1 repo~2.7k tokens
    DatabasesAuto-check passed

More from spencerpauly/awesome-cursor-skills

All 57 skills in this repo
  • Babysitting PR

    spencerpauly/awesome-cursor-skills

    Monitor a pull request for CI failures, review comments, and merge conflicts — then fix them automatically.

    842 GitHub stars~930 tokensUpdated 2 mo ago
    Auto-check passed
  • Best Of N Solving

    spencerpauly/awesome-cursor-skills

    Solve a hard problem by trying multiple approaches in parallel using isolated git worktrees.

    842 GitHub stars~698 tokensUpdated 2 mo ago
    Auto-check passed
  • Grinding Until Pass

    spencerpauly/awesome-cursor-skills

    Keep iterating on code changes until the tests pass, the build succeeds, or linting is clean.

    842 GitHub stars~796 tokensUpdated 2 mo ago
    Auto-check passed
  • Parallel CI Triage

    spencerpauly/awesome-cursor-skills

    When GitHub Actions fails, fetch failing job logs and assign each failing job to a separate subagent that fixes its slice of the problem in parallel.

    842 GitHub stars~793 tokensUpdated 2 mo ago
    Auto-check passed
  • Parallel Exploring

    spencerpauly/awesome-cursor-skills

    Explore a large codebase in parallel by launching multiple explore subagents that each investigate a different area simultaneously.

    842 GitHub stars~787 tokensUpdated 2 mo ago
    Auto-check: notes
  • Profiling Performance

    spencerpauly/awesome-cursor-skills

    Profile a running web application's CPU performance using Cursor's built-in browser profiler.

    842 GitHub stars~686 tokensUpdated 2 mo ago
    Auto-check passed

Categories

Questions about Database Design

What does Database Design do?

Design database schemas — tables, relationships, indexes, constraints, and ORM setup. Database Design is an agent skill from spencerpauly/awesome-cursor-skills. Design database schemas — tables, relationships, indexes, constraints, and ORM setup.

When should I use Database Design?

Database Design fits situations like: tasks that involve Database schema design; tasks that involve ORMs and data access.

How do I install Database Design in Claude Code?

Run `npx skills add spencerpauly/awesome-cursor-skills --skill database-design -a claude-code`. Or copy the skill folder (resources/database-design in spencerpauly/awesome-cursor-skills) into .claude/skills/database-design in your project. Claude Code loads it when a task matches its description.

How do I install Database Design in Codex?

Run `npx skills add spencerpauly/awesome-cursor-skills --skill database-design -a codex`. Or copy the skill folder (resources/database-design in spencerpauly/awesome-cursor-skills) into .agents/skills/database-design in your project. Codex loads it when a task matches its description.

Can I use Database Design 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 spencerpauly/awesome-cursor-skills --skill database-design -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/database-design, .gemini/skills/database-design, .github/skills/database-design and .opencode/skills/database-design in your project.

What does Database Design need to run?

SKILL.md names no scripts, command-line tools or credentials: Database Design is instructions for the agent only.

Does Database Design 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 Database Design 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 Database Design use?

Database Design is published under the CC0-1.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Database Design use?

About 1k tokens (SKILL.md is roughly 4.1k 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 Database Design?

Skills that share tags, products or a category with Database Design: DB Migrations (kurealnum/dotfiles, 290 stars), Change Database Schema (martin-ueding/geo-activity-playground, 100 stars), Drizzle (kurealnum/dotfiles, 290 stars) and Jpa Patterns (affaan-m/ECC, 275k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Database Design?

spencerpauly (a GitHub user) maintains it in spencerpauly/awesome-cursor-skills, which has 842 GitHub stars. The repository holds 57 skills in this directory. The repository was last updated on August 2, 2026.

Source: spencerpauly/awesome-cursor-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.