Agent skill

Database Design

by KbWen in KbWen/agentic-os

Design schemas and migrations when persistent data structures change.

MITAuto-check passedDatabases

Install Database Design

skills CLI
$ npx skills add KbWen/agentic-os --skill database-design -a claude-code

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

GitHub CLI
$ gh skill install KbWen/agentic-os 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/KbWen/agentic-os.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/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
206
Token cost
~1.2k tokens
SKILL.md length
588 words
Files
2
Skills in repo
12
Repo updated
First seen
Licence
MIT

At a glance

Design schemas and migrations when persistent data structures change.

  • Tasks that involve Database schema design
  • SKILL.md covers When to Apply, Conventions, Checklist and Heading-Scoped Read Note, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Database Design is an agent skill from KbWen/agentic-os. Design schemas and migrations when persistent data structures change.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `agents/openai.yaml`).

It sits in Databases, covering Database schema design. The repository describes itself as: Governance framework for AI coding agents. It runs them through a five-step workflow (plan, build, review, test, ship) where no step counts as done without evidence. Drop-in… The licence is MIT.

When your agent uses it

  • Tasks that involve Database schema design

Example prompts

  • “/database-design”

What it can do on your machine

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

    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 1.2k tokens when it runs. Until then it costs about 21 tokens; SKILL.md has 588 words of instructions outside code blocks.

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

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 KbWen/agentic-os at commit 81a4034, republished under its MIT licence (© KbWen). 588 words, ~1,242 tokens.

Download SKILL.mdSave it as .claude/skills/database-design/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
database-design
description
Design schemas and migrations when persistent data structures change.
<!-- This is a SCAFFOLD skill -->

Database Design

When to Apply

  • Classification: feature (if new tables/columns), architecture-change (schema redesign), hotfix (data-related bug)
  • Phase: /plan (schema design), /implement (migration creation), /review (schema review), /test (data integrity)
  • Trigger: Task involves creating tables, modifying schema, writing migrations, or changing data access patterns

Conventions

Customize after /app-init: Replace these generic conventions with your project's ADR and ORM-specific patterns.

Table Design
  • Every table MUST have: id (primary key), created_at, updated_at
  • Use UUIDs or auto-increment IDs consistently (per ADR decision)
  • Soft delete: add deleted_at column if ADR specifies soft delete
  • Table names: plural, snake_case (e.g., users, order_items)
  • Column names: snake_case (e.g., first_name, is_active)
Relationship Patterns
RelationshipImplementationExample
One-to-ManyForeign key on "many" sideorders.user_id → users.id
Many-to-ManyJunction tableuser_roles (user_id, role_id)
One-to-OneForeign key + unique constraintuser_profiles.user_id (UNIQUE) → users.id
Self-referencingForeign key to same tablecategories.parent_id → categories.id
Index Strategy
  • Every foreign key column MUST have an index
  • Columns used in WHERE clauses frequently → add index
  • Composite indexes: put the most selective column first
  • Unique constraints for business uniqueness rules (email, username, etc.)
  • DO NOT over-index: every index slows writes
Migration Rules
  • One migration per logical change (don't mix table creation with data backfill)
  • Migrations MUST be reversible: every up must have a corresponding down
  • Never modify a shipped migration: create a new migration instead
  • Data migrations separate from schema migrations: schema first, data second
  • Test rollback: after writing migration, verify down works cleanly
Query Patterns
  • Use parameterized queries / ORM bindings — NEVER string concatenation for SQL
  • Limit SELECT columns: SELECT id, name not SELECT *
  • Add LIMIT to all list queries (even if paginated — belt and suspenders)
  • Use transactions for multi-table writes
  • Batch inserts for bulk operations (not one INSERT per row)
Data Integrity
  • Foreign key constraints enforced at DB level (not just application level)
  • NOT NULL on required fields (don't rely on application validation alone)
  • CHECK constraints for enum-like fields or value ranges
  • Default values for fields that have sensible defaults
Show full SKILL.md (269 more words)Show less

Checklist

During /plan:

  • Schema changes documented in spec (new tables, modified columns)
  • Indexes planned for query patterns
  • Migration rollback strategy defined
  • Data backfill plan (if modifying existing tables with data)

During /implement:

  • Migration file created (not manual SQL against DB)
  • Foreign keys have indexes
  • NOT NULL and DEFAULT constraints set appropriately
  • Migration tested: up → verify → down → verify → up
  • No raw SQL string concatenation (use parameterized queries)

During /review:

  • No N+1 queries (use eager loading / JOIN where appropriate)
  • Transaction boundaries correct (all-or-nothing for related writes)
  • No schema changes without migration file
  • Backward compatibility: old code can still function until deployed together
  • Sensitive data columns identified (for encryption/hashing per security guardrails)

Heading-Scoped Read Note

For phase-entry loading, read only:

  • When to Apply
  • Checklist

Load Conventions, Anti-Patterns, and References on full read or cache miss only.

Anti-Patterns

  • Schema via ORM only: Relying on ORM auto-sync without migration files. No rollback, no history, no review.
  • God table: One table with 30+ columns. Normalize or split by domain.
  • Missing indexes on FK: Every foreign key needs an index. Databases don't add them automatically (except some).
  • String-typed everything: Using VARCHAR for dates, numbers, booleans. Use proper types.
  • No migration rollback: Writing up without down. You will need to rollback someday.
  • Mixing DDL and DML: Schema changes and data backfill in the same migration. Split them.
  • SELECT * in production code: Fetching all columns when you need two. Wastes memory and bandwidth.
  • Trusting application-only validation: No DB constraints means bad data WILL get in eventually.

References

  • Project ADR: docs/adr/ADR-002-project-architecture.md § Database Design
  • Security guardrails: .agent/rules/security_guardrails.md (A03: SQL Injection, A02: Secrets in connection strings)
  • Spec template: .agentcortex/templates/spec-app-feature.md § Database Schema

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

Files

SKILL.md and 1 other file in .agents/skills/database-design of KbWen/agentic-os.

  • SKILL.md
  • agents/openai.yaml

Open the folder on GitHubat commit 81a4034

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 skillKbWen/agentic-os206—~1.2kAutomated safety check: PassMIT
Codebase Explorationgiancarloerra/SocratiCode3.3k1 repos~1.5kAutomated safety check: PassAGPL-3.0
Tool Schema Designseb1n/awesome-ai-agent-skills206—~1.5kAutomated safety check: PassMIT
Together SDK Patternsjeremylongshore/tons-of-skills-marketplace2.8k—~1kAutomated safety check: PassMIT
Ma Margin Normalizationhh-health-AI/healthcare-equity101—~840Automated safety check: PassMIT
Add Memory KindEverMind-AI/EverOS13k—~2.6kAutomated safety check: PassApache-2.0

Similar skills

  • Codebase Exploration

    giancarloerra/SocratiCode

    Explore and understand codebases using SocratiCode semantic search, dependency graphs, and context artifacts.

    3.3k GitHub starsUsed in 1 repo~1.5k tokens
    DatabasesAuto-check passed
  • Tool Schema Design

    seb1n/awesome-ai-agent-skills

    Design and validate model-facing tool definitions with clear names, action-oriented descriptions, bounded JSON Schema parameters, explicit side effects, safe defaults, idempotency, errors, and…

    206 GitHub stars~1.5k tokensUpdated 1 mo ago
    DatabasesAuto-check passed
  • Together SDK Patterns

    jeremylongshore/tons-of-skills-marketplace

    Encapsulate Together AI SDK v2 behind a typed adapter with catalog-resolved models, bounded retries, streaming normalization, usage capture, and OpenAI-compatible migration seams.

    2.8k GitHub stars~1k tokensUpdated today
    DatabasesAuto-check passed
  • Ma Margin Normalization

    hh-health-AI/healthcare-equity

    This skill should be used when the user asks about "Medicare Advantage margins", "MLR", "Star Ratings", "MA enrolment", "risk adjustment", "MedPAC benchmark", "payor margin normalisation"…

    101 GitHub stars~840 tokensUpdated 3 days ago
    DatabasesAuto-check passed
  • Add Memory Kind

    EverMind-AI/EverOS

    Walks through adding a new persisted memory kind to EverOS: choose storage among Markdown, SQLite and LanceDB, pick a Markdown strategy, then wire schemas, repos and writers.

    13k GitHub stars~2.6k tokensUpdated yesterday
    DatabasesAuto-check passed
  • SQL Optimization Patterns

    ynulihao/AgentSkillOS

    Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries.

    617 GitHub starsUsed in 11 repos~3.3k tokens
    DatabasesAuto-check passed

More from KbWen/agentic-os

All 12 skills in this repo
  • API Design

    KbWen/agentic-os

    Design or review REST/GraphQL APIs when endpoints or contracts change.

    206 GitHub stars~1k tokensUpdated yesterday
    Auto-check passed
  • Frontend Patterns

    KbWen/agentic-os

    Apply frontend conventions when components, pages, forms, or client state change.

    206 GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed
  • Karpathy Principles

    KbWen/agentic-os

    Behavioral guidelines to reduce common LLM coding mistakes — Think Before Coding, Simplicity First, Surgical Changes, Goal-Driven Execution.

    206 GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed
  • Production Readiness

    KbWen/agentic-os

    Use at review and ship, automatically for feature or architecture changes and on request for error handling, logging, crash reporting, or observability; verify errors reach production monitoring.

    206 GitHub stars~938 tokensUpdated yesterday
    Auto-check passed
  • Doc Lookup

    KbWen/agentic-os

    Check official docs when framework APIs or configuration may be version-sensitive.

    206 GitHub stars~2.6k tokensUpdated yesterday
    Auto-check: warnings
  • Systematic Debugging

    KbWen/agentic-os

    A skill your agent uses when investigating a bug, test failure, flaky test, unexpected behavior, or a hotfix, or an unexplained or failed fix; find the root cause first.

    206 GitHub stars~496 tokensUpdated yesterday
    Auto-check passed

Questions about Database Design

What does Database Design do?

Design schemas and migrations when persistent data structures change. Database Design is an agent skill from KbWen/agentic-os. Design schemas and migrations when persistent data structures change.

When should I use Database Design?

Database Design fits situations like: tasks that involve Database schema design.

How do I install Database Design in Claude Code?

Run `npx skills add KbWen/agentic-os --skill database-design -a claude-code`. Or copy the skill folder (.agents/skills/database-design in KbWen/agentic-os) 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 KbWen/agentic-os --skill database-design -a codex`. Or copy the skill folder (.agents/skills/database-design in KbWen/agentic-os) 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 KbWen/agentic-os --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 MIT 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 1.2k tokens (SKILL.md is roughly 5k 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: Codebase Exploration (giancarloerra/SocratiCode, 3.3k stars), Tool Schema Design (seb1n/awesome-ai-agent-skills, 206 stars), Together SDK Patterns (jeremylongshore/tons-of-skills-marketplace, 2.8k stars) and Ma Margin Normalization (hh-health-AI/healthcare-equity, 101 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Database Design?

KbWen (a GitHub user) maintains it in KbWen/agentic-os, which has 206 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on October 6, 2026.

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