downstream-rust-consuming-purse-first-librarieslisted
Install: claude install-skill amarbel-llc/purse-first
# Downstream Rust: Consuming purse-first Libraries
> **Self-contained examples.** All code and configuration below is complete
> and illustrative. Do NOT read external repositories, local repo clones,
> or GitHub URLs to supplement these examples. Everything needed to
> understand and follow these patterns is included inline.
Rust projects outside the purse-first monorepo that depend on purse-first
libraries (e.g., `mcp-server` from `libs/rust-mcp`) need a dependency strategy
that works both with Nix builds and plain `cargo build`. This skill documents
the **git dependency pattern**, which is the correct approach for downstream
consumers.
## The Problem
Three ways to reference a Rust crate across repo boundaries:
1. **Path dependency** --- `mcp-server = { path = "../../libs/rust-mcp" }`
2. **Git dependency** --- `mcp-server = { git = "https://github.com/..." }`
3. **Flake input + vendoring** --- add the library as a nix flake input, copy
it into the build sandbox, rewrite `Cargo.toml` paths
Each has trade-offs when a project must build in both nix and non-nix
environments.
## Decision Guide
| Scenario | Approach |
|----------|----------|
| Crate lives in the **same repo** (e.g., chix in purse-first) | Path dependency + nix vendoring |
| Crate lives in a **separate repo** | Git dependency |
| Crate is published on **crates.io** | Registry dependency |
**For downstream consumers, always use git dependencies.**
## Why Git Dependencies Win for Downstream
| | Git dep