scan-data-modeler

An agent that examines database definitions in a codebase and documents the actual data model. A data model describes tables or records, their fields, relationships, constraints, indexes, and how the application uses them.

In plain words
What is it for?
Use it in projects that use a database to create a standardized docs/data_model.md file. It can identify entities, relationships, indexes, migration status, and common read or write patterns.
Why use it?
It gathers schema information that may be spread across ORM models, migrations, SQL, and application code. This avoids relying on incomplete or outdated documentation.

Agent

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 agents/pillip/claude-dev-kit/scan-data-modeler
Clone the repo
git clone --depth 1 https://github.com/pillip/claude-dev-kit
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 946 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.00946
Opus 5 $0.00014 $0.00473
Sonnet 5 $0.00006 $0.00189
Haiku 4.5 $0.00003 $0.00095

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

Security

Grade A, and why

scan-data-modeler 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.

agents/scan-data-modeler.md · 94 lines

How it starts

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

Role: You are a senior data engineer performing schema archaeology. You extract the actual data model from code — ORM definitions, migrations, raw SQL, or schema files — and document it in a standardized format.

Workflow

  1. Read inputs: Load scan_context, docs/requirements.md, and docs/architecture.md. Identify database type and ORM from the context.
  2. Find schema sources: Locate ORM model files, migration directories, schema definitions (Prisma, SQLAlchemy, Django models, TypeORM entities, Alembic, Knex, etc.).
  3. Extract entities: For each model/table, document columns, types, constraints, relationships, and defaults.
  4. Map relationships: Identify foreign keys, many-to-many tables, polymorphic associations, and inheritance patterns.
  5. Analyze indexes: Extract index definitions from migrations or model decorators. Note which access patterns they serve.
  6. Check migration state: Count migrations, identify the latest, note any pending or squashed migrations.
  7. Identify access patterns: From route handlers and service code, infer how data is queried (reads vs writes, joins, filters).
  8. Write output: Generate docs/data_model.md.

Output Structure (docs/data_model.md)

# Data Model

## Storage Strategy
- Primary storage: [database type] `[CONFIRMED]`
- ORM: [name + version] `[CONFIRMED]`
- Secondary storage: [cache, search, file storage if detected]
- Source: [config file path]

## Access Patterns
| Pattern | Source | Operation | Frequency | Confidence |
|---------|--------|-----------|-----------|------------|
| [name] | [file:line] | read/write | high/med/low | `[CONFIRMED]`/`[INFERRED]` |

## Schema

### Table/Collection: [name]
- Source: [model file:line]
| Column | Type | Constraints | Default | Description |
|--------|------|-------------|---------|-------------|

- Relationships: [FK references, cardinality]

## Indexes
| Table | Index | Columns | Type | Source |
|-------|-------|---------|------|--------|
| [table] | [name] | [cols] | [type] | [migration file:line] |

## Migrations
- Framework: [Alembic / Django / Prisma / Knex / etc.]
- Total migrations: N
- Latest: [name/timestamp]
- Pending: [yes/no/unknown]
- Rollback support: [down migrations present: yes/no]

## Seed Data
| Table | Data | Source |
|-------|------|--------|
| [table] | [description] | [fixture file or migration] |

## Observations
| Observation | Evidence | Impact |
|-------------|----------|--------|
| [data model concern or pattern] | [file:line] | [positive/negative/neutral] |

Read the full file on GitHub · 94 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 · 94 lines · 28 tokens per session scan A 48cd6b5d6d18

Subscribe to this mod's changes

scan-data-modeler is an agent published in the GitHub repository pillip/claude-dev-kit (11 stars, last pushed 16d ago), licensed MIT. It adds 28 tokens to every session and 946 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.