Skip to main content
在 Manus 中运行任何 Skill
一键导入

state-discipline

星标3
分支0
更新时间2026年6月6日 15:00

Apply React 19 / Next.js 16 state discipline — `useState` is the last resort, not the default. Derive state from props/URL/data, use a query library for server state, use event handlers for one-shot side effects, use `key` to reset state, use `useMountEffect` for one-time external sync, never bare `useEffect`. Use when the user pastes `useState + useEffect + fetch`, reaches for `useState` to mirror a prop, hand-rolls a derived value via `useEffect + setState`, syncs state with URL via `useEffect`, or asks "should I add useState here?". Pairs with `data-fetching` (Server Components first) and `forms` (the form toolkit owns field state). Refuses to apply outside React 19 / Next.js 16 (App Router) projects. Not for: server-data reads (use `data-fetching`), form field values (use `forms`), React Native state patterns (RN has no URL state primitive — use plain React patterns), or generic React tutorials (this is a discipline skill for an already-scaffolded Next.js 16 codebase, not a learning resource).

安装

用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。

文件资源管理器
3 个文件
SKILL.md
readonly