Skip to content
Not released yet: version 0.1 is being built. See what works today.

Built for agents

The people who run Metrics Book set it up, change it and use it mostly through an agent. So every command, file and API is built for an agent first and a person second.

Everything that defines a project is a file in git: pipelines, dbt models, metrics, terms, reports, access policy, budgets and the brand. A command is a faster way to edit those files, and mb check guards both routes. An agent that edits a file by hand and an agent that runs a command end up in the same place, checked by the same rules.

No command stops to ask a question. Each one finishes on its own and exits with one of three codes:

Exit code Means
0 done
1 refused, or a check failed
2 used wrongly: flags that conflict, or no project to run in

Every command takes --json and then prints one JSON document to stdout and nothing else. The shape is the same for every command: what it changed, every check it ran with the measured value, and every refusal. Output describes each field.

A refusal carries a stable code, the field it is about, the measured value, the rule it broke and a suggestion that would pass. Here mb brand name refuses a name that is too long:

{
"code": "name_length",
"field": "brand.name",
"value": "45 characters",
"rule": "1 to 40 characters",
"suggestion": "Northwind Outdoor Group Sales and Margin"
}

The agent reads the suggestion and tries again, without asking anyone. Codes never change silently: refusal codes lists every one, and a test fails when that list and the code differ.

A change that touches several files writes all of them or none. --dry-run runs the whole change on a copy and shows it as a diff, so an agent can check what would happen before it happens.

Each feature is described in two places an agent reads anyway: the managed block of the project’s AGENTS.md, and mb <command> --help. mb --help --json lists every command, flag and refusal code in one document.

The same rules for Claude Code, Codex and Cursor

Section titled “The same rules for Claude Code, Codex and Cursor”

A project made by mb init carries the instructions and settings for Claude Code, Codex and Cursor. All three read the same AGENTS.md; there is no CLAUDE.md. The agent proposes changes as pull requests, and a person merges them.