[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6F8R1T6WSFHGHPPPE3W8Y07":3,"skill-same:01M6F8R1T6WSFHGHPPPE3W8Y07":74},{"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":42,"linkOnly":43,"markdownContent":44,"markdownBody":45,"frontMatter":46,"refName":51,"commitSha":52,"skillDirectory":53,"forksCount":54,"repositoryHtmlUrl":55,"repositoryHomepageUrl":6,"ownerHtmlUrl":56,"ownerBlogUrl":57,"ownerDescription":58,"updatedAt":59,"install":60,"resources":73},"01M6F8R1T6WSFHGHPPPE3W8Y07","posthog-sdk-patterns",null,"Apply production-ready PostHog SDK patterns for TypeScript and Python.\nUse when implementing PostHog integrations, refactoring SDK usage,\nor establishing team coding standards for PostHog.\nTrigger with phrases like \"posthog SDK patterns\", \"posthog best practices\",\n\"posthog code patterns\", \"idiomatic posthog\".","Dicklesworthstone\u002Fpi_agent_rust","Dicklesworthstone","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F35050222?v=4","01M6CG26AR942CSVMN1M5E3DSE","Jeff Emanuel","01M6CG26EPP71PSHW1VDS71121",1992,"MIT","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fposthog-pack\u002Fskills\u002Fposthog-sdk-patterns\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41],"sdk","posthog","posthog sdk patterns","patterns","write","when","implementing","production-ready","code patterns","trigger","io","standards","ready","edit","typescript","read","coding","integrations","refactoring","team","coding standards","code","python","2026-11-10 10:12:30",false,"---\nname: posthog-sdk-patterns\ndescription: |\n  Apply production-ready PostHog SDK patterns for TypeScript and Python.\n  Use when implementing PostHog integrations, refactoring SDK usage,\n  or establishing team coding standards for PostHog.\n  Trigger with phrases like \"posthog SDK patterns\", \"posthog best practices\",\n  \"posthog code patterns\", \"idiomatic posthog\".\nallowed-tools: Read, Write, Edit\nversion: 1.0.0\nlicense: MIT\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\n---\n\n# PostHog SDK Patterns\n\n## Overview\nProduction-ready patterns for PostHog SDK usage in TypeScript and Python.\n\n## Prerequisites\n- Completed `posthog-install-auth` setup\n- Familiarity with async\u002Fawait patterns\n- Understanding of error handling best practices\n\n## Instructions\n\n### Step 1: Implement Singleton Pattern (Recommended)\n```typescript\n\u002F\u002F src\u002Fposthog\u002Fclient.ts\nimport { PostHogClient } from '@posthog\u002Fsdk';\n\nlet instance: PostHogClient | null = null;\n\nexport function getPostHogClient(): PostHogClient {\n  if (!instance) {\n    instance = new PostHogClient({\n      apiKey: process.env.POSTHOG_API_KEY!,\n      \u002F\u002F Additional options\n    });\n  }\n  return instance;\n}\n```\n\n### Step 2: Add Error Handling Wrapper\n```typescript\nimport { PostHogError } from '@posthog\u002Fsdk';\n\nasync function safePostHogCall\u003CT>(\n  operation: () => Promise\u003CT>\n): Promise\u003C{ data: T | null; error: Error | null }> {\n  try {\n    const data = await operation();\n    return { data, error: null };\n  } catch (err) {\n    if (err instanceof PostHogError) {\n      console.error({\n        code: err.code,\n        message: err.message,\n      });\n    }\n    return { data: null, error: err as Error };\n  }\n}\n```\n\n### Step 3: Implement Retry Logic\n```typescript\nasync function withRetry\u003CT>(\n  operation: () => Promise\u003CT>,\n  maxRetries = 3,\n  backoffMs = 1000\n): Promise\u003CT> {\n  for (let attempt = 1; attempt \u003C= maxRetries; attempt++) {\n    try {\n      return await operation();\n    } catch (err) {\n      if (attempt === maxRetries) throw err;\n      const delay = backoffMs * Math.pow(2, attempt - 1);\n      await new Promise(r => setTimeout(r, delay));\n    }\n  }\n  throw new Error('Unreachable');\n}\n```\n\n## Output\n- Type-safe client singleton\n- Robust error handling with structured logging\n- Automatic retry with exponential backoff\n- Runtime validation for API responses\n\n## Error Handling\n| Pattern | Use Case | Benefit |\n|---------|----------|---------|\n| Safe wrapper | All API calls | Prevents uncaught exceptions |\n| Retry logic | Transient failures | Improves reliability |\n| Type guards | Response validation | Catches API changes |\n| Logging | All operations | Debugging and monitoring |\n\n## Examples\n\n### Factory Pattern (Multi-tenant)\n```typescript\nconst clients = new Map\u003Cstring, PostHogClient>();\n\nexport function getClientForTenant(tenantId: string): PostHogClient {\n  if (!clients.has(tenantId)) {\n    const apiKey = getTenantApiKey(tenantId);\n    clients.set(tenantId, new PostHogClient({ apiKey }));\n  }\n  return clients.get(tenantId)!;\n}\n```\n\n### Python Context Manager\n```python\nfrom contextlib import asynccontextmanager\nfrom posthog import PostHogClient\n\n@asynccontextmanager\nasync def get_posthog_client():\n    client = PostHogClient()\n    try:\n        yield client\n    finally:\n        await client.close()\n```\n\n### Zod Validation\n```typescript\nimport { z } from 'zod';\n\nconst posthogResponseSchema = z.object({\n  id: z.string(),\n  status: z.enum(['active', 'inactive']),\n  createdAt: z.string().datetime(),\n});\n```\n\n## Resources\n- [PostHog SDK Reference](https:\u002F\u002Fdocs.posthog.com\u002Fsdk)\n- [PostHog API Types](https:\u002F\u002Fdocs.posthog.com\u002Ftypes)\n- [Zod Documentation](https:\u002F\u002Fzod.dev\u002F)\n\n## Next Steps\nApply patterns in `posthog-core-workflow-a` for real-world usage.","# PostHog SDK Patterns\n\n## Overview\nProduction-ready patterns for PostHog SDK usage in TypeScript and Python.\n\n## Prerequisites\n- Completed `posthog-install-auth` setup\n- Familiarity with async\u002Fawait patterns\n- Understanding of error handling best practices\n\n## Instructions\n\n### Step 1: Implement Singleton Pattern (Recommended)\n```typescript\n\u002F\u002F src\u002Fposthog\u002Fclient.ts\nimport { PostHogClient } from '@posthog\u002Fsdk';\n\nlet instance: PostHogClient | null = null;\n\nexport function getPostHogClient(): PostHogClient {\n  if (!instance) {\n    instance = new PostHogClient({\n      apiKey: process.env.POSTHOG_API_KEY!,\n      \u002F\u002F Additional options\n    });\n  }\n  return instance;\n}\n```\n\n### Step 2: Add Error Handling Wrapper\n```typescript\nimport { PostHogError } from '@posthog\u002Fsdk';\n\nasync function safePostHogCall\u003CT>(\n  operation: () => Promise\u003CT>\n): Promise\u003C{ data: T | null; error: Error | null }> {\n  try {\n    const data = await operation();\n    return { data, error: null };\n  } catch (err) {\n    if (err instanceof PostHogError) {\n      console.error({\n        code: err.code,\n        message: err.message,\n      });\n    }\n    return { data: null, error: err as Error };\n  }\n}\n```\n\n### Step 3: Implement Retry Logic\n```typescript\nasync function withRetry\u003CT>(\n  operation: () => Promise\u003CT>,\n  maxRetries = 3,\n  backoffMs = 1000\n): Promise\u003CT> {\n  for (let attempt = 1; attempt \u003C= maxRetries; attempt++) {\n    try {\n      return await operation();\n    } catch (err) {\n      if (attempt === maxRetries) throw err;\n      const delay = backoffMs * Math.pow(2, attempt - 1);\n      await new Promise(r => setTimeout(r, delay));\n    }\n  }\n  throw new Error('Unreachable');\n}\n```\n\n## Output\n- Type-safe client singleton\n- Robust error handling with structured logging\n- Automatic retry with exponential backoff\n- Runtime validation for API responses\n\n## Error Handling\n| Pattern | Use Case | Benefit |\n|---------|----------|---------|\n| Safe wrapper | All API calls | Prevents uncaught exceptions |\n| Retry logic | Transient failures | Improves reliability |\n| Type guards | Response validation | Catches API changes |\n| Logging | All operations | Debugging and monitoring |\n\n## Examples\n\n### Factory Pattern (Multi-tenant)\n```typescript\nconst clients = new Map\u003Cstring, PostHogClient>();\n\nexport function getClientForTenant(tenantId: string): PostHogClient {\n  if (!clients.has(tenantId)) {\n    const apiKey = getTenantApiKey(tenantId);\n    clients.set(tenantId, new PostHogClient({ apiKey }));\n  }\n  return clients.get(tenantId)!;\n}\n```\n\n### Python Context Manager\n```python\nfrom contextlib import asynccontextmanager\nfrom posthog import PostHogClient\n\n@asynccontextmanager\nasync def get_posthog_client():\n    client = PostHogClient()\n    try:\n        yield client\n    finally:\n        await client.close()\n```\n\n### Zod Validation\n```typescript\nimport { z } from 'zod';\n\nconst posthogResponseSchema = z.object({\n  id: z.string(),\n  status: z.enum(['active', 'inactive']),\n  createdAt: z.string().datetime(),\n});\n```\n\n## Resources\n- [PostHog SDK Reference](https:\u002F\u002Fdocs.posthog.com\u002Fsdk)\n- [PostHog API Types](https:\u002F\u002Fdocs.posthog.com\u002Ftypes)\n- [Zod Documentation](https:\u002F\u002Fzod.dev\u002F)\n\n## Next Steps\nApply patterns in `posthog-core-workflow-a` for real-world usage.",{"name":5,"author":47,"license":15,"version":48,"description":49,"allowed-tools":50},"Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Apply production-ready PostHog SDK patterns for TypeScript and Python.\nUse when implementing PostHog integrations, refactoring SDK usage,\nor establishing team coding standards for PostHog.\nTrigger with phrases like \"posthog SDK patterns\", \"posthog best practices\",\n\"posthog code patterns\", \"idiomatic posthog\".\n","Read, Write, Edit","main","90b50ed0778745a80fd5bfb13b1843d45b9e82f7","tests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fposthog-pack\u002Fskills\u002Fposthog-sdk-patterns",233,"https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust","https:\u002F\u002Fgithub.com\u002FDicklesworthstone","https:\u002F\u002Fwww.jeffreyemanuel.com\u002F","Building in NY","2026-11-15 01:54:15",{"source":8,"skillName":5,"commands":61,"prompt":71,"zipAvailable":72},[62,65,68],{"tool":63,"command":64},"npx","npx skills add Dicklesworthstone\u002Fpi_agent_rust --skill posthog-sdk-patterns",{"tool":66,"command":67},"bunx","bunx skills add Dicklesworthstone\u002Fpi_agent_rust --skill posthog-sdk-patterns",{"tool":69,"command":70},"pnpm","pnpm dlx skills add Dicklesworthstone\u002Fpi_agent_rust --skill posthog-sdk-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fposthog-pack\u002Fskills\u002Fposthog-sdk-patterns\u002FSKILL.md",true,[],[75,109,145,168,194,220],{"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":79,"licenseFileUrl":80,"sourceHtmlUrl":81,"categories":82,"keywords":88,"publishedAt":108},"01M6FCR7G5A005P364Z6ZWCJDP","theme-factory","Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors\u002Ffonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fcreative-design\u002Ftheme-factory\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fcreative-design\u002Ftheme-factory\u002FSKILL.md",[83],{"categoryNo":84,"categoryName":85,"taxonomyType":86,"taxonomyTypeDesc":87},"01JBSEEDCAT000000000000015","视觉设计","SCENARIO","使用场景",[89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107],"theme factory","factory","theme","docs","toolkit","generate","artifacts","SET","fly","slides","landing","html","styling","artifact","pages","themes","with","you","fonts","2026-11-11 15:11:14",{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":79,"licenseFileUrl":113,"sourceHtmlUrl":114,"categories":115,"keywords":119,"publishedAt":42},"01M6FEGPPK0ZTKCCM0R3E3KS33","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FSKILL.md",[116],{"categoryNo":117,"categoryName":118,"taxonomyType":86,"taxonomyTypeDesc":87},"01JBSEEDCAT000000000000009","前端开发",[120,121,95,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,100,138,139,140,141,142,143,144],"web artifacts builder","web","artifacts builder","builder","frontend","css","components","react","component","routing","state management","state","shadcn","file","ui","Tools","Tailwind","use","single-file","simple","ui components","multi","for","jsx","suite",{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":79,"licenseFileUrl":149,"sourceHtmlUrl":150,"categories":151,"keywords":156,"publishedAt":42},"01M6FEE9VTK1W4GY21AKREJXRG","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FSKILL.md",[152,155],{"categoryNo":153,"categoryName":154,"taxonomyType":86,"taxonomyTypeDesc":87},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":117,"categoryName":118,"taxonomyType":86,"taxonomyTypeDesc":87},[157,158,159,124,160,161,121,162,93,163,134,164,165,166,167,105,142],"testing","webapp testing","webapp","screenshots","playwright","debugging","browser","logs","applications","behavior","local",{"skillNo":169,"name":170,"nameZh":6,"description":171,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":172,"sourceHtmlUrl":173,"categories":174,"keywords":175,"publishedAt":42},"01M6FE20F7ZTQBFWKF4MPJ2SBX","neuropixels-analysis","Neuropixels neural recording analysis. Load SpikeGLX\u002FOpenEphys data, preprocess, motion correction, Kilosort4 spike sorting, quality metrics, Allen\u002FIBL curation, AI-assisted visual analysis, for Neuropixels 1.0\u002F2.0 extracellular electrophysiology. Use when working with neural recordings, spike sorting, extracellular electrophysiology, or when the user mentions Neuropixels, SpikeGLX, Open Ephys, Kilosort, quality metrics, or unit curation.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fneuropixels-analysis\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fneuropixels-analysis\u002FSKILL.md",[],[176,177,178,179,180,181,182,183,137,184,185,186,187,188,189,190,105,191,192,193,142,24],"analysis","neuropixels analysis","spike","metrics","data","open","quality","user","recordings","Neural","motion","visual","quality metrics","unit","sorting","curation","recording","load",{"skillNo":195,"name":196,"nameZh":6,"description":197,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":79,"licenseFileUrl":198,"sourceHtmlUrl":199,"categories":200,"keywords":204,"publishedAt":42},"01M6FDP0PDK6F1GGX395C7625Z","skill-creator","Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fskill-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fskill-creator\u002FSKILL.md",[201],{"categoryNo":202,"categoryName":203,"taxonomyType":86,"taxonomyTypeDesc":87},"01JBSEEDCAT000000000000023","Skill与智能体开发",[205,206,207,208,209,210,211,212,36,213,214,215,216,217,105,142,218,24,219],"skill creator","creator","workflows","create","update","capabilities","knowledge","tool","specialized","guide","new skill","existing skill","users","Existing","new",{"skillNo":221,"name":222,"nameZh":6,"description":223,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":224,"sourceHtmlUrl":225,"categories":226,"keywords":228,"publishedAt":42},"01M6FDM8Y7VK7NYG9SM7QPA3PW","notebooklm","Use this skill to query your Google NotebookLM notebooks directly from Claude Code for source-grounded, citation-backed answers from Gemini. Browser automation, library management, persistent auth. Drastically reduced hallucinations through document-only responses.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fnotebooklm\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fnotebooklm\u002FSKILL.md",[227],{"categoryNo":202,"categoryName":203,"taxonomyType":86,"taxonomyTypeDesc":87},[222,229,230,231,232,233,40,163,234,235,137,236,237,238,239,142,240],"google","browser automation","gemini","automation","auth","library","management","only","document","query","Citation","source"]