agentleFS
d-oitd-oit/rust-2026-template/.agents/skills/build-rust/SKILL.md

build-rust

Skill15 starsChanged 5 months agoMITView on GitHub

Compile, test, and verify Rust projects following 2026 best practices. Use when asked to build, compile, or check a Rust project, when CI/CD pipeline needs build steps, or when investigating build failures. Triggers: "build rust", "compile project", "cargo build", "check rust".

  • Installs packages

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When asked to build, compile, or check a Rust project

    line 25
  2. Distinctive:

    When CI/CD pipeline needs to run build steps

    line 26
  3. Distinctive:

    When investigating build failures or warnings

    line 27
  4. Very specific:

    Fix: Ensure target/ is on the Linux filesystem, not Windows mount.

    line 100

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: build-rust

Purpose

Compile, test, and verify Rust projects following 2026 best practices.

Trigger Conditions

  • When asked to build, compile, or check a Rust project
  • When CI/CD pipeline needs to run build steps
  • When investigating build failures or warnings

Prerequisites

  • Rust toolchain installed (see rust-toolchain.toml)
  • cargo available in PATH
  • WSL2 environment (optional but recommended on Windows)

Steps

1. Check (fast feedback)

cargo check --all-targets --all-features 2>&1

2. Build (debug)

cargo build --all-targets 2>&1

3. Build (release)

cargo build --release 2>&1

4. Lint with Clippy

cargo clippy --workspace --all-targets --all-features -- \
  -D warnings \
  -W clippy::pedantic \
  -W clippy::nursery \
  -A clippy::module_name_repetitions

5. Format check

cargo fmt --all -- --check

6. Run tests (with nextest)

cargo nextest run --all-features

7. Doc tests

cargo test --workspace --doc --all-features

8. Report metrics

Call metrics-reporter skill.

Success Criteria

  • cargo check exits 0 with no errors
  • cargo clippy exits 0 with -D warnings
  • cargo fmt --check exits 0
  • All tests pass
  • No unsafe blocks without // SAFETY: comments

Common Issues

Slow incremental builds in WSL2

Symptom: Build takes >30s even for small changes Fix: Ensure target/ is on the Linux filesystem, not Windows mount. See .cargo/config.toml for WSL2 disk optimization.

VS Code reloads during build

Symptom: VS Code refreshes while cargo build runs Fix: Set files.watcherExclude for **/target/** in .vscode/settings.json

Linker errors on WSL2

Symptom: error: linker 'cc' not found Fix: sudo apt-get install build-essential

Rationalizations

RationalizationReality
"cargo build passes, so the code is correct."Build success doesn't mean tests pass or lints are clean. Run the full pipeline.
"I'll skip clippy pedantic lints to save time."Pedantic lints catch real issues. Run them in CI at minimum.
"Just use cargo test, nextest isn't installed."Install nextest for parallel test execution — it's significantly faster.

Red Flags

  • Skipping --all-features in clippy/test commands (hides feature-gated bugs)
  • Using cargo build without --all-targets (misses test/bench compilation errors)
  • Running cargo fmt without --check in CI (format drift goes unnoticed)

Related Skills

  • test-rust - Running the test suite
  • lint-rust - Deep lint analysis
  • release-rust - Creating releases
  • metrics-reporter - Mandatory task completion reporting

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.