Flags
vercel/next.js
How to add or modify Next.js experimental feature flags end-to-end.
This skill should be used when the user asks to "add a feature flag", "gate a feature", "put this behind a flag", "add a workspace flag", "feature flag this", "make this configurable per workspace"…
$ npx skills add ambient-code/platform --skill unleash-flag -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install ambient-code/platform unleash-flag --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/ambient-code/platform.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/integrations/unleash-flag .claude/skills/unleash-flag && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "unleash-flag" agent skill from https://github.com/ambient-code/platform/tree/main/skills/integrations/unleash-flag into .claude/skills/unleash-flag/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "unleash-flag", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/ambient-code/platform/tree/main/skills/integrations/unleash-flagType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add ambient-code/platform --skill unleash-flag -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install ambient-code/platform unleash-flag --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ambient-code/platform.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/integrations/unleash-flag .agents/skills/unleash-flag && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "unleash-flag" agent skill from https://github.com/ambient-code/platform/tree/main/skills/integrations/unleash-flag into .agents/skills/unleash-flag/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "unleash-flag", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ambient-code/platform --skill unleash-flag -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install ambient-code/platform unleash-flag --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ambient-code/platform.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/integrations/unleash-flag .cursor/skills/unleash-flag && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "unleash-flag" agent skill from https://github.com/ambient-code/platform/tree/main/skills/integrations/unleash-flag into .cursor/skills/unleash-flag/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "unleash-flag", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/ambient-code/platform.git --path skills/integrations/unleash-flag--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add ambient-code/platform --skill unleash-flag -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install ambient-code/platform unleash-flag --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ambient-code/platform.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/integrations/unleash-flag .gemini/skills/unleash-flag && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "unleash-flag" agent skill from https://github.com/ambient-code/platform/tree/main/skills/integrations/unleash-flag into .gemini/skills/unleash-flag/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "unleash-flag", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install ambient-code/platform unleash-flagInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add ambient-code/platform --skill unleash-flag -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/ambient-code/platform.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/integrations/unleash-flag .github/skills/unleash-flag && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "unleash-flag" agent skill from https://github.com/ambient-code/platform/tree/main/skills/integrations/unleash-flag into .github/skills/unleash-flag/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "unleash-flag", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ambient-code/platform --skill unleash-flag -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install ambient-code/platform unleash-flag --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ambient-code/platform.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/integrations/unleash-flag .opencode/skills/unleash-flag && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "unleash-flag" agent skill from https://github.com/ambient-code/platform/tree/main/skills/integrations/unleash-flag into .opencode/skills/unleash-flag/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "unleash-flag", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
unleash-flagThis skill should be used when the user asks to "add a feature flag", "gate a feature", "put this behind a flag", "add a workspace flag", "feature flag this", "make this configurable per workspace"…
Unleash Flag is an agent skill from ambient-code/platform. This skill should be used when the user asks to "add a feature flag", "gate a feature", "put this behind a flag", "add a workspace flag", "feature flag this", "make this configurable per workspace", "configure Unleash", or references "flags.json", "useWorkspaceFlag", "useFlag", "SyncFlags", or "controlled rollout" of a feature.
Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `evals/evals.json`).
The repository describes itself as: Vision/Mission https://ambient-code.ai : Virtual team management and collaboration platform. User guides: https://ambient-code.github.io/platform/. The licence is MIT.
4 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 57e8af8. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
npxFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
CYPRESS_UNLEASH_ADMIN_TOKENUNLEASH_ADMIN_TOKENFrom names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Unleash Flag loads about 2.6k tokens when it runs. Until then it costs about 86 tokens; SKILL.md has 880 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from ambient-code/platform at commit 57e8af8, republished under its MIT licence (© ambient-code). 880 words, ~2,614 tokens.
.claude/skills/unleash-flag/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.Workspace-scoped feature flags for the Ambient Code Platform — naming, gating, evaluation, and lifecycle management.
Every new flag requires these steps. Skip none.
components/manifests/base/core/flags.jsonAdd to components/manifests/base/core/flags.json:
{
"name": "category.feature-name.enabled",
"description": "Human-readable purpose of this flag",
"tags": [
{
"type": "scope",
"value": "workspace"
}
]
}All new flags must use the category.feature-name.enabled format:
category.feature-name.enabled| Segment | Rules | Examples |
|---|---|---|
category | One of the standard categories below | runner, model, integration |
feature-name | Lowercase, hyphen-separated, descriptive | gemini-cli, coderabbit |
.enabled | Required suffix for all new flags | — |
Standard categories:
| Category | When | Example |
|---|---|---|
integration | External service integrations | integration.coderabbit.enabled |
runner | Runner type availability | runner.gemini-cli.enabled |
model | Model availability (auto-generated by SyncFlags) | model.claude-sonnet-4-5.enabled |
feature | Platform capabilities | feature.scheduled-export.enabled |
Grandfathered flags (do not rename):
jira-writeldap.autocomplete.enabledscheduled-session.reuse.enabledThese predate the convention. New flags must not follow their patterns.
Rules:
The scope:workspace tag is what makes a flag appear in the workspace settings UI. Without it, the flag exists in Unleash but workspace admins cannot toggle it.
Backend SyncFlags runs at startup: reads flags.json, creates flags in Unleash (type: release, disabled by default, 0% rollout), and tags them. Flags without EnabledByDefault: true start off.
To force a re-sync, restart the backend. To clear a stuck flag, archive + purge it in Unleash admin before restarting.
Default: useWorkspaceFlag — always prefer this hook. It respects ConfigMap overrides set by workspace admins.
import { useWorkspaceFlag } from "@/services/queries/use-feature-flags-admin";
const { enabled } = useWorkspaceFlag(projectName, "category.feature.enabled");Exception: useFlag — only for the rare case where no project context is available (e.g., cluster-level admin pages like /integrations). It bypasses workspace overrides entirely and returns only the Unleash global default. Do not use it in project-scoped pages.
import { useFlag } from "@/lib/feature-flags";
const enabled = useFlag("category.feature.enabled");| Hook | Scope | Evaluation |
|---|---|---|
useWorkspaceFlag | Project-scoped pages (default) | ConfigMap override > Unleash default |
useFlag | Cluster-scoped pages only (exception) | Unleash default only |
Conditionally render a component:
const { enabled: featureEnabled } = useWorkspaceFlag(projectName, "category.feature.enabled");
// In JSX:
{featureEnabled && <FeatureComponent />}Conditionally include in an array:
const items = [
{ key: "always-visible", name: "Always" },
...(featureEnabled
? [{ key: "gated", name: "Gated Feature" }]
: []),
];Extract project name from route params (when not passed as prop):
import { useParams } from "next/navigation";
const params = useParams();
const projectName = params.name as string;For full-stack gating (not always necessary — frontend-only is often sufficient):
// Global check
if !FeatureEnabled("category.feature.enabled") {
c.JSON(http.StatusForbidden, gin.H{"error": "Feature not enabled"})
return
}
// Request-scoped (includes user/IP context for Unleash strategies)
if !FeatureEnabledForRequest(c, "category.feature.enabled") {
c.JSON(http.StatusForbidden, gin.H{"error": "Feature not enabled"})
return
}For endpoints that should be entirely hidden behind a flag, create a middleware in routes.go that checks FeatureEnabledForRequest() and returns 404 when the flag is off:
// routes.go — gate an entire route group
flagged := router.Group("/api/v1/feature")
flagged.Use(func(c *gin.Context) {
if !handlers.FeatureEnabledForRequest(c, "category.feature.enabled") {
c.AbortWithStatus(http.StatusNotFound)
return
}
c.Next()
})
{
flagged.GET("/resource", handlers.ListResource)
flagged.POST("/resource", handlers.CreateResource)
}This returns 404 (not 403) when the flag is off, so the endpoint appears not to exist. Use this for features that shouldn't even be discoverable until enabled.
When writing E2E tests for flagged features, the Unleash admin token must be set as an environment variable. Never paste or export the token inline in a shell session — this risks exposing it in shell history, logs, or terminal recordings.
Obtain the token from Unleash UI > API Access or from deployment secrets, then set it using a non-echoing prompt or a secret manager:
# Non-echoing prompt (token not stored in shell history)
read -rs CYPRESS_UNLEASH_ADMIN_TOKEN && export CYPRESS_UNLEASH_ADMIN_TOKENIn CI, inject it via a secret reference (e.g. GitHub Actions secret, Vault, or sealed secret) — never hard-code or echo the value.
Note: When logging token-related errors, use
len(token)to confirm presence without exposing the value. Never include the full token in error messages, API responses, or commit history.
Map it in e2e/cypress.config.ts:
env: { UNLEASH_ADMIN_TOKEN: process.env.CYPRESS_UNLEASH_ADMIN_TOKEN }// e2e/cypress/e2e/flagged-feature.cy.ts
describe('Flagged Feature', () => {
before(() => {
// Enable the flag via Unleash admin API
cy.request({
method: 'POST',
url: 'http://localhost:4242/api/admin/projects/default/features/category.feature.enabled/environments/development/on',
headers: { Authorization: Cypress.env('UNLEASH_ADMIN_TOKEN') },
}).its('status').should('eq', 200);
});
after(() => {
// Disable the flag after tests
cy.request({
method: 'POST',
url: 'http://localhost:4242/api/admin/projects/default/features/category.feature.enabled/environments/development/off',
headers: { Authorization: Cypress.env('UNLEASH_ADMIN_TOKEN') },
}).its('status').should('eq', 200);
});
it('renders when flag is enabled', () => {
// ... test the feature
});
});Any component that now calls useWorkspaceFlag or useFlag needs its tests updated.
Mock useWorkspaceFlag:
vi.mock("@/services/queries/use-feature-flags-admin", () => ({
useWorkspaceFlag: () => ({ enabled: true }),
}));Mock useParams (if newly added):
vi.mock("next/navigation", () => ({
useParams: () => ({ name: "test-project" }),
}));Mock useFlag:
vi.mock("@/lib/feature-flags", () => ({
useFlag: () => true,
}));Test both states: confirm the gated element renders when enabled, and is absent when disabled.
cd components/frontend && npx tsc --noEmit # Type-check
cd components/frontend && npx vitest run # Unit testsBoth must pass with zero errors.
When a flag is evaluated at runtime, the platform checks in priority order:
feature-flag-overrides in workspace namespace) — set by workspace admin via settings UIfalse (fail-closed)This means a workspace admin can override the global Unleash state in either direction.
| Phase | Action |
|---|---|
| Create | Add to flags.json, gate frontend, assign ownership |
| Rollout | Workspace admins enable per-workspace via settings UI |
| GA | Remove flag checks from code, remove from flags.json, create Jira for cleanup tracking |
| Cleanup | Archive flag in Unleash, remove stale ConfigMap overrides |
Treat flags as technical debt. When a feature is fully rolled out, remove the flag — don't leave it permanently enabled.
When a feature reaches GA, create a Jira issue (use /jira-log) to track cleanup in this order:
useWorkspaceFlag / useFlag calls from code and deployflags.json and deploy (SyncFlags stops recreating it)Exceptions for long-lived flags: kill switches for graceful degradation, and debug flags for expensive tracing.
| Mistake | Fix |
|---|---|
Using useFlag() in project-scoped page | Use useWorkspaceFlag(projectName, flagName) |
Missing scope:workspace tag | Flag won't appear in workspace settings UI |
| Forgetting to mock hook in tests | Tests crash with "Cannot read properties of null" |
| Reusing a retired flag name | Unleash conflict error on sync — archive + purge first |
| Checking flag in multiple places | Evaluate once, pass result down |
| No test for disabled state | Add test verifying gated element is hidden when flag is off |
© ambient-code, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file in skills/integrations/unleash-flag of ambient-code/platform.
Open the folder on GitHubat commit 57e8af8
Unleash Flag next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Unleash Flag this skillambient-code/platform | 131 | — | ~2.6k | Automated safety check: Pass | MIT | |
| Flagsvercel/next.js | 143k | — | ~746 | Automated safety check: Pass | MIT | |
| Feature Flagssickn33/agentic-awesome-skills | 47k | 1 repos | ~2.6k | Automated safety check: Pass | MIT | |
| Feature Flagsgetsentry/sentry | 46k | — | ~374 | Automated safety check: Pass | Custom licence | |
| Setting Feature Flags In StorybookPostHog/posthog | 40k | — | ~1.1k | Automated safety check: Pass | Custom licence | |
| Admin7 Feature FlagsTryGhost/Ghost | 55k | — | ~169 | Automated safety check: Pass | MIT |
vercel/next.js
How to add or modify Next.js experimental feature flags end-to-end.
sickn33/agentic-awesome-skills
Implement feature flags for progressive feature rollout using LaunchDarkly, Unleash, or custom solutions.
getsentry/sentry
Gate a Sentry feature behind a FlagPole feature flag. An agent skill from getsentry/sentry.
PostHog/posthog
A skill your agent uses when writing a Storybook story for a component gated on a feature flag — boolean flags or multivariate/experiment-arm variants.
TryGhost/Ghost
Add, consume, review, or remove Admin 7 milestone flags using Ghost's existing Labs conventions.
warpdotdev/warp
Removes a Warp feature flag once it is stable for everyone, deleting the definition, the Cargo entries and every conditional check.
ambient-code/platform
Run a convention alignment check across the codebase to measure adherence to documented standards.
ambient-code/platform
Perform a comprehensive code review using repository-specific standards.
ambient-code/platform
Create a Cypress-based video demo for a feature branch with cursor, click effects, and captions.
ambient-code/platform
Deploy, update manifests, and troubleshoot the ambient-ui component.
ambient-code/platform
Discover domain-specific skills and context before starting any coding or spec work.
ambient-code/platform
Required context for all frontend work. An agent skill from ambient-code/platform.
This skill should be used when the user asks to "add a feature flag", "gate a feature", "put this behind a flag", "add a workspace flag", "feature flag this", "make this configurable per workspace"…. Unleash Flag is an agent skill from ambient-code/platform.json", "useWorkspaceFlag", "useFlag", "SyncFlags", or "controlled rollout" of a feature.
Unleash Flag fits situations like: asks to add a feature flag; put this behind a flag; add a workspace flag; feature flag this.
Run `npx skills add ambient-code/platform --skill unleash-flag -a claude-code`. Or copy the skill folder (skills/integrations/unleash-flag in ambient-code/platform) into .claude/skills/unleash-flag in your project. Claude Code loads it when a task matches its description.
Run `npx skills add ambient-code/platform --skill unleash-flag -a codex`. Or copy the skill folder (skills/integrations/unleash-flag in ambient-code/platform) into .agents/skills/unleash-flag in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ambient-code/platform --skill unleash-flag -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/unleash-flag, .gemini/skills/unleash-flag, .github/skills/unleash-flag and .opencode/skills/unleash-flag in your project.
Going by SKILL.md and its folder, Unleash Flag needs the command-line tools its instructions call (npx) and credentials named CYPRESS_UNLEASH_ADMIN_TOKEN and UNLEASH_ADMIN_TOKEN. Our summary lists: Node.js; A credential in CYPRESS_UNLEASH_ADMIN_TOKEN; A credential in UNLEASH_ADMIN_TOKEN.
SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Unleash Flag is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Unleash Flag: Flags (vercel/next.js, 143k stars), Feature Flags (sickn33/agentic-awesome-skills, 47k stars), Feature Flags (getsentry/sentry, 46k stars) and Setting Feature Flags In Storybook (PostHog/posthog, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
ambient-code (a GitHub organization) maintains it in ambient-code/platform, which has 131 GitHub stars. The repository holds 18 skills in this directory. The repository was last updated on October 7, 2026.
Source: ambient-code/platform on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.