store-data-structures

Installation
SKILL.md

LobeHub Store Data Structures

This guide covers how to structure data in Zustand stores for optimal performance and user experience.

Core Principles

✅ DO

  1. Separate List and Detail - Use different structures for list pages and detail pages
  2. Use Map for Details - Cache multiple detail pages with Record<string, Detail>
  3. Use Array for Lists - Simple arrays for list display
  4. Types from @lobechat/types - Never use @lobechat/database types in stores
  5. Distinguish List and Detail types - List types may have computed UI fields

❌ DON'T

  1. Don't use single detail object - Can't cache multiple pages
  2. Don't mix List and Detail types - They have different purposes
  3. Don't use database types - Use types from @lobechat/types
Related skills

More from lobehub/lobe-chat

Installs
1
GitHub Stars
77.0K
First Seen
Apr 8, 2026