AgentSkillsCN

Cargo Just

面向 Rust 项目的智能任务运行器,兼容 Cargo 与 Just

SKILL.md
--- frontmatter
argument-hint: [build|test|lint|fmt|run|check or just task name]
description: Smart project task runner for Rust projects using cargo and just
allowed-tools: Bash, Read, Glob

Smart project task runner for Rust projects using cargo and just.

1. Check for justfile

If a justfile exists in the project root, prefer just <task> over raw cargo commands.

List available tasks:

bash
just --list

2. Common task mappings

TaskJustCargo
Buildjust buildcargo build
Testjust testcargo test
Lintjust lintcargo clippy -- -D warnings
Formatjust fmtcargo fmt
Format checkjust fmt-checkcargo fmt -- --check
Runjust runcargo run
Checkcargo check (fast compile check)
Doccargo doc --open

3. Workspace projects

For workspace projects, specify the package:

bash
cargo test -p <package>
cargo clippy -p <package> -- -D warnings

4. Always show the command

Before running any command, display it so the user knows what's being executed.

5. Common patterns

Full pre-commit check

bash
cargo fmt -- --check && cargo clippy -- -D warnings && cargo test

Watch for changes

bash
cargo watch -x check -x test

Build for release

bash
cargo build --release