|
xrpld
|
This file provides guidance to AI coding agents (Claude Code, and other AGENTS.md-compatible tools) when working with code in this repository.
For the build steps, CMake options, and protocol codegen commands, see BUILD.md (## Steps, ## Options, ## Code generation). Nix development shells are available in the repo (not required) — see docs/build/nix.md for setup and variants.
Rust crate tests (independent of the CMake build): cargo test --manifest-path crates/Cargo.toml --workspace (CI uses cargo nextest).
The legacy unit tests under src/test/ are a custom framework (derived from Beast, not Boost.Test/GTest/Catch) built into the xrpld binary; see CONTRIBUTING.md for the basic invocation. The gtest suites under src/tests/ build into the separate xrpl_tests and xrpld_tests binaries (run with --gtest_filter=...). Notes not covered there:
See CONTRIBUTING.md for pre-commit setup and CONTRIBUTING.md for clang-tidy (opt-in, needs local clang-tidy and generated headers).
New file placement and header levelization: see CONTRIBUTING.md. Braces, whitespace, member order, and other conventions: see docs/CodingStyle.md. XRPL_ASSERT/UNREACHABLE contracts: see CONTRIBUTING.md. Commit messages: see CONTRIBUTING.md. New public functions/methods need a Doxygen-style comment.
Comments should explain why, not what/_how_ — the code already shows that. Only describe what/how when the code itself would otherwise be confusing (a non-obvious workaround, a subtle invariant, a surprising constraint). Write new or changed comments as full sentences: start with a capital letter and end with a period.
See ARCHITECTURE.md for the directory-by-directory map of the codebase.
When you add or change a convention, or touch a subsystem that has its own AGENTS.md, README.md, or ARCHITECTURE.md, update that documentation in the same change rather than leaving it stale.