Check if a PostHog MCP server is connected. If available, look for tools related to feature flag management (creating, listing, updating, deleting flags). Use these tools to manage flags directly in PostHog rather than requiring the user to do it manually in the dashboard.
For Next.js 15.3+, initialize PostHog in instrumentation-client.ts for the simplest setup
The PostHog React hooks (useFeatureFlagEnabled, useFeatureFlagPayload) work WITHOUT PostHogProvider if posthog-js is already initialized (e.g., via instrumentation-client.ts)
In client components, import and use hooks directly - the React context defaults to the posthog-js singleton
Do NOT wrap components in PostHogProvider just for feature flags - it’s unnecessary if posthog-js is initialized globally
Server Components and Route Handlers cannot use React hooks - use posthog-node SDK instead
Create a server-side PostHog client with posthog-node, call getAllFlags() or getFeatureFlag(), then await posthog.shutdown()
Pass flag values from server to client components as props to avoid hydration mismatches
For flags that affect initial render, evaluate server-side and pass as props to prevent UI flicker
Client-side hooks may return undefined initially while flags load - handle this loading state
For feature flags, use useFeatureFlagEnabled() or useFeatureFlagPayload() hooks - they handle loading states and external sync automatically
Add analytics capture in event handlers where user actions occur, NOT in useEffect reacting to state changes
Do NOT use useEffect for data transformation - calculate derived values during render instead
Do NOT use useEffect to respond to user events - put that logic in the event handler itself
Do NOT use useEffect to chain state updates - calculate all related updates together in the event handler
Do NOT use useEffect to notify parent components - call the parent callback alongside setState in the event handler
To reset component state when a prop changes, pass the prop as the component’s key instead of using useEffect
useEffect is ONLY for synchronizing with external systems (non-React widgets, browser APIs, network subscriptions)
Install this repository
$ npx skills add PostHog/skills
» /plugin marketplace add PostHog/skills
Skills install per repository, not per chapter — the CLI has no documented per-skill form, so we do not print one.
MIT — the text of every chapter is reproduced unmodified, frontmatter included, under the upstream licence.
Discovery
200 chapters found by walking the repository tree for SKILL.md, not by matching a directory convention. 5 distinct layouts observed: skills/omnibus/*/SKILL.md, skills/posthog/all/skills/*/SKILL.md, skills/posthog/error-tracking/skills/*/SKILL.md, skills/posthog/feature-flags/skills/*/SKILL.md, skills/posthog/integration/skills/*/SKILL.md.
Issue colours
Resolved from the awesome-design-md registry — hue 38°, chroma 0.190. Two accent tones are generated per issue and each is proven against its own ground before it ships: a single accent that passes AA on both light and dark paper is arithmetically impossible.
Typefaces
Display: IBM Plex Sans Variable is not a face we ship; the reader's own choice is used.
Body: IBM Plex Sans Variable is not a face we ship; the reader's own choice is used.
Mono: Source Code Pro is not a face we ship; the reader's own choice is used.
We never load a typeface at request time from a third-party origin, so a brand face we do not already self-host is substituted rather than fetched.
Heading repairs
1 repair applied to this chapter so the document has one h1 and no skipped levels:
Shifted “5 headings” from h1 to h2 so the chapter title is the only h1.
Spec compliance
40 editorial notes across 40 of 200 chapters. They are printed in the margin of each chapter rather than as errors here.
Images inside a chapter come from the upstream repository. Where the author gave no alternative text we mark the image decorative rather than inventing a description — a plausible caption we made up is worse than none for the reader who depends on it.
Marketplace
A plugin manifest is published at .claude-plugin/marketplace.json by PostHog, declaring 5 plugins. It is read for editorial metadata only — never as the skill index, which is always the repository tree.
Signal
Install counts come from skills.sh. They measure downloads, not quality, and an unranked repository is not an unread one.
Agent surfaces
The whole issue is available as one markdown document at /PostHog/skills.md, and each chapter at its own .md URL.
Publication
Set by Skills Docs from the source repository. Body text is Literata at the reader’s chosen size and measure; code is Geist Mono. Nothing on this page was written by us except this paragraph.