codebase-cleanup-tech-debt
它能做什么
这个工具会分析项目的代码,找出技术问题(也就是技术债务),比如重复的代码、过于复杂的代码或已经过时的代码。它还能帮你了解这些问题带来的影响,并建议优先修复哪些问题,让开发更顺畅。
适用场景
- ✓新功能的开发进度变慢时。
- ✓某些 bug 频繁出现时。
- ✓想为较老的项目规划改进方案时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/codebase-cleanup-tech-debt/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“分析一下这个项目的代码,告诉我最大的技术问题有哪些,以及我该从哪里开始修复。”
每周 5 个新技能,1 分钟读完。
工作原理
它会检查代码、修改历史和其他数据,找出问题集中的区域。然后估算这些问题的成本,并给出一份按优先级排序的行动计划。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Compatibility and maintenance
Compatibility alias of code-refactoring-tech-debt; use that ID for new references when no existing contract requires this one. 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
…
常见问题
什么是“技术债务”?
它就像你在软件开发中走捷径或没有遵循最佳实践时积累下来的“债务”。代码会因此更难理解、更容易出错,也更难演进。
它能找出哪些问题?
它会查找重复的代码、过于复杂的代码、结构性问题、过时的技术、缺少测试、文档不完整以及基础设施方面的困难。
它如何决定先修复哪个问题?
它会根据修复的影响(能节省多少时间或成本)以及实施所需的工作量来排序,优先推荐最快、最高效的解决方案。
详情
作者的原始描述
Identify technical debt from actual code and change history, estimate its impact, and prioritize bounded improvements with explicit assumptions.
热度
- GitHub 星标
- 48k
- 排名
- #4201
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。