rationalize-deps
Reduces Rust binary size and compile times by stripping unnecessary crate features.
Install
mkdir -p .claude/skills/rationalize-deps && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/7563" && unzip -o skill.zip -d .claude/skills/rationalize-deps && rm skill.zipInstalls to .claude/skills/rationalize-deps
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Analyze Cargo.toml dependencies and attempt to remove unused features to reduce compile times and binary sizeKey capabilities
- →Analyze Cargo.toml dependencies
- →Identify default features
- →Test compilation with disabled features
- →Binary search for minimal features
- →Verify full build
How it works
The skill identifies unnecessary default features in Cargo dependencies and iteratively tests compilation to find the minimal required feature set.
Inputs & outputs
When to use rationalize-deps
- →Reduce Rust binary size
- →Speed up workspace compilation
- →Clean up unnecessary dependency features
- →Audit crate dependency usage
About this skill
Rationalize Dependencies
This skill analyzes Cargo.toml dependencies to identify and remove unused features.
Overview
Many crates enable features by default that may not be needed. This skill:
- Identifies dependencies with default features enabled
- Tests if
default-features = falseworks - Identifies which specific features are actually needed
- Verifies compilation after changes
Step 1: Identify the target
Ask the user which crate(s) to analyze:
- A specific crate name (e.g., "tokio", "serde")
- A specific workspace member (e.g., "quickwit-search")
- "all" to scan the entire workspace
Step 2: Analyze current dependencies
For the workspace Cargo.toml (quickwit/Cargo.toml), list dependencies that:
- Do NOT have
default-features = false - Have default features that might be unnecessary
Run: cargo tree -p <crate> -f "{p} {f}" --edges features to see what features are actually used.
Step 3: For each candidate dependency
3a: Check the crate's default features
Look up the crate on crates.io or check its Cargo.toml to understand:
- What features are enabled by default
- What each feature provides
Use: cargo metadata --format-version=1 | jq '.packages[] | select(.name == "<crate>") | .features'
3b: Try disabling default features
Modify the dependency in quickwit/Cargo.toml:
From:
some-crate = { version = "1.0" }
To:
some-crate = { version = "1.0", default-features = false }
3c: Run cargo check
Run: cargo check --workspace (or target specific packages for faster feedback)
If compilation fails:
- Read the error messages to identify which features are needed
- Add only the required features explicitly:
some-crate = { version = "1.0", default-features = false, features = ["needed-feature"] } - Re-run cargo check
3d: Binary search for minimal features
If there are many default features, use binary search:
- Start with no features
- If it fails, add half the default features
- Continue until you find the minimal set
Step 4: Document findings
For each dependency analyzed, report:
- Original configuration
- New configuration (if changed)
- Features that were removed
- Any features that are required
Step 5: Verify full build
After all changes, run:
cargo check --workspace --all-targets
cargo test --workspace --no-run
Common Patterns
Serde
Often only needs derive:
serde = { version = "1.0", default-features = false, features = ["derive", "std"] }
Tokio
Identify which runtime features are actually used:
tokio = { version = "1.0", default-features = false, features = ["rt-multi-thread", "macros", "sync"] }
Reqwest
Often doesn't need all TLS backends:
reqwest = { version = "0.11", default-features = false, features = ["rustls-tls", "json"] }
Rollback
If changes cause issues:
git checkout quickwit/Cargo.toml
cargo check --workspace
Tips
- Start with large crates that have many default features (tokio, reqwest, hyper)
- Use
cargo bloat --cratesto identify large dependencies - Check
cargo tree -dfor duplicate dependencies that might indicate feature conflicts - Some features are needed only for tests - consider using
[dev-dependencies]features
When not to use it
- →When the crate requires all default features for core functionality
- →When the project is not a Rust/Cargo project
Prerequisites
Limitations
- →Requires manual verification of build results
- →May require multiple compilation cycles
How it compares
It automates the tedious process of feature pruning and verification, which is typically done manually.
Compared to similar skills
rationalize-deps side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| rationalize-deps (this skill) | 1 | 6mo | Review | Advanced |
| rust-pro | 3 | 26d | No flags | Advanced |
| rust-async-patterns | 11 | 2mo | Review | Intermediate |
| debug-lldb | 1 | 7mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by quickwit-oss
View all by quickwit-oss →You might also like
rust-pro
vudovn
Master Rust 1.75+ with modern async patterns, advanced type system features, and production-ready systems programming. Expert in the latest Rust ecosystem including Tokio, axum, and cutting-edge crates. Use PROACTIVELY for Rust development, performance optimization, or systems programming.
rust-async-patterns
wshobson
Master Rust async programming with Tokio, async traits, error handling, and concurrent patterns. Use when building async Rust applications, implementing concurrent systems, or debugging async code.
debug-lldb
regenrek
Capture and analyze thread backtraces with LLDB/GDB to debug hangs, deadlocks, UI freezes, IPC stalls, or high-CPU loops across any language or project. Use when an app becomes unresponsive, switching contexts stalls, or you need thread stacks to locate lock inversion or blocking calls.
port-c-module
RediSearch
Guide for porting a C module to Rust
organize-modules
r3bl-org
Apply private modules with public re-exports pattern for clean API design. Includes conditional visibility for docs and tests. Use when creating modules, organizing mod.rs files, or before creating commits.
run-rust-benchmarks
RediSearch
Run Rust benchmarks and compare performance with the C implementation