[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78DF1DAK0C0ZYK62CM61TEM":3,"skill-same:01M78DF1DAK0C0ZYK62CM61TEM":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},"01M78DF1DAK0C0ZYK62CM61TEM","codesync-storage-and-security",null,"Encrypted token storage with Web Crypto API AES-GCM (256-bit), chrome.storage abstraction, zero-client-secret model, and CSP compliance.","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-storage-and-security\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: codesync-storage-and-security\ndescription: Encrypted token storage with Web Crypto API AES-GCM (256-bit), chrome.storage abstraction, zero-client-secret model, and CSP compliance.\n---\n\n# CodeSync Storage & Extension Security Architecture\n\nUse this skill when modifying persistent storage, token encryption, authentication credentials, or security policies in `src\u002Fstorage\u002F` and `src\u002Futils\u002Fcrypto.ts`.\n\n---\n\n## 1. At-Rest Credential Encryption (AES-GCM 256-bit)\n\nOAuth tokens and Personal Access Tokens (PATs) are **never** stored in plain text inside `chrome.storage.local`. CodeSync uses the native browser **Web Crypto API (`window.crypto.subtle`)** to encrypt and decrypt tokens transparently:\n\n```\n[Plain Text Token]\n        │\n        ▼\n[crypto.subtle.encrypt(AES-GCM)]  \u003C── Key derived from extension installation entropy\n        │\n        ▼\n[Base64 Encrypted String: iv.ciphertext]\n        │\n        ▼\n[chrome.storage.local.set({ settings: { githubToken: 'enc:...' } })]\n```\n\n### Encryption Implementation (`src\u002Futils\u002Fcrypto.ts`)\n```typescript\nconst ALGORITHM = 'AES-GCM';\nconst KEY_LENGTH = 256;\n\nexport async function encryptToken(plainText: string): Promise\u003Cstring> {\n  if (!plainText) return '';\n  const key = await getOrCreateEncryptionKey();\n  const iv = crypto.getRandomValues(new Uint8Array(12)); \u002F\u002F 96-bit IV for AES-GCM\n  const encodedData = new TextEncoder().encode(plainText);\n\n  const encryptedBuffer = await crypto.subtle.encrypt(\n    { name: ALGORITHM, iv },\n    key,\n    encodedData\n  );\n\n  const ivB64 = bufferToBase64(iv.buffer);\n  const dataB64 = bufferToBase64(encryptedBuffer);\n  return `enc:${ivB64}:${dataB64}`;\n}\n```\n\nOn read (`storage.getSettings()`), the token is decrypted if the string begins with the `enc:` prefix.\n\n---\n\n## 2. Typed Storage Interface (`src\u002Fstorage\u002Findex.ts`)\n\nAll interaction with `chrome.storage.local` is strongly typed via the `UserSettings` interface:\n\n```typescript\nexport interface UserSettings {\n  githubToken: string | null;\n  githubUser: string | null;\n  selectedRepo: string | null;\n  syncOnAccept: boolean;\n  syncHistoricalOnView: boolean;\n  desktopNotifications: boolean;\n  folderLayout: FolderLayout;\n  theme?: string;\n  commitQueue: string[]; \u002F\u002F List of pending submission IDs\n}\n```\n\n### Storage Invariants:\n1. **Always merge with defaults**:\n   When reading settings, merge the raw object with `DEFAULT_SETTINGS` to ensure newly introduced keys are never `undefined`:\n   ```typescript\n   const merged = { ...DEFAULT_SETTINGS, ...rawSettings };\n   ```\n2. **Atomic token encryption**:\n   `updateSettings()` must encrypt `githubToken` before persisting to storage.\n\n---\n\n## 3. Zero-Client-Secret Model\n\n- **Absolute Rule**: Never embed a GitHub OAuth App Client Secret into frontend code or environment files bundled into the extension bundle.\n- In production, OAuth token exchange is routed through the proxy worker specified in `VITE_OAUTH_PROXY_URL`.\n- Personal Access Tokens (PATs) enter the extension solely through the user input form in `src\u002Fpopup\u002Fcomponents\u002FAuthForm.tsx` and are immediately encrypted before disk persistence.\n\n---\n\n## 4. Manifest V3 Content Security Policy (CSP)\n\nCodeSync strictly adheres to the Chrome Manifest V3 CSP:\n```json\n\"content_security_policy\": {\n  \"extension_pages\": \"script-src 'self'; object-src 'self';\"\n}\n```\n\n### Prohibited Patterns:\n- ❌ **No `eval()` or `Function()` constructors**: Any string-to-code execution will be rejected by the browser and Chrome Web Store review.\n- ❌ **No inline script tags**: All scripts must be loaded via external bundled `.js` files.\n- ❌ **No remote code loading**: Never inject scripts from external CDNs (e.g. unpkg, cdnjs). All dependencies must be packaged in `package.json` and bundled by Vite.\n\n---\n\n## 5. Security Checklist for Contributors\n\nBefore committing changes involving credentials or storage:\n- [ ] Verify that `githubToken` is never output to `console.log` in development or production.\n- [ ] Run `npm run test -- src\u002Futils\u002F__tests__\u002Fcrypto.test.ts` to ensure encryption and decryption pass with 100% round-trip parity.\n- [ ] Verify that logging out (`storage.clearSettings()`) cleans up stored credentials.\n","# CodeSync Storage & Extension Security Architecture\n\nUse this skill when modifying persistent storage, token encryption, authentication credentials, or security policies in `src\u002Fstorage\u002F` and `src\u002Futils\u002Fcrypto.ts`.\n\n---\n\n## 1. At-Rest Credential Encryption (AES-GCM 256-bit)\n\nOAuth tokens and Personal Access Tokens (PATs) are **never** stored in plain text inside `chrome.storage.local`. CodeSync uses the native browser **Web Crypto API (`window.crypto.subtle`)** to encrypt and decrypt tokens transparently:\n\n```\n[Plain Text Token]\n        │\n        ▼\n[crypto.subtle.encrypt(AES-GCM)]  \u003C── Key derived from extension installation entropy\n        │\n        ▼\n[Base64 Encrypted String: iv.ciphertext]\n        │\n        ▼\n[chrome.storage.local.set({ settings: { githubToken: 'enc:...' } })]\n```\n\n### Encryption Implementation (`src\u002Futils\u002Fcrypto.ts`)\n```typescript\nconst ALGORITHM = 'AES-GCM';\nconst KEY_LENGTH = 256;\n\nexport async function encryptToken(plainText: string): Promise\u003Cstring> {\n  if (!plainText) return '';\n  const key = await getOrCreateEncryptionKey();\n  const iv = crypto.getRandomValues(new Uint8Array(12)); \u002F\u002F 96-bit IV for AES-GCM\n  const encodedData = new TextEncoder().encode(plainText);\n\n  const encryptedBuffer = await crypto.subtle.encrypt(\n    { name: ALGORITHM, iv },\n    key,\n    encodedData\n  );\n\n  const ivB64 = bufferToBase64(iv.buffer);\n  const dataB64 = bufferToBase64(encryptedBuffer);\n  return `enc:${ivB64}:${dataB64}`;\n}\n```\n\nOn read (`storage.getSettings()`), the token is decrypted if the string begins with the `enc:` prefix.\n\n---\n\n## 2. Typed Storage Interface (`src\u002Fstorage\u002Findex.ts`)\n\nAll interaction with `chrome.storage.local` is strongly typed via the `UserSettings` interface:\n\n```typescript\nexport interface UserSettings {\n  githubToken: string | null;\n  githubUser: string | null;\n  selectedRepo: string | null;\n  syncOnAccept: boolean;\n  syncHistoricalOnView: boolean;\n  desktopNotifications: boolean;\n  folderLayout: FolderLayout;\n  theme?: string;\n  commitQueue: string[]; \u002F\u002F List of pending submission IDs\n}\n```\n\n### Storage Invariants:\n1. **Always merge with defaults**:\n   When reading settings, merge the raw object with `DEFAULT_SETTINGS` to ensure newly introduced keys are never `undefined`:\n   ```typescript\n   const merged = { ...DEFAULT_SETTINGS, ...rawSettings };\n   ```\n2. **Atomic token encryption**:\n   `updateSettings()` must encrypt `githubToken` before persisting to storage.\n\n---\n\n## 3. Zero-Client-Secret Model\n\n- **Absolute Rule**: Never embed a GitHub OAuth App Client Secret into frontend code or environment files bundled into the extension bundle.\n- In production, OAuth token exchange is routed through the proxy worker specified in `VITE_OAUTH_PROXY_URL`.\n- Personal Access Tokens (PATs) enter the extension solely through the user input form in `src\u002Fpopup\u002Fcomponents\u002FAuthForm.tsx` and are immediately encrypted before disk persistence.\n\n---\n\n## 4. Manifest V3 Content Security Policy (CSP)\n\nCodeSync strictly adheres to the Chrome Manifest V3 CSP:\n```json\n\"content_security_policy\": {\n  \"extension_pages\": \"script-src 'self'; object-src 'self';\"\n}\n```\n\n### Prohibited Patterns:\n- ❌ **No `eval()` or `Function()` constructors**: Any string-to-code execution will be rejected by the browser and Chrome Web Store review.\n- ❌ **No inline script tags**: All scripts must be loaded via external bundled `.js` files.\n- ❌ **No remote code loading**: Never inject scripts from external CDNs (e.g. unpkg, cdnjs). All dependencies must be packaged in `package.json` and bundled by Vite.\n\n---\n\n## 5. Security Checklist for Contributors\n\nBefore committing changes involving credentials or storage:\n- [ ] Verify that `githubToken` is never output to `console.log` in development or production.\n- [ ] Run `npm run test -- src\u002Futils\u002F__tests__\u002Fcrypto.test.ts` to ensure encryption and decryption pass with 100% round-trip parity.\n- [ ] Verify that logging out (`storage.clearSettings()`) cleans up stored credentials.\n",{"name":5,"description":7},"main","f2a54fba6f9faab5c8991fc4a98973e74303f925",".agent\u002Fskills\u002Fcodesync-storage-and-security","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-storage-and-security",{"tool":38,"command":39},"bunx","bunx skills add pardeep1916P\u002FcodeSync --skill codesync-storage-and-security",{"tool":41,"command":42},"pnpm","pnpm dlx skills add pardeep1916P\u002FcodeSync --skill codesync-storage-and-security","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fpardeep1916P\u002FcodeSync\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fcodesync-storage-and-security\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",[],[]]