code-refactoring
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…
Skill by rakaadi
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/rakaadi-code-refactoring
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/code-refactoring
What's inside
- Skill name
code-refactoring- Description
- 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.
- License
- MIT
- Instructions
- 72 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
## Skill Purpose 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. ## Core Refactoring Principles **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):** 1. Code readability and maintainability 2. RTK Query optimization (data flow determines component architecture) 3. Logical improvements and proper React patterns 4. Performance optimizations (let React Compiler handle micro-optimizations) 5. Modern React patterns (when they genuinely improve clarity) ## Refactoring Workflow ### Step 1: Analyze Current Pattern - Identify the anti-pattern (nested conditionals, unoptimized loops, etc.) - Check if the pattern violates React rules or ESLint config - Assess impact on component re-renders ### Step 2: Check RTK Query Usage - Is data being over-fetched? → Use `selectFromResult` - Are there conditional queries? → Use `skipToken` - Is cache invalidation configured? → Add `invalidatesTags`/`providesTags` - Is polling controlled? → Tie to screen focus with `useFocusEffect` ### Step 3: Evaluate Hook Necessity - Is `useMemo` wrapping simple calculations? → Remove - Is `useCallback` wrapping stable references? → Remove - Is `useEffect` creating derived state? → Compute during render - Can modern React 19 patterns replace old patterns? → Suggest upgrade if clearer ### Step 4: Apply Refactoring - Extract complex logic into helper functions - Use `ts-pattern` for nested conditionals in rendering - Use early returns for nested conditionals in functions - Stabilize references with `useCallback` only when passing to memoized children - Memoize expensive computations with clear performance benefit - Lift state when mapped components need coordination ### Step 5: Verify Compliance - All imports use path aliases (`@components`, `@utils/*`, etc.) where applicable - Redux hooks are typed (`useAppDispatch`, `useAppSelector`) - No Rules of Hooks violations - React Compiler compatible (no manual object identity preservation unless necessary) - ESLint passes ## Code Generation Guidelines When suggesting refactored code: **Always Include:** - Import statements with correct path aliases - Type annotations for function parameters and returns - Comments explaining WHY the refactor improves the code - Before/after comparison when helpful **Always Explain:** - The specific anti-pattern being fixed - How the refactor improves readability/performance - Trade-offs (if any) of the new approach - Which React/RTK Query pattern is being applied **Never:** - Use relative imports like `../../components` when the import is covered by an alias - Suggest React Native incompatible patterns (e.g., `Suspense` for data fetching is experimental in RN) - Use plain Redux hooks (`useDispatch`, `useSelector`) - Suggest patterns that conflict with React Compiler
From rakaadi/agent-kit, MIT.
More from rakaadi/agent-kit
- 0.592score
review-implementation
rakaadi
Review a completed implementation against its complete plan through independent spec-compliance and code-quality review, confirmed-finding remediation, blind…
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
art-of-comment
rakaadi
Guide for editing existing and writing inline comments and JSDoc.
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
execute-plan
rakaadi
Execute or resume an attached or referenced implementation plan through repository inspection, implementation, verification, and complete-plan review.
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
writing-unit-test
rakaadi
Guide for writing a unit test.
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
subagent-dispatch
rakaadi
Dispatch subagents for bounded independent work.
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
code-debugging
rakaadi
Guide for debugging issue on a specific code sections, pattern, or files.
SkillAFreshness: A★ 1Claude Code +9 - 0.584score
fix-repository-diagnostics
rakaadi
Verify or fix diagnostic findings in JavaScript/TypeScript repositories using project tooling.
SkillAFreshness: A★ 1Claude Code +9 - 0.584score
review-code-complexity
rakaadi
Assess flagged code architecturally and recommend justified retention or structural improvement, with approval before changes.
SkillAFreshness: A★ 1Claude Code +9 - 0.584score
program-design
rakaadi
Design the code shape before implementation for substantial features or refactors that introduce or reshape modules, interfaces, types, file layout, or…
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
delegation-assessment
rakaadi
Assess whether recorded implementation work is bounded and verifiable enough to delegate.
SkillAFreshness: A★ 1Claude Code +9 - 0.562score
writing-plan
rakaadi
Use when you have a spec or requirements for a multi-step task, before touching code.
SkillAFreshness: A★ 1Claude Code +9 - 0.551score
meaning
rakaadi
Stop.
SkillAFreshness: A★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 1
- Last commit (this folder)
- Aug 9, 2026 (2 months ago)
- Last release
- Oct 13, 2026 (15 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/rakaadi/agent-kit
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from rakaadi
- 0.592score
review-implementation
rakaadi
Review a completed implementation against its complete plan through independent spec-compliance and code-quality review, confirmed-finding remediation, blind…
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
art-of-comment
rakaadi
Guide for editing existing and writing inline comments and JSDoc.
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
execute-plan
rakaadi
Execute or resume an attached or referenced implementation plan through repository inspection, implementation, verification, and complete-plan review.
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
writing-unit-test
rakaadi
Guide for writing a unit test.
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
subagent-dispatch
rakaadi
Dispatch subagents for bounded independent work.
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
code-debugging
rakaadi
Guide for debugging issue on a specific code sections, pattern, or files.
SkillAFreshness: A★ 1Claude Code +9
Cite this page
code-refactoring skill. Agent Mart. https://agentmart.dev/skills/rakaadi-code-refactoring (last updated 2026-10-24)