1. Habit
  2. Skills
  3. React feature flags skill
react · 1K installs

React feature flags skill
Runs by itself, flag files change.

Flags consistent across every fork.

Install the React feature flags skill and make it a habit: follow https://gethabit.dev/skills/react/feature-flags.md

  1. 1Copy
  2. 2Paste into Claude Code, Codex or Cursor
  3. 3It runs by itself

1K installs252K starsMIT licenceSource on GitHub ↗

React feature flags

by react · 1K installs

The skill

The react feature flags skill explains React's flag files, @gate pragmas, inline gate() checks and __VARIANT__ flags, and how to debug channel-specific test failures.

Only when you ask.

The habit

Flags consistent across every fork.

↻ Runs by itselfflag files change

How the habit works.
You don't have to.

Three questionsWhen does it start? How does it check its work? What does it remember?

One run, step by step.
Then it stops.

Stop ruleStops after one pull request per run, checking at most ten flags.

  1. 01

    List changed flags

    The agent reads which flags the pull request adds or changes.

  2. 02

    Check fork files

    It confirms each flag is set in the www, native-fb and test-renderer forks too.

  3. 03

    Compare channels

    It runs /flags --diff between channels to see the values.

  4. 04

    Check gates

    It checks that @gate is used only when a feature is fully missing, and inline gate() otherwise.

  5. 05

    Test both variants

    For __VARIANT__ flags it runs /test www and /test www variant false.

  6. 06

    Log the result

    It writes missing forks and failing variants to the log and notifies you.

What it may do.
Nothing more.

Safe by defaultIt writes only in its own folder and asks you before anything goes out.

Is it for you?
Use it when it fits.

Quick checkRead both lists. If the left one sounds like you, the React feature flags skill helps.

Use it when

  • ✓ A feature flag test fails
  • ✓ You add a new React flag
  • ✓ A test fails on one channel only

Skip it when

  • – You use flags in your own app
  • – Your change touches no flags

Questions

React feature flags skill, answered.

Why test www twice?

Flags set to __VARIANT__ act like gatekeepers, so both the true and the false value need a run.

When is @gate wrong?

When both code paths should run. Then the test needs an inline gate() check.

How do I install the React feature flags skill?

Copy the prompt at the top into your agent. It installs the skill from react/react and sets up the habit. Or run npx skills add react/react --skill feature-flags.

Is the React feature flags skill free?

Yes. It is published under MIT. Habit is free too.

React feature flags. Now as a habit.

Install the React feature flags skill and make it a habit: follow https://gethabit.dev/skills/react/feature-flags.md

  • Free
  • No account
  • Undo in one line

All react skills →More code skills →

Works in

  • Claude Code
  • Codex
  • Cursor
  • ChatGPT
  • Claude app

Made by react, published under MIT. Habit links to the original and never changes it. Is this your skill?

Copying didn't work here. Select the line and copy it by hand.