code-refactoring

Refactor React Native components to eliminate anti-patterns and improve readability.

1|Updated Jan 10, 2026
One-click install
npx skills add https://github.com/rakaadi/agent-kit --skill code-refactoring-rakaadi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-refactoring
Source: https://github.com/rakaadi/agent-kit/tree/main/skills/code-refactoring
Command: npx skills add https://github.com/rakaadi/agent-kit --skill code-refactoring-rakaadi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides practical guidance for refactoring React Native components to improve readability, reduce complexity, and optimize rendering performance while preserving compatibility with React Compiler and ESLint rules.

Core Features & Use Cases

  • Eliminate deeply nested conditionals
  • Optimize array mapping and memoization
  • Improve RTK Query usage patterns and cache invalidation
  • Follow the refactoring workflow to maintain code standards and readability
  • Real-world scenario: refactor a complex RN component handling data loading and conditional rendering to cleaner, testable code.

Quick Start

Explain the current component and apply the outlined refactoring steps to produce before/after examples.

Frequently Asked Questions about code-refactoring

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor React Native components for better performance?

Refactor React Native components by eliminating deeply nested conditionals, optimizing array mapping, and applying selective RTK Query usage to improve readability and rendering performance.

What is the best way to handle complex state rendering in React Native?

The best way to handle complex state rendering is applying ts-pattern-based state rendering and lifting state for mapped items to reduce component complexity and improve maintainability.

How do I optimize RTK Query usage and cache invalidation in React Native?

Optimize RTK Query by applying selective usage patterns and targeted cache invalidation strategies to improve data fetching performance across your React Native application.

Does this refactoring approach work with React Compiler and TypeScript?

Yes, the refactoring approach ensures all code adheres to path alias conventions, uses typed Redux hooks, avoids direct color literals, and remains fully compatible with React Compiler.

How do I fix code smells in a React Native codebase?

Fix code smells by following a structured refactoring workflow to identify anti-patterns, eliminate direct color literals, and enforce typed Redux hooks for better code standards.

Why should I use ts-pattern for state rendering in React Native?

Use ts-pattern for state rendering to eliminate deeply nested conditionals, producing cleaner, testable code that is easier to maintain and debug in complex React Native components.