Technical Debt Detector
Efficiently identify technical debt in large Python projects using scripts that output targeted file locations, minimizing token cost.
Quick Start
# Full analysis - produces prioritized report
python scripts/analyze_all.py /path/to/project
# JSON output for programmatic use
python scripts/analyze_all.py /path/to/project --format json
# Run specific checks only
python scripts/analyze_all.py /path/to/project --only security testing
Individual Analyzers
Run specific checks when focused analysis is needed:
| Script |
Purpose |
Key Outputs |
analyze_all.py |
Master analyzer - runs all checks |
Prioritized report with fix sketches |
find_deferred_work.py |
TODO/FIXME/HACK/XXX markers |
Location + message + severity |
find_security_issues.py |
Security vulnerabilities (uses bandit) |
CVEs, hardcoded secrets, unsafe patterns |
analyze_test_coverage.py |
Missing tests, coverage gaps |
Untested modules, empty tests |
find_maintainability_issues.py |
Docstrings, type hints, naming |
Missing docs, bad names, long functions |
check_dependencies.py |
Outdated packages, vulnerabilities |
Versions, CVEs, unpinned deps |
Usage Examples
# Find all deferred work
python scripts/find_deferred_work.py /path/to/project
python scripts/find_deferred_work.py . --severity high # Only FIXME/BUG/HACK/XXX
# Security scan
python scripts/find_security_issues.py /path/to/project
# Test coverage analysis
python scripts/analyze_test_coverage.py /path/to/project
python scripts/analyze_test_coverage.py . --run-coverage # Include pytest-cov
# Maintainability check
python scripts/find_maintainability_issues.py /path/to/project
python scripts/find_maintainability_issues.py . --check docstrings # Focus on docs
# Dependency health
python scripts/check_dependencies.py /path/to/project
python scripts/check_dependencies.py . --only vulnerabilities # Just CVEs
Workflow
- Run full analysis:
python scripts/analyze_all.py /path/to/project
- Review prioritized report: High → Medium → Low severity
- For each high-priority item:
- Navigate to file:line
- Apply fix sketch from report
- See
references/fix_patterns.md for detailed patterns
- For complexity/code smells: Use python-simplifier skill
Output Format
All scripts support --format json for integration with other tools:
python scripts/analyze_all.py . --format json | jq '.[] | select(.severity == "high")'
Dependencies
Required (install if not present):
bandit - Security analysis: pip install bandit
pip-audit - Vulnerability scanning: pip install pip-audit
Optional (for deeper analysis):
pytest-cov - Coverage analysis: pip install pytest-cov
Severity Levels
- High 🔴: Fix immediately (security vulnerabilities, FIXME/BUG markers, critical gaps)
- Medium 🟡: Fix soon (TODOs, missing docstrings, outdated dependencies)
- Low 🔵: Fix when convenient (missing type hints, NOTEs, minor style issues)
Relationship to python-simplifier
This skill focuses on deferred work, security, testing, maintainability, and dependencies.
For complexity and code smells (cyclomatic complexity, duplication, coupling, dead code, over-engineering), use the python-simplifier skill.
1---2name: technical-debt-detector3description: Identify and prioritize technical debt in Python codebases. Use when the user asks to find tech debt, analyze code quality, identify what needs refactoring, find security issues, check test coverage gaps, review dependencies, find TODOs/FIXMEs, or assess maintainability. Triggers on phrases like "find technical debt", "what's wrong with this codebase", "where should I focus refactoring", "audit this code", "find TODOs", "check for security issues", "analyze dependencies", or "what needs tests". Complements python-simplifier skill (use that for complexity and code smell analysis).4---5
6# Technical Debt Detector
7
8Efficiently identify technical debt in large Python projects using scripts that output targeted file locations, minimizing token cost.
9
10## Quick Start
11
12```bash
13# Full analysis - produces prioritized report
14python scripts/analyze_all.py /path/to/project
15
16# JSON output for programmatic use
17python scripts/analyze_all.py /path/to/project --format json
18
19# Run specific checks only
20python scripts/analyze_all.py /path/to/project --only security testing
21```
22
23## Individual Analyzers
24
25Run specific checks when focused analysis is needed:
26
27| Script | Purpose | Key Outputs |
28|--------|---------|-------------|
29| `analyze_all.py` | Master analyzer - runs all checks | Prioritized report with fix sketches |
30| `find_deferred_work.py` | TODO/FIXME/HACK/XXX markers | Location + message + severity |
31| `find_security_issues.py` | Security vulnerabilities (uses bandit) | CVEs, hardcoded secrets, unsafe patterns |
32| `analyze_test_coverage.py` | Missing tests, coverage gaps | Untested modules, empty tests |
33| `find_maintainability_issues.py` | Docstrings, type hints, naming | Missing docs, bad names, long functions |
34| `check_dependencies.py` | Outdated packages, vulnerabilities | Versions, CVEs, unpinned deps |
35
36### Usage Examples
37
38```bash
39# Find all deferred work
40python scripts/find_deferred_work.py /path/to/project
41python scripts/find_deferred_work.py . --severity high # Only FIXME/BUG/HACK/XXX
42
43# Security scan
44python scripts/find_security_issues.py /path/to/project
45
46# Test coverage analysis
47python scripts/analyze_test_coverage.py /path/to/project
48python scripts/analyze_test_coverage.py . --run-coverage # Include pytest-cov
49
50# Maintainability check
51python scripts/find_maintainability_issues.py /path/to/project
52python scripts/find_maintainability_issues.py . --check docstrings # Focus on docs
53
54# Dependency health
55python scripts/check_dependencies.py /path/to/project
56python scripts/check_dependencies.py . --only vulnerabilities # Just CVEs
57```
58
59## Workflow
60
611. **Run full analysis**: `python scripts/analyze_all.py /path/to/project`
622. **Review prioritized report**: High → Medium → Low severity
633. **For each high-priority item**:
64 - Navigate to file:line
65 - Apply fix sketch from report
66 - See `references/fix_patterns.md` for detailed patterns
674. **For complexity/code smells**: Use python-simplifier skill
68
69## Output Format
70
71All scripts support `--format json` for integration with other tools:
72
73```bash
74python scripts/analyze_all.py . --format json | jq '.[] | select(.severity == "high")'
75```
76
77## Dependencies
78
79Required (install if not present):
80- `bandit` - Security analysis: `pip install bandit`
81- `pip-audit` - Vulnerability scanning: `pip install pip-audit`
82
83Optional (for deeper analysis):
84- `pytest-cov` - Coverage analysis: `pip install pytest-cov`
85
86## Severity Levels
87
88- **High** 🔴: Fix immediately (security vulnerabilities, FIXME/BUG markers, critical gaps)
89- **Medium** 🟡: Fix soon (TODOs, missing docstrings, outdated dependencies)
90- **Low** 🔵: Fix when convenient (missing type hints, NOTEs, minor style issues)
91
92## Relationship to python-simplifier
93
94This skill focuses on **deferred work, security, testing, maintainability, and dependencies**.
95
96For **complexity and code smells** (cyclomatic complexity, duplication, coupling, dead code, over-engineering), use the `python-simplifier` skill.