feature-flags — declarative feature-flags, official, declarative, ide skills, frontend, javascript, library, Claude Code, Cursor, Windsurf

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

Agent Capability Analysis

The feature-flags skill by facebook is an open-source official AI agent skill for Claude Code and other IDE workflows, helping agents execute tasks with better context, repeatability, and domain-specific guidance. 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

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
Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

feature-flags

Install feature-flags, an AI agent skill for AI agent workflows and automation. Works with Claude Code, Cursor, and Windsurf with one-command setup.

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

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is feature-flags?

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.

How do I install feature-flags?

Run the command: npx killer-skills add facebook/react/feature-flags. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for feature-flags?

Key use cases include: 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.

Which IDEs are compatible with feature-flags?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for feature-flags?

Requires knowledge of React and its ecosystem. Limited to React applications. Needs access to specific files like ReactFeatureFlags.js and its variants.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add facebook/react/feature-flags. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use feature-flags immediately in the current project.

Related Skills

Looking for an alternative to feature-flags or another official skill for your workflow? Explore these related open-source skills.

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
Developer

extract-errors

Logo of facebook
facebook

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

243.6k
0
Developer

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
Developer

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
Developer