model-contract

A planning aid for designing analytical data models, such as fact tables, dimensions, and star schemas, before they are built. It focuses on the level of detail each record should represent and whether the source data can support it.

In plain words
What is it for?
Use it to plan or restructure a data mart or star schema, check the intended detail of a fact table, and identify decisions that need an owner's input.
Why use it?
It prevents a model from being built on an unverified level of detail or on guessed column structures. It also makes structural choices visible before they become costly to change.

Skill for Claude CodeCodex

Part of the analytics-office plugin — 19 skills shipped together

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/debabsah/analytics-office/model-contract
Any agent
npx skills add debabsah/analytics-office --skill model-contract
Clone the repo
git clone --depth 1 https://github.com/debabsah/analytics-office

Made for: Claude Code, Codex.

Or install analytics-office, the plugin that ships this one along with the rest of its 19 skills.

Per session 176 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,814 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.00176 $0.02814
Opus 5 $0.00088 $0.01407
Sonnet 5 $0.00035 $0.00563
Haiku 4.5 $0.00018 $0.00281

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

Security

Grade A, and why

model-contract 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 3d 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/model-contract/SKILL.md · 87 lines

How it starts

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

model-contract

The data architect who won't let you build a star on an unverified grain: designs the model with you, pins every structural fork, gates on the source grain, and hands you a design, not a CREATE TABLE.

When to use

Fire when a dimensional/analytical model is about to be designed or restructured - a fact and its dimensions, a mart, a star schema - and the question is how to STRUCTURE it before it ships. Triggers: "design a data model / star schema", "how should I model this", "what's the grain of my fact table", "model this before we build", "structure these tables". Do NOT fire to pin what a metric MEANS (kpi-contract), to review EXISTING code (review-my-query), or to orient on an estate (groundwork). This designs the model's structure; it does not define a metric, review code, or orient.

The trap this exists to beat

Asked to "design a model," a capable assistant produces a plausible star - then, under deadline, does three wrong things. It jumps to physical DDL with invented column names and types (false precision on data it never saw). It assumes the target grain is achievable without checking whether the SOURCES can deliver it, and when a source's grain is ambiguous it buries the question in a footnote instead of gating on it. And it makes the contestable calls - SCD type, fact vs dimension, conformance - silently. Your value is the moves it skips: declare the target grain out loud, GATE on source-grain before any structure, surface every modelling fork for the owner, and stop at a logical design.

The discipline (rigid order; one fork at a time live, or scripted for prep)

  1. Set the target - the business process / decision the model serves, the questions it must answer, the candidate sources. If a knowledge-base/ exists, read kpi-contract.md (the metrics it must serve - the sharpest anchor), requirements-brief.md, landscape.md / lineage, data-quality.md - and on a redesign, estate-map.md: the existing structure, evidence-graded, where every dashed [unverified] edge is a dependency the new design must not lean on and every island is an unclaimed source to account for.
  2. Declare the target grain - one sentence: "one row per ___." Everything hangs on it.
  3. Gate on source-grain (the blocking move). For each source feeding the fact: what is ITS grain, keys, duplicate / fan-out risk, history behaviour? PUSH until you hear a concrete grain backed by evidence - a sample or profile the user provides, or landscape.md - "it's probably one row per order" is not an answer. Until each source is substantiated or marked [needs decision], do NOT propose structure.
  4. Walk the modelling forks - run references/modelling-forks.md: fact type, measures and additivity, dimensions and which are conformed, SCD type per dimension, degenerate / junk / role-playing dims, late-arriving facts and dims, unknown / NULL members, surrogate vs natural keys. Every fork ends pinned, [needs decision], or "N/A because ___" - a silent skip, or "looks fine" without saying what you checked, is forbidden.
  5. Present each contested fork as a brief - the fork, the stake if it is wrong, the options, your recommendation and why, the default. The OWNER pins it or it is [needs decision]; never a silent default. For a fork with more than four viable options, split the choice, do not drop any.
  6. Lay the star out logically - facts and their dimensions (and a small bus matrix when conformance spans processes). Grain, keys, SCD in words. No DDL, no invented column types.
  7. Set guardrails and version - what the model deliberately does NOT support, known risks, reconciliation with existing conformed dims; version and effective date; on a redesign, what changed and why.
  8. Emit and route - write the design; push open source-grain questions and [needs decision] forks into the KB.

Read the full file on GitHub · 87 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 3d ago First seen · 87 lines · 0 tokens per session scan A 490924b90726

Subscribe to this mod's changes

model-contract is a skill published in the GitHub repository debabsah/analytics-office (9 stars, last pushed 2mo ago), licensed MIT. It adds 176 tokens to every session and 2,814 once invoked, about $0.0009 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-31.

Related

Other skills, from other repositories

dagster-orchestration-adapter

Run the medallion sequence UNATTENDED / in CI as a Dagster asset graph -- the scheduler sibling of the retail-orchestrate conductor -- running ONLY already-approved steps behind every gate, and recording what each asset DID as DERIVED run-evidence. Use when someone asks to schedule the pipeline, run the medallion in…

Kemetra/Seshat-BI · 186 tokens

retail-govern

Run the Seshat BI governance checker and interpret its findings. Use when someone asks to check, validate, or gate Power BI / DAX / TMDL / PBIR / SQL work in the Seshat BI repo, when seshat check reports a rule violation, or when you need to know what a rule id (D8, C2, S2, G1, …) means and where to fix it.…

Kemetra/Seshat-BI · 129 tokens

retail-semantic-check

Compute the Semantic Model Ready (Stage 5) readiness verdict for a committed Power BI PBIP model in the Seshat BI repo. Use after Gold Ready is pass, when someone asks whether the semantic model is ready, to check that every measure binds to an approved metric contract, or before any dashboard/PBIP work. READ-ONLY and…

Kemetra/Seshat-BI · 186 tokens

run-next-readiness

Advance one table by one readiness stage in the Seshat BI repo: run the next required step, then stop. Use when someone asks what is next for a table and to do it. Never self-grants an approval and never marks a stage pass without its evidence.

Kemetra/Seshat-BI · 60 tokens

grain-confidence-reviewer

Surface grain-uniqueness CONFIDENCE as evidence and DIFF two source-map.yaml versions for a Mapping Ready reviewer in the Seshat BI repo. Use when someone asks "is the grain confident?", "what changed in this map?", or is about to review/approve a table's mapping. It READS the already-measured PK-uniqueness signal…

Kemetra/Seshat-BI · 175 tokens

pbi-mcp-write-adapter

APPLY an already-approved Power BI semantic-model change through Microsoft's official Power BI Modeling MCP, behind Seshat's recorded named-human approval -- closing the governed last mile so the change is not applied by hand in Desktop with nothing recorded. Use when someone asks to apply, push, or publish an…

Kemetra/Seshat-BI · 170 tokens