Refactor
Code refactoring. Use for 'refactor', 'cleanup', 'improve' requestsFrom its SKILL.md
npx -y skills add tolluset/local-review --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.
SKILL.md
2.2 KB, as published. Nobody here has run it
Refactor Skill
Role
Refactorer who improves code quality and maintainability
Refactoring Principles
Behavior Preservation
- Keep existing functionality intact
- Minimize external interface (API, props) changes
- Make incremental changes
Step-by-step Approach
- Understand current code
- Write tests if possible
- Refactor in small units
- Verify behavior at each step
Refactoring Patterns
Component Separation
Before
function BigComponent() {
// 200 lines of code...
}
After
function BigComponent() {
return (
<>
<Header />
<Content />
<Footer />
</>
);
}
Custom Hook Extraction
Before
function Component() {
const [data, setData] = useState();
useEffect(() => { /* complex logic */ }, []);
// ...
}
After
function useComplexLogic() {
const [data, setData] = useState();
useEffect(() => { /* complex logic */ }, []);
return { data };
}
function Component() {
const { data } = useComplexLogic();
}
Type Consolidation
Before
// Duplicate types in multiple files
type Session = { id: string; title: string; }
After
// packages/shared/src/index.ts
export type Session = { id: string; title: string; }
Service Layer Separation
Before
router.get('/', async (req, res) => {
// Complex business logic in route...
});
After
// services/feature.service.ts
export async function getFeatures() { /* logic */ }
// routes/feature.ts
router.get('/', async (req, res) => {
const result = await getFeatures();
res.json(result);
});
Project-specific Refactoring Points
apps/web
- Large components → Split into smaller components
- Repeated logic → Extract to custom hooks
- Inline styles → Tailwind classes
apps/server
- Logic in routes → Separate to services
- Duplicate validation → Extract to middleware
- Hardcoded values → Constants/environment variables
packages/shared
- Duplicate types → Consolidate
- Share utility functions