Use when implementing or refactoring React/TypeScript components and the task requires decisions about component ownership, feature boundaries, state, data flow
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-how-to-write-component-242fc35fb274 ,按照其中的说明把「how-to-write-component」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Use this skill to route component architecture decisions to its bundled references. Read only the references required by the current change.
references/ownership.md.references/state.md.references/data.md.references/interactions.md and the overlay guide it references when applicable. Also read references/state.md when the surface owns a draft or other local session state.references/runtime.md.Identify the behavior owner, state lifetime, and public contract from the nearby implementation and relevant references. Keep the change within that vertical slice unless the contract requires changes elsewhere. Verify the changed behavior and complete the owning package's required checks. For Web, read web/docs/test.md for test work and web/docs/lint.md for static checks. Dify UI verification is owned by packages/dify-ui/docs/testing.md.
w-105 instead of w-[420px], px-2.25 instead of px-[9px], bg-linear-to-b instead of bg-gradient-to-b, wrap-break-word instead of break-words, and field-sizing-content instead of [field-sizing:content].