KS
Killer-Skills

feature-flags — how to use feature flags in React how to use feature flags in React, feature flags setup guide, debugging feature flag test failures, feature flags vs environment variables, installing feature flags in React, feature flags best practices for React developers, what is feature flags in React, feature flags alternative for React, feature flags and @gate pragmas

v1.0.0
GitHub

About this Skill

Perfect for React Development Agents needing efficient feature flag management and debugging capabilities. feature-flags is a set of techniques and tools for managing and testing feature flags in React applications, including declarative frontend development and JavaScript libraries.

Features

Manages default flags and __EXPERIMENTAL__ overrides in ReactFeatureFlags.js
Supports channel-specific flag updates, including www, React Native, and test renderer
Uses @gate pragmas for test-level gating and debugging
Enables updating of flags for different channels, including __VARIANT__ overrides
Debugs channel-specific test failures and flag-related issues
Integrates with React for seamless feature flag management

# Core Topics

facebook facebook
[243.6k]
[50653]
Updated: 3/6/2026

Quality Score

Top 5%
71
Excellent
Based on code quality & docs
Installation
SYS Universal Install (Auto-Detect)
Cursor IDE Windsurf IDE VS Code IDE
> npx killer-skills add facebook/react/feature-flags

Agent Capability Analysis

The feature-flags MCP Server by facebook is an open-source Categories.official integration for Claude and other AI agents, enabling seamless task automation and capability expansion. Optimized for how to use feature flags in React, feature flags setup guide, debugging feature flag test failures.

Ideal Agent Persona

Perfect for React Development Agents needing efficient feature flag management and debugging capabilities.

Core Value

Empowers agents to manage and debug feature flags using @gate pragmas, understanding __EXPERIMENTAL__ and __VARIANT__ overrides, and updating flags in React, leveraging files like ReactFeatureFlags.js and ReactFeatureFlags.www.js.

Capabilities Granted for feature-flags MCP Server

Debugging channel-specific test failures
Updating feature flags for canary releases
Adding new flags to React applications

! Prerequisites & Limits

  • Requires React environment
  • Specific to React feature flag management
Project
SKILL.md
2.4 KB
.cursorrules
1.2 KB
package.json
240 B
Ready
UTF-8
SKILL.md
Readonly

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:

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

gate() inline (assertion-level)

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

javascript
1it('renders component', async () => { 2 await act(() => root.render(<App />)); 3 4 if (gate(flags => flags.enableNewBehavior)) { 5 expect(container.textContent).toBe('new output'); 6 } else { 7 expect(container.textContent).toBe('legacy output'); 8 } 9});

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):

bash
1/test www <pattern> # __VARIANT__ = true 2/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

Looking for an alternative to feature-flags or building a Categories.official AI Agent? Explore these related open-source MCP Servers.

View All

flags

Logo of facebook
facebook

flags is a feature flag management system that enables developers to check flag states, compare channels, and debug feature behavior differences across release channels.

243.6k
0
Design

extract-errors

Logo of facebook
facebook

extract-errors is a skill that assists in extracting and managing error codes in React applications using yarn extract-errors command.

243.6k
0
Design

fix

Logo of facebook
facebook

fix is a technical skill that resolves lint errors, formatting issues, and ensures code quality in declarative, frontend, and UI projects

243.6k
0
Design

flow

Logo of facebook
facebook

Flow is a type checking system for JavaScript, used to validate React code and ensure consistency across applications

243.6k
0
Design