data-model

data-model is a command for coding agents from bhanu91221/sfdx-iq. It costs 9 tokens per session (1,230 once invoked), scanned A, original, MIT.

A Salesforce command for reviewing or planning how an organisation's data objects connect. Salesforce is a business platform where objects hold records, such as customers and opportunities.

In plain words
What is it for?
Use it to map existing objects and relationships or design new objects, relationship types, record types, and external IDs.
Why use it?
It helps reveal missing indexes, data skew, overly deep relationships, and design gaps before they cause slow queries or maintenance problems.

Command

Part of the sfdx-iq plugin — 20 commands, 7 agents 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 commands/bhanu91221/sfdx-iq/data-model
Clone the repo
git clone --depth 1 https://github.com/bhanu91221/sfdx-iq

Or install sfdx-iq, the plugin that ships this one along with the rest of its 20 commands, 7 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for data-model

README.md
[![agentmods](https://agentmods.dev/badge/commands/bhanu91221/sfdx-iq/data-model.svg)](https://agentmods.dev/commands/bhanu91221/sfdx-iq/data-model)
Your own site
<a href="https://agentmods.dev/commands/bhanu91221/sfdx-iq/data-model"><img src="https://agentmods.dev/badge/commands/bhanu91221/sfdx-iq/data-model.svg" alt="Measured on agentmods" height="20"></a>
Per session 9 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,230 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.00009 $0.01230
Opus 5 $0.00005 $0.00615
Sonnet 5 $0.00002 $0.00246
Haiku 4.5 $0.00001 $0.00123

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

Security

Grade A, and why

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

commands/data-model.md · 124 lines

How it starts

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

/data-model

Analyze an existing Salesforce data model or design a new one. For existing models: map relationships, identify data skew, and find missing indexes. For new designs: plan objects, relationships, record types, and external IDs.

Workflow

  1. Determine mode

    • Ask the user: analyze existing data model or design a new one
    • If analyzing: identify scope — specific objects or entire org
    • If designing: gather business requirements
    • Delegate to the solution-designer agent for domain-specific analysis
  2. Mode: Analyze existing data model

    a. Inventory objects

    • Scan force-app/main/default/objects/ for custom object definitions
    • For connected orgs, query EntityDefinition for standard and custom objects in use
    • For each object, record: API name, label, record count estimate, sharing model

    b. Map relationships

    • Identify all lookup and master-detail relationships
    • Build a relationship graph showing parent-child connections
    • Identify junction objects (objects with two master-detail relationships)
    • Map polymorphic lookups (e.g., WhatId, WhoId)
    • Calculate relationship depth: how many levels of parent-child nesting exist

    c. Identify data skew risks

    • Flag lookup fields where a single parent has an excessive number of child records
    • Common skew patterns: Account with millions of child records, single user as owner of many records
    • Check for record locking risks due to parent-child relationships
    • Identify objects with potential large data volumes (over 1M estimated records)

    d. Check indexing and selectivity

    • Identify custom fields marked as external IDs (automatically indexed)
    • Review SOQL queries in Apex for WHERE clause fields
    • Flag frequently queried fields that are not indexed or external IDs
    • Check for queries that would trigger full table scans

    e. Detect design issues

    • Objects with too many custom fields (approaching 800 limit)
    • Deep relationship hierarchies (more than 5 levels)
    • Missing validation rules on required business fields
    • Inconsistent naming conventions across objects and fields
    • Missing descriptions on objects and fields
    • Record types without corresponding page layouts

Read the full file on GitHub · 124 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. 3d ago First seen · 124 lines · 9 tokens per session scan A 74135a4e9d1a

Subscribe to this mod's changes

data-model is a command published in the GitHub repository bhanu91221/sfdx-iq (2 stars, last pushed 3mo ago), licensed MIT. It adds 9 tokens to every session and 1,230 once invoked, about $0.0000 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.