[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EX4EW0GYR97Q3QJ4ZQ9MHZ":3,"skill-same:01M7EX4EW0GYR97Q3QJ4ZQ9MHZ":53},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7EX4EW0GYR97Q3QJ4ZQ9MHZ","modern-best-practice-react-components",null,"Build clean, modern React components that apply common best practices and avoid common pitfalls like unnecessary state management or useEffect usage","Phenomenon-Studio\u002Fphenomenon-configs","Phenomenon-Studio","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F85674486?v=4","01M7EX2X2JF76C91JB202QMQHW","Phenomenon studio","01M7EX2X37T2C5FBHAH4B60YMX",1,"MIT","https:\u002F\u002Fgithub.com\u002FPhenomenon-Studio\u002Fphenomenon-configs\u002Fblob\u002Fmain\u002Fexamples\u002Fnext\u002F.claude\u002Fskills\u002Fmodern-best-practice-react-components\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: modern-best-practice-react-components\ndescription: Build clean, modern React components that apply common best practices and avoid common pitfalls like unnecessary state management or useEffect usage\n---\n\n# Writing React Components\n\nWe're using modern React (19+) + React Compiler and we're following common best practices focused on\nclarity, correctness, and maintainability.\nImportant to note, some components have incorrect architectural decisions and we'll rework them soon.\n\n## Component Structure & Style\n\n- **PREFER** small, focused components with a single responsibility\n- **PREFER** arrow function components over named functions\n- **PREFER** explicit return types and props typing (TypeScript) where applicable\n- Keep components flat and readable; avoid deeply nested JSX\n- Group related logic together (event handlers, derived values, helpers)\n\n## State Management\n\n- **AVOID** `useEffect()`\n  - See the [\"You Might Not Need An Effect\" guide](references\u002Fyou-dont-need-useeffect.md) for detailed guidance\n  - **PREFER** deriving values during render instead of synchronizing state\n  - Fetch data via TanStack Query (`@tanstack\u002Freact-query`)\n- **AVOID** unnecessary `useState()` or `useReducer()` usage\n  - Derive state from props or other state when possible\n  - Localize state to the lowest possible component\n- **DO NOT** mirror props in state unless absolutely necessary\n- Prefer controlled components over syncing uncontrolled state\n\n## Rendering & Derivation\n\n- **PREFER** computing derived values inline or via helper functions\n- Use `useMemo()` sparingly and only for proven performance issues\n- **AVOID** premature optimization\n- Keep render logic deterministic and free of side effects\n\n## Event Handling\n\n- **AVOID** in-line event handlers in JSX\n  - **PREFER**:\n\n    ```tsx\n    const handleClick = () => {\n      \u002F\u002F ...\n    }\n\n    \u003Cbutton onClick={handleClick} \u002F>;\n    ```\n\n  - Over:\n    ```tsx\n    \u003Cbutton\n      onClick={() => {\n        \u002F* ... *\u002F\n      }}\n    \u002F>\n    ```\n\n- Name handlers clearly (`handleSubmit`, `handleChange`, `handleClose`)\n- Keep handlers small; extract complex logic into helpers\n\n## Effects, Data, and Side Effects\n\n- **AVOID** effects for:\n  - Derived state\n  - Data transformations\n  - Event-based logic that can live in handlers\n- If side effects are unavoidable, keep them minimal, isolated, and well-documented\n- Prefer framework-level or external abstractions (routers, data libraries) over raw effects\n\n## Props & Composition\n\n- **PREFER** composition over configuration\n- **AVOID** excessive boolean props; prefer expressive APIs\n- Use `children` intentionally and document expected structure\n- Keep prop names semantic and predictable\n\n## Performance & Stability\n\n- **PREFER** stable references only when required (not by default)\n- **AVOID** unnecessary memoization (`memo`, `useCallback`) unless absolutely required\n- Keep keys stable and meaningful when rendering lists\n\n## General Principles\n\n- Write code for humans first, compilers second\n- Prefer explicitness over cleverness\n- Optimize for readability and long-term maintenance\n- If a pattern feels complex, reconsider the component boundary\n","# Writing React Components\n\nWe're using modern React (19+) + React Compiler and we're following common best practices focused on\nclarity, correctness, and maintainability.\nImportant to note, some components have incorrect architectural decisions and we'll rework them soon.\n\n## Component Structure & Style\n\n- **PREFER** small, focused components with a single responsibility\n- **PREFER** arrow function components over named functions\n- **PREFER** explicit return types and props typing (TypeScript) where applicable\n- Keep components flat and readable; avoid deeply nested JSX\n- Group related logic together (event handlers, derived values, helpers)\n\n## State Management\n\n- **AVOID** `useEffect()`\n  - See the [\"You Might Not Need An Effect\" guide](references\u002Fyou-dont-need-useeffect.md) for detailed guidance\n  - **PREFER** deriving values during render instead of synchronizing state\n  - Fetch data via TanStack Query (`@tanstack\u002Freact-query`)\n- **AVOID** unnecessary `useState()` or `useReducer()` usage\n  - Derive state from props or other state when possible\n  - Localize state to the lowest possible component\n- **DO NOT** mirror props in state unless absolutely necessary\n- Prefer controlled components over syncing uncontrolled state\n\n## Rendering & Derivation\n\n- **PREFER** computing derived values inline or via helper functions\n- Use `useMemo()` sparingly and only for proven performance issues\n- **AVOID** premature optimization\n- Keep render logic deterministic and free of side effects\n\n## Event Handling\n\n- **AVOID** in-line event handlers in JSX\n  - **PREFER**:\n\n    ```tsx\n    const handleClick = () => {\n      \u002F\u002F ...\n    }\n\n    \u003Cbutton onClick={handleClick} \u002F>;\n    ```\n\n  - Over:\n    ```tsx\n    \u003Cbutton\n      onClick={() => {\n        \u002F* ... *\u002F\n      }}\n    \u002F>\n    ```\n\n- Name handlers clearly (`handleSubmit`, `handleChange`, `handleClose`)\n- Keep handlers small; extract complex logic into helpers\n\n## Effects, Data, and Side Effects\n\n- **AVOID** effects for:\n  - Derived state\n  - Data transformations\n  - Event-based logic that can live in handlers\n- If side effects are unavoidable, keep them minimal, isolated, and well-documented\n- Prefer framework-level or external abstractions (routers, data libraries) over raw effects\n\n## Props & Composition\n\n- **PREFER** composition over configuration\n- **AVOID** excessive boolean props; prefer expressive APIs\n- Use `children` intentionally and document expected structure\n- Keep prop names semantic and predictable\n\n## Performance & Stability\n\n- **PREFER** stable references only when required (not by default)\n- **AVOID** unnecessary memoization (`memo`, `useCallback`) unless absolutely required\n- Keep keys stable and meaningful when rendering lists\n\n## General Principles\n\n- Write code for humans first, compilers second\n- Prefer explicitness over cleverness\n- Optimize for readability and long-term maintenance\n- If a pattern feels complex, reconsider the component boundary\n",{"name":5,"description":7},"main","a5c9ac2f39c1611831e417faea2e6d635699d9b5","examples\u002Fnext\u002F.claude\u002Fskills\u002Fmodern-best-practice-react-components",0,"https:\u002F\u002Fgithub.com\u002FPhenomenon-Studio\u002Fphenomenon-configs","https:\u002F\u002Fgithub.com\u002FPhenomenon-Studio","https:\u002F\u002Fphenomenonstudio.com\u002F","Phenomenon is a digital product studio bolstering a core team of world-class developers, designers, and a flexible network of multi-specialized talent. ","2026-10-23 17:20:31",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Phenomenon-Studio\u002Fphenomenon-configs --skill modern-best-practice-react-components",{"tool":39,"command":40},"bunx","bunx skills add Phenomenon-Studio\u002Fphenomenon-configs --skill modern-best-practice-react-components",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Phenomenon-Studio\u002Fphenomenon-configs --skill modern-best-practice-react-components","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FPhenomenon-Studio\u002Fphenomenon-configs\u002Fblob\u002Fmain\u002Fexamples\u002Fnext\u002F.claude\u002Fskills\u002Fmodern-best-practice-react-components\u002FSKILL.md",true,[47],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"references\u002Fyou-dont-need-useeffect.md","REFERENCE","参考文档",34393,"https:\u002F\u002Fgithub.com\u002FPhenomenon-Studio\u002Fphenomenon-configs\u002Fblob\u002Fmain\u002Fexamples\u002Fnext\u002F.claude\u002Fskills\u002Fmodern-best-practice-react-components\u002Freferences\u002Fyou-dont-need-useeffect.md",[54,61,68,75,82,89],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7EXBNNR8YZB8PD7J8ZAB5FP","web-security","Enforce web security and avoid security vulnerabilities.","https:\u002F\u002Fgithub.com\u002FPhenomenon-Studio\u002Fphenomenon-configs\u002Fblob\u002Fmain\u002Ftemplate\u002Fproject\u002F{{ '.' if scope == 'app' and stack == 'vite' else '' }}\u002F.claude\u002Fskills\u002Fweb-security\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7EXBJGWKB32NY4R2V141G0S","typescript","Write clean, efficient TypeScript code that follows project conventions and advanced type patterns. Use when writing or reviewing TypeScript code, defining types, creating generics, handling errors, or working with React components, Zod schemas, and TanStack libraries.","https:\u002F\u002Fgithub.com\u002FPhenomenon-Studio\u002Fphenomenon-configs\u002Fblob\u002Fmain\u002Ftemplate\u002Fproject\u002F{{ '.' if scope == 'app' and stack == 'vite' else '' }}\u002F.claude\u002Fskills\u002Ftypescript\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7EXBESDHFPHAZKN292SDB6E","tanstack-router","TanStack Router patterns for this repo — file-based routing, auth guards, search params, data loading, TanStack Query integration, navigation, and code splitting. Use when creating routes, adding pages, implementing auth flows, working with search\u002Fpath params, or integrating loaders with TanStack Query.","https:\u002F\u002Fgithub.com\u002FPhenomenon-Studio\u002Fphenomenon-configs\u002Fblob\u002Fmain\u002Ftemplate\u002Fproject\u002F{{ '.' if scope == 'app' and stack == 'vite' else '' }}\u002F.claude\u002Fskills\u002Ftanstack-router\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7EXBAZW0KSMGVDB9DW157SD","tanstack-query","TanStack Query patterns for this repo — queryOptions\u002FmutationOptions factories, query key hierarchies, service layer integration, optimistic updates, Suspense usage, error handling, and TanStack Router data loading. Use when creating queries, mutations, API services, query keys, cache invalidation, optimistic updates, or integrating data fetching with routes.","https:\u002F\u002Fgithub.com\u002FPhenomenon-Studio\u002Fphenomenon-configs\u002Fblob\u002Fmain\u002Ftemplate\u002Fproject\u002F{{ '.' if scope == 'app' and stack == 'vite' else '' }}\u002F.claude\u002Fskills\u002Ftanstack-query\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7EXB6X2TG4HYWCYB293581T","tanstack-form","Build forms using TanStack Form with the project's useAppForm composition, composable field components, Zod validation schemas, FormFieldWrapper error tracking, and form.AppField vs form.Field patterns. Use when creating new forms, adding form fields, writing form validation, or working with TanStack Form in this project.","https:\u002F\u002Fgithub.com\u002FPhenomenon-Studio\u002Fphenomenon-configs\u002Fblob\u002Fmain\u002Ftemplate\u002Fproject\u002F{{ '.' if scope == 'app' and stack == 'vite' else '' }}\u002F.claude\u002Fskills\u002Ftanstack-form\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M7EXB4EXHFSSVY64QQAE77SA","react","Build clean, modern React components that apply common best practices and avoid common pitfalls like unnecessary state management or useEffect usage.","https:\u002F\u002Fgithub.com\u002FPhenomenon-Studio\u002Fphenomenon-configs\u002Fblob\u002Fmain\u002Ftemplate\u002Fproject\u002F{{ '.' if scope == 'app' and stack == 'vite' else '' }}\u002F.claude\u002Fskills\u002Freact\u002FSKILL.md",[],[]]