К основному содержанию
скилл CX Codex

code-refactoring-tech-debt — скилл для Claude Code: обзор и установка

Скилл code-refactoring-tech-debt находит технический долг в коде и истории коммитов, оценивает его влияние на разработку и строит план рефакторинга с расчётом ROI.

MIT 2 установок ★ 50 109 обновлён 2026-10-29

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add sickn33/agentic-awesome-skills --skill code-refactoring-tech-debt -a claude-code
Открыть на GitHub

Что делает code-refactoring-tech-debt

Скилл проводит инвентаризацию технического долга по нескольким категориям: дублирование, цикломатическую сложность, архитектурные дефекты и пробелы в тестах. Агент проверяет реальные файлы. Он ищет проблемные зоны в репозитории, включая методы длиннее 50 строк, запутанные ветвления и классы с избыточной ответственностью.

Анализ опирается на метрики кодовой базы, связность компонентов и процент тестового покрытия. По итогам формируется план устранения проблем — от быстрых правок до долгосрочного рефакторинга с учётом предполагаемых затрат рабочего времени.

Скилл работает строго в режиме аудита и сам по себе не вносит масштабных правок в архитектуру или конфигурацию деплоя. Если реальных данных о частоте сбоев или стоимости поддержки нет, инструкция требует помечать их как неизвестные, а не подставлять вымышленные цифры.

Какие задачи решает

  • найти дублирующийся код и участки с высокой цикломатической сложностью
  • оценить потери времени разработчиков из-за багов и проблемной структуры
  • составить приоритетный план рефакторинга на основе отдачи от вложений
  • выявить устаревшие библиотеки и пробелы в тестовом покрытии

Примеры запросов агенту

  • Просканируй репозиторий на технический долг и найди участки с высокой сложностью
  • Оцени влияние дублирования кода на скорость разработки и предложи быстрые исправления
  • Составь план рефакторинга для сервиса заказов с расчётом затрат и окупаемости

Как установить code-refactoring-tech-debt

1Через Skills CLI (Vercel)

npx skills add sickn33/agentic-awesome-skills --skill code-refactoring-tech-debt -a claude-code

2Вручную: положить файлы

~/.claude/skills/code-refactoring-tech-debt/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/code-refactoring-tech-debt/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о code-refactoring-tech-debt

Как установить code-refactoring-tech-debt в Claude Code?

Выполните в терминале команду npx skills add sickn33/agentic-awesome-skills --skill code-refactoring-tech-debt -a claude-code. Файл инструкции размещается по пути ~/.claude/skills/code-refactoring-tech-debt/SKILL.md.

Что делает этот скилл?

Он помогает структурированно разобрать накопленный технический долг в проекте, измерить его влияние на команду и приоритизировать задачи по рефакторингу.

Исправит ли скилл найденный код автоматически?

Нет, скилл предназначен только для аудита и планирования. Он не выполняет масштабный рефакторинг и не меняет конфигурацию окружения самостоятельно.

Исходный текст

SKILL.md · MIT
---
name: code-refactoring-tech-debt
description: "Identify technical debt from actual code and change history, estimate its impact, and prioritize bounded improvements with explicit assumptions."
risk: safe
source: community
date_added: "2026-02-27"
---

## Compatibility and maintenance

Primary editorial path for this compatibility group. The full instructions and support files remain local so existing installations
continue to work offline. This is one shared procedure, not an additional capability.
Preserve the callable ID when an existing manifest or client configuration uses it.
Modified in AAS on 2026-09-05; original metadata and license notices are retained.

# Technical Debt Analysis and Remediation

You are a technical debt expert specializing in identifying, quantifying, and prioritizing technical debt in software projects. Analyze the codebase to uncover debt, assess its impact, and create actionable remediation plans.

## Use this skill when

- Working on technical debt analysis and remediation tasks or workflows
- Needing guidance, best practices, or checklists for technical debt analysis and remediation

## Do not use this skill when

- The task is unrelated to technical debt analysis and remediation
- You need a different domain or tool outside this scope

## Context
The user needs a comprehensive technical debt analysis to understand what's slowing down development, increasing bugs, and creating maintenance challenges. Focus on practical, measurable improvements with clear ROI.

## Requirements
Inspect the current repository, hotspots and real change/incident history. The numbers,
thresholds, staffing and timelines below are hypothetical planning examples, not
measurements, promised returns or mandatory quality gates. Report missing cost/usage
inputs as unknown; never fill them with fabricated telemetry. Review-only scope does
not authorize broad refactors, policy changes or deployment.

## Instructions

### 1. Technical Debt Inventory

Conduct a thorough scan for all types of technical debt:

**Code Debt**
- **Duplicated Code**
  - Exact duplicates (copy-paste)
  - Similar logic patterns
  - Repeated business rules
  - Quantify: Lines duplicated, locations
  
- **Complex Code**
  - High cyclomatic complexity (>10)
  - Deeply nested conditionals (>3 levels)
  - Long methods (>50 lines)
  - God classes (>500 lines, >20 methods)
  - Quantify: Complexity scores, hotspots

- **Poor Structure**
  - Circular dependencies
  - Inappropriate intimacy between classes
  - Feature envy (methods using other class data)
  - Shotgun surgery patterns
  - Quantify: Coupling metrics, change frequency

**Architecture Debt**
- **Design Flaws**
  - Missing abstractions
  - Leaky abstractions
  - Violated architectural boundaries
  - Monolithic components
  - Quantify: Component size, dependency violations

- **Technology Debt**
  - Outdated frameworks/libraries
  - Deprecated API usage
  - Legacy patterns (e.g., callbacks vs promises)
  - Unsupported dependencies
  - Quantify: Version lag, security vulnerabilities

**Testing Debt**
- **Coverage Gaps**
  - Untested code paths
  - Missing edge cases
  - No integration tests
  - Lack of performance tests
  - Quantify: Coverage %, critical paths untested

- **Test Quality**
  - Brittle tests (environment-dependent)
  - Slow test suites
  - Flaky tests
  - No test documentation
  - Quantify: Test runtime, failure rate

**Documentation Debt**
- **Missing Documentation**
  - No API documentation
  - Undocumented complex logic
  - Missing architecture diagrams
  - No onboarding guides
  - Quantify: Undocumented public APIs

**Infrastructure Debt**
- **Deployment Issues**
  - Manual deployment steps
  - No rollback procedures
  - Missing monitoring
  - No performance baselines
  - Quantify: Deployment time, failure rate

### 2. Impact Assessment

Calculate the real cost of each debt item:

**Development Velocity Impact**
```
Debt Item: Duplicate user validation logic
Locations: 5 files
Time Impact: 
- 2 hours per bug fix (must fix in 5 places)
- 4 hours per feature change
- Monthly impact: ~20 hours
Annual Cost: 240 hours × $150/hour = $36,000
```

**Quality Impact**
```
Debt Item: No integration tests for payment flow
Bug Rate: 3 production bugs/month
Average Bug Cost:
- Investigation: 4 hours
- Fix: 2 hours  
- Testing: 2 hours
- Deployment: 1 hour
Monthly Cost: 3 bugs × 9 hours × $150 = $4,050
Annual Cost: $48,600
```

**Risk Assessment**
- **Critical**: Security vulnerabilities, data loss risk
- **High**: Performance degradation, frequent outages
- **Medium**: Developer frustration, slow feature delivery
- **Low**: Code style issues, minor inefficiencies

### 3. Debt Metrics Dashboard

Create measurable KPIs:

**Code Quality Metrics**
```yaml
Metrics:
  cyclomatic_complexity:
    current: 15.2
    target: 10.0
    files_above_threshold: 45
    
  code_duplication:
    percentage: 23%
    target: 5%
    duplication_hotspots:
      - src/validation: 850 lines
      - src/api/handlers: 620 lines
      
  test_coverage:
    unit: 45%
    integration: 12%
    e2e: 5%
    target: 80% / 60% / 30%
    
  dependency_health:
    outdated_major: 12
    outdated_minor: 34
    security_vulnerabilities: 7
    deprecated_apis: 15
```

**Trend Analysis**
```python
debt_trends = {
    "2024_Q1": {"score": 750, "items": 125},
    "2024_Q2": {"score": 820, "items": 142},
    "2024_Q3": {"score": 890, "items": 156},
    "growth_rate": "18.7% across Q1 to Q3 in this hypothetical series",
    "projection": "1200 by 2025_Q1 without intervention"
}
```

### 4. Prioritized Remediation Plan

Create an actionable roadmap based on ROI:

**Quick Wins (High Value, Low Effort)**
Week 1-2:
```
1. Extract duplicate validation logic to shared module
   Effort: 8 hours
   Savings: 20 hours/month
   Illustrative net time ROI: (20 - 8) / 8 = 150% in first month

2. Add error monitoring to payment service
   Effort: 4 hours
   Savings: 15 hours/month debugging
   Illustrative net time ROI: (15 - 4) / 4 = 275% in first month

3. Automate deployment script
   Effort: 12 hours
   Savings: 2 hours/deployment × 20 deploys/month
   Illustrative net time ROI: (40 - 12) / 12 = 233% in first month
```

**Medium-Term Improvements (Month 1-3)**
```
1. Refactor OrderService (God class)
   - Split into 4 focused services
   - Add comprehensive tests
   - Create clear interfaces
   Effort: 60 hours
   Savings: 30 hours/month maintenance
   ROI: Positive after 2 months

2. Upgrade React 16 → 18
   - Update component patterns
   - Migrate to hooks
   - Fix breaking changes
   Effort: 80 hours  
   Benefits: measure compatibility and actual performance; no assumed uplift
   ROI: Positive after 3 months
```

**Long-Term Initiatives (Quarter 2-4)**
```
1. Implement Domain-Driven Design
   - Define bounded contexts
   - Create domain models
   - Establish clear boundaries
   Effort: 200 hours
   Benefits: assess actual coupling after a scoped change
   ROI: Positive after 6 months

2. Comprehensive Test Suite
   - Unit: 80% coverage
   - Integration: 60% coverage
   - E2E: Critical paths
   Effort: 300 hours
   Benefits: measure escaped defects; no guaranteed reduction
   ROI: Positive after 4 months
```

### 5. Implementation Strategy

**Incremental Refactoring**
```python
# Phase 1: Add facade over legacy code
class PaymentFacade:
    def __init__(self):
        self.legacy_processor = LegacyPaymentProcessor()
    
    def process_payment(self, order):
        # New clean interface
        return self.legacy_processor.doPayment(order.to_legacy())

# Phase 2: Implement new service alongside
class PaymentService:
    def process_payment(self, order):
        # Clean implementation
        pass

# Phase 3: Gradual migration
class PaymentFacade:
    def __init__(self):
        self.new_service = PaymentService()
        self.legacy = LegacyPaymentProcessor()
        
    def process_payment(self, order):
        if feature_flag("use_new_payment"):
            return self.new_service.process_payment(order)
        return self.legacy.doPayment(order.to_legacy())
```

**Team Allocation**
```yaml
Debt_Reduction_Team:
  dedicated_time: "20% sprint capacity"
  
  roles:
    - tech_lead: "Architecture decisions"
    - senior_dev: "Complex refactoring"  
    - dev: "Testing and documentation"
    
  sprint_goals:
    - sprint_1: "Quick wins completed"
    - sprint_2: "God class refactoring started"
    - sprint_3: "Test coverage >60%"
```

### 6. Prevention Strategy

Implement gates to prevent new debt:

**Automated Quality Gates**
```yaml
pre_commit_hooks:
  - complexity_check: "max 10"
  - duplication_check: "max 5%"
  - test_coverage: "min 80% for new code"
  
ci_pipeline:
  - dependency_audit: "no high vulnerabilities"
  - performance_test: "no regression >10%"
  - architecture_check: "no new violations"
  
code_review:
  - requires_two_approvals: true
  - must_include_tests: true
  - documentation_required: true
```

**Debt Budget**
```python
debt_budget = {
    "allowed_monthly_increase": "2%",
    "mandatory_reduction": "5% per quarter",
    "tracking": {
        "complexity": "sonarqube",
        "dependencies": "dependabot",
        "coverage": "codecov"
    }
}
```

### 7. Communication Plan

**Stakeholder Reports**
```markdown
## Executive Summary
- Current debt score: 890 (High)
- Monthly velocity loss: 35%
- Bug rate increase: 45%
- Recommended investment: 500 hours
- Expected ROI: 280% over 12 months

## Key Risks
1. Payment system: 3 critical vulnerabilities
2. Data layer: No backup strategy
3. API: Rate limiting not implemented

## Proposed Actions
1. Immediate: Security patches (this week)
2. Short-term: Core refactoring (1 month)
3. Long-term: Architecture modernization (6 months)
```

**Developer Documentation**
```markdown
## Refactoring Guide
1. Always maintain backward compatibility
2. Write tests before refactoring
3. Use feature flags for gradual rollout
4. Document architectural decisions
5. Measure impact with metrics

## Code Standards
- Complexity limit: 10
- Method length: 20 lines
- Class length: 200 lines
- Test coverage: 80%
- Documentation: All public APIs
```

### 8. Success Metrics

Track progress with clear KPIs:

**Monthly Metrics**
- Debt score reduction: Target -5%
- New bug rate: Target -20%
- Deployment frequency: Target +50%
- Lead time: Target -30%
- Test coverage: Target +10%

**Quarterly Reviews**
- Architecture health score
- Developer satisfaction survey
- Performance benchmarks
- Security audit results
- Cost savings achieved

## Output Format

1. **Debt Inventory**: Comprehensive list categorized by type with metrics
2. **Impact Analysis**: Cost calculations and risk assessments
3. **Prioritized Roadmap**: Quarter-by-quarter plan with clear deliverables
4. **Quick Wins**: Immediate actions for this sprint
5. **Implementation Guide**: Step-by-step refactoring strategies
6. **Prevention Plan**: Processes to avoid accumulating new debt
7. **ROI Projections**: Expected returns on debt reduction investment

Focus on delivering measurable improvements that directly impact development velocity, system reliability, and team morale.

## Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

© sickn33 · MIT · sickn33/agentic-awesome-skills

Похожие скиллы

Все скиллы по теме «Код-ревью и рефакторинг» →
tech-debt Seth Hobson Команда tech-debt находит технический долг в кодовой базе, оценивает его влияние на разработку и строит план рефакторинга с расчётом окупаемости затрат. CX Codex +1 ★ 42 780звёзд репо tech-debt-tracker Alireza Rezvani Скилл tech-debt-tracker находит технический долг в кодовой базе, считает приоритеты и строит динамику по снапшотам. Помогает планировать спринты рефакторинга. CX Codex +1 614установок technical-debt-manager davila7 Субагент technical-debt-manager находит архитектурные проблемы и дыры в тестах. Помогает составить план рефакторинга перед спринтом. CX Codex 857установок refactoring-patterns proffesor-for-testing Скилл refactoring-patterns для Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI и OpenCode, который применяет паттерны рефакторинга. Запускается, когда нужно улучшить структуру кода без изменения поведения. CX Codex +1 140установок tech-debt-analyzer ailabs-393 Скилл tech-debt-analyzer находит техдолг в проектах на JavaScript и TypeScript с помощью скриптов на Python, а затем помогает оформить реестр проблем и записи архитектурных решений. CX Codex +1 991установок refactoring-expert SuperClaude-Org Субагент refactoring-expert снижает цикломатическую сложность кода и устраняет технический долг через принципы SOLID. Пригодится при безопасном рефакторинге без изменения поведения системы. CX Codex ★ 23 950звёзд репо

Из того же набора187

Весь набор →
docs-architect Скилл docs-architect для Claude Code разбирает архитектуру и устройство кодовой базы, чтобы подготовить подробную техническую документацию. Включается для создания руководств, описания компонентов и объяснения проектных решений. CX Codex +1 2установок network-engineer Скилл network-engineer для Claude Code настраивает облачные сети, архитектуру безопасности и производительность. Запускается при проектировании инфраструктуры и отладке сетевых маршрутов. CX Codex +1 2установок legacy-modernizer Скилл legacy-modernizer помогает безопасно обновлять устаревший стек, переписывать легаси-код и закрывать техдолг с сохранением обратной совместимости. CX Codex +1 2установок employment-contract-templates Скилл employment-contract-templates для Claude Code и Codex, создающий шаблоны трудовых договоров, офер-писем и HR-политик под разные юрисдикции. Работает также на Cursor, GitHub Copilot, Gemini CLI и OpenCode. CX Codex +1 2установок stitch-ui-design Скилл stitch-ui-design для Claude Code и Codex помогает составлять промпты для Google Stitch, генерирующего макеты веб- и мобильных интерфейсов. Он описывает экраны, стиль и поведение элементов. CX Codex +1 2установок programmatic-seo Скилл programmatic-seo для проектирования систем программного SEO: оценка осуществимости, выбор стратегии шаблонов и защита от тонкого контента. CX Codex +1 2установок backend-development-feature-development Скилл backend-development-feature-development для Claude Code ведёт разработку функции от требований и архитектуры до реализации, тестирования и выката. Координирует изменения между сервисами и командами. CX Codex +1 2установок machine-learning-ops-ml-pipeline Скилл machine-learning-ops-ml-pipeline для проектирования и развёртывания полного ML-конвейера. Координирует специализированные агенты для работы с данными, обучением моделей, их оптимизацией и развёртыванием на production. CX Codex +1 2установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой