Refactor
skill dump
npx -y skills add usrrname/agent-skills --skill refactorAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Refactors existing code by identifying language and applying best practices. Use when the user asks to refactor, improve, optimize, or clean up code.
SKILL.md
1.4 KB, as published. Nobody here has run it
- Detect the programming language before refactoring — state it in the response
- Refactor when the request includes "refactor", "improve", "optimize", "clean up", or similar
- Preserve original intent and functionality unless the user requests a change
- If code contains duplication, refactor and test before introducing new changes
- Use idiomatic, modern, maintainable patterns for the detected language
- Add or update comments and documentation as appropriate
- Ask clarifying questions if the request is ambiguous
- Provide before/after code examples in the response
- Ensure changes do not break unrelated code in larger files
- Run or suggest relevant tests after refactoring
- Make minimal changes while preserving readability
- Identify contradictory requirements or existing implementations that block the refactor
Examples
JavaScript
// Before:
function sum(a, b) { return a+b }
// After:
/** Returns the sum of two numbers */
function sum(a, b) {
return a + b;
}
Python
# Before:
def greet(name):return 'Hello, '+name
# After:
def greet(name: str) -> str:
"""Return a greeting for the given name."""
return f"Hello, {name}"