[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XCAW4C86CSGVJ5TRK9ZK4E":3,"skill-same:01M6XCAW4C86CSGVJ5TRK9ZK4E":64},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":33,"linkOnly":34,"markdownContent":35,"markdownBody":36,"frontMatter":37,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":13,"repositoryHtmlUrl":41,"repositoryHomepageUrl":6,"ownerHtmlUrl":42,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":43,"install":44,"resources":57},"01M6XCAW4C86CSGVJ5TRK9ZK4E","react-localstorage-keyboard-nav",null,"Create React components with localStorage persistence and keyboard navigation support","UF-gzj\u002Fopenspace-claude-evolution","UF-gzj","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F272393507?v=4","01M6XBCZB755P01VVYGQWPYZY3","01M6XBCZFJA5AREA17WGETA3FW",0,"MIT","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Freact-localstorage-keyboard-nav\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000009","前端开发","SCENARIO","使用场景",[23,24,25,26,27,28,29,30,31,32],"react","keyboard","react localstorage keyboard nav","support","components","react components","create","persistence","navigation","with","2026-11-10 10:12:30",false,"---\nname: react-localstorage-keyboard-nav\ndescription: Create React components with localStorage persistence and keyboard navigation support\n---\n\n# React Components with localStorage Persistence & Keyboard Navigation\n\nThis skill guides you through creating reusable React components that:\n1. Persist state to localStorage\n2. Implement keyboard navigation\n3. Follow modal\u002Fcommand palette patterns\n\n## Core Pattern\n\n```typescript\n\u002F\u002F 1. Define localStorage hooks\nconst useLocalStorage = (key: string, initialValue: any) => {\n  const [value, setValue] = useState(() => {\n    const stored = localStorage.getItem(key);\n    return stored ? JSON.parse(stored) : initialValue;\n  });\n\n  useEffect(() => {\n    localStorage.setItem(key, JSON.stringify(value));\n  }, [key, value]);\n\n  return [value, setValue];\n};\n\n\u002F\u002F 2. Implement keyboard navigation\nconst useKeyboardNav = (items: any[], onSelect: (item: any) => void) => {\n  const [selectedIndex, setSelectedIndex] = useState(0);\n\n  const handleKeyDown = (e: KeyboardEvent) => {\n    if (e.key === 'ArrowDown') {\n      setSelectedIndex(prev => Math.min(prev + 1, items.length - 1));\n    } else if (e.key === 'ArrowUp') {\n      setSelectedIndex(prev => Math.max(prev - 1, 0));\n    } else if (e.key === 'Enter') {\n      onSelect(items[selectedIndex]);\n    }\n  };\n\n  useEffect(() => {\n    window.addEventListener('keydown', handleKeyDown);\n    return () => window.removeEventListener('keydown', handleKeyDown);\n  }, [selectedIndex, items]);\n\n  return { selectedIndex };\n};\n```\n\n## Implementation Steps\n\n1. **Create Component Scaffolding**\n   ```bash\n   mkdir -p src\u002Fcomponents\u002F{Modal,CommandPalette}\n   touch src\u002Fcomponents\u002FModal\u002FSettingsModal.tsx\n   touch src\u002Fcomponents\u002FCommandPalette\u002FCommandPalette.tsx\n   ```\n\n2. **Implement localStorage Persistence**\n   ```typescript\n   \u002F\u002F SettingsModal.tsx\n   const SettingsModal = () => {\n     const [settings, setSettings] = useLocalStorage('app-settings', DEFAULT_SETTINGS);\n     \u002F\u002F ... modal implementation\n   };\n   ```\n\n3. **Add Keyboard Navigation**\n   ```typescript\n   \u002F\u002F CommandPalette.tsx\n   const CommandPalette = ({ commands }) => {\n     const { selectedIndex } = useKeyboardNav(commands, (cmd) => cmd.action());\n     \u002F\u002F ... render commands with highlighted selectedIndex\n   };\n   ```\n\n4. **Export Components**\n   ```typescript\n   \u002F\u002F src\u002Fcomponents\u002Findex.ts\n   export * from '.\u002FModal\u002FSettingsModal';\n   export * from '.\u002FCommandPalette\u002FCommandPalette';\n   ```\n\n## Best Practices\n\n- Create a `settings-keys.ts` file to manage localStorage keys\n- Use TypeScript interfaces for settings\u002Fcommands\n- Implement proper focus management for accessibility\n","# React Components with localStorage Persistence & Keyboard Navigation\n\nThis skill guides you through creating reusable React components that:\n1. Persist state to localStorage\n2. Implement keyboard navigation\n3. Follow modal\u002Fcommand palette patterns\n\n## Core Pattern\n\n```typescript\n\u002F\u002F 1. Define localStorage hooks\nconst useLocalStorage = (key: string, initialValue: any) => {\n  const [value, setValue] = useState(() => {\n    const stored = localStorage.getItem(key);\n    return stored ? JSON.parse(stored) : initialValue;\n  });\n\n  useEffect(() => {\n    localStorage.setItem(key, JSON.stringify(value));\n  }, [key, value]);\n\n  return [value, setValue];\n};\n\n\u002F\u002F 2. Implement keyboard navigation\nconst useKeyboardNav = (items: any[], onSelect: (item: any) => void) => {\n  const [selectedIndex, setSelectedIndex] = useState(0);\n\n  const handleKeyDown = (e: KeyboardEvent) => {\n    if (e.key === 'ArrowDown') {\n      setSelectedIndex(prev => Math.min(prev + 1, items.length - 1));\n    } else if (e.key === 'ArrowUp') {\n      setSelectedIndex(prev => Math.max(prev - 1, 0));\n    } else if (e.key === 'Enter') {\n      onSelect(items[selectedIndex]);\n    }\n  };\n\n  useEffect(() => {\n    window.addEventListener('keydown', handleKeyDown);\n    return () => window.removeEventListener('keydown', handleKeyDown);\n  }, [selectedIndex, items]);\n\n  return { selectedIndex };\n};\n```\n\n## Implementation Steps\n\n1. **Create Component Scaffolding**\n   ```bash\n   mkdir -p src\u002Fcomponents\u002F{Modal,CommandPalette}\n   touch src\u002Fcomponents\u002FModal\u002FSettingsModal.tsx\n   touch src\u002Fcomponents\u002FCommandPalette\u002FCommandPalette.tsx\n   ```\n\n2. **Implement localStorage Persistence**\n   ```typescript\n   \u002F\u002F SettingsModal.tsx\n   const SettingsModal = () => {\n     const [settings, setSettings] = useLocalStorage('app-settings', DEFAULT_SETTINGS);\n     \u002F\u002F ... modal implementation\n   };\n   ```\n\n3. **Add Keyboard Navigation**\n   ```typescript\n   \u002F\u002F CommandPalette.tsx\n   const CommandPalette = ({ commands }) => {\n     const { selectedIndex } = useKeyboardNav(commands, (cmd) => cmd.action());\n     \u002F\u002F ... render commands with highlighted selectedIndex\n   };\n   ```\n\n4. **Export Components**\n   ```typescript\n   \u002F\u002F src\u002Fcomponents\u002Findex.ts\n   export * from '.\u002FModal\u002FSettingsModal';\n   export * from '.\u002FCommandPalette\u002FCommandPalette';\n   ```\n\n## Best Practices\n\n- Create a `settings-keys.ts` file to manage localStorage keys\n- Use TypeScript interfaces for settings\u002Fcommands\n- Implement proper focus management for accessibility\n",{"name":5,"description":7},"main","0650921d63895de3997bc81f1ff1d0ac67032072","showcase\u002Fskills\u002Freact-localstorage-keyboard-nav","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution","https:\u002F\u002Fgithub.com\u002FUF-gzj","2026-04-16 09:31:03",{"source":8,"skillName":5,"commands":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add UF-gzj\u002Fopenspace-claude-evolution --skill react-localstorage-keyboard-nav",{"tool":50,"command":51},"bunx","bunx skills add UF-gzj\u002Fopenspace-claude-evolution --skill react-localstorage-keyboard-nav",{"tool":53,"command":54},"pnpm","pnpm dlx skills add UF-gzj\u002Fopenspace-claude-evolution --skill react-localstorage-keyboard-nav","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Freact-localstorage-keyboard-nav\u002FSKILL.md",true,[58],{"path":59,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":62,"sourceHtmlUrl":63},".skill_id","OTHER","其他",45,"https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Freact-localstorage-keyboard-nav\u002F.skill_id",[65,90,106,115,145,161],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":33},"01M6XCCXD3NCM2YKR3WNGBASPC","write-special-chars-ts-check","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) using a Python heredoc script, plus a reliable TypeScript type-checking step that filters output to only the newly-written files to avoid being misled by pre-existing errors.","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-ts-check\u002FSKILL.md",[],[72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89],"check","write","write special chars ts check","typescript","filters","characters","Existing","type-checking","for","errors","script","output","type","files","only","template","file","python",{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":33},"01M6XCCT7E3J922Q345PBGSHPN","write-special-chars-readback","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) using a Python heredoc script, with mandatory post-write verification via read_file and cleanup of \u002Ftmp helper scripts.","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-readback\u002FSKILL.md",[],[97,98,73,88,99,89,100,101,102,103,104,87,105,32,77,80,82],"readback","write special chars readback","helper","post","via","scripts","cleanup","read","verification",{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":33},"01M6XCCMQX1R8B6FECWB3P63T7","write-special-chars-heredoc","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) by using a Python heredoc script executed via shell.","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-heredoc\u002FSKILL.md",[],[113,73,77,114,82,101,87,88,89,80],"write special chars heredoc","shell",{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":126,"publishedAt":33},"01M6XCCG41M994JJEX6VN52PEP","worldmonitor-reference","Curated architecture index of the WorldMonitor open-source dashboard. Reference for extracting patterns — vanilla TypeScript, Panel class hierarchy, service layer, CSS grid, API edge functions, refresh scheduler, and 60+ data source integrations.","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fworldmonitor-reference\u002FSKILL.md",[121],{"categoryNo":122,"categoryName":123,"taxonomyType":124,"taxonomyTypeDesc":125},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[127,128,129,130,131,75,132,133,134,135,136,80,137,138,139,140,141,142,143,144],"reference","worldmonitor","worldmonitor reference","architecture","dashboard","css","scheduler","layer","hierarchy","source","extracting","panel","patterns","edge functions","integrations","open","api","data",{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":149,"categories":150,"keywords":151,"publishedAt":33},"01M6XCCCHWNKG2W4VH9E6A10HF","virtual-list","Implement efficient virtual scrolling for rendering large lists with DOM recycling, chunk-based rendering, and performance optimizations","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fvirtual-list\u002FSKILL.md",[],[152,153,154,155,80,156,32,157,158,159,160],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":162,"name":163,"nameZh":6,"description":164,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":165,"categories":166,"keywords":167,"publishedAt":33},"01M6XCC7X8PKMR2DEW91XGHYSV","verify-directory-structure","Diagnose and resolve file access issues by first verifying the directory structure.","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fverify-directory-structure\u002FSKILL.md",[],[168,169,170,171,172,173,88,174,175,176],"directory","verify directory structure","structure","verify","access","first","issues","diagnose","file access"]