Claude Marketplaces
SkillsMCP serversMarketplacesDigestTools
Submit

This week in Claude

Every Monday: Claude Code, Agent SDK, MCP, and the Anthropic platform moves worth your time.

Skills by category
Frontend DevelopmentBackend & APIsTesting & QASecurityDevOps & CI/CDGit & Pull RequestsDocumentationCode Review & QualityAI & Agent BuildingSkill Development
MCP servers by category
Sales & MarketingWeb & Browser AutomationDatabasesAI & LLM ToolsCloud & InfrastructureCommunication & MessagingDeveloper ToolsDesign & CreativeDocuments & KnowledgeSearch & Web Crawling
Marketplaces by category
AI Agents & OrchestrationLLM IntegrationDevelopment ToolsFrontend & UIBackend & APIsDatabasesTesting & Code QualityDevOps & CloudSecurity & ComplianceGit & Version Control
Claude Marketplaces

An independent directory of skills, plugins and MCP servers for Claude Code. Not affiliated with Anthropic.

Browse

  • Skills
  • MCP servers
  • Marketplaces
  • Weekly digest
  • Skill index
  • MCP index
  • Marketplace index

Site

  • About
  • Tools
  • Submit
  • Feedback
  • Privacy
  • llms.txt
  • Plugins reference

Maker

  • Snug
  • Agent Caffeine
  • knobs
  • Wax
  • Vectoys
  • mertduzgun.com
Crafted at
Skills/Frontend Development
facebook avatar

Feature Flags

facebook/reactOfficial

If you're working on React core and hit a test failure that only happens in the www channel or mysteriously skips in certain environments, this is your troubleshooting guide. It walks you through the fork file system (ReactFeatureFlags.js and its channel-specific variants), explains when to use @gate pragmas versus inline gate() checks, and covers the __VARIANT__ flag behavior that simulates gatekeeper testing. The debugging section on comparing flag states across channels is genuinely useful when you're staring at a CI failure that doesn't reproduce locally. One gotcha worth internalizing: feature flags need to exist in every fork file, not just the main one, which trips people up more than it should.

installs
1K
GitHub stars
246.5K
last updated
Jul 14, 2026
View on GitHubSave

Install

$ npx -y skills add facebook/react --skill feature-flags --agent claude-code

Installs into .claude/skills of the current project.

Files

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')
SKILL.md on GitHub

Sponsors

SnugThe clipboard manager you and your agent can use, safelyAgent CaffeineClose your lid, come back to finished workWaxBlock anything with supervision, without erasing your iPhoneOpen StepsSponsoredFree and open-source skills that make AI coding agents easier to understand, verify, and control.

Details

Repository
github.com/facebook/react
Category
Frontend Development

More from facebook/react

All 8
  • Flow987
  • Flags942
  • Fix
  • Fix2.1K
  • Extract Errors1.1K
  • Test1.1K
  • Verify1.1K

Recommended

More Frontend Development
1vercel avatarauthoring-skillsvercel/next.jsauthoring skills1Kinstalls
2vercel avatarnext-best-practicesvercel/nextjs-skillsnext best practices1Kinstalls
3vercel avatarruntime-debugvercel/next.jsruntime debug990installs
4angular avatarreference-coreangular/angularExplains the mental model and architecture of the code under `packages/core`. You MUST use this skill any time you plan to work with code in `packages/core`987installs
5facebook avatarflowfacebook/reactflow987installs
6angular avatarreference-signal-formsangular/angularExplains the mental model and architecture of the code under `packages/forms/signals`. You MUST use this skill any time you plan to work with code in `packages/970installs