Help us improve
Share bugs, ideas, or general feedback.
From rust-doctor
Rust code health scanner — runs security, performance, correctness, architecture, and dependency analysis to produce a 0-100 health score with categorized diagnostics and actionable fix guidance. Use when the user says 'rust-doctor', 'health check', 'scan my rust project', 'check rust code', 'rust audit', 'code quality', '/rust-doctor', or asks for a Rust project audit. Also triggers on: 'fix rust issues', 'rust best practices check', 'rust code health'. Do NOT trigger for non-Rust code, single compilation errors, test failures, or general Rust questions without a scan context.
npx claudepluginhub arthurdev44/rust-doctorHow this skill is triggered — by the user, by Claude, or both
Slash command
/rust-doctor:rust-doctor [path?] [--diff [BASE]] [--fix] [--plan] [--score] [--sarif] [--offline] [--project <MEMBERS>][path?] [--diff [BASE]] [--fix] [--plan] [--score] [--sarif] [--offline] [--project <MEMBERS>]haikuThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Scan target: $ARGUMENTS
Guides using Bun as JavaScript runtime, package manager, bundler, and test runner. Covers choosing Bun vs Node, Node migration, and Vercel deployment support.
Share bugs, ideas, or general feedback.
Scan target: $ARGUMENTS
rust-doctor is a 4-step pipeline that scans Rust codebases for security, performance, correctness, architecture, and dependency issues. It produces a 0-100 health score with dimensional breakdowns and actionable fix guidance.
rust-doctor CLI with appropriate flags$ARGUMENTS -> [path?] [--diff [BASE]] [--fix] [--plan] [--score] [--sarif] [--offline] [--project <MEMBERS>]
|
v
+---------------+
| Step 1: |
| SCOPE | <- Detect project, resolve flags
| (instant) |
+-------+-------+
|
v
+-------+-------+
| Step 2: |
| SCAN | <- Run rust-doctor CLI
| (5-30s) |
+-------+-------+
|
v
+-------+-------+
| Step 3: |
| INTERPRET | <- Parse score, categorize findings
| (instant) |
+-------+-------+
|
v
+-------+-------+
| Step 4: |
| GUIDE | <- Actionable fixes, re-scan to verify
| (analysis) |
+-------+-------+
Before each step, print a progress header:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[Step N/4] STEP_NAME
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Print: [Step 1/4] SCOPE
1a. Parse arguments and determine scan target:
$ARGUMENTS contains a path → use it as target directory$ARGUMENTS is empty → scan current directory (.)--diff [BASE] → scan only changed files vs base branch (default: auto-detect). Examples: --diff, --diff main, --diff develop--fix → apply machine-applicable fixes after scan--plan → show prioritized remediation plan (P0-P3)--score → quick score only (no detailed diagnostics)--sarif → output SARIF 2.1.0 format (for GitHub Code Scanning / GitLab SAST)--offline → skip network-dependent checks (advisory DB fetch)--project <MEMBERS> → scan only specific workspace members (comma-separated)--no-project-config → ignore rust-doctor.toml / Cargo.toml metadata configNote: --json, --score, and --sarif are mutually exclusive output formats.
1b. Detect rust-doctor installation:
Try in order:
rust-doctor --help (installed via cargo install rust-doctor)npx rust-doctor@latest --help (installed via npm)cargo run -- --help (if inside the rust-doctor repo itself)If none works, inform the user:
rust-doctor not found. Install with:
cargo install rust-doctor
# or
npm install -g rust-doctor
1c. Verify it's a Rust project:
Check that Cargo.toml exists in the target directory. If not, abort with a clear message.
Print: [Step 2/4] SCAN
2a. Build the command:
Base command: rust-doctor {target} --verbose --json
Add flags based on Step 1:
--diff → add --diff (or --diff <BASE> if a base branch was specified)--score → use --score instead of --json (quick mode — skip to summary)--sarif → use --sarif instead of --json (for CI integration)--plan → add --plan--offline → add --offline--project → add --project <MEMBERS>--no-project-config → add --no-project-configrust-doctor {target} --verbose --json [--diff] [--plan]
If rust-doctor binary not found, fallback to:
npx rust-doctor@latest {target} --verbose --json [--diff] [--plan]
2b. Capture output:
2c. Handle failures:
| Error | Action |
|---|---|
Missing cargo clippy | Suggest rustup component add clippy |
| Missing external tools (cargo-audit, etc.) | Run rust-doctor --install-deps to install them |
| Compilation errors | Show errors, suggest fixing compilation first |
| Timeout (>300s) | Report timeout, suggest --diff for faster incremental scan |
Print: [Step 3/4] INTERPRET
3a. Parse the JSON output:
Extract from the scan result:
3b. Categorize findings by priority:
| Priority | Criteria | Action |
|---|---|---|
| CRITICAL | Security errors (hardcoded-secrets, sql-injection-risk, advisory CVEs) | Fix immediately |
| HIGH | Correctness errors (blocking-in-async, block-on-in-async, panic-in-library, tokio-spawn-without-move) | Fix before merge |
| MEDIUM | Warnings (unwrap-in-production, unsafe-block-audit, excessive-clone, large-enum-variant) | Fix recommended |
| LOW | Info-level findings (string-from-literal, style lints, collect-then-iterate) | Fix when convenient |
3c. Display results:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
RUST-DOCTOR RESULTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
**Score:** {N}/100 ({label})
**Security:** {N}/100 | **Reliability:** {N}/100
**Maintainability:** {N}/100 | **Performance:** {N}/100 | **Dependencies:** {N}/100
**Findings:** {N} total — {N} CRITICAL | {N} HIGH | {N} MEDIUM | {N} LOW
**Skipped:** {passes} (install with `rust-doctor --install-deps`)
If --score mode, stop here with just the score display.
3d. List findings grouped by priority:
For each finding, display:
[PRIORITY] rule-id — message
→ file:line
Print: [Step 4/4] GUIDE
Tool selection (adapt to available MCP servers):
When researching fixes and best practices, use the best tools available:
resolve-library-id + query-docs) if available for version-accurate docs. Fallback: fetch from docs.rs with WebFetch.web_search_exa, get_code_context_exa) if available for high-quality code search. Fallback: native WebSearch/WebFetch.4a. For each finding (CRITICAL and HIGH first):
4b. If --fix was requested:
Ask the user for confirmation before applying fixes:
Found {N} machine-applicable fixes. Apply them? (CRITICAL: {N}, HIGH: {N}, MEDIUM: {N})
After confirmation, apply fixes by editing the flagged files directly.
4c. Re-scan to verify:
rust-doctor {target} --verbose --json [--diff]
Compare the new score to the original. Report improvement.
4d. Summary:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SUMMARY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
**Score:** {before}/100 → {after}/100 ({+/-delta})
**Fixed:** {N} findings
**Remaining:** {N} findings
If --plan was requested, display the remediation plan:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
REMEDIATION PLAN
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
**P0 — Fix Now** (security/correctness blockers)
- [ ] {rule}: {description} → {file:line}
**P1 — Fix Before Merge** (reliability issues)
- [ ] {rule}: {description} → {file:line}
**P2 — Fix This Sprint** (performance/maintainability)
- [ ] {rule}: {description} → {file:line}
**P3 — Backlog** (informational, style)
- [ ] {rule}: {description} → {file:line}
rust-doctor CLI before providing any guidance — never diagnose from memory.--verbose --json for the scan (unless --score quick mode).rust-doctor is not installed, guide the user through installation — do NOT fake results.--fix — show what will change first.--verbose (insufficient detail for diagnosis).rust-doctor scan executed with appropriate flags--fix) for CRITICAL and HIGH findingsrust-doctor before providing any guidance — never diagnose from memory--verbose --json for full diagnostics--fix) — show what will change before modifying filesrust-doctor --install-deps)