1k-state-management

Installation
SKILL.md

OneKey State Management

Jotai Atom Organization - MANDATORY STRUCTURE

Global State Atoms (for app-wide, persistent state)

  • Location: packages/kit-bg/src/states/jotai/atoms/
  • Usage: Global settings, account state, hardware state, currency, etc.
  • Pattern: Use globalAtom and EAtomNames for standardization
  • Examples: settings.ts, account.ts, hardware.ts, currency.ts

Feature-Specific State Atoms (for localized functionality)

  • Location: packages/kit/src/states/jotai/contexts/[feature_name]/atoms.ts
  • Usage: Feature-specific state that may be shared across components within that feature
  • Pattern: Use contextAtom from createJotaiContext for consistency
  • Structure:
    contexts/
    ├── marketV2/
    │   ├── atoms.ts     - State definitions
    
Related skills

More from majiayu000/claude-skill-registry

Installs
1
GitHub Stars
299
First Seen
Feb 5, 2026