Skip to main content
skill CX Codex

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add PostHog/skills --skill feature-flags-web -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/feature-flags-web/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/feature-flags-web/

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

Similar skills

All skills for Frontend and UI →

From the same set112

The whole set →
llm-analytics-setup llm-analytics-setup adds PostHog LLM analytics to an app running on any supported provider, tracking tokens, latency and cost for every generation. CX Codex +1 120installs experiment-audit The experiment-audit Claude Code skill checks a PostHog experiment's setup, variant data, attribution, and metrics. It runs on requests to review or validate an A/B test. CX Codex +1 118installs error-tracking-web error-tracking-web adds PostHog error tracking to a JavaScript web app: exception capture, source maps, alerts and issue triage, with the agent editing your code. CX Codex +1 116installs monthly-to-annual The monthly-to-annual Claude Code skill evaluates a PostHog customer’s move from monthly billing to an annual prepaid credit plan. It produces a discount briefing and a plain-text Slack draft. CX Codex +1 115installs feature-flags-nodejs The feature-flags-nodejs skill helps add PostHog feature flags to Node.js applications. Use it when new behavior needs controlled server-side rollout. CX Codex +1 113installs integration-expo The integration-expo skill adds PostHog analytics to Expo apps and guides the setup in stages. Use it for events, user identification, screens, and errors. CX Codex +1 112installs feature-flags-ios feature-flags-ios adds PostHog feature flags to iOS apps, manages SPM dependencies cleanly, and enforces environment variable handling in Xcode. CX Codex +1 112installs feature-flags-react feature-flags-react adds PostHog feature flag checks to a React app and keeps them clear of the code that already works. CX Codex +1 112installs

Project sponsors

Companies that keep this analytics open