# Tools for agents

Coding agents look things up through the compiler rather than by browsing
folders. Before an agent writes a helper, it reads what already exists;
before it changes something shared, it asks what the change reaches.

- **The library catalogue** (`build/catalogue/libraries.md`): every
  library function with its signature, `///` description and callers, and
  every library constant with its type, value, description and readers
  ([Logic](logic.md)). An agent reads it before writing a helper or a
  constant.
- **The similar-helper check**: when a new helper looks like an existing
  one, `jadpo check` reports `library.similar_exists` and names it. Two
  constants of the same type holding the same value are
  `constant.similar_exists` ([Two constants holding one
  value](03-logic.md#two-constants-holding-one-value)). Both are errors
  you can decline, not warnings: make the fix, or write a
  `decline <rule>: "<reason>"` line above the declaration ([Declining a
  judgement call](01-project-layout-and-modules.md#declining-a-judgement-call)).
- **The failure catalogue** (`build/catalogue/failures.md`): every failure
  with its code, kind, status and client fields.
- **The schema and query reports** (`build/report/`): every table, column
  and index with the query that needed it, and each query call's store,
  row bound and query count.
- **`jadpo impact <name>`**: what a change to a declaration reaches.

```text
$ jadpo impact rounding.half_even
rounding.half_even   shared/libraries/rounding.jadpo:4
  called from   ordering (3 calls), payments (1 call)
  entry points  POST /orders, POST /payments/refunds, schedule nightly_invoices
  tests         ordering/actions/place_order.test.jadpo, payments/actions/refund.test.jadpo
  public        no
```

- **`jadpo domain rename`, `split` and `merge`**: move files and update
  every call. A new or renamed domain appears in the approval review
  ([Project layout and modules](project-layout-and-modules.md)).
- **The Jadpo agent skill** (`skills/jadpo-agent/SKILL.md`): tells an agent
  to run `jadpo check --json` after edits, read the catalogues before
  adding code, and run `jadpo impact <name>` before changing or removing
  anything shared or public. It points at these pages for syntax.
  - It gives the routine for agents working in parallel workspaces: before
    pushing, merge `main`, run `jadpo check` (it builds nothing), fix any
    clash, then push. Private functions and types need only be unique
    within their domain, so two domains' helpers don't clash. A name
    another agent took in the same domain, or across the project, does.
  - It gives the rule for a fixed value: if a deployment could ever need a
    different value it is a setting in `config.jadpo`, otherwise a
    `constant` ([A constant or a setting](constants.md#a-constant-or-a-setting)).
    Never both, so a `default:` never names a constant. A constant that
    turns out to need a value per deployment is moved with
    `jadpo config move <constant>`, not by hand.
- **Generated CI runs `jadpo check` first**, so a name clash or any other
  check error fails in seconds, before tests or a build. No page says yet
  what generates a project's CI (`jadpo new` creates none); whatever does
  must follow this.

Not built yet: the schema and query reports, `jadpo impact`, the
`jadpo domain` commands, the agent skill and generated CI. The
catalogues and the similar-helper check are built.
