docs: add metrics workflow instructions to CLAUDE.md

This commit is contained in:
ZdenekSrotyr 2026-04-10 19:35:33 +02:00
parent 344d744089
commit 0320845e2c

View file

@ -138,6 +138,22 @@ curl -X POST http://localhost:8000/api/sync/trigger
docker compose up
```
## Business Metrics
Standardized metric definitions live in DuckDB (`metric_definitions` table). Import starter pack:
```bash
da metrics import docs/metrics/
```
### For AI agents analyzing data:
Before computing any business metric, look up the canonical definition:
1. `da metrics list` — find the relevant metric
2. `da metrics show revenue/mrr` — read the SQL and business rules
3. Use the SQL from the metric definition, adapt to the specific question
Never invent metric calculations — always use the canonical definitions.
## Extensibility
### Data Sources (extract.duckdb contract)