feature-flags

Diagnose and manage React feature flags and gate pragmas across forks.

247k|51.2k|Updated May 24, 2013
One-click install
npx skills add https://github.com/facebook/react --skill feature-flags-facebook
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: feature-flags
Source: https://github.com/facebook/react/tree/main/.claude/skills/feature-flags
Command: npx skills add https://github.com/facebook/react --skill feature-flags-facebook

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

React feature flags and gate pragmas can complicate testing and releases. This Skill guides engineers to reason about flag states, gates, and channel-specific behaviors, enabling safer, faster debugging of failure scenarios.

Core Features & Use Cases

  • Gate tests using @gate pragmas to selectively run or skip tests based on flag state.
  • Inline gate checks to adapt behavior within tests or components at runtime.
  • Flag lifecycle guidance across forks (www, native, test-renderer) and how to coordinate updates during CI/CD.

Quick Start

Use this Skill to inspect flag files, identify gates causing failures, and update the appropriate flag in the repository to restore stable test runs.

Frequently Asked Questions about feature-flags

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug React feature flags causing test failures?

To debug React feature flag failures, inspect flag files to identify active gates and use inline gate checks to trace channel-specific behaviors. This isolates the exact flag state triggering the failure so you can update the appropriate repository flag file.

What is a React gate pragma and how does it work?

A React gate pragma is an annotation used to selectively run or skip tests based on feature flag states. It controls test execution by checking flag configurations, ensuring tests run only under intended conditions.

How do I update feature flags across www, native, and test-renderer forks?

Updating feature flags across forks requires modifying ReactFeatureFlags.js and the standardized fork files for www, native, and test-renderer. Coordinating these updates during CI/CD ensures consistent flag states across all environments.

Can I use @gate pragmas to skip tests based on flag state?

Yes, you can use @gate pragmas to selectively run or skip tests based on the current feature flag state. This controls test execution depending on whether specific gates are enabled or disabled in your React configuration.

Why do my React tests fail on specific channels but pass locally?

React tests failing on specific channels often stem from inconsistent feature flag states across forks. Debugging channel-specific failures involves inspecting gate pragmas and verifying flag updates are synchronized across www, native, and test-renderer environments.