new-store

Create a shared frontend store with hydrate, set, and reset lifecycle.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/weiloon1234/Forge-Starter --skill new-store
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: new-store
Source: https://github.com/weiloon1234/Forge-Starter/tree/main/.claude/skills/new-store
Command: npx skills add https://github.com/weiloon1234/Forge-Starter --skill new-store

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a reusable shared frontend store to coordinate state across multiple components, pages, and hooks within a portal, removing the need for ad-hoc prop drilling or duplicate local state.

Core Features & Use Cases

  • Centralized store created with a generic createStore pattern, offering hydrate, set, and reset APIs, plus domain-specific verbs for mutations.
  • Narrow selector hooks that re-render only when the selected slice changes, and lifecycle management to hydrate on login and reset on logout.

Quick Start

Create and hydrate the shared-store on login, and reset it on logout.

Frequently Asked Questions about new-store

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

FAQPage Schema
How do I share React state across components without prop drilling?

A shared frontend store coordinates state across multiple components, pages, and hooks, removing the need for ad-hoc prop drilling or duplicate local state. It uses a generic createStore pattern with hydrate, set, and reset APIs.

How does a shared store handle React component re-renders?

Shared store implementations use narrow selector hooks that ensure components only re-render when the specific selected state slice changes. This prevents unnecessary re-renders across unrelated components sharing the same store.

Can I reset frontend state when a user logs out of a React portal?

Yes, the shared store includes auth-aware lifecycle management to automatically hydrate state on login and reset it on logout. This ensures user-specific state is cleared properly during authentication transitions.

What is the best way to manage cross-page state in a React portal?

Using a centralized store with a generic createStore pattern is an effective way to manage cross-page state. It supports portal-local or shared placement and offers domain-specific verbs for targeted state mutations.

When do I need to hydrate a frontend store?

Store hydration is needed during the lifecycle management phase when a user logs in. It initializes and populates the shared store with necessary data so multiple components have immediate access to the required state.

Does this shared store pattern support custom mutation verbs?

Yes, the createStore pattern supports domain-specific verbs for mutations alongside the standard hydrate, set, and reset APIs. This allows you to define custom actions tailored to your specific state update requirements.