Agent skill

Database Fundamentals

by DanielPodolsky in DanielPodolsky/ownyourcode

Reviews schema design, SQL queries, ORM patterns. An agent skill from DanielPodolsky/ownyourcode.

MITAuto-check passedDatabases

Install Database Fundamentals

skills CLI
$ npx skills add DanielPodolsky/ownyourcode --skill database-fundamentals -a claude-code

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

GitHub CLI
$ gh skill install DanielPodolsky/ownyourcode database-fundamentals --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/DanielPodolsky/ownyourcode.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/fundamentals/database .claude/skills/database-fundamentals && 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-fundamentals
GitHub stars
290
Used in
1 other repo
Token cost
~1.6k tokens
SKILL.md length
505 words
Files
1
Skills in repo
19
Repo updated
First seen
Licence
MIT

At a glance

Reviews schema design, SQL queries, ORM patterns. An agent skill from DanielPodolsky/ownyourcode.

  • Works in 5 steps: The N+1 Query Problem → Missing Indexes → SELECT * Everywhere → …
  • Junior creates schema
  • SKILL.md covers When to Apply, Review Checklist, Common Mistakes (Anti-Patterns) and Socratic Questions, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Database Fundamentals is an agent skill from DanielPodolsky/ownyourcode. Reviews schema design, SQL queries, ORM patterns. Use when junior creates schema, writes queries, adds migrations, works with Prisma/MongoDB/PostgreSQL, or asks "is this SQL safe", "N+1", "index".

Its SKILL.md is about 1.6k 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 ORMs and data access, Database schema design and SQL. It works with SQL, MongoDB, PostgreSQL and Prisma. The repository describes itself as: Claude Code workflow for AI-mentored development. Work efficiently with Spec-Driven Development and the 6 Gates. Built to fight cognitive offloading — for developers using AI to… The licence is MIT.

When your agent uses it

  • Junior creates schema
  • Adds migrations
  • Works with Prisma/MongoDB/PostgreSQL
  • Asks is this SQL safe

Example prompts

  • “is this SQL safe”
  • “Use the database-fundamentals skill to review schema design, SQL queries, ORM patterns. An agent skill from DanielPodolsky/ownyourcode”
  • “/database-fundamentals”

Workflow steps

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

  1. The N+1 Query Problem
  2. Missing Indexes
  3. SELECT * Everywhere
  4. String Concatenation (SQL Injection)
  5. Destructive Migrations

What it can do on your machine

Read from SKILL.md and the folder at commit bd1f17c. 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 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 Fundamentals loads about 1.6k tokens when it runs. Until then it costs about 55 tokens; SKILL.md has 505 words of instructions outside code blocks.

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

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 DanielPodolsky/ownyourcode at commit bd1f17c, republished under its MIT licence (© DanielPodolsky). 505 words, ~1,627 tokens.

Download SKILL.mdSave it as .claude/skills/database-fundamentals/SKILL.md (or your agent's skills folder).
name
database-fundamentals
description
Reviews schema design, SQL queries, ORM patterns. Use when junior creates schema, writes queries, adds migrations, works with Prisma/MongoDB/PostgreSQL, or asks "is this SQL safe", "N+1", "index".

Database Fundamentals Review

"Your database is the foundation. Build it wrong, and everything above it will crack."

When to Apply

Activate this skill when reviewing:

  • Schema design and migrations
  • SQL/NoSQL queries
  • ORM model definitions
  • Data relationships
  • Index creation
  • Query performance

Review Checklist

Schema Design
  • Normalization: Is data normalized appropriately (no excessive duplication)?
  • Denormalization justified: If denormalized, is there a performance reason?
  • Primary keys: Does every table have a clear primary key?
  • Foreign keys: Are relationships enforced at the database level?
  • Data types: Are appropriate types used (not everything TEXT)?
Indexes
  • Query-based: Are indexes created for frequently queried columns?
  • Composite indexes: Are multi-column queries covered?
  • Not over-indexed: Are there unnecessary indexes slowing writes?
  • Unique constraints: Are unique fields enforced at DB level?
Queries
  • No N+1: Are related records fetched in bulk?
  • Select specific fields: Are we avoiding SELECT *?
  • Pagination: Do list queries limit results?
  • Parameterized: Are all queries parameterized (no string concatenation)?
Migrations
  • Reversible: Can this migration be rolled back?
  • No data loss: Will existing data survive the migration?
  • Tested: Has this been tested against production-like data?
  • Incremental: Are large changes broken into smaller migrations?

Common Mistakes (Anti-Patterns)

1. The N+1 Query Problem
❌ // 1 query for users + N queries for posts
   const users = await User.findAll();
   for (const user of users) {
     user.posts = await Post.findAll({ where: { userId: user.id } });
   }

✅ // 1 query with JOIN
   const users = await User.findAll({
     include: [{ model: Post }]
   });

   // Or 2 queries with IN clause
   const users = await User.findAll();
   const userIds = users.map(u => u.id);
   const posts = await Post.findAll({ where: { userId: userIds } });
2. Missing Indexes
❌ // Queried frequently, but no index
   SELECT * FROM orders WHERE user_id = ?
   SELECT * FROM products WHERE category = ? AND status = 'active'

✅ CREATE INDEX idx_orders_user_id ON orders(user_id);
   CREATE INDEX idx_products_category_status ON products(category, status);
3. SELECT * Everywhere
❌ SELECT * FROM users; // Returns 50 columns

✅ SELECT id, name, email FROM users; // Only what's needed
4. String Concatenation (SQL Injection)
❌ db.query(`SELECT * FROM users WHERE email = '${email}'`);

✅ db.query('SELECT * FROM users WHERE email = ?', [email]);
5. Destructive Migrations
❌ -- Can't be rolled back
   DROP TABLE users;
   ALTER TABLE orders DROP COLUMN status;

✅ -- Add new, migrate data, then drop old (in separate migrations)
   -- Migration 1: Add new column
   ALTER TABLE orders ADD COLUMN status_new VARCHAR(20);
   -- Migration 2: Copy data
   UPDATE orders SET status_new = status;
   -- Migration 3: Drop old (after verification)
   ALTER TABLE orders DROP COLUMN status;

Socratic Questions

Ask the junior these questions instead of giving answers:

  1. Schema: "Why did you choose this data type?"
  2. Relationships: "What happens if this related record is deleted?"
  3. Indexes: "Which columns are queried together? Are they indexed?"
  4. N+1: "How many queries does this operation execute?"
  5. Migration: "What happens if we need to roll this back?"

Normalization Quick Reference

FormRuleExample Issue
1NFNo repeating groupstags: "js,react,node" should be separate table
2NFNo partial dependenciesOrder item price duplicated from products
3NFNo transitive dependenciesStoring city AND zip code (zip determines city)
Show full SKILL.md (200 more words)Show less
When to Denormalize
  • Read-heavy workloads with rare writes
  • Calculated aggregates (e.g., order totals)
  • Caching frequently accessed derived data

Index Strategy

sql
-- Single column (most common)
CREATE INDEX idx_users_email ON users(email);

-- Composite (for multi-column queries)
-- Order matters! Most selective first
CREATE INDEX idx_orders_user_date ON orders(user_id, created_at);

-- Partial (for filtered queries)
CREATE INDEX idx_active_users ON users(email) WHERE active = true;

-- Unique (enforces constraint)
CREATE UNIQUE INDEX idx_users_email_unique ON users(email);
Index Rules of Thumb
  1. Index columns in WHERE clauses
  2. Index columns in JOIN conditions
  3. Index columns in ORDER BY (if used with WHERE)
  4. Don't over-index write-heavy tables
  5. Consider composite indexes for multi-column queries

Query Optimization Checklist

  1. Use EXPLAIN to analyze query plan
  2. Avoid SELECT * - specify columns
  3. Use LIMIT for pagination
  4. Add indexes for WHERE/JOIN columns
  5. Use WHERE instead of HAVING when possible
  6. Avoid functions on indexed columns in WHERE
  7. Use EXISTS instead of IN for large subqueries

Red Flags to Call Out

FlagQuestion to Ask
Query in a loop"Can we fetch all this data in one query?"
No pagination"What if there are 1 million records?"
SELECT *"Do we need all 50 columns?"
String in query"Is this protected against SQL injection?"
No indexes on foreign keys"How fast are JOINs on this table?"
DROP TABLE in migration"How do we roll this back?"
TEXT for everything"Should this be an INT or DATE instead?"
No foreign key constraints"What prevents orphaned records?"

ORM Best Practices

typescript
// Eager loading (avoid N+1)
const users = await User.findAll({
  include: [{ model: Post, attributes: ['id', 'title'] }]
});

// Select specific fields
const users = await User.findAll({
  attributes: ['id', 'name', 'email']
});

// Pagination
const users = await User.findAll({
  limit: 20,
  offset: (page - 1) * 20
});

// Raw queries for complex operations
const results = await sequelize.query(
  'SELECT ... complex query ...',
  { type: QueryTypes.SELECT }
);

© DanielPodolsky, MIT. 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 .claude/skills/fundamentals/database of DanielPodolsky/ownyourcode.

Open the folder on GitHubat commit bd1f17c

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in DanielPodolsky/ownyourcode, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Database Fundamentals 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 Fundamentals compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Database Fundamentals this skillDanielPodolsky/ownyourcode2901 repos~1.6kAutomated safety check: PassMIT
DB SculptorEliasOulkadi/shokunin114—~3.1kAutomated safety check: NotesMIT
Database Expertcin12211/orca-q224—~2.8kAutomated safety check: PassMIT
Discover Databaserand/cc-polymath181—~2kAutomated safety check: PassMIT
DatabasesMicrock/ordinary-claude-skills404—~1.9kAutomated safety check: NotesMIT
Tsh SQL And Database UnderstandingTheSoftwareHouse/copilot-collections284—~11kAutomated safety check: PassMIT

Similar skills

  • DB Sculptor

    EliasOulkadi/shokunin

    Design database schemas with Prisma/Drizzle, PostgreSQL index strategy (B-tree, GIN, GiST, BRIN, Hash), query optimization (EXPLAIN ANALYZE), migration safety (expand/contract, zero-downtime), and…

    114 GitHub stars~3.1k tokensUpdated 4 days ago
    DatabasesAuto-check: notes
  • Database Expert

    cin12211/orca-q

    Database performance optimization, schema design, query analysis, and connection management across PostgreSQL, MySQL, MongoDB, and SQLite with ORM integration.

    224 GitHub stars~2.8k tokensUpdated 17 days ago
    DatabasesAuto-check passed
  • Discover Database

    rand/cc-polymath

    Automatically discover database skills when working with SQL, PostgreSQL, MongoDB, Redis, database schema design, query optimization, migrations, connection pooling, ORMs, or database selection.

    181 GitHub stars~2k tokensUpdated 7 mo ago
    DatabasesAuto-check passed
  • Databases

    Microck/ordinary-claude-skills

    Work with MongoDB (document database, BSON documents, aggregation pipelines, Atlas cloud) and PostgreSQL (relational database, SQL queries, psql CLI, pgAdmin).

    404 GitHub stars~1.9k tokensUpdated 1 mo ago
    DatabasesAuto-check: notes
  • Tsh SQL And Database Understanding

    TheSoftwareHouse/copilot-collections

    SQL writing and database engineering patterns, standards, and procedures.

    284 GitHub stars~11k tokensUpdated 3 days ago
    DatabasesAuto-check passed
  • Prisma Database Setup

    curvenote/curvenote

    Guides for configuring Prisma with different database providers (PostgreSQL, MySQL, SQLite, MongoDB, etc.).

    170 GitHub starsUsed in 3 repos~1.4k tokens
    DatabasesAuto-check passed

More from DanielPodolsky/ownyourcode

All 19 skills in this repo
  • Accessibility Fundamentals

    DanielPodolsky/ownyourcode

    Reviews accessibility including WCAG, ARIA, keyboard navigation.

    290 GitHub starsUsed in 1 repo~1.8k tokens
    Auto-check passed
  • Backend Fundamentals

    DanielPodolsky/ownyourcode

    Reviews API design, REST conventions, and backend architecture.

    290 GitHub starsUsed in 1 repo~1.1k tokens
    Auto-check passed
  • Documentation Fundamentals

    DanielPodolsky/ownyourcode

    Guides documentation standards including READMEs, JSDoc, and code comments.

    290 GitHub starsUsed in 1 repo~1.8k tokens
    Auto-check passed
  • Error Handling Fundamentals

    DanielPodolsky/ownyourcode

    Guides error handling for async operations and API calls. An agent skill from DanielPodolsky/ownyourcode.

    290 GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed
  • Frontend Fundamentals

    DanielPodolsky/ownyourcode

    Reviews React/Vue component architecture, state, and hooks. An agent skill from DanielPodolsky/ownyourcode.

    290 GitHub starsUsed in 1 repo~874 tokens
    Auto-check passed
  • Performance Fundamentals

    DanielPodolsky/ownyourcode

    Reviews performance including N+1 queries, re-renders, scalability.

    290 GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed

Categories

Questions about Database Fundamentals

What does Database Fundamentals do?

Reviews schema design, SQL queries, ORM patterns. An agent skill from DanielPodolsky/ownyourcode. Database Fundamentals is an agent skill from DanielPodolsky/ownyourcode. Reviews schema design, SQL queries, ORM patterns.

When should I use Database Fundamentals?

Database Fundamentals fits situations like: junior creates schema; adds migrations; works with Prisma/MongoDB/PostgreSQL; asks is this SQL safe.

How do I install Database Fundamentals in Claude Code?

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

How do I install Database Fundamentals in Codex?

Run `npx skills add DanielPodolsky/ownyourcode --skill database-fundamentals -a codex`. Or copy the skill folder (.claude/skills/fundamentals/database in DanielPodolsky/ownyourcode) into .agents/skills/database-fundamentals in your project. Codex loads it when a task matches its description.

Can I use Database Fundamentals 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 DanielPodolsky/ownyourcode --skill database-fundamentals -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-fundamentals, .gemini/skills/database-fundamentals, .github/skills/database-fundamentals and .opencode/skills/database-fundamentals in your project.

What does Database Fundamentals need to run?

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

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

Database Fundamentals 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 Fundamentals use?

About 1.6k tokens (SKILL.md is roughly 6.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 Fundamentals?

Skills that share tags, products or a category with Database Fundamentals: DB Sculptor (EliasOulkadi/shokunin, 114 stars), Database Expert (cin12211/orca-q, 224 stars), Discover Database (rand/cc-polymath, 181 stars) and Databases (Microck/ordinary-claude-skills, 404 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Database Fundamentals?

DanielPodolsky (a GitHub user) maintains it in DanielPodolsky/ownyourcode, which has 290 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on June 27, 2026.

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