review-and-refactor
github/awesome-copilot
Review and refactor code against project guidelines and best practices.
What is review-and-refactor?
A senior code reviewer that analyzes your project against defined coding standards in `.github/instructions/` and `.github/copilot-instructions.md`, then refactors code to improve cleanliness and maintainability. Use it to enforce consistent style, best practices, and architectural patterns across your codebase.
- Reads and applies coding guidelines from `.github/instructions/*.md` and `.github/copilot-instructions.md`
- Reviews entire codebase for adherence to project standards
- Refactors code to improve cleanliness and maintainability
- Preserves existing file structure and organization
- Validates that tests still pass after refactoring
How to install review-and-refactor
npx skills add https://github.com/github/awesome-copilot --skill review-and-refactor- Project must have coding guidelines defined in `.github/instructions/*.md` or `.github/copilot-instructions.md`
- Test suite should be present if you want validation after refactoring
How to use review-and-refactor
- 1.Install the skill using the provided npx command
- 2.Define your coding guidelines in `.github/instructions/` directory or `.github/copilot-instructions.md`
- 3.Invoke the skill to review and refactor your codebase
- 4.Review the suggested changes before committing
- 5.Run your test suite to verify all tests pass
Use cases
- Enforce consistent coding standards across a team project
- Clean up legacy code to match current best practices
- Prepare code for a major version release or refactor cycle
- Ensure new contributions align with project guidelines
- Improve code quality before code review or merge
- Senior developers managing code quality
- Project maintainers enforcing standards
- Teams with established coding guidelines
- Development teams using Copilot for automation
review-and-refactor FAQ
No. The skill keeps existing files intact and only refactors code within them.
The skill will look for guidelines in `.github/instructions/*.md` and `.github/copilot-instructions.md`. Without these files, it cannot apply specific standards.
The skill checks that tests still pass after changes, but you should review and commit the refactored code yourself.
Yes, but review the changes carefully. The skill processes the entire project according to your guidelines.
Full instructions (SKILL.md)
Source of truth, from github/awesome-copilot.
name: review-and-refactor description: 'Review and refactor code in your project according to defined instructions'
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
- Take a deep breath, and review all coding guidelines instructions in
.github/instructions/*.mdand.github/copilot-instructions.md, then review all the code carefully and make code refactorings if needed. - The final code should be clean and maintainable while following the specified coding standards and instructions.
- Do not split up the code, keep the existing files intact.
- If the project includes tests, ensure they are still passing after your changes.
Related skills
More from github/awesome-copilot and the wider catalog.
git-commit
Execute semantic git commits with conventional message analysis and intelligent staging.
excalidraw-diagram-generator
Generate Excalidraw diagrams from natural language descriptions.
documentation-writer
Create structured technical documentation using the Diátaxis framework for tutorials, how-to guides, references, and explanations.
gh-cli
GitHub CLI comprehensive reference for repositories, issues, PRs, Actions, projects, releases, and all GitHub operations from the command line.
prd
Generate comprehensive Product Requirements Documents with executive summaries, user stories, technical specs, and risk analysis.
refactor
Surgical code refactoring to improve maintainability without changing behavior.