Compare commits

...

7 Commits

Author SHA1 Message Date
Mayukha Vadari
09d7e75686 Merge branch 'develop' into mvadari/ai-setup 2026-08-25 16:56:04 -04:00
Mayukha Vadari
502bc13a9a docs: Drop duplicated nix devshell variant list from AGENTS.md
Point to docs/build/nix.md instead, consistent with the other doc pointers.
2026-08-25 16:52:51 -04:00
Mayukha Vadari
65e7a6c14c docs: Address review feedback on AGENTS.md
Point Build/Testing/Lint/Code Style sections at BUILD.md,
CONTRIBUTING.md, and docs/CodingStyle.md instead of duplicating them
(the duplicated 80-char line length was already stale vs. the 100-char
clang-format limit). Require Nix on Linux/macOS, add gtest-in-src/tests
guidance for new tests, note amendment retirement in tx/AGENTS.md, drop
the CLAUDE.md-symlink/CONTRIBUTING.md sentences, and drop the
unconfirmed .aider.* gitignore entries.
2026-08-25 16:34:29 -04:00
Mayukha Vadari
df31ff54e6 docs: Add tx/rpc AGENTS.md files and symlink convention
Documents the amendment workflow (features.macro) under src/libxrpl/tx
and the API-CHANGELOG.md requirement under src/xrpld/rpc. Also makes
it an explicit rule in CONTRIBUTING.md that any new AGENTS.md gets a
CLAUDE.md symlink alongside it.
2026-08-20 13:10:45 -04:00
Mayukha Vadari
cf4f627b33 docs: Correct xrpld unittest invocation in AGENTS.md 2026-08-20 12:57:06 -04:00
Mayukha Vadari
3e2e1d58d6 docs: Reflow paragraphs to single lines 2026-08-20 12:28:46 -04:00
Mayukha Vadari
79dcb83d5e docs: Add AGENTS.md/CLAUDE.md for AI coding agent guidance
Adds shared build/test/lint/architecture guidance for AI coding agents,
with CLAUDE.md symlinked to AGENTS.md for Claude Code. Updates
.gitignore so only personal/local AI-tool config is excluded, and
documents the shared vs. local convention in CONTRIBUTING.md.
2026-08-20 12:21:04 -04:00
8 changed files with 68 additions and 2 deletions

9
.gitignore vendored
View File

@@ -72,11 +72,16 @@ DerivedData
/.zed/
# AI tools.
# Shared/committable AI agent config (AGENTS.md, CLAUDE.md, GEMINI.md, .claude/settings.json,
# tool-specific rules files, etc.) should be checked in — see CONTRIBUTING.md. Only the
# personal/local variants below are ignored.
/.agent
/.agents
/.augment
/.claude
/CLAUDE.md
/.claude/settings.local.json
AGENTS.local.md
CLAUDE.local.md
GEMINI.local.md
# Python
__pycache__

42
AGENTS.md Normal file
View File

@@ -0,0 +1,42 @@
# AGENTS.md
This file provides guidance to AI coding agents (Claude Code, and other AGENTS.md-compatible tools) when working with code in this repository.
## Build
Required on Linux/macOS: use the Nix devshell, which sets up the compiler, Conan, ccache, and (optionally) Rust automatically.
```bash
nix develop
```
For alternate devshell variants (specific compiler, no-compiler, coverage), see [docs/build/nix.md](./docs/build/nix.md). For the manual build steps, CMake options, and protocol codegen commands, see [BUILD.md](./BUILD.md) (`## Steps`, `## Options`, `## Code generation`).
Rust crate tests (independent of the CMake build): `cargo test --manifest-path crates/Cargo.toml --workspace` (CI uses `cargo nextest`).
## Testing
Unit tests are a custom framework built into the `xrpld` binary itself (not Boost.Test/GTest/Catch); see [CONTRIBUTING.md](./CONTRIBUTING.md#unit-tests) for the basic invocation. Notes not covered there:
- A suite's `--unittest` name is built from the arguments to its `BEAST_DEFINE_TESTSUITE`/`BEAST_DEFINE_TESTSUITE_PRIO` macro (usually at the bottom of the test file), in reverse order and joined with `.`: `BEAST_DEFINE_TESTSUITE(Credentials, app, xrpl)``xrpl.app.Credentials`.
- `--unittest-arg` does nothing — don't use it.
- Tests that run offline in under a minute should be automatic `--unittest` suites; anything else is a manual/integration test.
- New tests should be written using `gtest` under `src/tests/` unless that isn't possible, in which case fall back to the legacy Beast framework under `src/test/`. `tests/` (top-level) holds integration tests exercised against `libxrpl`/`xrpld`.
## Lint/Format
See [CONTRIBUTING.md](./CONTRIBUTING.md#pre-commit-hooks) for `pre-commit` setup and [CONTRIBUTING.md](./CONTRIBUTING.md#clang-tidy) for `clang-tidy` (opt-in, needs local `clang-tidy` and generated headers).
## Code Style
New file placement and header levelization: see [CONTRIBUTING.md](./CONTRIBUTING.md#before-making-a-pull-request). Braces, whitespace, member order, and other conventions: see [docs/CodingStyle.md](./docs/CodingStyle.md). `XRPL_ASSERT`/`UNREACHABLE` contracts: see [CONTRIBUTING.md](./CONTRIBUTING.md#contracts-and-instrumentation). Commit messages: see [CONTRIBUTING.md](./CONTRIBUTING.md#good-commit-messages).
## Architecture
Paths below reflect the current layout; update this section if modularization moves a subsystem to a different directory.
- `include/xrpl/` + `src/libxrpl/` — the core protocol library: ledger, shamap, consensus, crypto, json, resource, nodestore, rdb, peerfinder, and `tx/` (transaction application: `Transactor.cpp`, `applySteps.cpp`, invariants, payment paths). `tx/transactors/` has one file per transaction type, grouped by subsystem: `escrow/`, `vault/`, `lending/`, `sponsor/`, `nft/`, `token/` (MPT), `payment_channel/`, `permissioned_domain/`, `dex/`, `oracle/`, `did/`, `credentials/`, `bridge/`, `check/`, `delegate/`, `account/`, `system/`. Any change to transaction-processing behavior must be gated behind an Amendment.
- `src/xrpld/` — the server application built on top of `libxrpl`: `app`, `core`, `overlay` (P2P networking), `peerfinder`, `perflog`, `rpc`, `shamap`. `main` builds an `ApplicationImp` implementing `Application`; most components hold a reference to it (`app_`), giving broad cross-component access — expect to trace call chains through `Application&`.
- `src/test/` — unit tests mirroring the subsystems above, plus `jtx/` (the transaction-building test DSL — e.g. `jtx/escrow.h`, `jtx/vault.h`, `jtx/sponsor.h`, `jtx/permissioned_dex.h`) and `unit_test/` (the custom test framework itself, derived from Beast).
- `src/tests/` — a second, separate tree of integration-style tests for `libxrpl`.
- `crates/` — a Rust workspace (only built with `-Dxrpld -Drust=ON`) bridged into C++ via `cxxbridge`/the `cxx` crate; currently just a `hello_world` interop scaffold. Requires the Rust toolchain pinned in `rust-toolchain.toml` (the Nix devshell provides it automatically).

1
CLAUDE.md Symbolic link
View File

@@ -0,0 +1 @@
AGENTS.md

View File

@@ -59,6 +59,12 @@ to an existing XLS. Neither change will be released (in an amendment's
case, marked as `Supported::yes`) until the corresponding XLS's status
is `Final`.
## AI coding agents
[`AGENTS.md`](./AGENTS.md) (and its `CLAUDE.md` symlink, for Claude Code) holds shared, checked-in guidance for AI coding agents working in this repository — build/test/lint commands and architecture notes. Additional `AGENTS.md` files may exist in subdirectories to give agents context specific to that part of the codebase; whenever you add one, also add a `CLAUDE.md` symlink pointing to it (`ln -s AGENTS.md CLAUDE.md`) so Claude Code picks it up too.
If you want to give an agent personal instructions that shouldn't be shared with other contributors (e.g. your own workflow preferences), put them in `AGENTS.local.md` or `CLAUDE.local.md` instead — those are gitignored. Likewise, `.claude/settings.local.json` is for personal, untracked Claude Code settings, while `.claude/settings.json` is shared.
## Before making a pull request
(Or marking a draft pull request as ready.)

5
src/libxrpl/tx/AGENTS.md Normal file
View File

@@ -0,0 +1,5 @@
# AGENTS.md — tx
See the repo-level [AGENTS.md](../../../AGENTS.md) for general build/test/style guidance.
Any change to transaction-processing behavior must be gated behind an amendment. New amendments (and fixes, i.e. `fix*` amendments) are added to [`include/xrpl/protocol/detail/features.macro`](../../../include/xrpl/protocol/detail/features.macro), as an `XRPL_FEATURE(...)` or `XRPL_FIX(...)` entry added to the top of the list (the list is kept in reverse chronological order). Once the pre-amendment code path for a retired amendment is removed, move its entry to `XRPL_RETIRE_FEATURE(...)`/`XRPL_RETIRE_FIX(...)` instead of deleting it.

1
src/libxrpl/tx/CLAUDE.md Symbolic link
View File

@@ -0,0 +1 @@
AGENTS.md

5
src/xrpld/rpc/AGENTS.md Normal file
View File

@@ -0,0 +1,5 @@
# AGENTS.md — rpc
See the repo-level [AGENTS.md](../../../AGENTS.md) for general build/test/style guidance.
Any change to a public RPC method's behavior (new/changed/removed fields, parameters, or error conditions) needs a corresponding entry in [`API-CHANGELOG.md`](../../../API-CHANGELOG.md), under the `## Unreleased` section (`### Additions`, `### Deprecations`, etc. as appropriate).

1
src/xrpld/rpc/CLAUDE.md Symbolic link
View File

@@ -0,0 +1 @@
AGENTS.md