PluginBench
Skill
Review
Audit score 70

m11-ecosystem

zhanghandong/rust-skills

How to install m11-ecosystem

npx skills add https://github.com/zhanghandong/rust-skills --skill m11-ecosystem
Claude Code
Cursor
Windsurf
Cline
Full instructions (SKILL.md)

Source of truth, from zhanghandong/rust-skills.


name: m11-ecosystem description: "Use when integrating crates or ecosystem questions. Keywords: E0425, E0433, E0603, crate, cargo, dependency, feature flag, workspace, which crate to use, using external C libraries, creating Python extensions, PyO3, wasm, WebAssembly, bindgen, cbindgen, napi-rs, cannot find, private, crate recommendation, best crate for, Cargo.toml, features, crate 推荐, 依赖管理, 特性标志, 工作空间, Python 绑定" user-invocable: false

Current Dependencies (Auto-Injected)

!grep -A 100 '^\[dependencies\]' Cargo.toml 2>/dev/null | head -30 || echo "No Cargo.toml found"


Ecosystem Integration

Layer 2: Design Choices

Core Question

What's the right crate for this job, and how should it integrate?

Before adding dependencies:

  • Is there a standard solution?
  • What's the maintenance status?
  • What's the API stability?

Integration Decision → Implementation

NeedChoiceCrates
SerializationDerive-basedserde, serde_json
Async runtimetokio or async-stdtokio (most popular)
HTTP clientErgonomicreqwest
HTTP serverModernaxum, actix-web
DatabaseSQL or ORMsqlx, diesel
CLI parsingDerive-basedclap
Error handlingApp vs libanyhow, thiserror
LoggingFacadetracing, log

Thinking Prompt

Before adding a dependency:

  1. Is it well-maintained?

    • Recent commits?
    • Active issue response?
    • Breaking changes frequency?
  2. What's the scope?

    • Do you need the full crate or just a feature?
    • Can feature flags reduce bloat?
  3. How does it integrate?

    • Trait-based or concrete types?
    • Sync or async?
    • What bounds does it require?

Trace Up ↑

To domain constraints (Layer 3):

"Which HTTP framework should I use?"
    ↑ Ask: What are the performance requirements?
    ↑ Check: domain-web (latency, throughput needs)
    ↑ Check: Team expertise (familiarity with framework)
QuestionTrace ToAsk
Framework choicedomain-*What constraints matter?
Library vs builddomain-*What's the deployment model?
API designdomain-*Who are the consumers?

Trace Down ↓

To implementation (Layer 1):

"Integrate external crate"
    ↓ m04-zero-cost: Trait bounds and generics
    ↓ m06-error-handling: Error type compatibility

"FFI integration"
    ↓ unsafe-checker: Safety requirements
    ↓ m12-lifecycle: Resource cleanup

Quick Reference

Language Interop

IntegrationCrate/ToolUse Case
C/C++ → RustbindgenAuto-generate bindings
Rust → CcbindgenExport C headers
Python ↔ Rustpyo3Python extensions
Node.js ↔ Rustnapi-rsNode addons
WebAssemblywasm-bindgenBrowser/WASI

Cargo Features

FeaturePurpose
[features]Optional functionality
default = [...]Default features
feature = "serde"Conditional deps
[workspace]Multi-crate projects

Error Code Reference

ErrorCauseFix
E0433Can't find crateAdd to Cargo.toml
E0603Private itemCheck crate docs
Feature not enabledOptional featureEnable in features
Version conflictIncompatible depscargo update or pin
Duplicate typesDifferent crate versionsUnify in workspace

Crate Selection Criteria

CriterionGood SignWarning Sign
MaintenanceRecent commitsYears inactive
CommunityActive issues/PRsNo response
DocumentationExamples, API docsMinimal docs
StabilitySemantic versioningFrequent breaking
DependenciesMinimal, well-knownHeavy, obscure

Anti-Patterns

Anti-PatternWhy BadBetter
extern crateOutdated (2018+)Just use
#[macro_use]Global pollutionExplicit import
Wildcard deps *UnpredictableSpecific versions
Too many depsSupply chain riskEvaluate necessity
Vendoring everythingMaintenance burdenTrust crates.io

Related Skills

WhenSee
Error type designm06-error-handling
Trait integrationm04-zero-cost
FFI safetyunsafe-checker
Resource managementm12-lifecycle

Related skills

More from zhanghandong/rust-skills and the wider catalog.

M1

m15-anti-pattern

zhanghandong/rust-skills

Use when reviewing code for anti-patterns. Keywords: anti-pattern, common mistake, pitfall, code smell, bad practice, code review, is this an anti-pattern, better way to do this, common mistake to avoid, why is this bad, idiomatic way, beginner mistake, fighting borrow checker, clone everywhere, unwrap in production, should I refactor, 反模式, 常见错误, 代码异味, 最佳实践, 地道写法

5.6k installsAudited
CO

coding-guidelines

zhanghandong/rust-skills

Use when asking about Rust code style or best practices. Keywords: naming, formatting, comment, clippy, rustfmt, lint, code style, best practice, P.NAM, G.FMT, code review, naming convention, variable naming, function naming, type naming, 命名规范, 代码风格, 格式化, 最佳实践, 代码审查, 怎么命名

1.2k installsAudited
M1

m10-performance

zhanghandong/rust-skills

CRITICAL: Use for performance optimization. Triggers: performance, optimization, benchmark, profiling, flamegraph, criterion, slow, fast, allocation, cache, SIMD, make it faster, 性能优化, 基准测试

881 installs
M0

m07-concurrency

zhanghandong/rust-skills

CRITICAL: Use for concurrency/async. Triggers: E0277 Send Sync, cannot be sent between threads, thread, spawn, channel, mpsc, Mutex, RwLock, Atomic, async, await, Future, tokio, deadlock, race condition, 并发, 线程, 异步, 死锁

831 installs
M0

m06-error-handling

zhanghandong/rust-skills

CRITICAL: Use for error handling. Triggers: Result, Option, Error, ?, unwrap, expect, panic, anyhow, thiserror, when to panic vs return Result, custom error, error propagation, 错误处理, Result 用法, 什么时候用 panic

810 installs
RU

rust-refactor-helper

zhanghandong/rust-skills

Safe Rust refactoring with LSP analysis. Triggers on: /refactor, rename symbol, move function, extract, 重构, 重命名, 提取函数, 安全重构

806 installs