PluginBench
Skill
Fail
Audit score 45

m11-ecosystem

actionbook/rust-skills

Navigate Rust crate selection, dependency management, and ecosystem integration decisions.

What is m11-ecosystem?

Use this skill when choosing which crates to add, managing Cargo dependencies, resolving import errors (E0425, E0433, E0603), configuring features, or integrating language interop (C/C++, Python, WebAssembly). It provides decision frameworks for evaluating crate maintenance, scope, and integration patterns before adding dependencies.

  • Evaluate crate maintenance status, API stability, and community activity before integration
  • Resolve common dependency errors (E0433, E0603) and version conflicts
  • Select appropriate crates for serialization, async, HTTP, database, CLI, and logging needs
  • Configure Cargo features and workspaces to manage optional functionality and multi-crate projects
  • Guide language interop decisions for C/C++ (bindgen, cbindgen), Python (PyO3), Node.js (napi-rs), and WebAssembly (wasm-bindgen)

How to install m11-ecosystem

npx skills add https://github.com/actionbook/rust-skills --skill m11-ecosystem
Claude Code
Cursor
Windsurf
Cline

How to use m11-ecosystem

  1. 1.Identify your integration need (serialization, async, HTTP, database, etc.) and check the decision table
  2. 2.Evaluate the candidate crate using the maintenance criteria: recent commits, active issues, documentation quality, semantic versioning
  3. 3.Check if feature flags can reduce bloat or if the full crate is necessary
  4. 4.Review the crate's API design (trait-based vs concrete, sync vs async) against your bounds and constraints
  5. 5.Add to Cargo.toml with a specific version, enable required features, and test for conflicts

Use cases

Good for
  • Deciding between tokio vs async-std for async runtime, or axum vs actix-web for HTTP servers
  • Resolving 'cannot find crate' errors by checking Cargo.toml and feature flag configuration
  • Evaluating whether to use serde, sqlx, or diesel based on project constraints
  • Setting up FFI bindings to external C libraries or creating Python extensions
  • Managing multi-crate workspaces and preventing duplicate type conflicts across versions
Who it's for
  • Rust developers integrating third-party crates or building ecosystem-dependent features
  • Teams evaluating crate maintenance and supply-chain risk before adoption
  • Developers working with language interop (C, Python, WebAssembly, Node.js)
  • Library authors deciding what to expose via feature flags

m11-ecosystem FAQ

How do I fix 'cannot find crate' errors?

Check that the crate is listed in [dependencies] in Cargo.toml with the correct name and version. If using a feature-gated item, ensure the feature is enabled in the features list.

When should I use feature flags vs adding a full dependency?

Use feature flags when a crate offers optional functionality you may not need; this reduces compile time and binary size. Add the full dependency only if you use most of its functionality.

How do I choose between competing crates (e.g., tokio vs async-std)?

Evaluate maintenance status, community adoption, documentation, and API fit. Tokio is the de facto standard for async Rust; choose alternatives only if they better match your constraints.

What's the best way to integrate C/C++ code into Rust?

Use bindgen to auto-generate Rust bindings from C headers, or cbindgen to export Rust code as C headers. For complex FFI, wrap unsafe blocks carefully and document safety invariants.

How do I prevent version conflicts in a workspace?

Use a workspace [dependencies] section to unify versions across crates, or pin specific versions in Cargo.toml. Run cargo update to resolve conflicts and check for duplicate types from different versions.

Full instructions (SKILL.md)

Source of truth, from actionbook/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