一键导入
technical-debt-assessment
Identify code smells, prioritize refactoring opportunities, and assess technical debt impact
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Identify code smells, prioritize refactoring opportunities, and assess technical debt impact
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Design AI agents with appropriate capabilities, tools, and personas for specific software development tasks
Design RESTful APIs with proper resource modeling, HTTP methods, error handling, and clear contracts following REST principles
Document APIs comprehensively with signatures, parameters, return values, errors, and working code examples for developer reference
Implement robust third-party API integrations with proper authentication, error handling, and rate limiting
Apply proven architectural patterns (MVC, layered, microservices) to create maintainable systems with clear separation of concerns
Systematically reproduce, diagnose, and analyze bugs to determine root cause, assess severity, and plan fix strategy
| name | Technical Debt Assessment |
| description | Identify code smells, prioritize refactoring opportunities, and assess technical debt impact |
| category | implementation |
| required_tools | ["Read","Grep","Glob"] |
Systematically identify, quantify, and prioritize technical debt to make informed decisions about when and what to refactor.
Scan Codebase for Quality Metrics
Identify Specific Debt Items
Assess Impact
Estimate Effort to Fix
Prioritize by Impact/Effort Ratio
Context: Assessing technical debt in a payments module
# Technical Debt Assessment Report
## Metrics Summary
**Overall Code Quality**: C (60/100)
| Metric | Value | Target | Status |
|--------|-------|--------|--------|
| Cyclomatic Complexity (avg) | 15.2 | <10 | ⚠️ High |
| Code Duplication | 18% | <5% | ❌ Critical |
| Test Coverage | 52% | >80% | ❌ Critical |
| Lines of Code | 12,500 | - | - |
| TODO/FIXME Comments | 47 | 0 | ⚠️ High |
| Outdated Dependencies | 8 | 0 | ⚠️ High |
## Identified Debt Items
### Critical Priority (P0) - Fix Immediately
**1. Missing Tests in Payment Processing**
- **Location**: `payments/processor.py`, `payments/refunds.py`
- **Type**: Missing test coverage
- **Impact**: Critical - Payment bugs reach production, financial risk
- **Current Coverage**: 35% (target: 80%)
- **Effort**: High (5 days for comprehensive coverage)
- **Risk**: High - No safety net for changes
- **Cost**: Estimated $50k per production payment bug
- **Priority**: P0 - Block releases until fixed
- **Recommendation**: Write tests immediately, starting with critical paths
**2. SQL Injection Vulnerability**
- **Location**: `payments/reports.py:145-167`
- **Type**: Security vulnerability
- **Impact**: Critical - Potential data breach
- **Code**:
```python
# VULNERABLE
query = f"SELECT * FROM payments WHERE user_id = {user_id}"
3. Duplicated Payment Validation Logic
payments/ modulePaymentValidator class4. God Class: PaymentProcessor
payments/processor.py (1,200 lines)PaymentProcessor, RefundHandler, PaymentValidator5. No Error Handling in Stripe Integration
payments/stripe_client.py6. Outdated Dependencies
requirements.txt7. 47 TODO Comments
8. Inconsistent Naming Conventions
Last 6 Months:
Trend Analysis: Technical debt is accumulating faster than it's being paid down. Recommend allocating 20% of sprint capacity to debt reduction.
Estimated Cost of Current Debt:
Cost of Fixing:
ROI: Fixing P0 and P1 debt saves ~$100,000/year in reduced bugs and faster development.
Immediate Actions (This Week):
Next Sprint:
Ongoing:
PaymentProcessor until refactoredProcess Changes:
**Tools for Debt Assessment**:
```bash
# Code complexity
radon cc src/ -a -nb
# Code duplication
pylint --disable=all --enable=duplicate-code src/
# Test coverage
pytest --cov=src --cov-report=html
# Security issues
bandit -r src/
# Outdated dependencies
pip list --outdated
# Find TODOs
grep -rn "TODO\|FIXME" src/