Agent skill · Audited from source
zustand
skill · lobehub/lobehubNOASSERTION licenceAudited 14 Nov 2026 · source ebe0ac1c2b52
Is it safe? With care — CAUTION, grade B (89/100). We read this skill's source at commit ebe0ac1c2b52 and found no filesystem, network or shell access and no hard-coded secrets. The audit raised 4 findings, 0 critical or high. What it does: Use for Zustand stores: state shapes and type sources, state-only stores with xActions classes, replica-backed list/detail data (local-replica), selectors, optimistic writes, and legacy slice/internal_* action…
Cite
Cite this page
ModelsAtlas. “zustand (lobehub/lobehub)”. Retrieved 14 Nov 2026. https://modelsatlas.com/skills/lobehub/zustand
2 skills are called “zustand”. You are viewing lobehub/lobehub.
- lobehub/lobehub★ 85k!CAUTION
- pedronauck/skills★ 637✓SAFE
Trust audit
Audit 0.4.1 · source read 14 Nov 2026
CAUTION means the audit found things worth knowing before you trust this skill. Grade B is shared by 17,406 of 18,389 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | WARN | 4 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | NA | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (4)
MEDIUMInventory / provenanceinv.symlink · .claude/skills
.claude/skills
- Why
- link not followed
- Fix
- —
MEDIUMInventory / provenanceinv.symlink · .codex/skills
.codex/skills
- Why
- link not followed
- Fix
- —
MEDIUMInventory / provenanceinv.symlink · .cursor/skills
.cursor/skills
- Why
- link not followed
- Fix
- —
MEDIUMInventory / provenanceinv.symlink · .gemini/skills
.gemini/skills
- Why
- link not followed
- Fix
- —
Audit 0.4.1 · source sha ebe0ac1c2b52 · 14 Nov 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publisherlobehub GitHub organizationOwner of the repository this skill is read from
- Source folderlobehub/lobehub/.agents/skills/zustandThe exact folder we audited
- LicenceNOASSERTIONAs the repository states it
- Commit pinned for this verdictebe0ac1c2b52A new audit runs when the source changes
- Repository statusNot archivedPushed today
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: Use for Zustand stores: state shapes and type sources, state-only stores with xActions classes, replica-backed list/detail data (local-replica), selectors, optimistic writes, and legacy slice/internal_* action…
---
name: zustand
description: 'Use for Zustand stores: state shapes and type sources, state-only stores with xActions classes, replica-backed list/detail data (local-replica), selectors, optimistic writes, and legacy slice/internal_* action composition.'
user-invocable: false
---
# LobeHub Zustand State Management
## State Shapes and Types
- Import shared store types from `@lobechat/types`, not `@lobechat/database`.
- Keep lightweight list-item types separate from full detail types; list types must not extend heavy detail types.
- Key cached details by id (`xxxDetailMap: Record<string, Detail>`); never hold a single `currentDetail` object.
- Read through `xxxSelectors` aggregates (`selectors.ts`), not ad-hoc lambdas repeated across components.
- Before choosing list/detail shapes or type sources, read [Data structures](references/data-structures.md).
## State-Only Stores (default for new and migrated stores)
Actions stay out of the Zustand state. Reference: `src/store/page`.
| File | Owns |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------ |
| `store.ts` | `useXStore = createWithEqualityFn<XState>()(devtools(() => initialState), shallow)`: state only, no methods |
| `privateAction.ts` | `XPrivateAction`: replica slices, entity links, and write helpers shared by public actions. Not exported from `index.ts` |
| `action.ts` | `XActionImpl` (the public API) and the singleton `xActions = new XActionImpl(setState, getState, new XPrivateAction(...))` |
- Components read state with `useXStore(selector)` and call `xActions.foo()` directly. Never select an action out of the store.
- Sync hooks live on the public class and are called as `xActions.useFetchX(params)`.
- Public actions call each other through `this.foo()`. Private helpers are reached through `this.#private`. Do not add `internal_*` methods to the store to share logic between classes.
- Label every write: `this.#set(partial, false, n('actionName'))` with `const n = setNamespace('x')`.
- Put `reset()` on the public class and register `xActions` in `resetableActions` in `src/store/utils/userDataStores.ts`.
- Tests drive `xActions` and assert on `useXStore.getState()`. To mock in component tests: `vi.mock('@/store/x', () => ({ xActions: { foo: vi.fn() }, useXStore: ... }))`.
## Replica-Backed Server Data
Server lists and details the UI paints go through `@/libs/replica`, not a hand-written SWR `onSuccess` + reducer. The engine owns hydration from IndexedDB, head revalidation, paging, optimistic overlays with rollback, and scope (user + workspace) isolation. API reference: the [`local-replica` README](https://github.com/lobehub/local-replica#readme). The engine is maintained in [lobehub/local-replica](https://github.com/lobehub/local-replica): fix it there, publish, then bump the dependency here.
1. Define the resource (`defineReplica` / `definePagedReplica`) in the store's `projection.ts`, converting server rows at the boundary.
2. Add two state fields per replica: the view (`xxxMap: Record<key, TData>`) and its bookkeeping (`xxxReplica: createReplicaState()`).
3. Bind it in the private class: `createReplicaSlice(resource, { get, set, stateKey: 'xxxReplica', view: recordLens('xxxMap'), ... })`. When the same entity lives in several replicas (list row + detail), link them with `linkReplicaEntity([list, detail])`.
4. Read: `slice.useSync(params)` returns only fetch flags (`isHydrated`, `isValidating`, `error`, `revalidate`). Data comes from selectors over `xxxMap`. "Entry is `undefined`" is the loading signal — do not add `xxxInit` flags or `loadingXxxIds`.
5. Read with no view mounted (hover prefetch, refresh after a mutation): `await slice.fetch(params)` (`{ fresh: true }` after a write). Never call the service and `slice.replace(...)` by hand, because that skips the scope, removal, clear and superseded-request guards. Side effects of every response (not-found maps, seeding another store) go in the slice `effects` (`onApplied` / `onMissing` / `onPurge` / `onError`) with `isMissing`, not in one hook's `onSuccess`.
6. Cold start without a skeleton: `useSync` hydrates only after the component mounts. For a list that must paint from the local copy, add a `preHydrate` action (`ensureScope` + `hydrate`) and call it from the route's `loader` through a lazy wrapper (`src/spa/router/pageListLoader.ts`, `agentChatTopicListLoader.ts`) bounded by `settleWithin(..., PRE_PAINT_HYDRATE_TIMEOUT)` from `@/libs/replica/prePaint`. `@/libs/replica` presets the cache scope, IndexedDB / localStorage storage (`AppIndexedDBStorage` / `AppLocalStorage` in `@/libs/replica/storage`) and the app's SWR driver; the package README stays app-agnostic.
7. Write: `slice.optimistic(key, apply, serverCall)` or `entity.optimistic(id, fn | 'remove', serverCall)`. A failed call rolls back to the confirmed value, so deletes are optimistic too. Rows that exist only on the client (temp ids) are declared with `isClientOnly` and seeded with `update(key, fn, { persist: false })`.
Outside test seeding, write a replica's view only through its slice. A plain `set` bypasses the engine's bookkeeping (persistence, rollback base, entity links).
## Legacy Stores
Stores that still flatten action classes into state (`flattenActions`, `create*Slice`, `internal_*`, `internal_dispatch*` + reducers, SWR `onSuccess` syncing) follow [Legacy slices](references/legacy-slices.md). Use that layout only when editing one of those stores; migrate to the layouts above when moving its data onto a replica.Excerpt, first 5,754 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit ebe0ac1
git clone https://github.com/lobehub/lobehub git -C lobehub checkout ebe0ac1c2b52
The author documents no install command, so this uses the repository directly. Our verdict covers commit ebe0ac1c2b52 only.
Works in
The author has not said which agents this skill supports, and we have not tested it in any.
Audit history
Every audit, every source change
- !CAUTION B 89 / 100
first audit · source
ebe0ac1c2b52
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/lobehub/zustand/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
lobehub/lobehub
Version release workflow — release process and GitHub Release notes (not docs/changelog pages).
lobehub/lobehub
Use for TypeScript style and type safety when editing TS/TSX/MTS, including imports, async code and error suppression.
lobehub/lobehub
Use for Upstash Workflow/QStash handlers, triggers, durable steps and async fan-out.
lobehub/lobehub
Explicit compatibility entry for Zustand data-shape guidance.
lobehub/lobehub
Use for Vitest tests, mocks, coverage and failing-test diagnosis.
lobehub/lobehub
Use for TSX components, UI libraries, styling, state locality, layout, render performance and memoization.
Add this badge to your README
[](https://modelsatlas.com/skills/lobehub/zustand/)
<a href="https://modelsatlas.com/skills/lobehub/zustand/"><img src="https://modelsatlas.com/skills/lobehub/zustand/badge.svg" alt="ModelsAtlas: CAUTION B"></a>
Questions about zustand
What does the zustand skill do?
Is zustand safe to install?
What can zustand access on my machine?
How current is this page?
Sources
- github.com/lobehub/lobehub/tree/canary/.agents/skills/zustand — the audited source at commit ebe0ac1c2b52 and every finding aboveObserved · 14 Nov 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the zustand skill do?
- Is zustand safe to install?
- What can zustand access on my machine?