How an agent should behave and operate in this repo.
Use docs in this order:
AGENTS.md(root): map of the repository and where to look next.- Module docs (
README.mdor localAGENTS.md): module behavior and local constraints. docs/*.md: deeper architecture and protocol context.
Each layer has a separate purpose:
CLAUDE.md: agent operating rules for this repository.- Module docs: what must be understood to make a safe change in that module.
docs/: background and deeper design context.
Before writing code:
- Read root
AGENTS.md. - Read docs for every module you will touch.
- Confirm how behavior is validated in tests for that module.
Before opening a contribution:
- Read CONTRIBUTING.md.
- Follow
STYLE.md. - Follow Conventional Commits guidance from
CONTRIBUTING.md. - Read the Developers section in the root
README.md.
- Prefer minimal, local diffs over cross-cutting refactors.
- Preserve current behavior unless the task explicitly asks for behavior changes.
- Do not silently change risk-sensitive defaults (profitability, finality, rebalancing thresholds).
- If a change affects money movement logic, include explicit validation steps.
- Keep docs updated in the same change when behavior changes.
Stop and ask for clarification if any of the following are true:
- The change crosses multiple module boundaries and design intent is unclear.
- You find conflicting patterns across modules and cannot infer the canonical one.
- A module appears to be in active refactor and interfaces are unstable.
- The change modifies signing, transfer, fill, refund, or finalization behavior.
- The right success criteria or test coverage is unclear.
- A behavior-sensitive conclusion depends on assumptions that have not been verified in code paths or tests.
- Before writing a plan, identify any meaningful ambiguities and ask for clarification first.
- For every new task, explicitly propose 0-3 concrete updates to
CLAUDE.mdand/or relevantAGENTS.mdfiles, or state "no updates needed" with a brief reason. - When creating deep-dive docs, include discoverability updates in the same change (relevant
README.mdlinks and, when useful,AGENTS.mdquick index entries). - Default deep-dive docs to cross-module coverage when behavior spans module boundaries; avoid single-file explanations for multi-module flows.
- Default deep-dive docs to a "current behavior first" structure with a concise contributor recommendations section at the end.
After code changes:
- Run targeted checks for edited modules first.
- Run broader tests when shared clients, interfaces, or config parsing is changed:
yarn test. - Lint via
yarn lint-fix. - Report exactly what was run and anything intentionally not run.