Feature Flags Agent Skill
LaunchDarkly/Flagsmith/Vercel patterns, gradual rollouts, percentage splits, A/B toggles.
The Skill
Full content, every format. Copy it, download it, or install with one command.
---
description: LaunchDarkly/Flagsmith/Vercel patterns, gradual rollouts, percentage splits, A/B toggles.
homepage: https://yepapi.com/skills/feature-flags
metadata:
tags: [feature-flags, rollouts, ab-testing, toggles]
---
# Feature Flags
## Rules
- Use feature flags for gradual rollouts — ship code behind flags, enable incrementally
- Flag types: boolean (on/off), percentage (10% of users), user-targeting (specific IDs/segments)
- LaunchDarkly for enterprise, Flagsmith for open-source, Vercel Flags or `@vercel/flags` for Next.js
- Evaluate flags server-side by default — only pass flag values to client, never the evaluation logic
- Flag naming convention: `enable-new-checkout`, `show-pricing-v2` — descriptive, kebab-case
- Clean up flags after full rollout — stale flags are tech debt; set expiration dates
- Percentage rollouts: hash user ID for consistent bucketing — same user always sees same variant
- Default to flag-off for new features — fail safe if flag service is unavailable
- Use flags for A/B testing: define variants, track conversion events, measure statistical significance
- Store flag overrides in environment variables for local development
## Patterns
```ts
// Vercel Flags / Next.js pattern
import { flag } from "@vercel/flags/next";
export const showNewCheckout = flag({
key: "show-new-checkout",
decide: () => false, // default off
});
// In server component
const enabled = await showNewCheckout();
```
```ts
// LaunchDarkly pattern
import * as ld from "@launchdarkly/node-server-sdk";
const client = ld.init(process.env.LAUNCHDARKLY_SDK_KEY!);
const showFeature = await client.variation("new-checkout", user, false);
```
## Avoid
- Shipping features without a flag — every new feature should be toggleable
- Nested flag dependencies — keep flag logic flat and independent
- Leaving flags in code after 100% rollout — schedule cleanup within 2 weeks
- Client-side flag evaluation exposing targeting rules — evaluate on server, send resultInstall
Why Use the Feature Flags Skill?
Without this skill, your AI guesses at feature flags patterns. It might hallucinate deprecated APIs, use outdated conventions, or miss best practices entirely. With it, your AI follows a proven ruleset — every suggestion aligns with current standards.
Drop this skill into your project and your AI instantly knows the rules. Better code suggestions, fewer errors, faster shipping.
Try These Prompts
These prompts work better with the Feature Flags skill installed. Your AI knows the context and writes code that fits.
"Implement feature flags with percentage-based rollouts and user targeting rules"
"Create a feature flag dashboard with toggle controls and rollout history"
"Set up LaunchDarkly-style flags with gradual rollouts and A/B test integration"
Works Great With
Feature Flags skill — FAQ
It provides LaunchDarkly, Flagsmith, and Vercel patterns for gradual rollouts, percentage splits, and A/B toggles. Your AI implements feature flags that are safe to use in production.
Run `npx skills add YepAPI/skills --skill feature-flags` in your project root. This copies the skill file into your repo where your AI coding tool can read it automatically.
The skill includes a lifecycle pattern: create, activate, monitor, and remove. Set an expiry date when creating flags and use a cleanup cron job to flag stale experiments for removal.