Skip to content

claude-commands/command-tech-debt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

command-tech-debt

A Claude Code slash command for analyzing technical debt and code complexity.

Installation

# Clone to your preferred location
git clone git@github.com:claude-commands/command-tech-debt.git <clone-path>/command-tech-debt

# Symlink (use full path to cloned repo)
ln -s <clone-path>/command-tech-debt/tech-debt.md ~/.claude/commands/tech-debt.md

Usage

/tech-debt                   # Analyze current directory
/tech-debt src/              # Analyze specific directory
/tech-debt src/auth/login.ts # Analyze specific file
/tech-debt --full            # Comprehensive analysis

What it does

  1. Scans for complexity hotspots (cyclomatic & cognitive)
  2. Detects code duplication patterns
  3. Identifies large files and long functions
  4. Finds code smells (TODO, FIXME, deep nesting)
  5. Generates prioritized remediation report

Output Format

# Technical Debt Analysis

## Summary
| Metric | Value | Status |
|--------|-------|--------|
| Avg Cyclomatic Complexity | 8.2 | OK |
| Code Duplication | 3.2% | OK |
| Long Functions (>50 lines) | 12 | WARNING |

## Critical Issues (Fix First)
### 1. `src/services/payment.ts` - Complexity: 45
- Function `processPayment()` at line 120
- **Recommendation**: Extract into strategy pattern

Thresholds

Metric OK Warning Critical
Cyclomatic Complexity < 10 10-20 > 20
Function Length < 50 50-100 > 100
File Length < 300 300-500 > 500
Nesting Depth < 4 4-5 > 5
Parameters < 5 5-7 > 7
Duplication < 5% 5-10% > 10%

Metrics Analyzed

  • Cyclomatic Complexity: Decision points per function
  • Cognitive Complexity: Code understandability
  • Code Duplication: Copy-paste and similar patterns
  • Size Metrics: Function/file length, nesting depth
  • Code Smells: TODO/FIXME, magic numbers, empty catches

Requirements

  • Git repository with source code
  • Claude Code with Opus 4.5 model access

Updates

cd <clone-path>/command-tech-debt && git pull

About

Claude Code slash command: Analyze codebase for technical debt and complexity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •