Code Quality — Đánh giá sức khỏe codebase
Đo lường và phân tích chất lượng code: health score, technical debt, complexity metrics.Cú pháp
Bảng tham chiếu nhanh
| Lệnh | Mô tả | Output |
|---|---|---|
/code-health | Quality metrics, test coverage, docs, maintainability | Health score 0-100 |
/debt-analysis | Tech debt identification, prioritization, refactoring roadmap | Debt report + roadmap |
/code-health — Codebase Health
Health Score Breakdown:
| Category | Weight | Metrics |
|---|---|---|
| Test Coverage | 25% | Line, branch, function coverage |
| Type Safety | 20% | TypeScript strictness, any count |
| Code Complexity | 20% | Cyclomatic complexity, nesting depth |
| Documentation | 15% | README, API docs, inline comments |
| Dependencies | 10% | Outdated, vulnerable, unused deps |
| Maintainability | 10% | File size, duplication, coupling |
/debt-analysis — Technical Debt
- Debt inventory: categorized list (architecture, code, test, docs, infra)
- Prioritization: impact × effort matrix
- Refactoring roadmap: phased plan with estimates
Ví dụ thực tế
- /code-health output
- /debt-analysis output
Khi nào dùng / không dùng
| Dùng | Không dùng |
|---|---|
| Đầu sprint — đánh giá code health | Giữa feature development |
| Plan refactoring sprint | Debug specific bug (dùng /fix) |
| Báo cáo cho stakeholders | Security audit (dùng /ck-security) |