Agent skill

Adding Feature Flags

by spencerpauly in spencerpauly/awesome-cursor-skills

Add feature flags to an application for gradual rollouts, A/B testing, and kill switches using PostHog, LaunchDarkly, or a simple local implementation.

CC0-1.0Auto-check: notesMarketing & SEO

Install Adding Feature Flags

skills CLI
$ npx skills add spencerpauly/awesome-cursor-skills --skill adding-feature-flags -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install spencerpauly/awesome-cursor-skills adding-feature-flags --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/spencerpauly/awesome-cursor-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/resources/adding-feature-flags .claude/skills/adding-feature-flags && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
adding-feature-flags
GitHub stars
842
Token cost
~550 tokens
SKILL.md length
152 words
Files
1
Skills in repo
57
Repo updated
First seen
Licence
CC0-1.0

At a glance

Add feature flags to an application for gradual rollouts, A/B testing, and kill switches using PostHog, LaunchDarkly, or a simple local implementation.

  • Works in 4 steps: Install PostHog if not already present → Use feature flags in code → Server-side evaluation — for server… → …
  • Tasks that involve A/B testing
  • SKILL.md covers Option A: PostHog Feature…, Option B: Simple Local Feature… and Notes
  • Calls npm; needs POSTHOG_API_KEY

What it does

Adding Feature Flags is an agent skill from spencerpauly/awesome-cursor-skills. Add feature flags to an application for gradual rollouts, A/B testing, and kill switches using PostHog, LaunchDarkly, or a simple local implementation.

Its SKILL.md is about 550 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Marketing & SEO, covering A/B testing. It works with PostHog. The repository describes itself as: A curated list of awesome skills for Cursor. The licence is CC0-1.0.

When your agent uses it

  • Tasks that involve A/B testing

Example prompts

  • “/adding-feature-flags”

Requirements

  • Node.js
  • A credential in POSTHOG_API_KEY

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Install PostHog if not already present
  2. Use feature flags in code
  3. Server-side evaluation — for server components or API routes
  4. Create flags in the PostHog dashboard — set up targeting rules based on user properties, percentage rollouts, or cohorts.

What it can do on your machine

Read from SKILL.md and the folder at commit 99cd265. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • POSTHOG_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Adding Feature Flags loads about 550 tokens when it runs. Until then it costs about 43 tokens; SKILL.md has 152 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~43
When it runs · the whole SKILL.md, loaded when a task matches
~550

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:64
    3. **Add env vars** — add flags to `.env` and `.env.example`:

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from spencerpauly/awesome-cursor-skills at commit 99cd265, republished under its CC0-1.0 licence (© spencerpauly). 152 words, ~550 tokens.

Download SKILL.mdSave it as .claude/skills/adding-feature-flags/SKILL.md (or your agent's skills folder).
name
adding-feature-flags
description
Add feature flags to an application for gradual rollouts, A/B testing, and kill switches using PostHog, LaunchDarkly, or a simple local implementation.

Add Feature Flags

Use this skill when the user asks to add feature flags, feature toggles, gradual rollouts, or A/B testing.

  1. Install PostHog if not already present:

    bash
    npm install posthog-js
  2. Use feature flags in code:

    tsx
    import { useFeatureFlagEnabled } from "posthog-js/react";
    
    function MyComponent() {
      const showNewFeature = useFeatureFlagEnabled("new-checkout-flow");
      if (showNewFeature) return <NewCheckout />;
      return <OldCheckout />;
    }
  3. Server-side evaluation — for server components or API routes:

    ts
    import { PostHog } from "posthog-node";
    
    const posthog = new PostHog(process.env.POSTHOG_API_KEY!);
    const isEnabled = await posthog.isFeatureEnabled("new-checkout-flow", userId);
  4. Create flags in the PostHog dashboard — set up targeting rules based on user properties, percentage rollouts, or cohorts.

Option B: Simple Local Feature Flags

For projects that don't need a third-party service:

  1. Create a flags config — lib/feature-flags.ts:

    ts
    export const FLAGS = {
      NEW_CHECKOUT: process.env.NEXT_PUBLIC_FF_NEW_CHECKOUT === "true",
      DARK_MODE: process.env.NEXT_PUBLIC_FF_DARK_MODE === "true",
    } as const;
  2. Use in components:

    tsx
    import { FLAGS } from "@/lib/feature-flags";
    
    function App() {
      return FLAGS.NEW_CHECKOUT ? <NewCheckout /> : <OldCheckout />;
    }
  3. Add env vars — add flags to .env and .env.example:

    NEXT_PUBLIC_FF_NEW_CHECKOUT=false
    NEXT_PUBLIC_FF_DARK_MODE=true

Notes

  • Use feature flags for all user-facing changes during rollout, not just experiments.
  • Clean up stale flags — remove the flag and the old code path once a feature is fully rolled out.
  • For server-side flags, cache the evaluation result to avoid per-request API calls.
  • Name flags descriptively: new-checkout-flow not flag-1.

© spencerpauly, CC0-1.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in resources/adding-feature-flags of spencerpauly/awesome-cursor-skills.

Open the folder on GitHubat commit 99cd265

Compare with similar skills

Adding Feature Flags next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Adding Feature Flags compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Adding Feature Flags this skillspencerpauly/awesome-cursor-skills842—~550Automated safety check: NotesCC0-1.0
Analyticsericrisco/rsc-harness167—~2.8kAutomated safety check: PassMIT
Flags SDKvercel/vercel-plugin301—~6.9kAutomated safety check: NotesCustom licence
Experimentation Platform Orchestratorrampstackco/claude-skills940—~6.6kAutomated safety check: PassMIT
Posthog Core Workflow Bjeremylongshore/tons-of-skills-marketplace2.8k—~2.3kAutomated safety check: PassMIT
Ab Testingcoreyhaines31/marketingskills54k3 repos~2.8kAutomated safety check: PassMIT

Similar skills

  • Analytics

    ericrisco/rsc-harness

    A skill your agent uses when instrumenting product or web analytics — GA4/PostHog SDK wiring, event taxonomy, funnels, double-counted events, consent gating, PII scrubbing.

    167 GitHub stars~2.8k tokensUpdated today
    Marketing & SEOAuto-check passed
  • Flags SDK

    vercel/vercel-plugin

    Official

    Set up and use feature flags and A/B tests with the Flags SDK (flags npm package) and Vercel Flags.

    301 GitHub stars~6.9k tokensUpdated yesterday
    Marketing & SEOAuto-check: notes
  • Experimentation Platform Orchestrator

    rampstackco/claude-skills

    A platform decision framework for experimentation. An agent skill from rampstackco/claude-skills.

    940 GitHub stars~6.6k tokensUpdated yesterday
    Marketing & SEOAuto-check passed
  • Posthog Core Workflow B

    jeremylongshore/tons-of-skills-marketplace

    Implement a safe PostHog feature-flag and experiment lifecycle with defaults, exposure integrity, rollout ownership, and cleanup.

    2.8k GitHub stars~2.3k tokensUpdated today
    Marketing & SEOAuto-check passed
  • Ab Testing

    coreyhaines31/marketingskills

    When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program.

    54k GitHub starsUsed in 3 repos~2.8k tokens
    Marketing & SEOAuto-check passed
  • Analytics

    Nexus-JPF/note-companion

    When the user wants to set up, improve, or audit analytics tracking and measurement.

    870 GitHub starsUsed in 7 repos~2.2k tokens
    Marketing & SEOAuto-check passed

More from spencerpauly/awesome-cursor-skills

All 57 skills in this repo
  • Babysitting PR

    spencerpauly/awesome-cursor-skills

    Monitor a pull request for CI failures, review comments, and merge conflicts — then fix them automatically.

    842 GitHub stars~930 tokensUpdated 2 mo ago
    Auto-check passed
  • Best Of N Solving

    spencerpauly/awesome-cursor-skills

    Solve a hard problem by trying multiple approaches in parallel using isolated git worktrees.

    842 GitHub stars~698 tokensUpdated 2 mo ago
    Auto-check passed
  • Grinding Until Pass

    spencerpauly/awesome-cursor-skills

    Keep iterating on code changes until the tests pass, the build succeeds, or linting is clean.

    842 GitHub stars~796 tokensUpdated 2 mo ago
    Auto-check passed
  • Parallel CI Triage

    spencerpauly/awesome-cursor-skills

    When GitHub Actions fails, fetch failing job logs and assign each failing job to a separate subagent that fixes its slice of the problem in parallel.

    842 GitHub stars~793 tokensUpdated 2 mo ago
    Auto-check passed
  • Parallel Exploring

    spencerpauly/awesome-cursor-skills

    Explore a large codebase in parallel by launching multiple explore subagents that each investigate a different area simultaneously.

    842 GitHub stars~787 tokensUpdated 2 mo ago
    Auto-check: notes
  • Profiling Performance

    spencerpauly/awesome-cursor-skills

    Profile a running web application's CPU performance using Cursor's built-in browser profiler.

    842 GitHub stars~686 tokensUpdated 2 mo ago
    Auto-check passed

Works with

Categories

Questions about Adding Feature Flags

What does Adding Feature Flags do?

Add feature flags to an application for gradual rollouts, A/B testing, and kill switches using PostHog, LaunchDarkly, or a simple local implementation. Adding Feature Flags is an agent skill from spencerpauly/awesome-cursor-skills. Add feature flags to an application for gradual rollouts, A/B testing, and kill switches using PostHog, LaunchDarkly, or a simple local implementation.

When should I use Adding Feature Flags?

Adding Feature Flags fits situations like: tasks that involve A/B testing.

How do I install Adding Feature Flags in Claude Code?

Run `npx skills add spencerpauly/awesome-cursor-skills --skill adding-feature-flags -a claude-code`. Or copy the skill folder (resources/adding-feature-flags in spencerpauly/awesome-cursor-skills) into .claude/skills/adding-feature-flags in your project. Claude Code loads it when a task matches its description.

How do I install Adding Feature Flags in Codex?

Run `npx skills add spencerpauly/awesome-cursor-skills --skill adding-feature-flags -a codex`. Or copy the skill folder (resources/adding-feature-flags in spencerpauly/awesome-cursor-skills) into .agents/skills/adding-feature-flags in your project. Codex loads it when a task matches its description.

Can I use Adding Feature Flags in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add spencerpauly/awesome-cursor-skills --skill adding-feature-flags -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/adding-feature-flags, .gemini/skills/adding-feature-flags, .github/skills/adding-feature-flags and .opencode/skills/adding-feature-flags in your project.

What does Adding Feature Flags need to run?

Going by SKILL.md and its folder, Adding Feature Flags needs the command-line tools its instructions call (npm) and credentials named POSTHOG_API_KEY. Our summary lists: Node.js; A credential in POSTHOG_API_KEY.

Does Adding Feature Flags access the network?

SKILL.md contains no URLs. Its commands use npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Adding Feature Flags safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Adding Feature Flags use?

Adding Feature Flags is published under the CC0-1.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Adding Feature Flags use?

About 550 tokens (SKILL.md is roughly 2.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Adding Feature Flags?

Skills that share tags, products or a category with Adding Feature Flags: Analytics (ericrisco/rsc-harness, 167 stars), Flags SDK (vercel/vercel-plugin, 301 stars), Experimentation Platform Orchestrator (rampstackco/claude-skills, 940 stars) and Posthog Core Workflow B (jeremylongshore/tons-of-skills-marketplace, 2.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Adding Feature Flags?

spencerpauly (a GitHub user) maintains it in spencerpauly/awesome-cursor-skills, which has 842 GitHub stars. The repository holds 57 skills in this directory. The repository was last updated on August 2, 2026.

Source: spencerpauly/awesome-cursor-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.