KS
Killer-Skills

feature-flags — Categories.official

v1.0.0
GitHub

About this Skill

Perfect for React Development Agents needing to manage and debug feature flags across different channels and environments. Use when feature flag tests fail, flags need updating, understanding @gate pragmas, debugging channel-specific test failures, or adding new flags to React.

# Core Topics

facebook facebook
[243.6k]
[50650]
Updated: 3/5/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 declarative, frontend, javascript.

Ideal Agent Persona

Perfect for React Development Agents needing to manage and debug feature flags across different channels and environments.

Core Value

Empowers agents to efficiently update and manage feature flags using @gate pragmas, understand channel-specific test failures, and add new flags to React applications, leveraging files like ReactFeatureFlags.js and ReactFeatureFlags.www.js.

Capabilities Granted for feature-flags MCP Server

Debugging channel-specific test failures in React applications
Updating and managing feature flags across different environments
Adding new flags to React applications using @gate pragmas
Understanding and overriding __EXPERIMENTAL__ and __VARIANT__ flags

! Prerequisites & Limits

  • Requires knowledge of React and its ecosystem
  • Limited to React applications
  • Needs access to specific files like ReactFeatureFlags.js and its variants
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

Use when you need to check feature flag states, compare channels, or debug why a feature behaves differently across release channels.

243.6k
0
Design

extract-errors

Logo of facebook
facebook

Use when adding new error messages to React, or seeing unknown error code warnings.

243.6k
0
Design

fix

Logo of facebook
facebook

Use when you have lint errors, formatting issues, or before committing code to ensure it passes CI.

243.6k
0
Design

flow

Logo of facebook
facebook

Use when you need to run Flow type checking, or when seeing Flow type errors in React code.

243.6k
0
Design