The Flags SDK (flags npm package) is a feature flags toolkit for Next.js and SvelteKit. It turns each feature flag into a callable function, works with any flag provider via adapters, and keeps pages static using the precompute pattern. Vercel Flags is the first-party provider, letting you manage flags from the Vercel dashboard or the vercel flags CLI.
Works with
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionflags-sdkExecute the skills CLI command in your project's root directory to begin installation:
Fetches flags-sdk from vercel/flags and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate flags-sdk. Access via /flags-sdk in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Create detailed user stories, acceptance criteria, and feature specs
Example
Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios
Reduce spec writing time by 50%, ensure comprehensive coverage
Research competitors, compare features, identify gaps
Example
Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities
Complete competitive research in 2 hours instead of 2 days
Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs
Example
Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale
0
total installs
0
this week
581
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
581
stars
The Flags SDK (flags npm package) is a feature flags toolkit for Next.js and SvelteKit. It turns each feature flag into a callable function, works with any flag provider via adapters, and keeps pages static using the precompute pattern. Vercel Flags is the first-party provider, letting you manage flags from the Vercel dashboard or the vercel flags CLI.
Each flag is declared as a function. No string keys at call sites:
import { flag } from 'flags/next';
export const exampleFlag = flag({
key: 'example-flag',
decide() { return false; },
});
const value = await exampleFlag();
Flags evaluate server-side to avoid layout shift, keep pages static, and maintain confidentiality. Combine routing middleware with the precompute pattern to serve static variants from CDN.
Adapters replace decide and origin on a flag declaration, connecting your flags to a provider. Vercel Flags (@flags-sdk/vercel) is the first-party adapter. Third-party adapters are available for Statsig, LaunchDarkly, PostHog, and others.
import { flag } from 'flags/next';
import { vercelAdapter } from '@flags-sdk/vercel';
export const exampleFlag = flag({
key: 'example-flag',
adapter: vercelAdapter(),
});
When a user asks you to create or add a feature flag, follow these steps in order. Do not leave CLI steps as "next steps" for the user — execute them yourself.
Check the project state to adapt commands and decide which steps you can skip:
pnpm-lock.yaml, package-lock.json, yarn.lock, bun.lockb)? → Adapt all package manager commands accordingly (pnpm add, npm install, yarn add, bun add).flags in package.json? → Skip install (step 1).vercel/ directory exist? → Project is linked, skip vercel link in step 2.env.local contain FLAGS=? → Env vars already pulled, skip step 3flags.ts (or lib/flags.ts, src/flags.ts) exist? → Add to it rather than creating from scratch (step 4)@vercel/toolbar in package.json? → Skip toolbar setup (step 6)app/.well-known/vercel/flags/route.ts exist? → Flags Explorer already set up, skip step 7Install packages (if not already in package.json):
pnpm i flags @flags-sdk/vercel
Register the flag with Vercel: Run vercel flags add <flag-key> --kind boolean --description "<description>".
Prerequisite: The
vercel flagscommands require the Vercel CLI to be installed and authenticated. If the Vercel CLI is not installed, runpnpm i -g vercel. For authentication or linking issues, read and follow thevercel-cliskill. If it's not installed, runnpx skills add https://github.com/vercel/vercel --skill vercel-cli.
Before running vercel flags add, verify the project is linked to Vercel. Check for a .vercel directory in the project root. If it doesn't exist, run vercel link first.
Pull environment variables: Run vercel env pull to write FLAGS and FLAGS_SECRET to .env.local. Without these environment variables, vercelAdapter() will not be able to evaluate flags. This step is mandatory after creating a flag.
Declare the flag in code: Add it to flags.ts (or create the file if it doesn't exist) using vercelAdapter():
import { flag } from 'flags/next';
import { vercelAdapter } from '@flags-sdk/vercel';
export const myFlag = flag({
key: 'my-flag',
adapter: vercelAdapter(),
});
Use the flag: Call it in your page or component and conditionally render based on the result:
import { myFlag } from '../flags';
export default async function Page() {
const enabled = await myFlag();
return <div>{enabled ? 'Feature on' : 'Feature off'}</div>;
}
Set up the Vercel Toolbar (if not already present):
pnpm i @vercel/toolbarnext.config.ts with the toolbar plugin<VercelToolbar /> in the root layout
See references/nextjs.md — Toolbar Setup for the full code.Set up Flags Explorer (if not already present): Create app/.well-known/vercel/flags/route.ts — see the Flags Explorer setup section below.
Vercel Flags is Vercel's feature flags platform. You create and manage flags from the Vercel dashboard or the vercel flags CLI, then connect them to your code with the @flags-sdk/vercel adapter. When you create a flag in Vercel, the FLAGS and FLAGS_SECRET environment variables are configured automatically.
To create a flag end-to-end, follow the Agent workflow above.
For the full Vercel provider reference — user targeting, vercel flags CLI subcommands, custom adapter configuration, and Flags Explorer setup — see references/providers.md.
When using Vercel Flags, declare flags with vercelAdapter() as shown in the Agent workflow. For other providers, see references/providers.md. Below are the general flag() patterns.
import { flag } from 'flags/next'; // or 'flags/sveltekit'
export const showBanner = flag<boolean>({
key: 'show-banner',
description: 'Show promotional banner',
defaultValue: false,
options: [
{ value: false, label: 'Hide' },
{ value: true, label: 'Show' },
],
decide() { return false; },
});
Use identify to establish who the request is for. The returned entities are passed to decide:
import { dedupe, flag } from 'flags/next';
import type { ReadonlyRequestCookies } from 'flags';
interface Entities {
user?: { id: string };
}
const identify = dedupe(
({ cookies }: { cookies: ReadonlyRequestCookies }): Entities => {
const userId = cookies.get('user-id')?.value;
return { user: userId ? { id: userId } : undefined };
},
);
export const dashboardFlag = flag<boolean, Entities>({
key: 'new-dashboard',
identify,
decide({ entities }) {
if (!entities?.user) return false;
return ['user1', 'user2'].includes(entities.user.id);
},
});
Adapters connect flags to third-party providers. Each adapter replaces decide and origin:
import { flag } from 'flags/next';
import { statsigAdapter } from '@flags-sdk/statsig';
export const myGate = flag({
key: 'my_gate',
adapter: statsigAdapter.featureGate((gate) => gate.value),
identify,
});
See Make data-driven prioritization decisions faster Draft PRDs, status updates, and stakeholder presentations Example Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement Save 3-5 hours/week on communication overhead Prerequisites Time Estimate 30-60 minutes to see productivity improvements Steps Common Pitfalls ✓ Do ✗ Don't 💡 Pro Tips ✓ Use when Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work. ✗ Avoid when Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed. mattpocock/skills parcadei/continuous-claude-v3 cursor/plugins ailabs-393/ai-labs-claude-skills ailabs-393/ai-labs-claude-skills pproenca/dot-skills flags-sdk fits our agent workflows well — practical, well scoped, and easy to wire into existing repos. I recommend flags-sdk for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area. flags-sdk is among the better-maintained entries we tried; worth keeping pinned for repeat workflows. I recommend flags-sdk for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area. flags-sdk fits our agent workflows well — practical, well scoped, and easy to wire into existing repos. Keeps context tight: flags-sdk is the kind of skill you can hand to a new teammate without a long onboarding doc. We added flags-sdk from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront. Solid pick for teams standardizing on skills: flags-sdk is focused, and the summary matches what you get after install. flags-sdk has been reliable in day-to-day use. Documentation quality is above average for community skills. flags-sdk is among the better-maintained entries we tried; worth keeping pinned for repeat workflows. showing 1-10 of 32✓Stakeholder Communication
✓Implementation Guide
Best Practices
When to Use This
Learning Path
Related Skills
grill-me
704Productivitysame categorypremortem
218Productivitysame categorydeslop
164Productivitysame categorytravel-planner
145Productivitysame categorynutritional-specialist
141Productivitysame categoryframer-motion
140Productivitysame categoryReviews
4.6★★★★★32 reviewsSSoo Ndlovu★★★★★Dec 28, 2024CChaitanya Patil★★★★★Dec 24, 2024AArjun Rahman★★★★★Dec 16, 2024DDev Martinez★★★★★Nov 19, 2024PPiyush G★★★★★Nov 15, 2024AArya Bhatia★★★★★Nov 7, 2024AArjun Singh★★★★★Oct 26, 2024AAmelia Huang★★★★★Oct 10, 2024SShikha Mishra★★★★★Oct 6, 2024NNoah Shah★★★★★Sep 17, 20241 / 4Discussion
Comments — not star reviews