node-reth
CLAUDE.md927 starsChanged 13 days agoMITView on GitHub
We split this CLAUDE.md into the rules it gives an agent
26 rules. About 0 are common, 9 are distinctive, and 17 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
17
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Run just to list recipes. docs/guides/TESTING.md explains what just ci, just pr, and each check cover.
- Very specific: line 14
All crate names must use the base- prefix, for example base-enclave or base-builder-core.
- Very specific: line 15
Keep lib.rs files minimal and free of logic.
- Very specific: line 17
Do not declare modules pub or pub(crate) unless they are test utilities, such as pub mod test_utils.
- Distinctive: line 19
Prefer methods on a type, including a unit struct when appropriate, over bare functions so the public API exports types rather than loose …
- Very specific: line 20
Keep binary crates under bin/ as minimal glue code.
- Distinctive: line 25
Put features sections at the bottom of manifests.
- Very specific: line 26
Every crate and binary manifest must inherit workspace lints with [lints] workspace = true.
- Very specific: line 27
Before choosing a new crate's directory, check its dependencies, including dev-dependencies, against etc/scripts/ci/check-crate-deps.sh, …
- Very specific: line 28
Do not enable dependency features in the workspace root Cargo.toml.
- Very specific: line 33
Use #![doc = include_str!("../README.md")] for crate documentation in lib.rs.
- Very specific: line 35
Do not suppress Clippy warnings with #![allow(missing_docs)] or other allow-lints.
- Very specific: line 39
Put all use imports at the top of the file or at the top of a mod block.
- Very specific: line 42
Do not destructure a value merely to read its fields, such as let Self { width, height } = self.
- Distinctive: line 57
Prefer simple call chains over indirection.
- Distinctive: line 74
Use structured tracing with key-value fields for all dynamic data.
- Very specific: line 75
Use % for Display values and ?
- Very specific: line 76
Write info!(block = %block_number, "processed block"), not info!("processed block {block_number}").
- Very specific: line 81
Keep unit tests colocated with their implementation in a #[cfg(test)] mod tests { ...
- Very specific: line 82
Place #[cfg(test)] mod tests { ...
- Distinctive: line 83
Test observable behavior through public APIs.
- Very specific: line 91
Document the specific reason for a hand-rolled fake in its module doc comment.
- Distinctive: line 95
Keep changes scoped; split unrelated refactors and remove code and dependencies your change makes unused.
- Distinctive: line 97
Prefer domain types and named constants over magic strings and numbers.
- Distinctive: line 98
Keep modules and actor loops focused.
- Distinctive: line 99
Document contracts and non-obvious reasons, not code narration or change history.
≈ “Common” is an estimate: at least 1 in 5 of the 25,680 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agent Instructions
Repository Layout
bin/: thin binary crates (node, builder, consensus, basectl, proposer, challenger, prover services, and others).crates/: library crates grouped asbatcher,builder,common,consensus,execution,infra,proof,utilities.acceptance/,actions/,etc/systems/: real-devnet acceptance scenarios, action tests, and system tests.etc/: Docker and Compose files,justmodules, CI and local scripts, upstream pins, and tools.docs/: cross-cutting guides and specs. Crate and binary docs are READMEs next to their source.- Run
justto list recipes. docs/guides/TESTING.md explains whatjust ci,just pr, and each check cover.
Crate Architecture and Public API
- All crate names must use the
base-prefix, for examplebase-enclaveorbase-builder-core. - Keep
lib.rsfiles minimal and free of logic. - Group each module declaration with its re-export (
mod foo; pub use foo::Bar;) instead of listing all modules and then all re-exports. - Do not declare modules
puborpub(crate)unless they are test utilities, such aspub mod test_utils. - Make all structs, types, enums, and functions within modules
pub, and re-export them fromlib.rs. Do not introduce private orpub(crate)types. - Prefer methods on a type, including a unit struct when appropriate, over bare functions so the public API exports types rather than loose functions.
- Keep binary crates under
bin/as minimal glue code. Put meaningful logic in library crates.
Cargo Manifests and Features
- Sort
Cargo.tomldependencies by line length (waterfall style) and preserve the workspace's logical grouping. - Put features sections at the bottom of manifests.
- Every crate and binary manifest must inherit workspace lints with
[lints] workspace = true. - Before choosing a new crate's directory, check its dependencies, including dev-dependencies, against
etc/scripts/ci/check-crate-deps.sh, and run that script before opening a PR. - Do not enable dependency features in the workspace root
Cargo.toml. Enable them only in the crates or binaries that need them to prevent feature leakage intono_stdcrates.
Documentation and Lints
- Docs are READMEs next to the code they describe, plus cross-cutting guides in
docs/guides/. Open every doc with a short paragraph that says what it covers in plain terms, naming the generic concept alongside any codename (for example, "Azul network upgrade"), so a text search finds it. - Use
#![doc = include_str!("../README.md")]for crate documentation inlib.rs; never use//!comments there. - Begin every
mod.rsfile with a//!module doc comment describing its contents. - Do not suppress Clippy warnings with
#![allow(missing_docs)]or other allow-lints. Fix the underlying issue.
Rust Structure and Style
- Put all
useimports at the top of the file or at the top of amodblock. Do not place imports inside functions or closures.- Conditional imports may live inside their
#[cfg(...)]-gated block, such as a#[cfg(test)] mod testsor feature-gated function. - Imports inside
macro_rules!bodies are allowed when the macro needs them in its expansion context.
- Conditional imports may live inside their
- Do not destructure a value merely to read its fields, such as
let Self { width, height } = self. Access fields directly, such asself.widthandself.height.
// Avoid
fn area(&self) -> u32 {
let Self { width, height } = self;
width * height
}
// Prefer
fn area(&self) -> u32 {
self.width * self.height
}- Prefer simple call chains over indirection. Inline methods that perform only one internal operation, and call an inner type directly instead of adding a forwarding method.
// Avoid: a wrapper that just forwards to the inner type
impl Wallet {
fn balance(&self) -> u64 {
self.account.balance()
}
}
let bal = wallet.balance();
// Prefer: call the inner type's method directly
let bal = wallet.account.balance();Tracing
- Use structured tracing with key-value fields for all dynamic data. Keep the message string static.
- Use
%forDisplayvalues and?forDebugvalues. - Write
info!(block = %block_number, "processed block"), notinfo!("processed block {block_number}"). - Write
error!(error = %error, peer = %peer_id, "connection failed"), noterror!("connection to {peer_id} failed: {error}").
Testing
- Keep unit tests colocated with their implementation in a
#[cfg(test)] mod tests { ... }block. Do not create standalonetests.rsmodules for unit tests. - Place
#[cfg(test)] mod tests { ... }at the end of the file, after all non-test code. - Test observable behavior through public APIs. Do not create tautological or change-detector tests that duplicate production logic or assert incidental implementation details.
- Tests should fail for behavior regressions and survive behavior-preserving refactors.
- Interaction assertions are appropriate only when the interaction itself is part of the contract.
- For test doubles of internal traits, default to
#[cfg_attr(test, mockall::automock)]rather than hand-rolling a fake. Seecrates/consensus/service/src/actors/*/client.rs,crates/consensus/service/src/actors/network/gossip.rs,crates/consensus/service/src/follow/local.rs, andcrates/consensus/service/src/follow/source.rs. - Hand-roll a fake only when
automockcannot express the required behavior, such as:- A trait method returns a non-constructible builder type like Alloy's
ProviderCallorEthGetBlock. - The double needs one call log ordered across multiple trait methods.
- Tests must mutate scripted responses while calls are in flight.
- A trait method returns a non-constructible builder type like Alloy's
- Document the specific reason for a hand-rolled fake in its module doc comment. Examples live in
crates/consensus/service/src/test_utils/fake_engine_client.rsandfake_l1.rs.
Recurring Review Expectations
- Keep changes scoped; split unrelated refactors and remove code and dependencies your change makes unused.
- Reuse existing types, APIs, and fixtures; add abstractions or configuration only for concrete supported use cases.
- Prefer domain types and named constants over magic strings and numbers; name values by their meaning and units.
- Keep modules and actor loops focused; put state-specific logic on the type that owns it.
- Document contracts and non-obvious reasons, not code narration or change history; keep docs consistent with behavior.
- Preserve historical fork behavior and parity across execution paths; test both old and new fork behavior.
- Cost hot-path work at its production frequency, not per call. Hot paths and their rates are listed in docs/guides/HOT_PATH_PERFORMANCE_REVIEW.md. Keep allocation, cloning, serialization, I/O, and metric-handle lookups out of per-candidate work, and do not scan pool-sized collections per candidate or rejection.
- Measure default-off features with the feature enabled, and benchmark production code when claiming performance gains.
- Make async lifetimes explicit: bound waits, distinguish retryable from terminal errors, and clean up tasks on failure and shutdown.
Other versions1 project uses a version of this.
Word for word · 1
- base/base★ 927100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository2 other files it gives its agents.
- depot-ciSkill
- verify-baseSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

