dex AGENTS.md

Repository instructions for dex, an analytics engineering toolkit that helps coding agents explore databases and maintain dbt projects. dbt is a tool for building tested, documented data models with SQL.

In plain words
What is it for?
Use them to map a warehouse or DuckDB database, create dbt models and metrics, and find schema, data-volume, or definition changes over time.
Why use it?
They provide the commands and rules for examining unfamiliar data, changing models, and detecting differences between the database and the project.

Instructions file for CodexOpenCode

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 instructions/exmergo/dex/agents-md
Clone the repo
git clone --depth 1 https://github.com/exmergo/dex

Made for: Codex, OpenCode.

Per session 9,733 This file is loaded in full into every session.
When invoked 9,733 The same file — it is already loaded in full.
Security scan C 2 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.09733 $0.09733
Opus 5 $0.04866 $0.04866
Sonnet 5 $0.01947 $0.01947
Haiku 4.5 $0.00973 $0.00973

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

Security

Grade C, and why

dex AGENTS.md scanned grade C with 2 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.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

(`curl -LsSf https://astral.sh/uv/install.sh | sh`, or `brew install uv`, or

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

(`curl -LsSf https://astral.sh/uv/install.sh | sh`, or `brew install uv`, or
AGENTS.md · 252 lines

How it starts

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

dex: driving the engine from any agent

dex is the agent-native analytics engineering toolkit. All logic lives in one portable engine, exmergo-dex-core; this file tells any coding agent how to drive it. On Claude Code the three skills (explore, transform, maintain) auto-trigger and do this for you. On other agents, follow the contract below directly. The guardrails and outputs are identical because they live in the engine, not here.

The loop: Explore, Transform, Maintain (ETM)

  1. Explore an unfamiliar warehouse or DuckDB database: rank what matters, profile selectively, infer joins, persist a draft map.
  2. Transform the dbt project: author and refactor dbt SQL models (staging to marts) with tests and docs, and author the semantic layer on top (entities, dimensions, measures, metrics) as dbt semantic models (MetricFlow YAML). Both are the same job, reviewable diffs to the dbt project.
  3. Maintain the project as the world changes: diff the current warehouse and dbt against the last .dex/ snapshot, surface schema, volume, grain, and definition drift, and propose the reconciling edits.

The command contract

The engine exposes one small, stable command surface. Run a subcommand, read the single JSON envelope it prints to stdout, decide the next step. State persists in .dex/, so subcommands are stateless and you orchestrate multi-step flows.

uv run python -m exmergo_dex_core <subcommand> [flags]
# or, with the pinned wrapper a skill ships:
uv run scripts/run.py <subcommand> [flags]

Both forms need uv on PATH: it is what installs and runs the engine, and no agent host installs it for you. Without it the shell reports uv: command not found, and the shipped wrapper run directly refuses with an error envelope (reason: prerequisite) naming the fix. The install is one line (curl -LsSf https://astral.sh/uv/install.sh | sh, or brew install uv, or pipx install uv); relay it to the user rather than reaching for another way to do the work, since every guardrail below lives in the engine.

Read the full file on GitHub · 252 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 · 252 lines · 9,733 tokens per session scan C 55df74174c97

Subscribe to this mod's changes

dex AGENTS.md is an instructions file published in the GitHub repository exmergo/dex (24 stars, last pushed 3d ago), licensed Apache-2.0. It adds 9,733 tokens to every session, about $0.0487 per session on Opus 5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.