Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

feature-flags

Skill by primer

Explains how to create, use, test and debug feature flags in Primer React. Covers the useFeatureFlag hook, the FeatureFlags provider, DefaultFeatureFlags and Storybook integration. It is aimed at developers working on Primer React components.

  • Score 83
  • 3.9k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install feature-flags

Built from the published package, never by AI.

git clone --depth 1 https://github.com/primer/react /tmp/react && mkdir -p ~/.claude/skills && cp -r /tmp/react/.agent/skills/feature-flags ~/.claude/skills/feature-flags

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install feature-flags in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill gives an assistant guidance on feature flags in Primer React, the React package of the Primer design system. It explains where the flag code lives in packages/react/src/FeatureFlags/, how to register a flag in DefaultFeatureFlags.ts, and how to read it with the useFeatureFlag hook. It also covers the FeatureFlags provider, which tests and Storybook stories use to set flag values.

The skill describes the flag lifecycle at GitHub, from creating and testing a flag through enabling it for specific actors, staffship and general availability, to removing it. It includes naming conventions, example patterns and how to enable a flag through an environment variable in Storybook. It is written for developers who work on Primer React components.

Written from the project's SKILL.md and checked against it.

What it can do

  • useFeatureFlag hookChecks whether a named feature flag is enabled inside a React component.
  • FeatureFlags providerSets flag values for a component subtree, used in tests and Storybook stories.
  • DefaultFeatureFlagsLists all registered flags and their default values, set to false when added.
  • Testing guidanceShows how to test a component with a flag both enabled and disabled.
  • Storybook integrationShows how to enable a flag in a single story or globally through an environment variable.
  • Flag lifecycleDescribes the steps from creating a flag through rollout at GitHub to removal.
  • Naming conventionsSets the primer_react_ prefix and snake_case format for flag names.

What you need

  • Access to the Primer React source repository

Try asking

  • Add a new feature flag called primer_react_my_feature to Primer React
  • Show me how to test a Primer React component with a feature flag enabled
  • Explain how to enable a feature flag in Storybook using an environment variable

Good to know

  • Flags are exported from @primer/react/experimental and not from the main entry point
  • Flags should be set back to false before merging when enabled for Dotcom CI testing
  • Once a flag is fully rolled out, it should be removed from the code and DefaultFeatureFlags.ts

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: .agent/skills/feature-flags/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Alternatives to feature-flags

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

feature-flags: common questions

How do I add a feature flag to Primer React?

Register the flag in packages/react/src/FeatureFlags/DefaultFeatureFlags.ts with a default value of false. Then read it in a component with useFeatureFlag.

How do I test a component with a feature flag?

Wrap the component in the FeatureFlags provider and pass the flag value in the flags prop. The skill recommends testing both enabled and disabled states.

Are feature flags available from the main @primer/react package?

No. The source says feature flags are exported from @primer/react/experimental and are not exported from the main entry point.

How do I install feature-flags?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is feature-flags free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is feature-flags safe to use?

It scores 83 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to feature-flags?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

feature-flags Install

Add to stack

Loading.