[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74F73D4Y3CJ3DWDM1NK17EH":3,"skill-same:01M74F73D4Y3CJ3DWDM1NK17EH":45},{"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":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":31,"install":32,"resources":44},"01M74F73D4Y3CJ3DWDM1NK17EH","you-might-not-need-an-effect",null,"Analyze code for useEffect anti-patterns and refactor to simpler alternatives. Use when the user says \"you might not need an effect\", \"check effects\", \"useEffect audit\", or asks to review useEffect usage.","tamarillo-ai\u002Ftheta","tamarillo-ai","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F264659913?v=4","01M732W8TW61PS979NJ2W4Z6XZ","tamarillo.ai","01M732W8VRBBGT4F0Q3B2HNGTQ",15,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Ftamarillo-ai\u002Ftheta\u002Fblob\u002Fmain\u002Ftest\u002Fcast-fixtures\u002Fcodex-cli\u002Fregression\u002Fseedit\u002F.codex\u002Fskills\u002Fyou-might-not-need-an-effect\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: you-might-not-need-an-effect\ndescription: Analyze code for useEffect anti-patterns and refactor to simpler alternatives. Use when the user says \"you might not need an effect\", \"check effects\", \"useEffect audit\", or asks to review useEffect usage.\ndisable-model-invocation: true\n---\n\n# You Might Not Need an Effect\n\nAnalyze code for `useEffect` anti-patterns and refactor to simpler, more correct alternatives.\n\nBased on https:\u002F\u002Freact.dev\u002Flearn\u002Fyou-might-not-need-an-effect\n\n## Arguments\n\n- **scope**: what to analyze (default: uncommitted changes). Examples: `diff to main`, `src\u002Fcomponents\u002F`, `whole codebase`\n- **fix**: whether to apply fixes (default: `true`). Set to `false` to only propose changes.\n\n## Workflow\n\n1. **Determine scope** — get the relevant code:\n   - Default: `git diff` for uncommitted changes\n   - If a directory\u002Ffile is specified, read those files\n   - If \"whole codebase\": search all `.tsx`\u002F`.ts` files for `useEffect`\n\n2. **Scan for anti-patterns** — check each `useEffect` against the patterns below\n\n3. **Fix or propose** — depending on the `fix` argument:\n   - `fix=true`: apply the refactors, then verify with `yarn build && yarn lint && yarn type-check`\n   - `fix=false`: list each anti-pattern found with a before\u002Fafter code suggestion\n\n4. **Report** — summarize what was found and changed\n\n## Anti-Patterns to Catch\n\n### 1. Deriving state during render (no effect needed)\n\nIf you're computing something from existing props or state, calculate it during render.\n\n```typescript\n\u002F\u002F ❌ Anti-pattern\nconst [fullName, setFullName] = useState('');\nuseEffect(() => {\n  setFullName(firstName + ' ' + lastName);\n}, [firstName, lastName]);\n\n\u002F\u002F ✅ Fix — derive during render\nconst fullName = firstName + ' ' + lastName;\n```\n\n### 2. Caching expensive calculations (useMemo, not useEffect)\n\n```typescript\n\u002F\u002F ❌ Anti-pattern\nconst [filtered, setFiltered] = useState([]);\nuseEffect(() => {\n  setFiltered(items.filter(item => item.active));\n}, [items]);\n\n\u002F\u002F ✅ Fix — calculate during render (useMemo only if profiling shows it's needed)\nconst filtered = items.filter(item => item.active);\n```\n\n### 3. Resetting state when props change (use key, not useEffect)\n\n```typescript\n\u002F\u002F ❌ Anti-pattern\nuseEffect(() => {\n  setComment('');\n}, [postCid]);\n\n\u002F\u002F ✅ Fix — use key on the component to reset state\n\u003CCommentForm key={postCid} \u002F>\n```\n\n### 4. Fetching data (use bitsocial-react-hooks, not useEffect)\n\nThis project uses `bitsocial-react-hooks` for all data fetching. Never use `useEffect` + `fetch`.\n\n```typescript\n\u002F\u002F ❌ Anti-pattern\nconst [comment, setComment] = useState(null);\nuseEffect(() => {\n  fetchComment(cid).then(setComment);\n}, [cid]);\n\n\u002F\u002F ✅ Fix — use the hook\nconst { state, ...comment } = useComment({ commentCid: cid });\n```\n\n### 5. Syncing with external stores (use Zustand, not useEffect)\n\n```typescript\n\u002F\u002F ❌ Anti-pattern\nconst [theme, setTheme] = useState('light');\nuseEffect(() => {\n  const unsub = settingsStore.subscribe((s) => setTheme(s.theme));\n  return unsub;\n}, []);\n\n\u002F\u002F ✅ Fix — use the Zustand store directly\nconst theme = useSettingsStore((s) => s.theme);\n```\n\n### 6. Sending analytics \u002F logging (move to event handlers)\n\n```typescript\n\u002F\u002F ❌ Anti-pattern — fires on every render, not on user action\nuseEffect(() => {\n  logPageView(pageName);\n}, [pageName]);\n\n\u002F\u002F ✅ Fix — call in the event handler or route change callback\nconst navigate = () => {\n  logPageView(pageName);\n  router.push(path);\n};\n```\n\n### 7. Initializing global singletons (use module scope or lazy init)\n\n```typescript\n\u002F\u002F ❌ Anti-pattern\nuseEffect(() => {\n  initializeAnalytics();\n}, []);\n\n\u002F\u002F ✅ Fix — module-level init (runs once on import)\nif (typeof window !== 'undefined') {\n  initializeAnalytics();\n}\n```\n\n## Project-Specific Replacements\n\n| useEffect pattern | Replace with |\n|-------------------|-------------|\n| Fetch data | `useComment`, `useFeed`, `useCommunity`, etc. from bitsocial-react-hooks |\n| Sync shared state | Zustand store in `src\u002Fstores\u002F` |\n| Derive values from state | Calculate during render |\n| Boolean loading\u002Ferror flags | `state` field from bitsocial-react-hooks, or state machine in Zustand |\n\n## When useEffect IS Appropriate\n\nNot every effect is wrong. Keep `useEffect` for:\n- Subscribing to browser APIs (resize, intersection observer, etc.) with proper cleanup\n- Synchronizing with non-React systems (third-party widgets, imperative DOM)\n- Running code on mount that genuinely has no hook equivalent\n","# You Might Not Need an Effect\n\nAnalyze code for `useEffect` anti-patterns and refactor to simpler, more correct alternatives.\n\nBased on https:\u002F\u002Freact.dev\u002Flearn\u002Fyou-might-not-need-an-effect\n\n## Arguments\n\n- **scope**: what to analyze (default: uncommitted changes). Examples: `diff to main`, `src\u002Fcomponents\u002F`, `whole codebase`\n- **fix**: whether to apply fixes (default: `true`). Set to `false` to only propose changes.\n\n## Workflow\n\n1. **Determine scope** — get the relevant code:\n   - Default: `git diff` for uncommitted changes\n   - If a directory\u002Ffile is specified, read those files\n   - If \"whole codebase\": search all `.tsx`\u002F`.ts` files for `useEffect`\n\n2. **Scan for anti-patterns** — check each `useEffect` against the patterns below\n\n3. **Fix or propose** — depending on the `fix` argument:\n   - `fix=true`: apply the refactors, then verify with `yarn build && yarn lint && yarn type-check`\n   - `fix=false`: list each anti-pattern found with a before\u002Fafter code suggestion\n\n4. **Report** — summarize what was found and changed\n\n## Anti-Patterns to Catch\n\n### 1. Deriving state during render (no effect needed)\n\nIf you're computing something from existing props or state, calculate it during render.\n\n```typescript\n\u002F\u002F ❌ Anti-pattern\nconst [fullName, setFullName] = useState('');\nuseEffect(() => {\n  setFullName(firstName + ' ' + lastName);\n}, [firstName, lastName]);\n\n\u002F\u002F ✅ Fix — derive during render\nconst fullName = firstName + ' ' + lastName;\n```\n\n### 2. Caching expensive calculations (useMemo, not useEffect)\n\n```typescript\n\u002F\u002F ❌ Anti-pattern\nconst [filtered, setFiltered] = useState([]);\nuseEffect(() => {\n  setFiltered(items.filter(item => item.active));\n}, [items]);\n\n\u002F\u002F ✅ Fix — calculate during render (useMemo only if profiling shows it's needed)\nconst filtered = items.filter(item => item.active);\n```\n\n### 3. Resetting state when props change (use key, not useEffect)\n\n```typescript\n\u002F\u002F ❌ Anti-pattern\nuseEffect(() => {\n  setComment('');\n}, [postCid]);\n\n\u002F\u002F ✅ Fix — use key on the component to reset state\n\u003CCommentForm key={postCid} \u002F>\n```\n\n### 4. Fetching data (use bitsocial-react-hooks, not useEffect)\n\nThis project uses `bitsocial-react-hooks` for all data fetching. Never use `useEffect` + `fetch`.\n\n```typescript\n\u002F\u002F ❌ Anti-pattern\nconst [comment, setComment] = useState(null);\nuseEffect(() => {\n  fetchComment(cid).then(setComment);\n}, [cid]);\n\n\u002F\u002F ✅ Fix — use the hook\nconst { state, ...comment } = useComment({ commentCid: cid });\n```\n\n### 5. Syncing with external stores (use Zustand, not useEffect)\n\n```typescript\n\u002F\u002F ❌ Anti-pattern\nconst [theme, setTheme] = useState('light');\nuseEffect(() => {\n  const unsub = settingsStore.subscribe((s) => setTheme(s.theme));\n  return unsub;\n}, []);\n\n\u002F\u002F ✅ Fix — use the Zustand store directly\nconst theme = useSettingsStore((s) => s.theme);\n```\n\n### 6. Sending analytics \u002F logging (move to event handlers)\n\n```typescript\n\u002F\u002F ❌ Anti-pattern — fires on every render, not on user action\nuseEffect(() => {\n  logPageView(pageName);\n}, [pageName]);\n\n\u002F\u002F ✅ Fix — call in the event handler or route change callback\nconst navigate = () => {\n  logPageView(pageName);\n  router.push(path);\n};\n```\n\n### 7. Initializing global singletons (use module scope or lazy init)\n\n```typescript\n\u002F\u002F ❌ Anti-pattern\nuseEffect(() => {\n  initializeAnalytics();\n}, []);\n\n\u002F\u002F ✅ Fix — module-level init (runs once on import)\nif (typeof window !== 'undefined') {\n  initializeAnalytics();\n}\n```\n\n## Project-Specific Replacements\n\n| useEffect pattern | Replace with |\n|-------------------|-------------|\n| Fetch data | `useComment`, `useFeed`, `useCommunity`, etc. from bitsocial-react-hooks |\n| Sync shared state | Zustand store in `src\u002Fstores\u002F` |\n| Derive values from state | Calculate during render |\n| Boolean loading\u002Ferror flags | `state` field from bitsocial-react-hooks, or state machine in Zustand |\n\n## When useEffect IS Appropriate\n\nNot every effect is wrong. Keep `useEffect` for:\n- Subscribing to browser APIs (resize, intersection observer, etc.) with proper cleanup\n- Synchronizing with non-React systems (third-party widgets, imperative DOM)\n- Running code on mount that genuinely has no hook equivalent\n",{"name":5,"description":7,"disable-model-invocation":24},true,"main","08c084f718b2b842cd53622ce0b1a1fb2888ccef","test\u002Fcast-fixtures\u002Fcodex-cli\u002Fregression\u002Fseedit\u002F.codex\u002Fskills\u002Fyou-might-not-need-an-effect",1,"https:\u002F\u002Fgithub.com\u002Ftamarillo-ai\u002Ftheta","https:\u002F\u002Fgithub.com\u002Ftamarillo-ai","2026-07-15 23:48:12",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":24},[34,37,40],{"tool":35,"command":36},"npx","npx skills add tamarillo-ai\u002Ftheta --skill you-might-not-need-an-effect",{"tool":38,"command":39},"bunx","bunx skills add tamarillo-ai\u002Ftheta --skill you-might-not-need-an-effect",{"tool":41,"command":42},"pnpm","pnpm dlx skills add tamarillo-ai\u002Ftheta --skill you-might-not-need-an-effect","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Ftamarillo-ai\u002Ftheta\u002Fblob\u002Fmain\u002Ftest\u002Fcast-fixtures\u002Fcodex-cli\u002Fregression\u002Fseedit\u002F.codex\u002Fskills\u002Fyou-might-not-need-an-effect\u002FSKILL.md",[],[46,53,60,68,75,82],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":19},"01M74FCAJ0RRFRJRQES26329E7","deploy-app","Deploy the application to staging or production environments.","https:\u002F\u002Fgithub.com\u002Ftamarillo-ai\u002Ftheta\u002Fblob\u002Fmain\u002Ftest\u002Fcast-fixtures\u002Fcursor\u002Fskills\u002Fbasic\u002F.cursor\u002Fskills\u002Fdeploy-app\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M74FC8GPJGCS0KTGKS1CJZZS","deploy","Deploy the application to environments.","https:\u002F\u002Fgithub.com\u002Ftamarillo-ai\u002Ftheta\u002Fblob\u002Fmain\u002Ftest\u002Fcast-fixtures\u002Fcursor\u002Fcombined\u002Ffull-config\u002F.cursor\u002Fskills\u002Fdeploy\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":64,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M74FC5RT3VTNZEK1F7NX5380","building-native-ui","Complete guide for building beautiful apps with Expo Router. Covers fundamentals, styling, components, navigation, animations, patterns, and native tabs.","MIT","https:\u002F\u002Fgithub.com\u002Ftamarillo-ai\u002Ftheta\u002Fblob\u002Fmain\u002Ftest\u002Fcast-fixtures\u002Fcopilot\u002Fskills\u002Fwith-references\u002F.github\u002Fskills\u002Fbuilding-native-ui\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},"01M74FC1ZGP5R44HPGWWSW6P3B","create-section","Use when creating a new section for the AI Workshop presentation. Guides through title slide setup, layout choices, and content gathering. Activates when user wants to add a new topic section to the slideshow.","https:\u002F\u002Fgithub.com\u002Ftamarillo-ai\u002Ftheta\u002Fblob\u002Fmain\u002Ftest\u002Fcast-fixtures\u002Fcopilot\u002Fskills\u002Fbasic\u002F.github\u002Fskills\u002Fcreate-section\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},"01M74FBZXSZ7GVP0HCGNR1BVNH","ship-checker","Run a full pre-ship review for this repo. Use when asked if a change is ready to deploy, publish, or ship.","https:\u002F\u002Fgithub.com\u002Ftamarillo-ai\u002Ftheta\u002Fblob\u002Fmain\u002Ftest\u002Fcast-fixtures\u002Fcopilot\u002Fcombined\u002Feverything\u002F.github\u002Fskills\u002Fship-checker\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},"01M74FBY4N2E3ZERWBRM4S3DE6","lint-check","Run repository linters and report failures.","https:\u002F\u002Fgithub.com\u002Ftamarillo-ai\u002Ftheta\u002Fblob\u002Fmain\u002Ftest\u002Fcast-fixtures\u002Fcodex-cli\u002Fskills\u002Fagents-path\u002F.agents\u002Fskills\u002Flint-check\u002FSKILL.md",[],[]]