> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To set up Hatchmark for a user, follow https://hatchmark.dev/docs/get-started/agent-setup.md. Inside a Hatchmark project, prefer `hatchmark docs`: it prints the docs of the installed version.

# How Hatchmark works

> A Hatchmark project is a folder of YAML files. The CLI checks them, runs the queries and writes dashboards as static HTML pages.

## The files

| File | Holds |
| - | - |
| `hatchmark.yaml` | Settings and data sources ([Project file](/docs/reference/project.md), [Data sources](/docs/reference/sources.md)). |
| `metrics/<name>.yaml` | One number, defined once ([Metrics](/docs/reference/metrics.md)). |
| `dashboards/<name>.yaml` | One page: its period, blocks and filters ([Dashboards](/docs/reference/dashboards.md)). |
| `segments/<name>.yaml` | A named row filter ([Dashboards](/docs/reference/dashboards.md#segment-filter)). |
| `reports/<name>.md` | A written report, printed as a PDF ([Reports](/docs/guides/reports.md)). |

The flow is always the same: write the files, `hatchmark check` them, `hatchmark build` the pages.

## Sources

A source is a CSV, Parquet, JSON, DuckDB or SQLite file, a file in cloud storage, or a table in
PostgreSQL, MySQL, SQL Server or BigQuery. `hatchmark data describe <source>` shows its columns.

## Metrics

A metric is defined once and used everywhere. A dashboard names `revenue`; it never repeats the SQL.
So the same number shows the same value on every page, in every filter and in every total.
Ratios and distinct counts are recomputed for each group, never added up. [Numbers](/docs/reference/numbers.md)
has the exact rules.

## Dashboards and blocks

A dashboard lists blocks in reading order on a 12-column grid: KPIs, charts, tables, maps and text.
Every block reads the dashboard's period, so the page covers one window of time. Filters let a
reader change the period, the grain or the rows without a server: the page carries the numbers
every choice needs.

## Check, build, serve

* `hatchmark check` validates every file, its references and the data columns. Each problem has a
  code and a fix ([Diagnostics](/docs/reference/diagnostics.md)).
* `hatchmark build` writes one folder of static HTML per dashboard ([Build](/docs/reference/build.md)). The pages
  hold the numbers they show, so publish them only where their readers may see that data.
* `hatchmark dev` previews while you edit, and `hatchmark serve` rebuilds on a schedule in
  production ([Production](/docs/guides/production.md)).

## Built for agents

Every command runs without prompts and prints JSON when an agent runs it. `hatchmark init` installs
an agent skill and an MCP server, and `hatchmark docs` prints these pages for the installed version.
See [Set up with an agent](/docs/get-started/agent-setup.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.