一键导入
cargo-check
Run the standard Rust local gate (fmt, clippy -D warnings, build, test). Use before commits/PRs on Rust crates.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run the standard Rust local gate (fmt, clippy -D warnings, build, test). Use before commits/PRs on Rust crates.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Draft or refresh a Hugging Face model card (MODEL_CARD.md / README model section). Use when publishing BitNet/trit/HF checkpoints or training runs.
Run a minimal train/import smoke for ML crates (Rust or Python HF). Use before claiming a training path works.
Prepare code for git commit by running format checks, lints, tests, and generating a commit message. Use before committing changes.
Detect drift from tzervas fleet standards (workflows, badges, issue tiers, Copilot off). Use when auditing a repo or filing fleet-gap issues.
Two-pass pull request review — triage by size/risk, then grounded file:line checklist. Use when reviewing PRs or before merge.
Review Rust unsafe blocks for SAFETY comments (what/why/invariants). Use when writing or reviewing unsafe Rust.
| name | cargo-check |
| description | Run the standard Rust local gate (fmt, clippy -D warnings, build, test). Use before commits/PRs on Rust crates. |
| metadata | {"author":"tz-forge","version":"1.0"} |
| allowed-tools | Bash(cargo:*) Bash(rustup:*) Bash(./scripts/check.sh:*) |
Canonical Rust quality gate used across the fleet.
./scripts/check.sh # full gate
./scripts/check.sh --fix # rustfmt write
./scripts/check.sh --quick # skip build if script supports it
modules/local-ci/rust/check.sh is the tz-forge template for this script.
export CARGO_TERM_COLOR=always
export RUST_BACKTRACE=1
TOOLCHAIN="${RUSTUP_TOOLCHAIN:-stable}"
rustup component add rustfmt clippy --toolchain "$TOOLCHAIN" || true
cargo +"$TOOLCHAIN" fmt --check
cargo +"$TOOLCHAIN" clippy --all-targets --all-features -- -D warnings
cargo +"$TOOLCHAIN" build --all-features
cargo +"$TOOLCHAIN" test --all-features --verbose
cargo deny check # when deny.toml is present (modules/rust/cargo-deny)
| Step | Failure | Action |
|---|---|---|
| fmt | diff | cargo fmt or ./scripts/check.sh --fix |
| clippy | -D warnings | Fix or justify with scoped #[allow] + comment |
| build | compile err | Fix API / features |
| test | assert / panic | Fix code or update tests intentionally |
| deny | license/advisory | Adjust allowlist only with review |
Cargo check
===========
fmt: ✅/❌
clippy: ✅/❌
build: ✅/❌
test: ✅/❌
deny: ✅/❌/skipped
Do not claim "green" unless the commands actually ran successfully in this environment.