# Contributor handoff — pmndrs/zustand

> Canonical page: https://codevetter.com/unpack/zustand/agent-handoff

# Contributor handoff — pmndrs/zustand

Scanned commit d7a5583cffd80af515f7dfb69583c95cbdc9e2ce (2026-09-29). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

Start with the affected runtime module and its API/type contract before editing. Tests and CI were inspected, not executed, so all suggested validation remains future work when execution is authorized. Keep changes focused on source and meaningful regressions, and treat initialization, middleware ordering, hydration generations, and generated declarations as coupled contracts.
- Read vanilla.ts and react.ts first for store/hook changes, and read the affected middleware alongside middlewareTypes.test.tsx when altering wrapped APIs or overloads. — [src/vanilla.ts#L9-L37](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/src/vanilla.ts#L9-L37) [src/react.ts#L26-L64](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/src/react.ts#L26-L64) [tests/middlewareTypes.test.tsx#L533-L562](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/tests/middlewareTypes.test.tsx#L533-L562)
- Source imports use explicit .ts extensions and type-only imports; tsconfig enforces strictness, exact optional properties, unchecked-index awareness, verbatim module syntax, and isolated declarations. — [src/react.ts#L1-L9](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/src/react.ts#L1-L9) [tsconfig.json#L3-L15](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/tsconfig.json#L3-L15) [eslint.config.mjs#L46-L47](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/eslint.config.mjs#L46-L47)
- Preserve setState replacement semantics and the retained initial snapshot; replacing a state object can remove actions, and synchronously reading get() during initialization precedes state assignment. — [src/vanilla.ts#L66-L95](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/src/vanilla.ts#L66-L95) [README.md#L129-L138](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/README.md#L129-L138)
- For persistence changes, read both sync/async suites and preserve generation checks around state application, completion, errors, and clearStorage; storage clearing must remain distinct from live-state reset. — [src/middleware/persist.ts#L296-L334](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/src/middleware/persist.ts#L296-L334) [src/middleware/persist.ts#L348-L350](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/src/middleware/persist.ts#L348-L350) [tests/persistSync.test.tsx#L41-L74](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/tests/persistSync.test.tsx#L41-L74) [tests/persistAsync.test.tsx#L1174-L1192](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/tests/persistAsync.test.tsx#L1174-L1192)
- When execution is authorized, use the existing test:spec script to target affected suites and test:types for signature changes; inspected CI also requests format, lint, and build checks, but none ran during this investigation. — [package.json#L79-L83](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/package.json#L79-L83) [.github/workflows/test.yml#L24-L29](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/.github/workflows/test.yml#L24-L29)
- Packaging edits require reading Rollup aliases/replacements and declaration postprocessing; generated ESM declarations change extensions and module-augmentation paths. — [rollup.config.mjs#L11-L16](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/rollup.config.mjs#L11-L16) [rollup.config.mjs#L53-L68](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/rollup.config.mjs#L53-L68) [package.json#L84-L87](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/package.json#L84-L87)
- Root type/lint scopes exclude the examples; inspect their own manifests and configs for example work, and account for demo's Zustand 4 dependency instead of assuming it tests local Zustand 5. — [tsconfig.json#L23-L24](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/tsconfig.json#L23-L24) [eslint.config.mjs#L11-L12](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/eslint.config.mjs#L11-L12) [examples/demo/package.json#L6-L10](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/examples/demo/package.json#L6-L10) [examples/demo/package.json#L25-L28](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/examples/demo/package.json#L25-L28)
- CONTRIBUTING.md requests focused changes, regression tests, formatting, conventional commits, and discussion-led contributions rather than direct contributor PRs; publication and deployment are separate CI operations, not local validation steps. — [CONTRIBUTING.md#L17-L25](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/CONTRIBUTING.md#L17-L25) [CONTRIBUTING.md#L52-L70](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/CONTRIBUTING.md#L52-L70) [.github/workflows/publish.yml#L26-L29](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/.github/workflows/publish.yml#L26-L29) [.github/workflows/docs.yml#L27-L43](https://github.com/pmndrs/zustand/blob/d7a5583cffd80af515f7dfb69583c95cbdc9e2ce/.github/workflows/docs.yml#L27-L43)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
