data-modeling

A guide to structuring a data warehouse: the system that stores data for analysis. It covers raw data, cleaned data, business-facing tables, and shared definitions for metrics.

In plain words
What is it for?
Use it to design or reorganize warehouse tables, choose the level of detail in a table, model a new data source, or build a shared metrics layer.
Why use it?
It helps prevent business rules from being buried in the wrong layer, where they are hard to change and can produce conflicting results.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/cbrock84/headcount/data-modeling
Any agent
npx skills add cbrock84/headcount --skill data-modeling
Clone the repo
git clone --depth 1 https://github.com/cbrock84/headcount

Made for: Claude Code, Codex.

Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 757 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00077 $0.00757
Opus 5 $0.00039 $0.00378
Sonnet 5 $0.00015 $0.00151
Haiku 4.5 $0.00008 $0.00076

Measured 2d ago against content hash b0534bb8a538, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

data-modeling 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 2d 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.

plugins/data-analytics/skills/data-modeling/SKILL.md · 76 lines

How it starts

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

Data modeling

Layers, and why the middle one matters

Three layers, each with one job:

  1. Raw — source data, append-only, otherwise unmodified. Do not apply business logic on ingest: you cannot recover what you discarded, and the logic will need to change retroactively.

    Privacy and security transformations are the exception, and belong at ingest. Credentials and secrets should never land in the warehouse at all. Personal data that is not needed should be dropped rather than stored and governed later, and identifiers you must keep but rarely need in the clear should be tokenized or encrypted on arrival. Retention and deletion apply from ingest, not from the marts.

    The distinction: strip what you must not hold, keep everything you are entitled to hold, and leave interpretation for later.

  2. Staging — cleaned and conformed: consistent types, standardized names, deduplicated, no business logic yet.

  3. Marts — business-facing models shaped for how questions are asked.

The discipline that pays is keeping business logic out of layers 1 and 2. Logic embedded in ingestion cannot be changed retroactively, and it will need to change.

Grain is the decision everything follows from

State the grain of every table in one sentence: one row per what. "One row per order line per day" is a grain. "Order data" is not.

Most modeling errors are grain errors, and they surface as fan-out — a join multiplying rows so every downstream sum is inflated. If a number is mysteriously too high, check the grain before checking the logic.

Dimensional structure

Facts for events and measurements; dimensions for the things being described. Keep facts narrow and long, dimensions wide and short.

Conform dimensions across facts — one customer dimension, used everywhere. Separate customer tables per domain is how the same customer gets counted differently in two reports.

Handle history deliberately. Overwriting a dimension attribute rewrites the past: last year's revenue silently re-attributes to this year's segment. Decide per attribute whether history matters, and where it does, keep versions with valid-from and valid-to.

Read the full file on GitHub · 76 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. 2d ago First seen · 76 lines · 77 tokens per session scan A b0534bb8a538

Subscribe to this mod's changes

data-modeling is a skill published in the GitHub repository cbrock84/headcount (578 stars, last pushed 3d ago), licensed MIT. It adds 77 tokens to every session and 757 once invoked, about $0.0004 per session on Opus 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

model-compatibility

Model family compatibility matrix covering loaders, resolutions, samplers, CFG, VAE, ControlNet, and LoRA compatibility for SD 1.5, SDXL, Flux, SD3, and video models.

artokun/comfyui-mcp · 47 tokens

comfyui-node-registry

Authoring & publishing ComfyUI custom nodes to the Comfy Registry, covering node structure, pyproject.toml spec, comfy-cli publishing, and CI.

artokun/comfyui-mcp · 38 tokens

performance-analysis

Measurement approaches, profiling patterns, bottleneck identification, and optimization guidance. Use when diagnosing performance issues, establishing baselines, identifying bottlenecks, or planning for scale. Always measure before optimizing.

rsmdt/the-startup · 42 tokens

optimize

Self-contained compound loop: read threadsskilllearnings.log, cluster the misses, propose concrete sub-skill rule edits, and apply them with the user's approval. The fourth step after Plan / Work / Review. Trigger words: 'optimize', 'compound', '優化skill', '自我優化', '閉環'.

akseolabs-seo/AK-Threads-booster · 70 tokens

changelog-detective

Detect what changed in the product by comparing before and after a deploy or date — find new behaviors, new errors, changed user flows, and unexpected side effects that weren't in the release notes. Use after a deploy or when the user suspects something changed but doesn't know what.

reatlat/fullstory-claude-plugin · 60 tokens

repair-orchestrator

5-level repair escalation when quality gates fail. Surgical → Section-rewrite → Stage-rewrite → Full-regen → From-scratch. Hard cap 4 rounds total. Use when quality.json reports overallpassed=false OR reviewer rejects. Last line of defense before declaring an article unsalvageable.

XuanRanL/loamwright-SEO-Skill · 66 tokens