- NEVER use fully qualified paths (e.g.,
std::collections::HashMap::new()). Always add ausedeclaration and reference the type directly. This applies to all Rust code — production, tests, and examples. - Don't capitalize string literal messages in logs, errors,
Option::expect,panic!, etc. - To borrow from an
Arc<T>/Arc<dyn Trait>, usearc.as_ref(), not&*arc. Both compile to the same thing;as_ref()is cleaner.
Always use the /pr skill to create pull requests. It handles branch creation,
title format, description, and confirmation. Check memory for description
formatting preferences before creating PRs.
- Do NOT run the protocol schema check unless explicitly asked. It is expensive.
- When asked to update the schema, first read
tools/protocol-schema-check/README.md, then follow its instructions exactly. Do NOT guess the command.
- To run specific tests, use
cargo test --package {package} --features test_features -- {path::to::test} --exact --show-output. Always use--features test_features. Use--feature nightlyif needed.
- For Rust run
cargo fmtafter making changes. It's cheap. - For Python run
scripts/formatting --fix.
- Only run clippy prior to making a commit. It is somewhat expensive.
- Run exact command
RUSTFLAGS="-D warnings" cargo clippy --all-features --all-targets - Never run clippy on individual packages
Before working in these areas, read the relevant documentation first. Keep these documents up to date when making changes to the corresponding code.
- Dynamic resharding:
docs/architecture/how/dynamic_resharding.md - Sync:
docs/architecture/how/sync.md - Test-loop tests:
test-loop-tests/README.mdfor the framework, and read examples intest-loop-tests/src/examples/for latest API patterns and best practices. - Chain:
chain/chain/AGENTS.md— read before working inchain/chain/. - Runtime:
runtime/runtime/AGENTS.md— read before working inruntime/runtime/.
- Do NOT update the OpenAPI spec unless explicitly asked.
- When asked, follow the
openapi-specrecipe in theJustfile.