loom-database-design

loom-database-design is a skill for Claude Code from cosmix/loom. It costs 30 tokens per session (10,122 once invoked), scanned A, original, MIT.

Guidance for designing how application data is organised in databases, including relational, NoSQL, time-series, and data-warehouse systems. It explains how requirements and common queries should shape tables, collections, indexes, and other structures.

In plain words
What is it for?
Use it to plan schemas, entity-relationship diagrams, indexes, migrations, partitioning, and data pipelines. It covers normalised relational databases, star and snowflake warehouse designs, event-sourced systems, and performance tuning.
Why use it?
It helps avoid data models that are hard to query, slow under load, or difficult to change safely. It also distinguishes systems for everyday transactions from those used for reporting and analysis.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: positional $N argument.

Good fit Use it to plan schemas, entity-relationship diagrams, indexes, migrations, partitioning, and data pipelines. It covers normalised relational databases, star and snowflake warehouse designs, event-sourced systems, and performance tuning.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cosmix/loom/loom-database-design
View source ↗ cosmix/loom
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add cosmix/loom --skill loom-database-design
Clone the repo
git clone --depth 1 https://github.com/cosmix/loom

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 loom-database-design

README.md
[![agentmods](https://agentmods.dev/badge/skills/cosmix/loom/loom-database-design/github.svg)](https://agentmods.dev/skills/cosmix/loom/loom-database-design)
Your own site
<a href="https://agentmods.dev/skills/cosmix/loom/loom-database-design"><img src="https://agentmods.dev/badge/skills/cosmix/loom/loom-database-design/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 loom-database-design

Your own site · 80×15
<a href="https://agentmods.dev/skills/cosmix/loom/loom-database-design"><img src="https://agentmods.dev/badge/skills/cosmix/loom/loom-database-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 10,122 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00030 $0.10122
Opus 5.5 $0.00012 $0.04049
Sonnet 5.5 $0.00006 $0.02024
Haiku 4.5 $0.00003 $0.01012

Measured 29d ago against content hash 8303b773b1ba, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

loom-database-design 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 29d 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.

skills/loom-database-design/SKILL.md · 745 lines

How it starts

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

Database Design

Overview

Designing schemas and data models across workloads: OLTP (normalized relational, transactional integrity), OLAP (star/snowflake warehouses), NoSQL (document/KV/wide-column), time-series (TimescaleDB/InfluxDB), event sourcing (append-only stores), and ETL/pipeline staging. Most examples are PostgreSQL; principles generalize. The mechanism-level rules — keys, indexing, concurrency, lock-aware DDL, partitioning — live in Expert Practices below; this section is the design method.

Design Method

1. Requirements → model. Entities, attributes, relationships (1:1 / 1:N / M:N); access patterns (read vs write heavy, hot queries); volume, growth, retention; OLTP vs OLAP. The access pattern, not the entities, drives the physical design.

2. Schema per workload:

  • OLTP: normalize to 3NF (one home per fact), then derive read models. Surrogate vs natural PK (see Keys). FK cascade rules. Correct types + CHECK constraints. Deliberate NULL semantics.
  • OLAP: star schema (fact + denormalized dimensions); snowflake only when a dimension's cardinality/reuse justifies normalizing it. Surrogate dimension keys. SCD Type 1 (overwrite) / Type 2 (row-versioned history) / Type 3 (prior-value column). Fact tables = FKs + additive measures + degenerate dims.
  • Time-series: time as leading PK component; partition by time range; append-only writes; downsample into rollup/continuous-aggregate tables; retention policy that drops old partitions.
  • Event sourcing: immutable append-only events (aggregate_id, event_type, sequence_number, payload, occurred_at); optimistic concurrency via UNIQUE(aggregate_id, sequence_number); projections as derived read models; version the payload for schema evolution; snapshots to bound replay cost.

3. Performance & concurrency, migrations, ETL: these are the highest-defect areas — apply the mechanism rules from Expert Practices: index every child FK column; INCLUDE covering indexes; partial-index literal-match limits; declarative partitioning (never inheritance+triggers); READ COMMITTED anomalies vs SERIALIZABLE+40001 retry; lock-aware DDL (lock_timeout, NOT VALID+VALIDATE, CREATE INDEX CONCURRENTLY); idempotent MERGE/ON CONFLICT upserts with staging tables and audit columns.

Read the full file on GitHub · 745 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. 29d ago Changed · +6 tokens per session 8303b773b1ba
  2. 1mo ago Changed · -33 tokens per session 9cab7a01df65
  3. 1mo ago First seen · 745 lines · 57 tokens per session scan A a2ba5fb35e68

Subscribe to this mod's changes

loom-database-design is a skill published in the GitHub repository cosmix/loom (62 stars, last pushed yesterday), licensed MIT. It adds 30 tokens to every session and 10,122 once invoked, about $0.0001 per session on Opus 5.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-30.

Related

Other skills, from other repositories

domainmodel-dsl

Read, write, and modify Domain Model DSL files (.dmodel) — datatypes, entities with inheritance and multi-valued features, and nested packages with qualified cross-references. Use when the user wants to create, edit, explain, or debug a domain model in this DSL, including resolving references across packages.

TypeFox/agent-skills · 68 tokens

domainmodel-dsl

Work with the Domain Model DSL (.dmodel) for describing data models — datatypes, entities, and their features. Use when the user wants to create or edit a domain model in this DSL.

TypeFox/agent-skills · 45 tokens

basin

Build and troubleshoot Cloudflare Basin analytics workflows with Basin Pipelines, Basin Catalog, and Basin SQL. Use for streaming data into R2 Iceberg tables, managing catalogs, or querying those tables; also use for requests using the former Data Platform, Pipelines, R2 Data Catalog, or R2 SQL names.

cloudflare/skills · 66 tokens

k2

Build and troubleshoot Cloudflare K2 or K2 Streams durable logs. Use for stream setup, producing from Workers or HTTP, configuring retention and inputs, and consuming through subscriptions.

cloudflare/skills · 38 tokens

coverage-tracker

Run a Google Alerts-style keyword coverage tracker. Uses news-search for recent keyword queries, lets the LLM dedupe and classify real features versus junk, stores decisions in SQLite, and alerts only on new real coverage.

elvisun/newsjack · 47 tokens

journalist-fit-check

Gate a pitch against one journalist at a time. Runs the pair through proven media-relations checks (last-10-bylines audit, 90-day topic sweep, beat-vs-angle-vs-one-off, the 5 forms of journalism, source-mirror, stated-preferences, database triangulation) and returns fit, soft-fit, no-fit, or unknown with a real recent…

elvisun/newsjack · 88 tokens