
Rust Deps Visualizer
Render an ASCII dependency tree of a Rust crate using cargo metadata and cargo tree with optional depth and feature flags.
Overview
rust-deps-visualizer is an agent skill for the Build phase that builds ASCII Cargo dependency trees with optional depth limits and feature-flag labels.
Install
npx skills add https://github.com/zhanghandong/rust-skills --skill rust-deps-visualizerWhat is this skill?
- Trigger phrases include /deps-viz, dependency graph, visualize deps, and Chinese 依赖图 variants
- Runs cargo metadata --format-version=1 --no-deps then cargo tree with configurable depth
- Default tree depth of 3 with --features switch for feature-aware output
- Formats output with box-drawing characters ├── └── and continuation pipes
- Documents simple versus feature-aware trees including proc-macro and std feature notation
- Default visualization depth is 3 via --depth N
- Implementation uses a 3-step pipeline: Cargo.toml read, cargo metadata, then cargo tree
Adoption & trust: 647 installs on skills.sh; 1.2k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You cannot see how Rust crates and features chain together without running cargo tree yourself and reformatting the result.
Who is it for?
Solo Rust developers auditing transitive deps or explaining crate graphs in chat-friendly ASCII.
Skip if: Non-Rust projects or teams needing interactive SVG/HTML dependency dashboards with license policy enforcement.
When should I use this skill?
Triggers on /deps-viz, dependency graph, show dependencies, visualize deps, 依赖图, 依赖可视化, or 显示依赖.
What do I get? / Deliverables
You get a depth-limited ASCII dependency tree—optionally feature-aware—for sharing in reviews, docs, or agent follow-up refactors.
- ASCII art dependency tree with box-drawing layout
- Optional feature-aware dependency listing with proc-macro notes
Recommended Skills
Journey fit
Dependency mapping happens while implementing or auditing a Rust codebase, which sits in Build rather than launch or growth work. Backend subphase fits Cargo.toml / crate graph analysis for services and CLIs written in Rust.
How it compares
Lightweight cargo-tree formatter in chat, not a full supply-chain security audit platform.
Common Questions / FAQ
Who is rust-deps-visualizer for?
Rust builders on Claude Code, Cursor, or similar agents who want quick terminal-style dependency graphs from the current repo.
When should I use rust-deps-visualizer?
During Build backend work when trimming dependencies, debugging feature flags, or documenting what a binary crate pulls in.
Is rust-deps-visualizer safe to install?
The skill runs local cargo commands via Bash; review the Security Audits panel on this Prism page and treat shell access like any repo-scoped skill.
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 |