Reactive Global State Management for React

VerifiedSafe

A simple, secure, and scalable reactive global state management library for React with TypeScript support, persistence, and sync capabilities.

Sby Skills Guide Bot
DevelopmentIntermediate
7/23/2026
Claude CodeCursorWindsurfCopilotCodex
#react#state-management#typescript#ssr#persistence

Recommended for

Automated summary

Contribution skill for the @biglogic/rgs library that guides writing hooks and utilities for reactive React global state in strict TypeScript, with build and type-check before committing.

Strengths

  • Explicit, checkable code rules: strict typing, no any, no console.log, arrow functions only
  • Task-based workflow (new feature, bug fix, testing) with the exact commands to run
  • Enforced output format through a JSDoc block documenting every new hook or function
  • Points to the right files (core/, index.ts, core/types.ts) and commands (npx tsc --noEmit, npm run build)

Limitations

  • Highly specific to the @biglogic/rgs library; the conventions do not transfer directly to other projects
  • Covers neither versioning, npm publishing, nor a real test strategy beyond running npm run test
  • Style rules are stated without tooling configuration (ESLint, Prettier) to enforce them automatically
When to use it

Use it when contributing to the @biglogic/rgs repository or writing hooks and utilities built on that library.

When not to use it

Avoid it on a React project relying on another state manager (Zustand, Redux, Jotai) or not depending on @biglogic/rgs.

Security analysis

Safe
Quality score78/100

The skill contains only documentation and coding guidelines for a React state management library. No destructive, exfiltration, or obfuscated actions are described; build/test commands are standard and not executed by the skill itself.

No concerns found

How this analysis is made

Examples

Add a new hook
Add a useSyncedState hook in core/hooks.ts of @biglogic/rgs, export it from index.ts, add its types to core/types.ts, then run npm run build and npx tsc --noEmit.
Fix type errors
Fix the TypeScript errors in core/persistence.ts of @biglogic/rgs: start with npx tsc --noEmit, fix the type errors first, and don't introduce any.
Secure persisted store
Write a type-safe helper in core/ for @biglogic/rgs that uses generateEncryptionKey() and sanitizeValue() before persisting a store value, with a JSDoc comment and console.warn instead of console.log.

name: biglogic-rgs description: Reactive global state management library for React - simple, secure, scalable

@biglogic/rgs - Reactive Global State

Overview

RGS (Argis) is a reactive global state management library for React. Simple, secure, and scalable. It provides typed state management with built-in persistence, security, and sync capabilities.

Instructions

Constraints

  1. TypeScript Strict: Always use strict typing - avoid any unless absolutely necessary
  2. No console.log: Use console.debug for debugging, or console.warn/console.error for warnings/errors
  3. Build before commit: Always run npm run build successfully before any commit
  4. Test TypeScript: Run npx tsc --noEmit to verify no type errors
  5. No console.log debugging: Never leave console.log statements in production code
  6. Use arrow functions: Prefer arrow functions over function declarations

Workflow

  1. For new features:

    • Create in core/ folder
    • Export from index.ts if public API
    • Add types to core/types.ts
    • Run build and type-check
  2. For bug fixes:

    • Run npx tsc --noEmit to identify issues
    • Fix type errors first
    • Verify build succeeds
  3. For testing:

    • Run npm run build or npm run test
    • Config is in tests/ folder

Output Format

When adding new hooks or functions:

/**
 * Description of what the hook does.
 * @param param - Description of parameter
 * @returns Description of return value
 */
export const myHook = (param: string): boolean => {
  // Implementation
}

Usage Examples

Basic Store Creation

import { gstate } from '@biglogic/rgs'

// Create store with typed hook
const store = gstate({ count: 0, name: 'John' })

// Use typed hook for specific keys
const [count, setCount] = store('count')
const [name, setName] = store('name')

// Or use store directly
store.set('count', 5)
store.get('count')

SSR Support

import { isServerSide, hydrateOnClient } from '@biglogic/rgs'

if (isServerSide()) {
  // Server-side logic
}

hydrateOnClient(myStore)

Security

import { generateEncryptionKey, validateKey } from '@biglogic/rgs'

// Generate encryption key for secure persistence
const key = generateEncryptionKey()

// Validate keys to prevent XSS
if (validateKey(userInput)) {
  store.set(userInput, value)
}

API Quick Reference

Core

| Function | Description | |----------|-------------| | gstate(initialState, config?) | Creates store + returns typed hook | | useStore(key, store?) | React hook for state subscription | | createStore(config?) | Creates store instance | | initState(config?) | Initializes global store | | getStore() | Gets current default store |

SSR

| Function | Description | |----------|-------------| | isServerSide() | Check if running on server | | isClientSide() | Check if running on client | | hydrateOnClient(store) | Hydrate store on client |

Security

| Function | Description | |----------|-------------| | generateEncryptionKey() | Generate AES-256 key | | validateKey(key) | Validate key format (XSS prevention) | | sanitizeValue(value) | Sanitize value |

Project Structure

core/
├── hooks.ts       # React hooks (useStore, useSyncedState)
├── store.ts       # Core store implementation
├── types.ts       # TypeScript types
├── security.ts    # Security utilities
├── persistence.ts # Storage persistence
├── sync.ts        # Sync engine
└── ssr.ts        # SSR support

Dependencies

  • peerDependencies: react, react-dom (>=16.8.0)
  • devDependencies: typescript, tsup, terser

License

MIT - Copyright Dario Passariello

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/reactive-global-state-management-for-react-mrx3xy2y/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/reactive-global-state-management-for-react-mrx3xy2y' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/reactive-global-state-management-for-react-mrx3xy2y/download' --output '.skill-downloads/reactive-global-state-management-for-react-mrx3xy2y/SKILL.md.part' && mv '.skill-downloads/reactive-global-state-management-for-react-mrx3xy2y/SKILL.md.part' '.skill-downloads/reactive-global-state-management-for-react-mrx3xy2y/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Original excerpt: Dependencies
  • peerDependencies: react, react-dom (>=16.8.0)
  • devDependencies: typescript, tsup, terser

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/reactive-global-state-management-for-react-mrx3xy2y/SKILL.md' && test -s '.skill-downloads/reactive-global-state-management-for-react-mrx3xy2y/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/biglogic-rgs' && cp -R '.skill-downloads/reactive-global-state-management-for-react-mrx3xy2y' '.claude/skills/biglogic-rgs'

Cursor
test -f '.skill-downloads/reactive-global-state-management-for-react-mrx3xy2y/SKILL.md' && test -s '.skill-downloads/reactive-global-state-management-for-react-mrx3xy2y/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/biglogic-rgs' && cp -R '.skill-downloads/reactive-global-state-management-for-react-mrx3xy2y' '.cursor/skills/biglogic-rgs'

Codex
test -f '.skill-downloads/reactive-global-state-management-for-react-mrx3xy2y/SKILL.md' && test -s '.skill-downloads/reactive-global-state-management-for-react-mrx3xy2y/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/biglogic-rgs' && cp -R '.skill-downloads/reactive-global-state-management-for-react-mrx3xy2y' '.agents/skills/biglogic-rgs'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/reactive-global-state-management-for-react-mrx3xy2y'

openskills read 'reactive-global-state-management-for-react-mrx3xy2y'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/reactive-global-state-management-for-react-mrx3xy2y/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills