code-refactoring-tech-debt
Skill này làm gì
Công cụ này phân tích code của bạn để tìm các vấn đề làm chậm việc phát triển hoặc gây lỗi. Nó gợi ý nên sửa vấn đề nào trước, dựa trên mức ảnh hưởng và công sức cần bỏ ra.
Khi nào nên dùng
- ✓Khi code khó hiểu hoặc khó sửa.
- ✓Khi nhiều lỗi xuất hiện ở một số phần cụ thể của code.
- ✓Trước khi thực hiện các thay đổi lớn để tránh gây ra vấn đề mới.
Liên kết skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/code-refactoring-tech-debt/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Phân tích code của tôi và cho tôi biết những vấn đề lớn nhất cùng cách sửa chúng trước.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ xem xét code và lịch sử thay đổi để tìm các phần bị trùng lặp, phức tạp hoặc lỗi thời. Sau đó, nó ước tính chi phí của các vấn đề này và đề xuất kế hoạch sửa, bắt đầu từ những vấn đề quan trọng nhất.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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:
…
Câu hỏi thường gặp
“Nợ kỹ thuật” (technical debt) là gì?
Giống như nợ tài chính nhưng trong code. Đó là các đường tắt hoặc cách sửa nhanh, theo thời gian làm phần mềm khó bảo trì và phát triển hơn, tốn kém hơn.
Công cụ tìm được những loại vấn đề nào?
Công cụ tìm code bị trùng lặp, code quá phức tạp, thiếu kiểm thử, thư viện lỗi thời, vấn đề kiến trúc và tài liệu chưa đầy đủ.
Công cụ quyết định sửa cái nào trước bằng cách nào?
Nó ưu tiên các vấn đề gây chậm trễ phát triển hoặc gây lỗi nhiều nhất, và những vấn đề dễ sửa hơn, tập trung vào lợi ích tốt so với công sức bỏ ra.
Chi tiết
Mô tả gốc của tác giả
Identify technical debt from actual code and change history, estimate its impact, and prioritize bounded improvements with explicit assumptions.
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #4185
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
00-andruia-consultant
48kGiúp agent của bạn bắt đầu hoặc cải thiện các dự án AI. Phân tích mã, gợi ý công cụ và lập kế hoạch hành động bằng tiếng Tây Ban Nha.
007
48kCho phép agent của bạn thực hiện kiểm toán bảo mật và mô hình hóa mối đe dọa. Hữu ích để bảo vệ dự án khỏi các cuộc tấn công và lỗ hổng.
10-andruia-skill-smith
48kGiúp agent của bạn tạo hoặc cải thiện các công cụ AI. Xác định cách công cụ hoạt động, viết tài liệu và kiểm tra cấu trúc.
20-andruia-niche-intelligence
48kGiúp agent của bạn tạo bản tóm tắt về một ngành cụ thể. Hữu ích để hiểu bối cảnh, quy tắc, cách người dùng tương tác và rủi ro của dự án.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.