vulture-dead-code
Vulture and deadcode tools for detecting unused Python code (functions, classes, imports). Use when cleaning up codebases or removing dead code. Triggers vulture, deadcode.
What this skill does
# Vulture and deadcode - Dead Code Detection
Tools for finding unused Python code including functions, classes, variables, imports, and attributes.
## When to Use This Skill
| Use this skill when... | Use another tool instead when... |
|------------------------|----------------------------------|
| Detecting unused functions, classes, variables | Finding unused imports only (use `ruff --select F401`) |
| Cleaning up dead code in a codebase | Checking type correctness (use basedpyright) |
| Enforcing code hygiene in CI | Formatting code (use ruff format) |
| Generating whitelists for false positives | Running general linting (use ruff check) |
## Overview
**Vulture** (mature, confidence-based) and **deadcode** (newer, AST-based) both detect unused code but with different approaches:
| Feature | Vulture | deadcode |
|---------|---------|----------|
| **Approach** | Static analysis + confidence scores | AST-based detection |
| **Accuracy** | Confidence scores (60-100%) | High accuracy, fewer false positives |
| **Speed** | Fast | Very fast |
| **Configuration** | Whitelist files | TOML configuration |
| **Maturity** | Mature (2012) | Newer (2023+) |
| **Best For** | Large codebases, gradual cleanup | New projects, strict enforcement |
## Installation
```bash
# Install vulture
uv add --dev vulture
# Install deadcode (newer alternative)
uv add --dev deadcode
# Install both for comparison
uv add --dev vulture deadcode
```
## Vulture - Confidence-Based Detection
### Basic Usage
```bash
# Check entire project
vulture .
# Check specific files/directories
vulture src/ tests/
# Minimum confidence threshold (60-100%)
vulture --min-confidence 80 .
# Exclude patterns
vulture . --exclude "**/migrations/*,**/tests/*"
# Sort by confidence
vulture --sort-by-size .
# Generate whitelist of current issues
vulture . --make-whitelist > vulture_whitelist.py
```
### Configuration (pyproject.toml)
```toml
[tool.vulture]
min_confidence = 80
paths = ["src", "tests"]
exclude = [
"**/migrations/*",
"**/__pycache__/*",
".venv/*"
]
ignore_decorators = [
"@app.route",
"@pytest.fixture",
"@property",
"@staticmethod",
"@classmethod"
]
ignore_names = [
"test_*",
"setUp*",
"tearDown*",
]
```
## deadcode - AST-Based Detection
### Basic Usage
```bash
# Check entire project
deadcode .
# Check specific files/directories
deadcode src/
# Verbose output
deadcode --verbose .
# Dry run (show what would be removed)
deadcode --dry-run .
# Show unreachable code
deadcode --show-unreachable .
# Generate configuration
deadcode --init
```
### Configuration (pyproject.toml)
```toml
[tool.deadcode]
paths = ["src"]
exclude = [
"tests/*",
"**/__pycache__/*",
"**/migrations/*",
]
ignore_names = [
"test_*",
"setUp",
"tearDown",
"main",
]
ignore_decorators = [
"app.route",
"pytest.fixture",
"property",
"staticmethod",
"classmethod",
"abstractmethod"
]
show_unreachable = false
```
## Choosing Between Tools
| Choose Vulture when... | Choose deadcode when... |
|------------------------|------------------------|
| Large, mature codebases | New projects |
| Need confidence-based filtering | Want fewer false positives |
| Need whitelist file approach | Prefer TOML configuration |
| Dynamic code (getattr, exec) | Need unreachable code detection |
### Hybrid Approach
```bash
# Run both for comprehensive detection
vulture --min-confidence 80 .
deadcode .
```
## Agentic Optimizations
| Context | Command |
|---------|---------|
| Quick vulture check | `vulture --min-confidence 90 .` |
| Quick deadcode check | `deadcode .` |
| Generate whitelist | `vulture . --make-whitelist > vulture_whitelist.py` |
| CI enforcement | `vulture --min-confidence 80 . vulture_whitelist.py` |
| Unreachable code | `deadcode --show-unreachable .` |
| Combined check | `vulture --min-confidence 80 . && deadcode .` |
## Quick Reference
### Vulture Flags
| Flag | Description |
|------|-------------|
| `--min-confidence N` | Minimum confidence (60-100%) |
| `--exclude PATTERN` | Exclude glob patterns |
| `--sort-by-size` | Sort results by size |
| `--make-whitelist` | Generate whitelist file |
### deadcode Flags
| Flag | Description |
|------|-------------|
| `--verbose` | Verbose output |
| `--dry-run` | Show without modifying |
| `--show-unreachable` | Detect unreachable code |
| `--init` | Generate configuration |
| `--strict` | Strict enforcement mode |
For detailed examples, advanced patterns, and best practices, see [REFERENCE.md](REFERENCE.md).
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.