m11-ecosystem

Use when integrating crates or ecosystem questions. Keywords: E0425, E0433, E0603, crate, cargo, dependency, feature flag, workspace, which crate to use, using…

INSTALLATION
npx skills add https://github.com/actionbook/rust-skills --skill m11-ecosystem
Run in your project or agent environment. Adjust flags if your CLI version differs.

SKILL.md

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:

-

Is it well-maintained?

  • Recent commits?
  • Active issue response?
  • Breaking changes frequency?

-

What's the scope?

  • Do you need the full crate or just a feature?
  • Can feature flags reduce bloat?

-

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
BrowserAct

Let your agent run on any real-world website

Bypass CAPTCHA & anti-bot for free. Start local, scale to cloud.

Explore BrowserAct Skills →

Stop writing automation&scrapers

Install the CLI. Run your first Skill in 30 seconds. Scale when you're ready.

Start free
free · no credit card