Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
facebook avatar

Feature Flags

  • 1.1k installs
  • 247k repo stars
  • Updated July 27, 2026
  • facebook/react

feature-flags is a React core skill for @gate pragmas and feature flag test maintenance.

About

The feature-flags skill guides React core contributors and framework maintainers working with React feature flag tests and @gate pragmas. It documents flag file locations, channel-specific test expectations, and procedures for adding or updating flags when tests fail across experimental channels. Agents help diagnose gate pragma mismatches, update snapshot tests, and understand which flags apply to which release channels. The skill is scoped to the facebook/react repository flag infrastructure rather than general app feature toggles. React core feature flag test debugging and updates. @gate pragma and channel-specific test failure guidance. Flag file locations and add-new-flag procedures. Scoped to facebook/react repository flag infrastructure. Helps maintainers fix experimental channel test failures. Debug and update React feature flag tests, @gate pragmas, and channel-specific flag behavior.

  • React core feature flag test debugging and updates.
  • @gate pragma and channel-specific test failure guidance.
  • Flag file locations and add-new-flag procedures.
  • Scoped to facebook/react repository flag infrastructure.
  • Helps maintainers fix experimental channel test failures.

Feature Flags by the numbers

  • 1,060 all-time installs (skills.sh)
  • +19 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #349 of 2,277 Frontend Development skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
From the docs

What feature-flags says it does

Use when feature flag tests fail, flags need updating, understanding @gate pragmas
SKILL.md
npx skills add https://github.com/facebook/react --skill feature-flags

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1.1k
repo stars247k
Security audit3 / 3 scanners passed
Last updatedJuly 27, 2026
Repositoryfacebook/react

Why are React feature flag tests failing for this channel or @gate pragma?

Debug and update React feature flag tests, @gate pragmas, and channel-specific flag behavior.

Who is it for?

React core contributors working on feature flags in facebook/react.

Skip if: Skip for application-level feature toggles outside React core repo.

When should I use this skill?

User debugs React feature flag tests, @gate pragmas, or channel failures.

What you get

Updated flags and tests aligned with React channel-specific expectations.

  • updated flag files
  • @gate-gated test updates
  • channel override entries

By the numbers

  • Documents 4 React feature-flag file locations across release channels

Files

SKILL.mdMarkdownGitHub ↗

React Feature Flags

Flag Files

FilePurpose
packages/shared/ReactFeatureFlags.jsDefault flags (canary), __EXPERIMENTAL__ overrides
packages/shared/forks/ReactFeatureFlags.www.jswww channel, __VARIANT__ overrides
packages/shared/forks/ReactFeatureFlags.native-fb.jsReact Native, __VARIANT__ overrides
packages/shared/forks/ReactFeatureFlags.test-renderer.jsTest renderer

Gating Tests

@gate pragma (test-level)

Use when the feature is completely unavailable without the flag:

// @gate enableViewTransition
it('supports view transitions', () => {
  // This test only runs when enableViewTransition is true
  // and is SKIPPED (not failed) when false
});

gate() inline (assertion-level)

Use when the feature exists but behavior differs based on flag:

it('renders component', async () => {
  await act(() => root.render(<App />));

  if (gate(flags => flags.enableNewBehavior)) {
    expect(container.textContent).toBe('new output');
  } else {
    expect(container.textContent).toBe('legacy output');
  }
});

Adding a New Flag

1. Add to ReactFeatureFlags.js with default value 2. Add to each fork file (*.www.js, *.native-fb.js, etc.) 3. If it should vary in www/RN, set to __VARIANT__ in the fork file 4. Gate tests with @gate flagName or inline gate()

Checking Flag States

Use /flags to view states across channels. See the flags skill for full command options.

__VARIANT__ Flags (GKs)

Flags set to __VARIANT__ simulate gatekeepers - tested twice (true and false):

/test www <pattern>              # __VARIANT__ = true
/test www variant false <pattern> # __VARIANT__ = false

Debugging Channel-Specific Failures

1. Run /flags --diff <channel1> <channel2> to compare values 2. Check @gate conditions - test may be gated to specific channels 3. Run /test <channel> <pattern> to isolate the failure 4. Verify flag exists in all fork files if newly added

Common Mistakes

  • Forgetting both variants - Always test www AND www variant false for __VARIANT__ flags
  • Using @gate for behavior differences - Use inline gate() if both paths should run
  • Missing fork files - New flags must be added to ALL fork files, not just the main one
  • Wrong gate syntax - It's gate(flags => flags.name), not gate('name')

Related skills

How it compares

Use feature-flags for React monorepo channel flags and @gate tests, not for LaunchDarkly-style product feature toggles in application code.

FAQ

Which repository is this for?

The facebook/react repository feature flag system.

What is @gate?

A pragma marking tests tied to specific React feature flags and channels.

When should flags be updated?

When flag tests fail, channels change, or new flags are added to React.

Is Feature Flags safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.