[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78DF6BBVFYV13AMQWNVEGEQ":3,"skill-same:01M78DF6BBVFYV13AMQWNVEGEQ":46},{"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":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M78DF6BBVFYV13AMQWNVEGEQ","codesync-ui-and-state",null,"Architecture for Zustand state management, cross-context extension synchronization, 15+ CSS themes, and modular React UI components.","pardeep1916P\u002FcodeSync","pardeep1916P","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F168327487?v=4","01M78DE87WVVWDH8M849ATQ25Y","Devanaboyina Charan Chaitanya","01M78DE890X74HPFK91EMX91W5",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fpardeep1916P\u002FcodeSync\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fcodesync-ui-and-state\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: codesync-ui-and-state\ndescription: Architecture for Zustand state management, cross-context extension synchronization, 15+ CSS themes, and modular React UI components.\n---\n\n# CodeSync UI, Themes & Reactive State Architecture\n\nUse this skill when developing or modifying popup components, the options page, the theme engine, or the Zustand store in `src\u002Fpopup\u002F`, `src\u002Foptions\u002F`, `src\u002Fstore\u002F`, and `src\u002Fstyles\u002F`.\n\n---\n\n## 1. Cross-Context Zustand State Synchronization\n\nBecause browser extension contexts (Popup UI, Options Page, Background Service Worker) run in completely separate JavaScript runtimes, state mutations must be synchronized across boundaries.\n\n```mermaid\nsequenceDiagram\n    participant UI as Popup \u002F Options (React)\n    participant Store as Zustand Store\n    participant Storage as chrome.storage.local\n    participant Runtime as chrome.runtime Messaging\n\n    UI->>Store: updateSettings({ theme: 'dracula' })\n    Store->>Storage: setLocalStorage({ settings: ... })\n    Store->>Runtime: sendMessage({ action: 'STATE_CHANGED' })\n    Runtime-->>Store: Broadcast to all open contexts\n    Store-->>UI: Re-render with new state\n```\n\n### Store Implementation Invariants (`src\u002Fstore\u002Findex.ts`):\n1. **Singleton Listener Guard**:\n   Prevent multiple `chrome.runtime.onMessage` event listeners from stacking during hot module reloads:\n   ```typescript\n   let isListenerRegistered = false;\n   if (!isListenerRegistered && typeof chrome !== 'undefined' && chrome.runtime?.onMessage) {\n     isListenerRegistered = true;\n     chrome.runtime.onMessage.addListener((message) => {\n       if (message.action === 'STATE_UPDATED') {\n         useAppStore.getState().initialize();\n       }\n     });\n   }\n   ```\n2. **Asynchronous Initializer**:\n   Every UI entrypoint (`Popup.tsx`, `Options.tsx`) calls `initialize()` on mount to load encrypted tokens and settings from storage.\n\n---\n\n## 2. Dynamic 15+ CSS Theme Engine (`src\u002Fstyles\u002Fthemes.ts`)\n\nCodeSync features a variety of themes (including AMOLED, Dracula, Tokyo Night, Cyberpunk, Matrix, Nord, and Monokai).\n\n### Theme Structure\nEach theme is defined by a palette of CSS custom property tokens:\n```typescript\nexport interface Theme {\n  id: string;\n  name: string;\n  colors: {\n    bgPrimary: string;\n    bgSecondary: string;\n    bgTertiary: string;\n    textPrimary: string;\n    textSecondary: string;\n    accent: string;\n    border: string;\n    card: string;\n  };\n}\n```\n\n### Applying Themes:\nThemes are applied to the root document element dynamically:\n```typescript\nexport function applyTheme(themeId: string): void {\n  const theme = getThemeById(themeId);\n  const root = document.documentElement;\n  Object.entries(theme.colors).forEach(([token, value]) => {\n    root.style.setProperty(`--color-${token}`, value);\n  });\n}\n```\n\nIn Tailwind, CSS variables are mapped via `tailwind.config.js`:\n```javascript\ntheme: {\n  extend: {\n    colors: {\n      bgPrimary: 'var(--color-bgPrimary)',\n      accent: 'var(--color-accent)',\n    }\n  }\n}\n```\n\n---\n\n## 3. Modular Popup Component Hierarchy\n\nThe popup UI (`src\u002Fpopup\u002FPopup.tsx`) is decomposed into focused, single-responsibility components under `src\u002Fpopup\u002Fcomponents\u002F`:\n\n- **`Header.tsx`**: Displays logo, extension version, online status, and theme selector trigger.\n- **`UpdateBanner.tsx`**: Renders when a new Chrome Web Store version has downloaded in the background; triggers one-click reload via `chrome.runtime.reload()`.\n- **`UserProfileCard.tsx`**: Displays the authenticated GitHub user profile, avatar, and logout action.\n- **`RepoSelector.tsx`**: Dropdown for selecting the destination GitHub repository, creating a new repo, and showing solved counts.\n- **`SyncControl.tsx`**: Displays the pending commit queue count and provides the manual \"Sync Now\" trigger button.\n- **`AuthForm.tsx`**: Renders GitHub OAuth button and fallback Personal Access Token (PAT) input.\n- **`Footer.tsx`**: Navigation links to problem platforms, options page, and documentation.\n\n---\n\n## 4. Design Guidelines & Radix Primitives\n\n1. **Accessibility First**:\n   - Switches use `@radix-ui\u002Freact-switch` with associated `@radix-ui\u002Freact-label`.\n   - Modals use accessible backdrop trapping and keyboard escape triggers (`ConfirmModal.tsx`).\n2. **Compact Viewport Constraints**:\n   - The Chrome extension popup width is fixed at `w-[360px]` to `w-[400px]` with a maximum height of `600px`.\n   - Content that exceeds viewport height must use custom scrollbars (`overflow-y-auto`).\n3. **No Heavy Icon Bundles**:\n   - Icons are centralized in `src\u002Fpopup\u002Fcomponents\u002FIcons.tsx` as lightweight, hand-crafted SVG components rather than importing massive full-library bundles (e.g. `lucide-react` or `react-icons`).\n\n---\n\n## 5. Testing UI State\n\nTest cross-context state hydration and store actions using Vitest:\n```bash\nnpm run test -- src\u002Fstore\u002F__tests__\u002FstateSync.test.ts\n```\n","# CodeSync UI, Themes & Reactive State Architecture\n\nUse this skill when developing or modifying popup components, the options page, the theme engine, or the Zustand store in `src\u002Fpopup\u002F`, `src\u002Foptions\u002F`, `src\u002Fstore\u002F`, and `src\u002Fstyles\u002F`.\n\n---\n\n## 1. Cross-Context Zustand State Synchronization\n\nBecause browser extension contexts (Popup UI, Options Page, Background Service Worker) run in completely separate JavaScript runtimes, state mutations must be synchronized across boundaries.\n\n```mermaid\nsequenceDiagram\n    participant UI as Popup \u002F Options (React)\n    participant Store as Zustand Store\n    participant Storage as chrome.storage.local\n    participant Runtime as chrome.runtime Messaging\n\n    UI->>Store: updateSettings({ theme: 'dracula' })\n    Store->>Storage: setLocalStorage({ settings: ... })\n    Store->>Runtime: sendMessage({ action: 'STATE_CHANGED' })\n    Runtime-->>Store: Broadcast to all open contexts\n    Store-->>UI: Re-render with new state\n```\n\n### Store Implementation Invariants (`src\u002Fstore\u002Findex.ts`):\n1. **Singleton Listener Guard**:\n   Prevent multiple `chrome.runtime.onMessage` event listeners from stacking during hot module reloads:\n   ```typescript\n   let isListenerRegistered = false;\n   if (!isListenerRegistered && typeof chrome !== 'undefined' && chrome.runtime?.onMessage) {\n     isListenerRegistered = true;\n     chrome.runtime.onMessage.addListener((message) => {\n       if (message.action === 'STATE_UPDATED') {\n         useAppStore.getState().initialize();\n       }\n     });\n   }\n   ```\n2. **Asynchronous Initializer**:\n   Every UI entrypoint (`Popup.tsx`, `Options.tsx`) calls `initialize()` on mount to load encrypted tokens and settings from storage.\n\n---\n\n## 2. Dynamic 15+ CSS Theme Engine (`src\u002Fstyles\u002Fthemes.ts`)\n\nCodeSync features a variety of themes (including AMOLED, Dracula, Tokyo Night, Cyberpunk, Matrix, Nord, and Monokai).\n\n### Theme Structure\nEach theme is defined by a palette of CSS custom property tokens:\n```typescript\nexport interface Theme {\n  id: string;\n  name: string;\n  colors: {\n    bgPrimary: string;\n    bgSecondary: string;\n    bgTertiary: string;\n    textPrimary: string;\n    textSecondary: string;\n    accent: string;\n    border: string;\n    card: string;\n  };\n}\n```\n\n### Applying Themes:\nThemes are applied to the root document element dynamically:\n```typescript\nexport function applyTheme(themeId: string): void {\n  const theme = getThemeById(themeId);\n  const root = document.documentElement;\n  Object.entries(theme.colors).forEach(([token, value]) => {\n    root.style.setProperty(`--color-${token}`, value);\n  });\n}\n```\n\nIn Tailwind, CSS variables are mapped via `tailwind.config.js`:\n```javascript\ntheme: {\n  extend: {\n    colors: {\n      bgPrimary: 'var(--color-bgPrimary)',\n      accent: 'var(--color-accent)',\n    }\n  }\n}\n```\n\n---\n\n## 3. Modular Popup Component Hierarchy\n\nThe popup UI (`src\u002Fpopup\u002FPopup.tsx`) is decomposed into focused, single-responsibility components under `src\u002Fpopup\u002Fcomponents\u002F`:\n\n- **`Header.tsx`**: Displays logo, extension version, online status, and theme selector trigger.\n- **`UpdateBanner.tsx`**: Renders when a new Chrome Web Store version has downloaded in the background; triggers one-click reload via `chrome.runtime.reload()`.\n- **`UserProfileCard.tsx`**: Displays the authenticated GitHub user profile, avatar, and logout action.\n- **`RepoSelector.tsx`**: Dropdown for selecting the destination GitHub repository, creating a new repo, and showing solved counts.\n- **`SyncControl.tsx`**: Displays the pending commit queue count and provides the manual \"Sync Now\" trigger button.\n- **`AuthForm.tsx`**: Renders GitHub OAuth button and fallback Personal Access Token (PAT) input.\n- **`Footer.tsx`**: Navigation links to problem platforms, options page, and documentation.\n\n---\n\n## 4. Design Guidelines & Radix Primitives\n\n1. **Accessibility First**:\n   - Switches use `@radix-ui\u002Freact-switch` with associated `@radix-ui\u002Freact-label`.\n   - Modals use accessible backdrop trapping and keyboard escape triggers (`ConfirmModal.tsx`).\n2. **Compact Viewport Constraints**:\n   - The Chrome extension popup width is fixed at `w-[360px]` to `w-[400px]` with a maximum height of `600px`.\n   - Content that exceeds viewport height must use custom scrollbars (`overflow-y-auto`).\n3. **No Heavy Icon Bundles**:\n   - Icons are centralized in `src\u002Fpopup\u002Fcomponents\u002FIcons.tsx` as lightweight, hand-crafted SVG components rather than importing massive full-library bundles (e.g. `lucide-react` or `react-icons`).\n\n---\n\n## 5. Testing UI State\n\nTest cross-context state hydration and store actions using Vitest:\n```bash\nnpm run test -- src\u002Fstore\u002F__tests__\u002FstateSync.test.ts\n```\n",{"name":5,"description":7},"main","f2a54fba6f9faab5c8991fc4a98973e74303f925",".agent\u002Fskills\u002Fcodesync-ui-and-state","https:\u002F\u002Fgithub.com\u002Fpardeep1916P\u002FcodeSync","https:\u002F\u002Fpardeep1916p.github.io\u002FcodeSync\u002F","https:\u002F\u002Fgithub.com\u002Fpardeep1916P","https:\u002F\u002Fcharan-chaitanya-devanaboyina.vercel.app\u002F","2026-11-10 02:31:26",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add pardeep1916P\u002FcodeSync --skill codesync-ui-and-state",{"tool":38,"command":39},"bunx","bunx skills add pardeep1916P\u002FcodeSync --skill codesync-ui-and-state",{"tool":41,"command":42},"pnpm","pnpm dlx skills add pardeep1916P\u002FcodeSync --skill codesync-ui-and-state","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fpardeep1916P\u002FcodeSync\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fcodesync-ui-and-state\u002FSKILL.md",true,[],[47,55,62,69,76,83],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":51,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M78DFT64JJNAQR5TETTT7S5A","openspec-update-change","Update an OpenSpec change by revising its existing planning artifacts and keeping them coherent with one another. Use when the user wants to revise a change's plan, fold new decisions into it, or reconcile its artifacts after an edit. Never edits code.","MIT","https:\u002F\u002Fgithub.com\u002Fpardeep1916P\u002FcodeSync\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fopenspec-update-change\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":51,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M78DFQNNEY55FD44WZAC85MS","openspec-sync-specs","Sync delta specs from a change to main specs. Use when the user wants to update main specs with changes from a delta spec, without archiving the change.","https:\u002F\u002Fgithub.com\u002Fpardeep1916P\u002FcodeSync\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fopenspec-sync-specs\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":51,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M78DFMM7Q03FQ00QRDB9KY53","openspec-propose","Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.","https:\u002F\u002Fgithub.com\u002Fpardeep1916P\u002FcodeSync\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fopenspec-propose\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":51,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M78DFHBCWK1VE0GCKJ9FZC9T","openspec-explore","Enter explore mode - a thinking partner for exploring ideas, investigating problems, and clarifying requirements. Use when the user wants to think through something before or during a change.","https:\u002F\u002Fgithub.com\u002Fpardeep1916P\u002FcodeSync\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fopenspec-explore\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":51,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M78DFEZR53TXK69N8X00MBH3","openspec-archive-change","Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.","https:\u002F\u002Fgithub.com\u002Fpardeep1916P\u002FcodeSync\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fopenspec-archive-change\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":51,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M78DFB8AXAA18VTCV22PYGG4","openspec-apply-change","Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.","https:\u002F\u002Fgithub.com\u002Fpardeep1916P\u002FcodeSync\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fopenspec-apply-change\u002FSKILL.md",[],[]]