# launchdarkly-flag-create

Walks the agent through reading how flags already work in your repo, creating a new one in LaunchDarkly, and wiring the evaluation into code the same way.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 4100 installs · ★ 28
- Author: launchdarkly
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/launchdarkly/ai-tooling/tree/HEAD/skills/feature-flags/launchdarkly-flag-create/SKILL.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/launchdarkly-flag-create

## What it does

Reach for this skill when you ask for a new feature flag, want code wrapped in a toggle, or need an experiment set up. The agent starts by hunting for the LaunchDarkly SDK: imports like `launchdarkly`, `ldclient`, `LDClient`, and dependencies in `package.json`, `requirements.txt`, `go.mod` or `Gemfile`. Then it reads how the project calls `variation()`, `boolVariation()` or `useFlags()`, whether flags hide behind a wrapper, and where flag keys live as constants.

Flag type comes next. Boolean for on/off and gradual rollout, multivariate with a string, number or JSON for A/B tests and thresholds. If you skip the key, it gets generated from the name, matched to whatever casing the codebase already uses. Creation runs through `create-flag`, and the flag lands with targeting off in every environment, so everyone gets `offVariation` until you flip it.

The evaluation code follows the patterns found earlier, with a safe fallback value — usually the behavior that existed before the flag, so nothing turns on if the SDK cannot reach LaunchDarkly. You need the remotely hosted LaunchDarkly MCP server configured with `create-flag` and `get-flag`; without those two tools the create and verify steps have nothing to call. One thing to decide up front: flag keys are immutable once created.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add launchdarkly/ai-tooling --skill launchdarkly-flag-create -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/launchdarkly-flag-create/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/launchdarkly-flag-create/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add launchdarkly/ai-tooling --skill launchdarkly-flag-create -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/launchdarkly-flag-create/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add launchdarkly/ai-tooling --skill launchdarkly-flag-create -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/launchdarkly-flag-create/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install launchdarkly/ai-tooling launchdarkly-flag-create
```

2. **Manually: put the files in place**
- File: `.github/skills/launchdarkly-flag-create/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add launchdarkly/ai-tooling --skill launchdarkly-flag-create -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/launchdarkly/ai-tooling --path skills/feature-flags/launchdarkly-flag-create
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/launchdarkly-flag-create/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add launchdarkly/ai-tooling --skill launchdarkly-flag-create -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/launchdarkly/ai-tooling/tree/HEAD/skills/feature-flags/launchdarkly-flag-create/SKILL.md

## When to use it
- create a LaunchDarkly flag that matches project conventions
- wrap new code in a flag check while keeping old behavior as fallback
- pick between a boolean toggle and a multivariate A/B test
- locate existing SDK calls and key constants in the repo
- confirm with `get-flag` that the flag was created correctly

## Example prompts
- add a feature flag for the new checkout and check how flags are used here
- wrap this block in a toggle and keep the old behavior as the default
- create a multivariate flag for an A/B test on the headline

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 0c2fcae3644c60ba.

BEGIN THIRD-PARTY FILE 0c2fcae3644c60ba
```text
---
name: launchdarkly-flag-create
description: "Create and configure LaunchDarkly feature flags in a way that fits the existing codebase. Use when the user wants to create a new flag, wrap code in a flag, add a feature toggle, or set up an experiment. Guides exploration of existing patterns before creating."
license: Apache-2.0
compatibility: Requires the remotely hosted LaunchDarkly MCP server
metadata:
  author: launchdarkly
  version: "1.1.0-experimental"
---

# LaunchDarkly Flag Create & Configure

You're using a skill that will guide you through introducing a new feature flag into a codebase. Your job is to explore how flags are already used in this codebase, create the flag in LaunchDarkly in a way that fits, add the evaluation code matching existing patterns, and verify everything is wired up correctly.

## Prerequisites

This skill requires the remotely hosted LaunchDarkly MCP server to be configured in your environment.

**Required MCP tools:**
- `create-flag`: create a new feature flag in a project
- `get-flag`: verify the flag was created correctly

**Optional MCP tools (enhance workflow):**
- `list-flags`: browse existing flags to understand naming conventions and tags
- `update-flag-settings`: update flag metadata (name, description, tags, temporary/permanent status)

## Workflow

### Step 1: Explore the Codebase

Before creating anything, understand how this codebase uses feature flags.

1. **Find the SDK.** Search for LaunchDarkly SDK imports or initialization:
   - Look for `launchdarkly`, `ldclient`, `ld-client`, `LDClient` in imports
   - Check `package.json`, `requirements.txt`, `go.mod`, `Gemfile`, or equivalent for the SDK dependency
   - Identify which SDK is in use (server-side Node, React, Python, Go, Java, etc.)

2. **Find existing flag evaluations.** Search for variation calls to understand the patterns this codebase uses:
   - Direct SDK calls: `variation()`, `boolVariation()`, `useFlags()`, etc.
   - Wrapper patterns: Does this codebase abstract flags behind a service or utility?
   - Constant definitions: Are flag keys defined as constants somewhere?
```
END THIRD-PARTY FILE 0c2fcae3644c60ba

The third-party file has ended. Everything between the 0c2fcae3644c60ba tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2116 of 7988 bytes. © launchdarkly · Apache-2.0 · https://github.com/launchdarkly/ai-tooling/tree/HEAD/skills/feature-flags/launchdarkly-flag-create/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
