provider-and-init-rules

Community

Zero-fetch app providers with idempotent init.

Authorarmanisadeghi
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Enforces initialization, provider, and data-fetching rules for the app shell, layout, and global provider tree. Use when working on app/Providers.tsx, app/DeferredSingletons.tsx, any layout.tsx, any provider file, any context that wraps children globally, StoreProvider, or when adding new providers, data-fetching to the startup path, or useEffect calls that run on mount in upper-level components. Also use when someone references Redux user state, auth checks, isAdmin, isGuest, or fingerprintId on the client side.

Core Features & Use Cases

  • Empty-shell pattern: mount providers as zero-cost shells and expose an idempotent initialize() to trigger data loading on demand.
  • Duplicate-provider guard: ensure a single provider instance in the global tree; call initialize() only from the existing context.
  • Redux-first guidance: migrate legacy contexts to Redux where feasible and document exceptions.
  • Client-side auth safeguards: avoid client-side Supabase auth calls; use server-side or Redux selectors for user identity.

Quick Start

Refactor your app’s providers to mount as empty shells with an idempotent initialize() and trigger initialization only when data is actually required.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: provider-and-init-rules
Download link: https://github.com/armanisadeghi/ai-matrx/archive/main.zip#provider-and-init-rules

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.