Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Data Modeling

ASecurity

Designs the warehouse tables analysts read: grain declared before any column, staging and mart layers kept apart, one home per metric definition, slowly changing dimensions that keep their history, a uniqueness test on every key, and reconciliation against a total somebody already believes. Use when building or refactoring a dbt or SQL transformation, when a join fans out, or when one metric is computed three different ways.

9 stars
0 votes
0 copies
0 views
Added 9/27/2026
ai-agentssqlrefactoringapi

Works with

api

Security Analysis

A100/100

Scanned 9/27/2026

Install to Claude Code

$npx -y skills add khuynh22/agent-dev-team --skill data-modeling --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Data Modeling?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Data Modeling
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/khuynh22-data-modeling/badge)](https://www.skillsdirectory.com/skills/khuynh22-data-modeling)

More formats (shields.io, HTML) on the badges page.

Download with Pro
Files
SKILL.md
---
name: data-modeling
description: Designs the warehouse tables analysts read: grain declared before any column, staging and mart layers kept apart, one home per metric definition, slowly changing dimensions that keep their history, a uniqueness test on every key, and reconciliation against a total somebody already believes. Use when building or refactoring a dbt or SQL transformation, when a join fans out, or when one metric is computed three different ways.
license: MIT
metadata:
  phase: build
  owners: [analytics-engineer, data-engineer]
  version: "0.1.0"
---

# Data Modeling

A model is a claim about shape: one row per this, keyed by that, meaning exactly this. Most
modelling bugs are a grain nobody wrote down, discovered later as a number that is quietly
double what it should be.

Standing reference: `references/data-quality-checklist.md`.

## Process

1. **Declare the grain in the first line of the model.** "One row per subscription per
   billing period." Every column decision follows from it, and the uniqueness test that
   guards it comes free once it is written.

2. **Search for the metric before defining it.** Grep the transformation project, then the
   dashboards. If "active user" already exists, use it or replace it. Forking it produces
   two numbers that both cite the warehouse and disagree in a meeting.

3. **Keep the layers honest.**
   - *Staging*: rename, cast, deduplicate. One staging model per source table. No joins, no
     business logic, because logic here leaks into every consumer that follows.
   - *Intermediate*: the joins and the reshaping, where fan-out is possible and therefore
     tested.
   - *Mart*: what people query, named in their language, documented.

4. **Choose the history behaviour deliberately.** Type 1 overwrites, and silently rewrites
   every historical report that reads the dimension by date. Type 2 keeps a row per version
   with valid-from and valid-to. Pick one, write which, and be able to say why.

5. **Test the key before anything else.** Uniqueness and not-null on the declared grain.
   Then referential integrity on every join key, accepted values on every enum, and a
   not-null on the columns people filter by.

6. **Check fan-out at every join.** Row count before and after, with the expected
   relationship stated. A join that silently multiplies rows is the most common way a
   correct-looking model doubles revenue.

7. **Reconcile against something already believed.** The source table total, the previous
   dashboard, the billing system. Quote both numbers. An unreconciled model is a hypothesis
   with a schedule.

8. **Document the columns that will be misread.** Not all of them: the ones whose name
   promises something the definition does not deliver.

## Metric definitions

One definition, one place, and it includes the denominator and the exclusions. A metric
definition is a contract with everyone who quotes the number, so:

- Write the numerator, the denominator, the time grain, the time zone, and what is excluded:
  internal accounts, bots, refunds, test records.
- Changing a published definition is a breaking change. Version it, announce it, and give
  the old number a name rather than silently rewriting history.
- If two teams need different definitions, they need two names. Never one name and a
  footnote.

## Output

```markdown
## Model: <name>

- **Grain:** one row per <X>
- **Key:** <cols> — uniqueness test result quoted
- **Layer:** staging | intermediate | mart · depends on <models>
- **Metrics defined:** <name> = <numerator> / <denominator>, excluding <list>
- **History:** type 1 | type 2 on <cols>, valid-from/valid-to <cols>
- **Fan-out check:** <n> rows in, <n> rows out, expected <relationship>
- **Reconciled against:** <source> — <both totals>
- **Tests:** <list>, output quoted
```

## Verification

- The uniqueness test on the declared grain ran and passed; quote it.
- Row count and one summed measure reconcile with the source; both numbers quoted.
- Every join key has a referential integrity test.
- The whole project builds, not only the changed model.
- No metric defined here exists elsewhere under a different definition. Say where you looked.

## Red flags

| Thought | Reality |
|---------|---------|
| "The grain is obvious" | Then it costs one line to write, and it prevents the duplicate nobody catches. |
| "I will add my own version of the metric" | Two dashboards now disagree and both cite the warehouse. |
| "The join looked right in the preview" | Twenty rows preview fine and fan out at scale. Test the key. |
| "It matches roughly" | Roughly means it does not match. Find the difference first. |
| "I will just overwrite the dimension" | Every historical report that reads it by date has now changed. |
| "Logic in the dashboard ships faster" | And is invisible to everyone who queries the model instead. |
| "Tests slow the build" | Less than explaining a wrong number to whoever acted on it. |

Attribution

khuynh22khuynh22
View sourceMore from khuynh22 →
SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Related Skills

Caveman

Ultra-compressed communication mode that cuts output tokens while keeping technical accuracy. Levels: lite, full, ultra and the wenyan variants. Use for /caveman, "caveman mode", "talk like caveman", "be brief" or "less tokens".

1074701 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

694821 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3351 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

691 votes

math-skill

A comprehensive mathematical reasoning skill for AI assistants — handles arithmetic to research-level problems with rigorous step-by-step reasoning, systematic verification, and transparent uncertainty handling

381 votes
View all in ai-agents →