Agent skill
test-optimization
Advanced test optimization with cargo-nextest, property testing, and performance benchmarking. Use when optimizing test execution speed, implementing property-based tests, or analyzing test performance.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/test-optimization
SKILL.md
Test Optimization
Advanced test optimization with cargo-nextest, property testing, and benchmarking.
cargo-nextest Integration
# Install
cargo install cargo-nextest --locked
# Run all tests
cargo nextest run
# CI profile (with retries)
cargo nextest run --profile ci
Configuration (.config/nextest.toml)
[profile.default]
slow-timeout = { period = "30s", terminate-after = 3 }
[profile.ci]
retries = 2
fail-fast = false
test-threads = 4
Property-Based Testing (proptest)
proptest! {
#[test]
fn test_episode_id_uniqueness(
tasks in prop::collection::vec(any::<String>(), 1..100)
) {
let rt = tokio::runtime::Runtime::new().unwrap();
rt.block_on(async {
let memory = setup_memory().await;
let mut ids = HashSet::new();
for desc in tasks {
let id = memory.start_episode(desc, ctx, type_).await;
prop_assert!(ids.insert(id));
}
});
}
}
Performance Targets
| Operation | Target | Actual |
|---|---|---|
| Episode Creation | < 50ms | ~2.5 µs |
| Step Logging | < 20ms | ~1.1 µs |
| Pattern Extraction | < 1000ms | ~10.4 µs |
| Memory Retrieval | < 100ms | ~721 µs |
Best Practices
- Use nextest profiles for dev/CI separation
- Implement property tests for edge cases
- Monitor test duration
- Track coverage trends
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?