tech-debt-analyzer

21
5
Source

This skill should be used when analyzing technical debt in a codebase, documenting code quality issues, creating technical debt registers, or assessing code maintainability. Use this for identifying code smells, architectural issues, dependency problems, missing documentation, security vulnerabilities, and creating comprehensive technical debt documentation.

Install

mkdir -p .claude/skills/tech-debt-analyzer && curl -L -o skill.zip "https://mcp.directory/api/skills/download/2565" && unzip -o skill.zip -d .claude/skills/tech-debt-analyzer && rm skill.zip

Installs to .claude/skills/tech-debt-analyzer

About this skill

Technical Debt Analyzer

Overview

Systematically identify, analyze, document, and track technical debt in JavaScript/TypeScript codebases. This skill provides automated analysis tools, comprehensive debt categorization frameworks, and documentation templates to maintain a technical debt register.

Core Workflow

1. Automated Analysis

Run automated scripts to detect technical debt indicators across the codebase.

Code Smell Detection

Identify code quality issues using the automated detector:

python3 scripts/detect_code_smells.py src --output markdown

The script analyzes:

  • Large Files: Files exceeding 500 lines
  • Complex Functions: High cyclomatic complexity (>10) or long functions (>50 lines)
  • Debt Markers: TODO, FIXME, HACK, XXX, BUG comments
  • Console Statements: Debug statements left in code
  • Weak Typing: Use of any type in TypeScript
  • Long Parameters: Functions with >5 parameters
  • Deep Nesting: Code nested >4 levels deep
  • Magic Numbers: Hardcoded numeric values

Output Example:

# Technical Debt Analysis Report

**Files Analyzed:** 127
**Total Lines:** 15,432
**Total Issues:** 89

### Issues by Severity
- HIGH: 23
- MEDIUM: 41
- LOW: 25

## Large Files (12 issues)
### High Priority
- src/components/Dashboard.tsx (847 lines): File too large
- src/services/DataProcessor.ts (623 lines): File too large
...

Dependency Analysis

Examine dependencies for debt indicators:

python3 scripts/analyze_dependencies.py package.json

The script identifies:

  • Deprecated Packages: Known deprecated libraries (request, tslint, etc.)
  • Duplicate Functionality: Multiple packages serving same purpose
  • Version Issues: Overly loose or strict version constraints
  • Security Concerns: Known vulnerable packages (requires audit data)

Output Example:

# Dependency Analysis Report

**Package:** expense-tracker
**Dependencies:** 24
**Dev Dependencies:** 18
**Total Issues:** 7

## Deprecated/Outdated Packages (3)
### request [HIGH]
Using deprecated package - use axios, node-fetch, or got instead
- Current version: ^2.88.0

## Duplicate Functionality (2)
### HTTP client [MEDIUM]
Multiple packages for HTTP client: axios, node-fetch

2. Manual Code Review

Complement automated analysis with manual review for issues that require human judgment.

Review Focus Areas

Architectural Debt:

  • Tight coupling between components
  • Missing abstractions
  • Poor separation of concerns
  • Circular dependencies

Test Debt:

  • Missing test coverage for critical paths
  • Fragile tests coupled to implementation
  • No integration or E2E tests
  • Slow test execution

Documentation Debt:

  • Missing README or setup instructions
  • No architecture documentation
  • Outdated API docs
  • Missing ADRs for major decisions

Performance Debt:

  • N+1 query problems
  • Inefficient algorithms
  • Memory leaks
  • Large bundle sizes

Security Debt:

  • Missing input validation
  • No authentication/authorization
  • SQL injection vulnerabilities
  • XSS vulnerabilities
  • Exposed secrets

3. Categorize and Assess

Organize findings using the standardized debt categories.

Debt Categories

Refer to references/debt_categories.md for comprehensive details on:

  1. Code Quality Debt: Code smells, complexity, duplication
  2. Architectural Debt: Structure, coupling, abstractions
  3. Test Debt: Coverage gaps, fragile tests
  4. Documentation Debt: Missing or outdated docs
  5. Dependency Debt: Outdated or problematic dependencies
  6. Performance Debt: Inefficiencies and bottlenecks
  7. Security Debt: Vulnerabilities and weaknesses
  8. Infrastructure Debt: DevOps and deployment issues
  9. Design Debt: UI/UX inconsistencies

Severity Assessment

Assign severity based on impact and urgency:

Critical:

  • Security vulnerabilities
  • Production-breaking issues
  • Data loss risks
  • Action: Immediate fix required

High:

  • Significant performance problems
  • Architectural issues blocking features
  • High-risk untested code
  • Action: Fix within current/next sprint

Medium:

  • Code quality issues in frequently changed files
  • Missing documentation
  • Outdated dependencies (non-security)
  • Action: Address within quarter

Low:

  • Minor code smells
  • Optimization opportunities
  • Nice-to-have improvements
  • Action: Address when convenient

Priority Matrix

Impact / EffortLow EffortMedium EffortHigh Effort
High ImpactDo FirstDo SecondPlan & Do
Medium ImpactDo SecondPlan & DoConsider
Low ImpactQuick WinConsiderAvoid

4. Document Findings

Create comprehensive documentation of technical debt.

Technical Debt Register

Use the provided template to maintain a debt register:

Template Location: assets/DEBT_REGISTER_TEMPLATE.md

Structure:

## DEBT-001: Complex UserService with 847 lines

**Category:** Code Quality
**Severity:** High
**Location:** src/services/UserService.ts

**Description:**
UserService has grown to 847 lines with multiple responsibilities
including authentication, profile management, and notification handling.

**Impact:**
- Business: Slows down feature development by 30%
- Technical: Difficult to test, high bug rate
- Risk: Changes frequently break unrelated functionality

**Proposed Solution:**
Split into separate services:
- AuthenticationService
- UserProfileService
- NotificationService

**Effort Estimate:** 3 days
**Priority Justification:** High churn area blocking new features
**Target Resolution:** Sprint 24

Register Sections:

  1. Active Debt Items: Current technical debt needing attention
  2. Resolved Items: Historical record of fixed debt
  3. Won't Fix Items: Debt accepted as acceptable trade-off
  4. Trends: Analysis by category, severity, and age
  5. Review Schedule: Regular maintenance plan

Architecture Decision Records (ADRs)

Document major technical decisions using ADRs to prevent future debt.

Template Location: assets/ADR_TEMPLATE.md

When to Create ADRs:

  • Choosing frameworks or libraries
  • Architectural changes
  • Major refactoring decisions
  • Technology migrations
  • Performance optimization strategies

Example:

# ADR-003: Migrate from Moment.js to date-fns

**Status:** Accepted
**Date:** 2024-01-15

## Context
Moment.js is deprecated and increases bundle size by 67KB.
Team needs a modern date library with tree-shaking support.

## Decision
Migrate to date-fns for date manipulation.

## Consequences
- Positive: Reduce bundle by 60KB, modern API, active maintenance
- Negative: Migration effort, learning curve for team
- Technical Debt: None - this resolves existing dependency debt

5. Prioritize and Plan

Create actionable plans to address technical debt.

Prioritization Approach

  1. Critical Items: Add to current sprint immediately
  2. High Items: Include in sprint planning
  3. Medium Items: Add to quarterly roadmap
  4. Low Items: Opportunistic fixes during related work

Time Allocation

Recommended Allocation:

  • 20% of sprint capacity for technical debt
  • Alternating sprints: feature sprint / debt sprint
  • Dedicated quarterly "tech health" sprint

Tracking Progress

Monitor debt reduction over time:

Metrics to Track:

  • Total debt items (trend down)
  • Debt by severity (critical should be 0)
  • Debt age (old debt is concerning)
  • Resolution rate (items fixed per sprint)
  • New debt rate (items added per sprint)

6. Prevention Strategies

Implement practices to minimize new technical debt.

Code Review Checklist

Before approving PRs, verify:

  • No code smells introduced (complexity, size, nesting)
  • Tests added/updated with adequate coverage
  • Documentation updated (README, comments, ADRs)
  • No security vulnerabilities
  • Performance impact considered
  • No new dependencies without justification
  • Follows team conventions and patterns

Automated Prevention

Linting and Formatting:

{
  "rules": {
    "complexity": ["error", 10],
    "max-lines-per-function": ["error", 50],
    "max-params": ["error", 5],
    "max-depth": ["error", 4],
    "no-console": "warn"
  }
}

Required Checks:

  • TypeScript strict mode enabled
  • Minimum test coverage threshold (80%)
  • No high-severity security vulnerabilities
  • Bundle size limits enforced

Regular Maintenance

Weekly:

  • Review and triage TODO/FIXME comments
  • Update debt register with new findings

Monthly:

  • Dependency updates (security patches)
  • Debt register review
  • Plan fixes for high-priority items

Quarterly:

  • Full codebase debt analysis
  • Architecture review
  • Major dependency updates
  • Trend analysis and strategy adjustment

Decision Tree

Follow this workflow based on the situation:

Starting a new analysis? → Run automated scripts (detect_code_smells.py, analyze_dependencies.py) → Review output for high-severity issues → Conduct manual review for areas scripts can't detect → Go to documentation step

Documenting findings? → Copy DEBT_REGISTER_TEMPLATE.md to project root → Add each debt item with full details → Categorize by type and assign severity → Estimate effort and prioritize → Go to planning step

Planning debt reduction? → Sort by priority matrix (impact/effort) → Allocate sprint capacity (20% recommended) → Create tickets for top priority items → Schedule regular reviews

Making architectural decisions? → Copy ADR_TEMPLATE.md → Document context, options, and decision → Identify any debt being incurred → Add to debt register if applicable

Preventing new debt? → Implement code review checklist → Configure automated linting/testing → Set up regular maintenance schedule → Monitor metrics over time

Tools and Scripts

detect_code_smells.


Content truncated.

travel-planner

ailabs-393

This skill should be used whenever users need help planning trips, creating travel itineraries, managing travel budgets, or seeking destination advice. On first use, collects comprehensive travel preferences including budget level, travel style, interests, and dietary restrictions. Generates detailed travel plans with day-by-day itineraries, budget breakdowns, packing checklists, cultural do's and don'ts, and region-specific schedules. Maintains database of preferences and past trips for personalized recommendations.

11666

finance-manager

ailabs-393

Comprehensive personal finance management system for analyzing transaction data, generating insights, creating visualizations, and providing actionable financial recommendations. Use when users need to analyze spending patterns, track budgets, visualize financial data, extract transactions from PDFs, calculate savings rates, identify spending trends, generate financial reports, or receive personalized budget recommendations. Triggers include requests like "analyze my finances", "track my spending", "create a financial report", "extract transactions from PDF", "visualize my budget", "where is my money going", "financial insights", "spending breakdown", or any finance-related analysis tasks.

1710

script-writer

ailabs-393

This skill should be used whenever users need YouTube video scripts written. On first use, collects comprehensive preferences including script type, tone, target audience, style, video length, hook style, use of humor, personality, and storytelling approach. Generates complete, production-ready YouTube scripts tailored to user's specifications for any topic. Maintains database of preferences and past scripts for consistent style.

144

social-media-generator

ailabs-393

This skill should be used when the user requests social media content creation for Twitter, Instagram, LinkedIn, or Facebook. It generates platform-optimized posts and saves them in an organized folder structure with meaningful filenames based on event details.

314

business-document-generator

ailabs-393

This skill should be used when the user requests to create professional business documents (proposals, business plans, or budgets) from templates. It provides PDF templates and a Python script for generating filled documents from user data.

133

frontend-enhancer

ailabs-393

This skill should be used when enhancing the visual design and aesthetics of Next.js web applications. It provides modern UI components, design patterns, color palettes, animations, and layout templates. Use this skill for tasks like improving styling, creating responsive designs, implementing modern UI patterns, adding animations, selecting color schemes, or building aesthetically pleasing frontend interfaces.

53

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

1,5701,369

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

1,1161,188

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

1,4181,109

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

1,193747

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

1,153683

pdf-to-markdown

aliceisjustplaying

Convert entire PDF documents to clean, structured Markdown for full context loading. Use this skill when the user wants to extract ALL text from a PDF into context (not grep/search), when discussing or analyzing PDF content in full, when the user mentions "load the whole PDF", "bring the PDF into context", "read the entire PDF", or when partial extraction/grepping would miss important context. This is the preferred method for PDF text extraction over page-by-page or grep approaches.

1,311614

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.