{
  "id": 21234451,
  "title": "Stop the agent from introducing a second state-management library when the repo already has one",
  "url": "https://urgent.news/2026/11/22/stop-the-agent-from-introducing-a-second-state-management-library",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-22T15:40:10.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/sherotree/stop-the-agent-from-introducing-a-second-state-management-library-when-the-repo-already-has-one-1j3d"
  },
  "original_language": "en",
  "account": "The PR adds Zustand to a settings modal to keep an open flag. The existing repository already utilizes Redux (or Recoil, or a single React context along with React Query) for app state, while local useState is employed for UI elements that do not necessitate global access. Introducing a second state management library results in an additional source of truth, an additional development tools monitoring path, and a new programming paradigm for the subsequent developer to emulate. The reporter believes that considering a new state library in a feature pull request as a scope change, regardless of the modal's functionality, is warranted. One widget should not be sufficient reason to alter the manner in which the application manages state.\n\nA considerable number of training examples frequently select Zustand or Redux Toolkit as the default choice. The model will not examine the contents of the package.json file unless expressly instructed to disregard the inclusion of a specific library, for instance, \"we already have X; do not add Y\". The open flag of a modal does not necessitate the presence of a store at all. The reviewer pays twice: in terms of bundle size and in the review process, where certain flows interact with the existing store, while others engage with the new library.\n\nTo address this issue, a straightforward state library policy should be implemented. The current store, server cache, or local state should be utilized. Zustand, Redux, Jotai, Valtio, or any other new context framework should not be added in a feature pull request. UI-only state should remain local unless something external already requires access to it. A migration away from the current library should be a separate pull request, complete with a plan, rather than an unintended consequence of a modal. If the current store proves inadequate for the specific case, this should be mentioned in the pull request. No additional state management library should be quietly installed. The prompt should mention not introducing a new state management library; instead, use the existing store/helpers in src/store (or local useState) for this UI. The open flag of a modal should be a local state unless another route already requires it. If the existing store cannot accommodate this case, the reporter should halt the process and elucidate the issue instead of installing a second library. The reporter should paste the contents of the package.json dependencies and an example of an existing store usage. In the review process, the reporter should search the diff for new packages (zustand, jotai, recoil, or a second Redux wrapper) and for a new createStore / createContext used solely by the new widget. The reporter should reject or send back any pull request that includes a new state library added for a single component, a global store for a purely local open/tab flag, a second context \"provider layer\" that duplicates the existing store, or a partial migration that leaves both libraries in the repository. The reporter should accept local state for widget-only UI, a change that passes through the existing store or server cache, and a dedicated RFC or migration pull request, not mixed into a feature.",
  "summary": "The PR adds Zustand so a settings modal can keep an open flag. The repo already uses Redux (or Recoil, or a single React context plus React Query) for app state, and local useState for UI that does not need to be global. The new dependency is a second source of truth, a second devtools path, and a new pattern for the next agent to copy. I’ve started treating a new state library in a feature PR as…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}