data-fetching-architecture
LobeHub data-fetching pipeline guide. Use for service layer, Zustand store, SWR, lambdaClient, useClientDataSWR, useFetchXxx hooks, or migrating useEffect fetches.
Install
Install this Claude and Codex skill with the command below. The command stays visible even when copy support is unavailable.
git clone https://github.com/lobehub/lobehub /tmp/lobehub && ln -s /tmp/lobehub/.agents/skills/data-fetching-architecture ~/.claude/skills/data-fetching-architecture
From README
LobeHub Data Fetching Architecture Related: store-data-structures covers List vs Detail data shape rationale (Map vs Array). Architecture Overview Core Principles ✅ DO Use Service Layer for all API calls Use Store SWR Hooks for data fetching (not useEffect) Use proper data structures — see store-data-structures skill for List vs Detail patterns Use lambdaClient.mutate for write operations (create/update/delete) Use lambdaClient.query only inside service methods Naming convention — read hooks are useFetchXxx, cache invalidation helpers are refreshXxx (e.g. useFetchBenchmarks / refreshBenchmarks). Mutations then chain refreshXxx() after the service call.