- Read the codebase - the codebase is source of truth, and you should prefer reading lots of source code over searching.
- Do not search web unless explicitly asked to do so. Web search does not help in general for our project.
- Write performant code. Always prefer performance over other things.
- Use
ghCLI tool for fetching data fromgithub.com. - Do not let sandbox constraints stall progress. If sandbox restrictions block required work, request escalation promptly and continue.
- Write comments and documentations in English.
- Write documentation for your code.
- Commit your work as frequent as possible using git. Do NOT use
--no-verifyflag. - Prefer multiple small files over single large file.
- Prefer enum (or dedicated type) based modeling over raw string literals whenever possible.
- When creating Atom instances, it's better to use
Cow<str>or&strinstead ofString. Note that&stris better thanCow<str>here.
- Do not guess behavior. Verify assumptions by reading source, fixtures, and tests.
- Debug with logs when behavior is unclear.
- Write sufficient logs for debugging and operational troubleshooting.
- Prefer structured logging in Rust (
tracing) over ad-hoc plain text logs when feasible.
- For shell commands or scripts, prefer
$(...)over legacy backticks for command substitution. - Quote and escape all dynamic shell values strictly.
- Run
git commitonly aftergit add. - Once changes are staged, commit without unnecessary delay so staged history is preserved.
- After addressing pull request review comments and pushing updates, resolve the corresponding review threads.
- Write unit tests for your code.
- Prefer fixture tests over inline (
#[test]) tests. - Before running tests, run
git submodule update --init --recursiveto initialize and update all submodules. - You can do
UPDATE=1 cargo testto get test outputs updated for fixture tests. - When instructed to fix tests, do not remove or modify existing tests.
- Add new coverage by extending existing fixture suites instead of adding ad-hoc inline tests.
- Find the exact fixture harness before adding files with:
rg -n "#\[(testing::)?fixture\(" tests src --glob "*.rs". - Keep each suite's naming conventions (for example: input., output., exec.*, .ans).
- For snapshot-style tests, update expected outputs with
UPDATE=1 cargo test -p ...using the exact crate command documented in each crate's AGENTS.md. - Always rerun the same crate tests without
UPDATEbefore finishing.
- Before finishing a task, always run this baseline locally.
cargo fmt --allcargo clippy --all --all-targets -- -D warnings
- For each touched Rust crate, run crate-level verification locally.
cargo test -p <crate>
- If wasm binding packages are touched, run:
(cd bindings/binding_core_wasm && ./scripts/test.sh)(cd bindings/binding_minifier_wasm && ./scripts/test.sh)(cd bindings/binding_typescript_wasm && ./scripts/test.sh)(cd bindings/binding_es_ast_viewer && ./scripts/test.sh)
- If node bindings or integration paths are touched, run:
(cd packages/core && yarn build:dev && yarn test)
- Do not use unstable, nightly only features of rustc.