Rust Build and Cache Management
Preserve correctness, valid artifacts, and stable configuration before optimizing disk usage. This skill grants no permission to delete files, install tools, or change settings.
Ordinary development
- Respect existing Cargo settings and reuse build directories; do not force incremental compilation off or override debug settings by default.
- Prefer
cargo check for quick feedback, but run project-required builds and tests before claiming completion.
- Never automatically perform a full clean, delete entire target/build directories or Cargo home, or remove unrelated caches. A verified non-deleting preview is allowed; scoped deletion still requires the applicable approval.
Disk pressure or cleanup
Read references/defaults.md for the nine recommended defaults, evidence, and exceptions before choosing settings or cleanup methods. Read references/policy.md for the full safety policy. Read references/inspection.md when determining paths, concurrency, or disk usage.
- Identify the workspace, actual artifact paths, shared users, free space, and growth. Do not assume
./target is the only cache. Optionally run the standalone Rust helper, rust-cache-inspect --path /absolute/verified/target, on explicitly verified paths; it neither resolves Cargo settings nor certifies cleanup safety. See README.md for installation and diagnostic limits. Do not enable updates or install anything without applicable authorization.
- Separate read-only diagnosis from mutation. Produce a plan with exact paths, selection criteria, expected benefit, rebuild cost, and uncertainty.
- Verify that the proposed method supports the installed Cargo version and layout. Preview candidates without deleting. Age alone is insufficient.
- Coordinate all users of affected directories. A process snapshot is not a lock; if concurrent work cannot be excluded safely, stop cleanup.
- Obtain required approval for the exact operation. Apply only the approved scope, recheck safety immediately beforehand, and stop if conditions change.
- Report observed space reclaimed and validation actually performed. Never describe
cargo check as successful linking or test execution.
If paths, ownership, permissions, tool behavior, or concurrency remain uncertain, leave artifacts untouched and report the blocker. Do not install cleanup tools automatically.
Installing this skill for an agent
When the user explicitly asks to register this skill, read references/distribution.md and use the packaged command's agents detect / agents setup --dry-run to preview selected agents, scope, paths and conflicts. Apply only the reviewed selection with explicit consent (--yes for noninteractive use). Preserve existing manual skills and configuration. Never grant project trust, edit provider settings, or install every detected agent by default. File registration is not proof of discovery or instruction adherence. This setup operation is separate from read-only cache diagnosis and grants no permission to delete cache artifacts.
1---2name: rust-cache-management3description: Diagnose Rust build-cache growth and plan safe selective cleanup while preserving Cargo configuration and reusable artifacts. Use for Rust disk pressure, cache cleanup, or repeated-build storage concerns.4metadata:5 source: https://skillmd.com/skills/4mgln/rust-cache-management6---78# Rust Build and Cache Management910Preserve correctness, valid artifacts, and stable configuration before optimizing disk usage. This skill grants no permission to delete files, install tools, or change settings.1112## Ordinary development1314- Respect existing Cargo settings and reuse build directories; do not force incremental compilation off or override debug settings by default.15- Prefer `cargo check` for quick feedback, but run project-required builds and tests before claiming completion.16- Never automatically perform a full clean, delete entire target/build directories or Cargo home, or remove unrelated caches. A verified non-deleting preview is allowed; scoped deletion still requires the applicable approval.1718## Disk pressure or cleanup1920Read [references/defaults.md](references/defaults.md) for the nine recommended defaults, evidence, and exceptions before choosing settings or cleanup methods. Read [references/policy.md](references/policy.md) for the full safety policy. Read [references/inspection.md](references/inspection.md) when determining paths, concurrency, or disk usage.21221. Identify the workspace, actual artifact paths, shared users, free space, and growth. Do not assume `./target` is the only cache. Optionally run the standalone Rust helper, `rust-cache-inspect --path /absolute/verified/target`, on explicitly verified paths; it neither resolves Cargo settings nor certifies cleanup safety. See [README.md](README.md) for installation and diagnostic limits. Do not enable updates or install anything without applicable authorization.232. Separate read-only diagnosis from mutation. Produce a plan with exact paths, selection criteria, expected benefit, rebuild cost, and uncertainty.243. Verify that the proposed method supports the installed Cargo version and layout. Preview candidates without deleting. Age alone is insufficient.254. Coordinate all users of affected directories. A process snapshot is not a lock; if concurrent work cannot be excluded safely, stop cleanup.265. Obtain required approval for the exact operation. Apply only the approved scope, recheck safety immediately beforehand, and stop if conditions change.276. Report observed space reclaimed and validation actually performed. Never describe `cargo check` as successful linking or test execution.2829If paths, ownership, permissions, tool behavior, or concurrency remain uncertain, leave artifacts untouched and report the blocker. Do not install cleanup tools automatically.3031## Installing this skill for an agent3233When the user explicitly asks to register this skill, read [references/distribution.md](references/distribution.md#agent-skill-setup) and use the packaged command's `agents detect` / `agents setup --dry-run` to preview selected agents, scope, paths and conflicts. Apply only the reviewed selection with explicit consent (`--yes` for noninteractive use). Preserve existing manual skills and configuration. Never grant project trust, edit provider settings, or install every detected agent by default. File registration is not proof of discovery or instruction adherence. This setup operation is separate from read-only cache diagnosis and grants no permission to delete cache artifacts.