How to handle with just commands
#4324
|
To reduce the Hallucination of AI, it's recommended to use script to run the static check rather than asking AI to run commands one by one following the rules defined in AGENTS.md. So I write a lot of commands in justfile, like: rsc:
cargo clippy -D --warnings
cargo fmt --check
cargo test
# many other commandsand in AGENTS.md, the rule is |
Replies: 1 comment 1 reply
|
Short answer: The best approach is to call rtk directly inside your justfile recipe rather than wrapping the outer just command.
Code snippet Now AGENTS.md still instructs the agent to run just rsc, but you get the full rtk token-saving summarization for every step. (Quick note on your clippy line: cargo clippy -D --warnings is invalid syntax because -D expects a warning group like warnings. Use rtk cargo clippy -- -D warnings or CARGO_BUILD_WARNINGS=deny cargo clippy instead). |
Short answer: The best approach is to call rtk directly inside your justfile recipe rather than wrapping the outer just command.
Why just rsc loses rtk benefits
rtk treats just as a generic command—it only applies a basic text truncation filter (max_lines = 50) rather than running native, smart summarizers for cargo test or clippy. As a result, important test failure details get cut off.
The Fix: Put rtk inside the justfile
Update your justfile so each individual command runs through its own native rtk filter:
Code snippet
Now AGENTS.md still instructs the agent to run just rsc, but you get the full rtk…