refactor-legacy-code by aj-geddes/useful-ai-prompts
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill refactor-legacy-code此技能可帮助您系统地重构遗留代码,以在保留现有功能的同时,提高可维护性、可读性和性能。它遵循行业最佳实践,通过全面的测试进行安全重构。
首先,分析遗留代码以了解情况:
# 查看代码库结构
tree -L 3 -I 'node_modules|dist|build'
# 检查过时的依赖项
npm outdated # 或 pip list --outdated, composer outdated 等
# 识别代码复杂度热点
# 使用工具如:
# - SonarQube 用于检测代码异味
# - eslint 用于 JavaScript
# - pylint 用于 Python
# - RuboCop 用于 Ruby
references/ 目录下的详细实现:
| 指南 | 内容 |
|---|---|
| 代码评估 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 代码评估 |
| 建立安全网 | 建立安全网 |
| 增量重构 | 增量重构 |
| 现代化模式 | 现代化模式 |
| 减少依赖 | 减少依赖、文档 |
| 完整重构示例 | 完整重构示例 |
| 实现的收益 | 实现的收益 |
每周安装数
122
代码仓库
GitHub 星标数
116
首次出现
2026年1月21日
安全审计
安装于
opencode103
gemini-cli100
codex97
claude-code96
cursor91
github-copilot86
This skill helps you systematically refactor legacy code to improve maintainability, readability, and performance while preserving existing functionality. It follows industry best practices for safe refactoring with comprehensive testing.
First, analyze the legacy code to understand:
# Review the codebase structure
tree -L 3 -I 'node_modules|dist|build'
# Check for outdated dependencies
npm outdated # or pip list --outdated, composer outdated, etc.
# Identify code complexity hotspots
# Use tools like:
# - SonarQube for code smells
# - eslint for JavaScript
# - pylint for Python
# - RuboCop for Ruby
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Code Assessment | Code Assessment |
| Establish Safety Net | Establish Safety Net |
| Incremental Refactoring | Incremental Refactoring |
| Modernize Patterns | Modernize Patterns |
| Reduce Dependencies | Reduce Dependencies, Documentation |
| Complete Refactoring Example | Complete Refactoring Example |
| Benefits Achieved |
Weekly Installs
122
Repository
GitHub Stars
116
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode103
gemini-cli100
codex97
claude-code96
cursor91
github-copilot86
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
33,600 周安装
claw402:按次付费市场数据与AI API | 230+专业数据端点 | 加密货币、股票、外汇、AI推理
1 周安装
QR Coin 拍卖:在 Base 区块链上竞标二维码 URL 展示位 | 区块链拍卖工具
1 周安装
SAP ABAP 开发技能指南:语法、SQL、内表操作与性能优化
149 周安装
Hydrex 治理指南:锁定 HYDX 获取投票权,参与流动性池投票与单边挖矿
1 周安装
Base技能:Bankrbot/Clawdbot-Skill核心基础功能,GitHub星标984+的开发者工具
1 周安装
Bankr Signals - Base区块链交易信号验证与复制工具,提升交易绩效
1 周安装
| Benefits Achieved |