Agent skill
build-compile
Build Rust code with proper error handling and optimization for development, testing, and production. Use when compiling the self-learning memory project or troubleshooting build errors.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/build-compile
SKILL.md
Build and Compile
Build Rust code with proper error handling and optimization.
Build Commands
| Build Type | Command | Purpose |
|---|---|---|
| Development | cargo build |
Fast compile, debug symbols |
| Release | cargo build --release |
Optimized for production |
| Check | cargo check |
Fast type check only |
Build Profiles
[profile.dev]
opt-level = 0
debug = true
[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1
strip = true
Common Errors
Type Errors
error[E0308]: mismatched types
Fix: Ensure return types match
Lifetime Errors
error[E0597]: value does not live long enough
Fix: Clone data or return owned type
Trait Bound Errors
error[E0277]: trait bound `X: Send` not satisfied
Fix: Use Send-safe types (Arc<Mutex<T>>)
Async Errors
error: await only allowed in async functions
Fix: Make function async
Speed Up Builds
# Incremental
export CARGO_INCREMENTAL=1
# Clean rebuild
cargo clean && cargo build --all
# Parallel jobs
cargo build -j 8
Optimization Tips
- LTO:
lto = "fat"in release - Codegen units:
codegen-units = 1 - Profile:
cargo build --timings
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?