Eliminate God Stores

Refactor large Zustand stores into modular slices under 120 lines.

Updated Feb 5, 2026
One-click install
npx skills add https://github.com/shynlee04/idumb-v2 --skill eliminate-god-stores
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Eliminate God Stores
Source: https://github.com/shynlee04/idumb-v2/tree/main/.agent/skills%20copy/architecture-remediation/workflows/eliminate-god-stores
Command: npx skills add https://github.com/shynlee04/idumb-v2 --skill eliminate-god-stores

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the complexity and maintainability issues arising from large, monolithic Zustand stores (god stores) by systematically breaking them down into smaller, focused, and manageable slices.

Core Features & Use Cases

  • Modularization: Splits large stores (>300 lines) into smaller slices (≤120 lines each).
  • Backward Compatibility: Ensures existing functionality remains intact through facade exports.
  • Modernization: Facilitates adoption of Zustand v5 patterns like individual selectors.
  • Use Case: Refactoring a complex user-profile store that has grown too large and unmanageable, improving code clarity and reducing the risk of bugs.

Quick Start

Refactor the large Zustand store located at src/lib/state/user-profile.ts into smaller, manageable slices.

Frequently Asked Questions about Eliminate God Stores

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

FAQPage Schema
How do I refactor a large Zustand store into smaller modular slices?

To refactor a large Zustand store, systematically extract logic into modular slices under 120 lines each while maintaining 100% backward compatibility through facade exports. This process involves store analysis, slice extraction, migration execution, and validation.

What is a god store in Zustand and when should I split it?

A god store in Zustand is a monolithic state management file exceeding 300 lines that causes complexity and maintainability issues. You should split it into focused, manageable slices to improve code organization and reduce bug risks.

Can I modernize my existing Zustand store to use v5 patterns during modularization?

Yes, you can modernize existing Zustand stores during modularization by adopting Zustand v5 patterns like individual selectors. The refactoring process facilitates this modernization while ensuring 100% backward compatibility through facade exports.

Does refactoring a Zustand store into slices break my existing component imports?

No, refactoring a Zustand store into slices does not break existing imports because the process ensures 100% backward compatibility. It creates facade exports that consolidate duplicate stores and maintain existing functionality throughout the migration.

What is the best way to manage a complex user-profile store that has grown too large?

The best way to manage a complex user-profile store is to break down the monolithic structure into focused slices under 120 lines. This modularization improves code clarity, ensures maintainability, and reduces the risk of bugs.

How do I consolidate duplicate Zustand stores during a code modularization refactor?

You can consolidate duplicate Zustand stores during code modularization by executing a systematic slice extraction and migration process. This approach creates facade exports to unify overlapping state logic while maintaining 100% backward compatibility.