/vercel:vercel-flagsfrom vercel
Guides planning, adding, changing, and cleaning up feature flags, A/B tests, and gradual rollouts with Vercel Flags. Covers integration choice (Flags SDK, @vercel/flags-core, OpenFeature), the Vercel dashboard, the vercel flags CLI, and safe flag retirement.
Ships in vercel. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Vercel Flags is Vercel's feature flags platform. Flags are created and managed in the Vercel dashboard or with the vercel flags CLI, evaluated server-side in your app, and switched per environment (Development, Preview, Production) without a redeploy.
Use this skill to decide how a feature should be flagged, to create and change flags, and to run rollouts and experiments. Write app code with the skill that matches the stack (see Choose an approach). Do not leave non-destructive CLI steps as "next steps" for the user; execute them yourself, and ask for explicit user approval before destructive operations.
.env.local (except vercel flags override, which reads FLAGS_SECRET).flags in package.json): load the flags-sdk skill right away; it creates the flag on Vercel and declares it in code.Check the project before writing code.
flags-sdk skill. On any other stack, use the provider's own SDK. Rollouts, targeting, and experiments for that provider are configured in its own dashboard, not with vercel flags; the CLI and lifecycle sections of this skill do not apply.flags + @flags-sdk/vercel). It adds Flags Explorer integration and precompute for static pages. Load the flags-sdk skill. If it is not available, suggest npx skills add vercel/flags@flags-sdk (do not auto-install).@vercel/flags-core. See Other frameworks.The dashboard and the vercel flags CLI work the same for every integration.
Decide these before creating the flag; the kind cannot be changed later.
boolean for on/off and kill switches; string, number, or json when the flag selects a variant or carries configuration (Flag types).control, new-checkout), not after the rollout step.key in flag() or the first argument of evaluate()).user.id. Define the entity and attribute under Flags → Entities first; the app must return the same names from its evaluation context (Entities).defaultValue in code.The CLI uses your Vercel account authentication. SDK keys and vercel env pull are application credentials, not CLI prerequisites.
Prerequisite: The Vercel CLI must be installed and authenticated. If it is not installed, run
pnpm i -g vercel. For authentication or linking issues, follow thevercel-cliskill if it is available. If it is not, suggestnpx skills add vercel/vercel@vercel-cli(do not auto-install it) and rely onvercel <command> --helpin the meantime.
Run vercel flags --help for the current subcommand list and vercel flags <cmd> --help before using a subcommand. references/cli.md covers what --help cannot: how CLI concepts map to the app, promotion order, static value vs targeting mode, and the checks to run before archiving or deleting.
Use --project <name-or-id> and --scope <team> to select the target without a local link. If the CLI rejects --project, upgrade it first (pnpm i -g vercel). Without these options the commands use the linked project: run vercel project inspect --non-interactive and check the reported owner and project name; a .vercel/ directory alone does not prove a link. If it reports link_required, the project is not linked. If the user named a project or team and the output differs, stop and ask instead of relinking. In an unlinked directory, prefer --project / --scope over vercel link; if the target project is unknown, ask.
Always inspect first so you know what each environment serves today, and match the CLI key to the flag the application already declares; creating a second flag is not a substitute for adopting an existing one.
vercel flags create <key> --kind boolean --description "<description>". If the key exists, adopt it instead.enable / disable for boolean flags, set <key> to serve one variant of any kind. These put the environment in static value mode.rollout <key> --by user.id ... (Roll out a feature).split <key> --by user.id ... (Run an A/B test).rules, segments, and targeting enable <key> to switch an environment from a static value back to targets and rules (CLI versions before 65 call it use-targeting <key>).inspect for the served state, versions for history, evaluations to confirm traffic reaches the new variant.datafile --environment <production|preview|development> --json shows the current datafile used by SDKs for debugging.archive. Prefer leaving retired flags archived; delete an archived flag (delete / rm) only when the user explicitly requests permanent deletion. Follow Lifecycle and safety.Destructive flag and resource operations (archive, delete/rm, variant or resource removals) and unarchive require explicit user approval before running. Never pass --confirm-name or --yes before approval; see Lifecycle and safety and vercel flags <cmd> --help for the exact flag.
vercel env pull --non-interactive writes the Development token to .env.local for local development (Getting started). Never read .env.local contents into context; if vercel env pull --non-interactive stops with env_file_exists, ask the user before passing --yes to overwrite or pulling to another file.FLAGS): for apps outside Vercel, selecting an environment explicitly, or reading flags across teams. Each key is scoped to one environment and shown once, at creation (SDK Keys). Not a recovery path for failed CLI authentication.FLAGS_SECRET: created per environment when Vercel Flags is activated for a project. It signs Flags Explorer overrides and precompute codes, and vercel flags override reads it from the environment or .env.local. Preserve existing values and never rotate them as part of routine setup; a missing local value does not mean the remote value is missing, so check the target environment with vercel env ls --environment <target> (table output only, without --json and without reading .env.local) before generating one. The flags-sdk skill documents how to generate a missing value. Do not print secrets to the terminal, logs, or chat.Flags Explorer is the Vercel Toolbar panel that lists the app's flags and lets you override them per browser through a cookie signed with FLAGS_SECRET (Flags Explorer). The app exposes its flags through a discovery endpoint; the Flags SDK generates it (flags-sdk skill). vercel flags override <key>=<value> produces the same cookie token from the terminal.
For frameworks without a Flags SDK entrypoint, use @vercel/flags-core directly (Core SDK). Create one client at module scope and call evaluate() or bulkEvaluate() inside a request handler; both initialize the client on first use. Do not add a module-scope client.initialize() call or cache its promise for handlers to await.
// src/flags.ts
import { createClient } from "@vercel/flags-core";
const client = createClient();
// Call from a request handler, not during module loading.
export async function showNewCheckout(userId: string): Promise<boolean> {
const result = await client.evaluate<boolean>("new-checkout", false, {
user: { id: userId },
});
return result.value;
}
With OIDC the token can come from request context and may not exist during module loading. Even embedded definitions need it to select the entry by the token's project_id, and local .env.local credentials can hide this timing problem. Explicit initialization is optional and must wait until authentication is available; awaiting an already-started initialization promise later does not move it into request context. Outside Vercel, pass the SDK key: createClient(process.env.FLAGS).
The third argument to evaluate() is the evaluation context; its entity and attribute names must match the ones defined under Flags → Entities so rollouts and rules can bucket on them.
vercel flags concepts map to the app (key, kind, variants, fallback, targeting attributes, timestamp conditions, authentication, overrides, embedded definitions, datafiles), and the lifecycle and safety checklist for promoting, verifying, removing, and archiving flags.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub vercel/vercel-plugin --plugin vercel-plugin41 skills in this plugin
/access-protected-vercel-deploymentAccess and test Vercel deployments protected by Vercel Authentication, SSO, or Deployment Protection. Use when curl, agent-browser, Playwright, or another automated request reaches a Vercel login or protection page; when a protected preview or production URL returns 401 or 403; when TRUSTED_SOURCES_ENVIRONMENT_MISMATCH appears; or when choosing between `vercel curl` and the `x-vercel-trusted-oidc-idp-token` header./ai-gatewayVercel AI Gateway guidance for setup, model discovery, authentication, routing, fallbacks, virtual models, evaluation models, BYOK, budgets, spend reporting, observability, compatible APIs, and coding-agent configuration. Use when adding AI Gateway to an app, migrating provider calls, choosing models or providers, centralizing model configuration, evaluating application state, debugging gateway requests, or running `vercel ai-gateway` commands./ai-sdkOther plugins' skills for the same job