Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Add PostHog feature flags to gate new functionality. Use after implementing features or reviewing PRs to ensure safe rollouts with feature flag controls. Also handles initial PostHog SDK setup if not yet installed.
.claude/skills/kunanonj-cursor-plugin-posthog-instrument-feature-flags/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-07 | ✗→✓ | ▲ Improved | 9% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 64% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 96% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 54% | 0% |
| case-23 | ✗→✓ | ▲ Improved | 40% | 0% |
Use this skill to add PostHog feature flags that gate new or changed functionality. Use it after implementing features or reviewing PRs to ensure safe rollouts with feature flag controls. If PostHog is not yet installed, this skill also covers initial SDK setup. Supports any platform or language.
Supported platforms: React, Next.js, React Native, Web (JavaScript), Node.js, Python, PHP, Ruby, Go, Java, Rust, .NET, Elixir, Android, iOS, Flutter, and the REST API.
Follow these steps IN ORDER:
STEP 1: Analyze the codebase and detect the platform. - Look for dependency files (package.json, pubspec.yaml, Podfile, Package.swift, requirements.txt, go.mod, Gemfile, composer.json, mix.exs, etc.) to determine the language and framework. - Look for lockfiles (pnpm-lock.yaml, package-lock.json, yarn.lock, bun.lockb, go.sum, pubspec.lock, Podfile.lock, Package.resolved, mix.lock) to determine the package manager.
STEP 2: Research instrumentation. (Skip if PostHog is already set up.) 2.1. Find the reference file below that matches the detected platform — it is the source of truth for SDK initialization, flag evaluation methods, and framework-specific patterns. Read it now. 2.2. If no reference matches, fall back to your general knowledge and web search. Use posthog.com/docs as the primary search source.
STEP 3: Create or find the feature flag.
STEP 4: Plan release conditions.
STEP 5: Instrument the feature.
STEP 6: Set up environment variables.
.env, .env.local, or framework-specific env files). If valid values already exist, skip this step.projects-get tool to retrieve the project's api_token. If multiple projects are returned, ask the user which project to use. If the MCP server is not connected or not authenticated, ask the user for their PostHog project API key instead.https://us.i.posthog.com for US Cloud or https://eu.i.posthog.com for EU Cloud.references/react.md - React feature flags installation - docsreferences/react-native.md - React native feature flags installation - docsreferences/web.md - Web feature flags installation - docsreferences/nodejs.md - Node.js feature flags installation - docsreferences/python.md - Python feature flags installation - docsreferences/django.md - Django - docsreferences/flask.md - Flask - docsreferences/php.md - Php feature flags installation - docsreferences/laravel.md - Laravel - docsreferences/ruby.md - Ruby feature flags installation - docsreferences/ruby-on-rails.md - Ruby on rails - docsreferences/go.md - Go feature flags installation - docsreferences/java.md - Java feature flags installation - docsreferences/rust.md - Rust feature flags installation - docsreferences/dotnet.md - .net feature flags installation - docsreferences/dotnet.md - .net - docsreferences/elixir.md - Elixir feature flags installation - docsreferences/android.md - Android feature flags installation - docsreferences/ios.md - Ios feature flags installation - docsreferences/usage.md - Ios SDK usage - docsreferences/flutter.md - Flutter feature flags installation - docsreferences/api.md - API feature flags installation - docsreferences/next-js.md - Next.js - docsreferences/adding-feature-flag-code.md - Adding feature flag code - docsreferences/best-practices.md - Best practices for production-ready flags - docsEach platform reference contains SDK-specific installation, flag evaluation, and code examples. Find the one matching the user's stack. If unlisted, use the API reference as a fallback.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-19 | pass→pass | 8,545 | 5,815 | -32% | 1 | 1 | 0% | 1,828 | 2,659 | +45% | 0 | 0 | — |
case-01 | fail→fail | 12,969 | 4,117 | -68% | 1 | 1 | 0% | 2,604 | 1,489 | -43% | 0 | 0 | — |
case-02 | fail→fail | 2,402 | 3,111 | +30% | 1 | 1 | 0% | 110 | 1,479 | +1245% | 0 | 0 | — |
case-03 | fail→fail | 3,836 | 2,480 | -35% | 1 | 1 | 0% | 173 | 1,506 | +771% | 0 | 0 | — |
case-18 | pass→pass | 9,407 | 2,080 | -78% | 1 | 1 | 0% | 1,542 | 1,677 | +9% | 0 | 0 | — |
case-04 | pass→fail | 13,288 | 4,083 | -69% | 1 | 1 | 0% | 2,462 | 1,648 | -33% | 0 | 0 | — |
case-05 | pass→pass | 13,754 | 15,048 | +9% | 1 | 1 | 0% | 2,447 | 3,693 | +51% | 0 | 0 | — |
case-06 | pass→fail | 19,383 | 8,546 | -56% | 1 | 1 | 0% | 3,415 | 2,713 | -21% | 0 | 0 | — |
case-07 | fail→pass | 12,670 | 5,694 | -55% | 1 | 1 | 0% | 2,081 | 2,276 | +9% | 0 | 0 | — |
case-08 | pass→pass | 13,304 | 8,179 | -39% | 1 | 1 | 0% | 2,180 | 2,524 | +16% | 0 | 0 | — |
case-09 | pass→pass | 3,373 | 1,861 | -45% | 1 | 1 | 0% | 620 | 1,667 | +169% | 0 | 0 | — |
case-10 | pass→pass | 4,682 | 2,469 | -47% | 1 | 1 | 0% | 860 | 1,839 | +114% | 0 | 0 | — |
case-11 | fail→pass | 6,375 | 2,170 | -66% | 1 | 1 | 0% | 1,071 | 1,757 | +64% | 0 | 0 | — |
case-12 | fail→pass | 7,253 | 6,385 | -12% | 1 | 1 | 0% | 1,378 | 2,694 | +96% | 0 | 0 | — |
case-13 | pass→pass | 12,346 | 6,906 | -44% | 1 | 1 | 0% | 2,027 | 2,607 | +29% | 0 | 0 | — |
case-14 | pass→fail | 8,423 | 1,244 | -85% | 1 | 1 | 0% | 1,418 | 1,538 | +8% | 0 | 0 | — |
case-15 | pass→pass | 11,671 | 2,609 | -78% | 1 | 1 | 0% | 2,542 | 1,911 | -25% | 0 | 0 | — |
case-16 | fail→pass | 6,830 | 1,655 | -76% | 1 | 1 | 0% | 1,097 | 1,688 | +54% | 0 | 0 | — |
case-17 | pass→pass | 10,865 | 6,579 | -39% | 1 | 1 | 0% | 2,130 | 2,796 | +31% | 0 | 0 | — |
case-20 | pass→pass | 14,508 | 5,815 | -60% | 1 | 1 | 0% | 2,636 | 2,352 | -11% | 0 | 0 | — |
case-21 | pass→pass | 7,772 | 4,207 | -46% | 1 | 1 | 0% | 1,323 | 1,936 | +46% | 0 | 0 | — |
case-22 | pass→pass | 5,857 | 2,065 | -65% | 1 | 1 | 0% | 973 | 1,688 | +73% | 0 | 0 | — |
case-23 | fail→pass | 7,558 | 2,396 | -68% | 1 | 1 | 0% | 1,260 | 1,758 | +40% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted, and 19 counted toward the lift figure. The other 4 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +9 percentage points is the difference between those two pass rates over the 19 comparable cases. 3 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.