skills/code-refactoring/SKILL.md
Guide for code refactoring, use this skill to guide you when user asked to refactor a components or functions and when an implementation of a plan requiring a code refactoring.
npx skillsauth add rakaadi/agent-kit code-refactoringInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill specializes in refactoring React Native code. It focuses on eliminating deeply nested conditionals, optimizing array operations and component re-renders, improving RTK Query usage patterns, and enhancing code readability while maintaining React Compiler compatibility and ESLint compliance.
Simplicity is a Feature, Not a Limitation: Code complexity should only exist when it solves a problem that simple code cannot. Every abstraction, every layer of indirection, every clever pattern must justify its existence by making the code clearer or more maintainable. If a straightforward approach works, use it. Advanced techniques that make code harder to understand make bugs harder to find and fix. In a healthcare application, clarity is a safety feature.
Priority Order (Highest to Lowest):
selectFromResultskipTokeninvalidatesTags/providesTagsuseFocusEffectuseMemo wrapping simple calculations? → RemoveuseCallback wrapping stable references? → RemoveuseEffect creating derived state? → Compute during renderts-pattern for nested conditionals in renderinguseCallback only when passing to memoized children@components, @utils/*, etc.) where applicableuseAppDispatch, useAppSelector)When suggesting refactored code:
Always Include:
Always Explain:
Never:
../../components when the import is covered by an aliasSuspense for data fetching is experimental in RN)useDispatch, useSelector)development
Guide for writing a unit test. Use when writing a unit test for functions or components, and when fixing a bug in existing code.
development
Use when you have a spec or requirements for a multi-step task, before touching code. Supports either Markdown plans or review-oriented HTML plan artifacts.
documentation
Protocol for dispatching subagents effectively. Use this skill EVERY TIME you are about to delegate work to a custom or built-in agent. Covers when to dispatch, which agent to pick, how to write self-contained prompts, and parallel execution. Trigger phrases: "delegate to agent", "dispatch subagent", "run agent", "use subagent", "context isolation", "parallel agents".
development
Guide for debugging issue on a specific code sections, pattern, or files. Used this skill when user asking for assistant when debugging an issues or explaining a code.