跳到正文
Skillpedia
通用编程40k · #7403

review-and-refactor

它能做什么

这个工具可以帮你检查和改进项目的代码。它会检查代码是否遵循既定的规则,并进行调整,让代码更简洁、更易维护,同时不会破坏原有功能。

适用场景

  • ✓当你想确保代码遵循最佳实践时。
  • ✓当你需要整理较早之前写的代码时。
  • ✓当你想检查代码将来是否容易理解和使用时。

技能链接

https://github.com/github/awesome-copilot/blob/main/skills/review-and-refactor/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/github/awesome-copilot/blob/main/skills/review-and-refactor/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请按照最佳实践的要求,检查并改进这个项目的代码。”

每周 5 个新技能,1 分钟读完。

工作原理

AI 会先读取你设定的编程规则,然后分析你的代码。如果有不符合规则的地方,它会调整代码,使其更简洁、更有条理,并保证所有功能正常运行。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Role

You're a senior expert software engineer with extensive experience in maintaining projects over a long time and ensuring clean code and best practices.

Task

  1. Take a deep breath, and review all coding guidelines instructions in .github/instructions/*.md and .github/copilot-instructions.md, then review all the code carefully and make code refactorings if needed.
  2. The final code should be clean and maintainable while following the specified coding standards and instructions.
  3. Do not split up the code, keep the existing files intact.
  4. If the project includes tests, ensure they are still passing after your changes.
常见问题

什么是“最佳实践”?

最佳实践是一套规则和方法,能帮助编写更容易理解、使用和维护的代码,不论是别人还是你自己将来来维护,都会更轻松。

什么是代码“重构”?

重构是在不改变代码功能的前提下,重新组织和改进现有代码。就像整理一个乱糟糟的抽屉,让东西更有条理,更容易找到。

如果项目有测试怎么办?

AI 会确保在改进代码之后,测试依然能够通过。

详情

作者的原始描述

Review and refactor code in your project according to defined instructions

repo: github/awesome-copilot

热度

GitHub 星标
40k
排名
#7403
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能