model-data-schema

A design procedure for defining a database's stored data and structure from captured external data shapes and user interviews. The resulting schema is treated as a binding contract before test stubs are written.

In plain words
What is it for?
Use it to review external contracts, test recordings, interview notes, and glossary terms; classify the workload; and define a normalized or analytical data model.
Why use it?
It prevents tables and fields from being invented without evidence and helps choose a structure suited to how the data will be written and read.

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/nullhack/temple8/model-data-schema
Any agent
npx skills add nullhack/temple8 --skill model-data-schema
Clone the repo
git clone --depth 1 https://github.com/nullhack/temple8

Made for: Claude Code, Codex.

Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 748 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.00028 $0.00748
Opus 5 $0.00014 $0.00374
Sonnet 5 $0.00006 $0.00150
Haiku 4.5 $0.00003 $0.00075

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

Security

Grade A, and why

model-data-schema 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 yesterday.

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.

.opencode/skills/model-data-schema/SKILL.md · 24 lines

What it actually says

Model Data Schema

  1. Load [[architecture/data-modeling]], [[software-craft/external-fixtures]] — the schema-as-contract rule, OLTP/OLAP selection, workload-driven normalization, and the captured external shapes that bound the model.
  2. Bootstrap the journal. IF .cache/<session_id>/journal.md does not exist THEN render it from .templates/cache/journal.md.template (substitute <session_id>). The journal is the carry-over artifact for build-phase escalations, capture gaps, and the simulation walk; empty until those states write to it. Absence on a first pass is expected — never a deliberation point; the first pass IS the empty-journal pass. IF it exists THEN it carries build-phase escalations from the prior build cycle — read them and model the gaps it names first.
  3. Read .cache/<session_id>/external-contracts.md, tests/cassettes/**, .cache/<session_id>/interview-notes.md, docs/glossary.md.
  4. Classify the workload before naming a table. State, with cited evidence from the interview or the captured exchanges, whether the dominant access pattern is:
    • OLTP — ingest-heavy append-only, per-row writes, point reads; normalise; enforce integrity in constraints.
    • OLAP — read-heavy analytics over large sets, aggregations and filters on named dimensions; model the dimensions and pre-aggregate where a named query pays for it.
    • Hybrid — name the OLTP path and the OLAP path separately and the trade-off that reconciles them.
  5. Author .cache/<session_id>/data-model.md as the schema spec the build-phase developer implements against — NOT a deferral, NOT a sketch. For every table record:
    • its purpose, in one line, traced to a finding in interview-notes.md;
    • every column with its type and the constraint that holds on it (NOT NULL, UNIQUE, CHECK, FK target);
    • every index, paired with the named query pattern that justifies it — an index without a cited query is rejected per [[architecture/data-modeling]] and per the agent's own refusal (data-architect.md);
    • the OLTP/OLAP/hybrid verdict from step 4 and the access patterns it optimises for.
  6. Trace every field to a captured external shape or an interview finding. A field with no trace is either speculative (drop it) or a missing capture (route to needs-capture), never an ungrounded guess baked into the model. Anti-patterns to refuse, named in [[architecture/data-modeling]]: mirroring a code-class shape into a table, premature denormalization, an index without a query, a constraint the spec does not require.
  7. Apply simplicity discipline per [[methodology/simplicity-discipline]]: model the smallest schema that serves the cited access patterns. A table with no query that reads it, a column with no consumer, a normalisation level beyond what the workload needs — each is speculative structure, dropped here, not deferred to build.
  8. IF the model surfaces an important new domain concept THEN add it to the glossary.
  9. IF a captured external shape is ambiguous or insufficient to model against THEN append the gap to .cache/<session_id>/journal.md (service, the missing case) and fire needs-capture. Do NOT invent the shape — the model is grounded in captures, not guesses.
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. yesterday First seen · 24 lines · 28 tokens per session scan A acc86defa32d

Subscribe to this mod's changes

model-data-schema is a skill published in the GitHub repository nullhack/temple8 (11 stars, last pushed 27d ago), licensed MIT. It adds 28 tokens to every session and 748 once invoked, about $0.0001 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.