
Rust Deps Visualizer
Generate ASCII dependency trees from Cargo metadata so you can see what your Rust crate actually pulls in before you refactor or trim deps.
Overview
Rust Dependencies Visualizer is an agent skill for the Build phase that turns Cargo dependency trees into ASCII art with optional depth and feature flags.
Install
npx skills add https://github.com/actionbook/rust-skills --skill rust-deps-visualizerWhat is this skill?
- Parses Cargo.toml and runs cargo metadata plus cargo tree with configurable depth (default 3)
- Optional --features mode shows enabled feature flags and proc-macro crates in the tree
- Renders box-drawing ASCII trees (├──, └──, │) with version pins per crate
- Supports category-grouped views (e.g. Runtime) for scan-friendly terminal output
- Triggered via /deps-viz, dependency graph, visualize deps, and related phrases
- Default tree depth of 3
- Supports --depth N and --features options
Adoption & trust: 822 installs on skills.sh; 1.2k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You inherit a Rust repo and cannot quickly see which crates and features your binary actually depends on.
Who is it for?
Solo Rust developers auditing crate graphs in the terminal during backend or CLI work.
Skip if: Teams that need interactive HTML graphs, license policy enforcement, or non-Rust package managers.
When should I use this skill?
User asks for /deps-viz, dependency graph, show dependencies, visualize deps, or 依赖图 / 依赖可视化 on a Rust project.
What do I get? / Deliverables
You get a readable ASCII dependency tree in the session so you can trim deps, explain transitive risk, or plan refactors with concrete version lines.
- ASCII dependency tree with versions
- Optional feature-aware dependency listing
Recommended Skills
Journey fit
Dependency visualization is a build-time comprehension task when wiring backends and auditing crate graphs. Rust services and CLIs live in backend build work; cargo tree output maps directly to backend dependency decisions.
How it compares
Use for quick terminal trees instead of ad-hoc cargo tree paste without formatting or version context.
Common Questions / FAQ
Who is rust-deps-visualizer for?
Indie and solo builders working in Rust who want their coding agent to diagram dependencies from real Cargo.lock metadata without leaving the chat.
When should I use rust-deps-visualizer?
During Build when exploring a new crate graph, before removing dependencies, or when you ask for a dependency graph, /deps-viz, or visualize deps on a Rust project.
Is rust-deps-visualizer safe to install?
It runs standard cargo CLI read commands in your repo; review the Security Audits panel on this Prism page and restrict Bash permissions if you do not want agents executing cargo locally.
SKILL.md
READMESKILL.md - Rust Deps Visualizer
# Rust Dependencies Visualizer Generate ASCII art visualizations of your Rust project's dependency tree. ## Usage ``` /rust-deps-visualizer [--depth N] [--features] ``` **Options:** - `--depth N`: Limit tree depth (default: 3) - `--features`: Show feature flags ## Output Format ### Simple Tree (Default) ``` my-project v0.1.0 ├── tokio v1.49.0 │ ├── pin-project-lite v0.2.x │ └── bytes v1.x ├── serde v1.0.x │ └── serde_derive v1.0.x └── anyhow v1.x ``` ### Feature-Aware Tree ``` my-project v0.1.0 ├── tokio v1.49.0 [rt, rt-multi-thread, macros, fs, io-util] │ ├── pin-project-lite v0.2.x │ └── bytes v1.x ├── serde v1.0.x [derive] │ └── serde_derive v1.0.x (proc-macro) └── anyhow v1.x [std] ``` ## Implementation **Step 1:** Parse Cargo.toml for direct dependencies ```bash cargo metadata --format-version=1 --no-deps 2>/dev/null ``` **Step 2:** Get full dependency tree ```bash cargo tree --depth=${DEPTH:-3} ${FEATURES:+--features} 2>/dev/null ``` **Step 3:** Format as ASCII art tree Use these box-drawing characters: - `├──` for middle items - `└──` for last items - `│ ` for continuation lines ## Visual Enhancements ### Dependency Categories ``` my-project v0.1.0 │ ├─[Runtime]───────────────────── │ ├── tokio v1.49.0 │ └── async-trait v0.1.x │ ├─[Serialization]─────────────── │ ├── serde v1.0.x │ └── serde_json v1.x │ └─[Development]───────────────── ├── criterion v0.5.x └── proptest v1.x ``` ### Size Visualization (Optional) ``` my-project v0.1.0 ├── tokio v1.49.0 ████████████ 2.1 MB ├── serde v1.0.x ███████ 1.2 MB ├── regex v1.x █████ 890 KB └── anyhow v1.x ██ 120 KB ───────────────── Total: 4.3 MB ``` ## Workflow 1. Check for Cargo.toml in current directory 2. Run `cargo tree` with specified options 3. Parse output and generate ASCII visualization 4. Optionally categorize by purpose (runtime, dev, build) ## Related Skills | When | See | |------|-----| | Crate selection advice | m11-ecosystem | | Workspace management | m11-ecosystem | | Feature flag decisions | m11-ecosystem |