feature-flags-web — Claude Code skill
The feature-flags-web skill helps add PostHog feature flags to JavaScript web apps. Use it for boolean checks, server-side evaluation, and flag management through MCP.
MIT 114 installs ★ 80 updated 2026-10-24
npx skills add PostHog/skills --skill feature-flags-web -a claude-codeWhat feature-flags-web does
The skill guides Claude through adding PostHog feature flags to web applications built with JavaScript. It keeps the new checks beside the current application logic, starts with boolean flags, and favors server-side evaluation when that fits the task.
Its reference material covers web installation, adding flag code, and practical flag usage in references/web.md, references/adding-feature-flag-code.md, and references/best-practices.md. Multivariate flags are used when the request calls for them.
If a PostHog MCP server is connected, the skill can use its feature-flag tools to create, list, update, or delete flags. PostHog keys belong in environment variables, so hardcoding them in the application is outside the intended setup.
What it helps with
- add PostHog feature flags to a JavaScript web app
- place a boolean flag check beside existing code
- evaluate a flag on the server
- apply PostHog setup and API guidance
- manage flags through a connected PostHog MCP server
Example prompts for the agent
- Add a boolean PostHog feature flag to the existing logic in this JavaScript web app.
- Show how to evaluate this flag on the server so the UI does not flicker.
- Check for a connected PostHog MCP server and use its tools to create the requested feature flag.
How to install feature-flags-web
1Skills CLI (Vercel)
npx skills add PostHog/skills --skill feature-flags-web -a claude-code2Manually: put the files in place
~/.claude/skills/feature-flags-web/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/feature-flags-web/
1Skills CLI (Vercel)
npx skills add PostHog/skills --skill feature-flags-web -a codex2Manually: put the files in place
.agents/skills/feature-flags-web/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add PostHog/skills --skill feature-flags-web -a cursor2Manually: put the files in place
.cursor/skills/feature-flags-web/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install PostHog/skills skills/posthog/all/skills/feature-flags-web2Manually: put the files in place
.github/skills/feature-flags-web/SKILL.md1Skills CLI (Vercel)
npx skills add PostHog/skills --skill feature-flags-web -a gemini-cli2Platform CLI
gemini skills install https://github.com/PostHog/skills --path skills/posthog/all/skills/feature-flags-webManually: put the files in place
.devin/skills/feature-flags-web/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add PostHog/skills --skill feature-flags-web -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about feature-flags-web
How do I install feature-flags-web in Claude Code?
Run npx skills add PostHog/skills --skill feature-flags-web -a claude-code, then check ~/.claude/skills/feature-flags-web/SKILL.md.
What does feature-flags-web do?
It helps add PostHog feature flags to JavaScript web applications, including flag checks, server-side evaluation, and guidance for managing flags through MCP.
Which platforms support feature-flags-web?
The skill supports Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode.
Source text
SKILL.md · MIT
--- name: feature-flags-web description: PostHog feature flags for Web (JavaScript) applications metadata: author: PostHog version: 1.9.4 --- # PostHog feature flags for Web (JavaScript) This skill helps you add PostHog feature flags to Web (JavaScript) applications. ## Reference files - `references/web.md` - Web feature flags installation - docs - `references/adding-feature-flag-code.md` - Adding feature flag code - docs - `references/best-practices.md` - Feature flag best practices - docs Consult the documentation for API details and framework-specific patterns. ## Key principles - **Environment variables**: Always use environment variables for PostHog keys. Never hardcode them. - **Minimal changes**: Add feature flag code alongside existing logic. Don't replace or restructure existing code. - **Boolean flags first**: Default to boolean flag checks unless the user specifically asks for multivariate flags. - **Server-side when possible**: Prefer server-side flag evaluation to avoid UI flicker. ## PostHog MCP tools 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. ## Framework guidelines _No specific framework guidelines._
© PostHog · MIT · PostHog/skills