К основному содержанию
скилл CX Codex

launchdarkly-flag-create — скилл для Claude Code: фича-флаги в вашем

Проводит агента по шагам: изучить, как флаги уже используются в проекте, создать новый в LaunchDarkly и вписать проверку в код по существующим паттернам.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add launchdarkly/ai-tooling --skill launchdarkly-flag-create -a claude-code
Открыть на GitHub

Что делает launchdarkly-flag-create

Скилл включается, когда вы просите добавить фича-флаг, обернуть код в тумблер или завести эксперимент. Сначала агент ищет в репозитории SDK LaunchDarkly — по импортам launchdarkly, ldclient, LDClient и по зависимостям в package.json, requirements.txt, go.mod или Gemfile. Потом смотрит, как в проекте вызывают variation(), boolVariation(), useFlags(), есть ли обёртка над флагами и где лежат ключи-константы.

Дальше он выбирает тип флага: булев для включения и постепенного раската, мультивариантный со строкой, числом или JSON для A/B-теста и порогов. Ключ генерируется из имени, если вы его не задали, но с оглядкой на принятый в коде стиль — kebab-case, snake_case или camelCase. Флаг создаётся через create-flag с выключенным таргетингом во всех окружениях, так что до включения все получают offVariation.

Код агент дописывает теми же приёмами, что уже есть в проекте, и ставит безопасное значение по умолчанию — обычно прежнее поведение, чтобы фича не включилась, если SDK не достучится до LaunchDarkly. Для работы нужен настроенный удалённый MCP-сервер LaunchDarkly с инструментами create-flag и get-flag; без него шаги создания и проверки не выполнятся. Ключ флага неизменяем после создания, поэтому имя стоит продумать заранее.

Какие задачи решает

  • завести фича-флаг в LaunchDarkly под конвенции проекта
  • обернуть новый код в проверку флага и сохранить прежнее поведение
  • выбрать между булевым тумблером и мультивариантным A/B-тестом
  • найти в репозитории, как уже устроены вызовы SDK и константы ключей
  • проверить через get-flag, что флаг создан с нужной конфигурацией

Примеры запросов агенту

  • добавь фича-флаг для нового чекаута, посмотри, как флаги уже используются у нас
  • оберни этот блок в тумблер и оставь старое поведение по умолчанию
  • заведи мультивариантный флаг для A/B-теста заголовка

Как установить launchdarkly-flag-create

1Через Skills CLI (Vercel)

npx skills add launchdarkly/ai-tooling --skill launchdarkly-flag-create -a claude-code

2Вручную: положить файлы

~/.claude/skills/launchdarkly-flag-create/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/launchdarkly-flag-create/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о launchdarkly-flag-create

Как установить launchdarkly-flag-create в Claude?

Выполните npx skills add launchdarkly/ai-tooling --skill launchdarkly-flag-create -a claude-code. Скилл окажется в ~/.claude/skills/launchdarkly-flag-create/SKILL.md.

Что делает launchdarkly-flag-create?

Ведёт агента по пяти шагам: изучить существующие паттерны флагов в коде, выбрать тип флага, создать его в LaunchDarkly, добавить проверку в код и убедиться, что всё связано верно.

Что нужно для работы скилла?

Настроенный удалённый MCP-сервер LaunchDarkly. Обязательны инструменты create-flag и get-flag, а list-flags и update-flag-settings расширяют работу.

Исходный текст

SKILL.md · Apache-2.0
---
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?
   - See [SDK Evaluation Patterns](references/sdk-evaluation-patterns.md) for patterns by language

3. **Understand conventions.** Look at existing flags to learn:
   - **Naming convention**: Are keys `kebab-case`, `snake_case`, `camelCase`?
   - **Organization**: Are flag keys co-located with features, or centralized in a constants file?
   - **Default values**: What defaults do existing evaluations use?
   - **Context/user construction**: How does this codebase build the user/context object passed to the SDK? This determines which context kinds and attributes any future targeting can use — and it differs by surface (server vs client vs anonymous). See [Context Availability](../launchdarkly-flag-targeting/references/context-availability.md) before planning a rule, individual target, or rollout.

4. **Check LaunchDarkly project conventions.** Optionally use `list-flags` to see existing flags:
   - What tags are commonly used?
   - Are flags marked as temporary or permanent?
   - What naming patterns exist in the project?

### Step 2: Determine the Right Flag Type

Based on what the user needs, choose the appropriate flag configuration. See [Flag Types and Patterns](references/flag-types.md) for the full guide.

**Quick decision:**

| User intent | Flag kind | Variations |
|-------------|-----------|------------|
| "Toggle a feature on/off" | `boolean` | `true` / `false` |
| "Gradually roll out a feature" | `boolean` | `true` / `false` |
| "A/B test between options" | `multivariate` (string) | User-defined values |
| "Configure a numeric threshold" | `multivariate` (number) | User-defined values |
| "Serve different config objects" | `multivariate` (JSON) | User-defined values |

**Defaults to apply:**
- Set `temporary: true` unless the user explicitly says this is a permanent/long-lived flag. Most flags are release flags that should eventually be cleaned up.
- Generate a `key` from the name if not provided (e.g., "New Checkout Flow" -> `new-checkout-flow`), but match the codebase's naming convention if one exists.
- Suggest relevant tags based on the feature area, team, or context the user mentions.

### Step 3: Create the Flag in LaunchDarkly

Use `create-flag` with the configuration determined in Step 2.

After creation:
- The flag is created with **targeting OFF** in all environments.
- The flag serves the `offVariation` to everyone until targeting is turned on.
- Remind the user they'll need to use the [flag targeting skill](../launchdarkly-flag-targeting/SKILL.md) to toggle it on and optionally set up rollout rules.

### Step 4: Add Flag Evaluation to Code

Now add the code to evaluate the flag, **matching the patterns you found in Step 1**.

1. **Use the same SDK patterns** the codebase already uses. If there's a wrapper, use the wrapper. If there are constants, add the new key to the constants file.
2. **Use an appropriate default value.** The default (fallback) value in code should be the "safe" behavior: typically the existing behavior before the flag. This ensures the feature stays off if the SDK can't reach LaunchDarkly.
3. **Add the conditional logic.** Wrap the new behavior in a flag check.
4. **Handle both branches.** Make sure the code path for each variation is clear and complete.

See [SDK Evaluation Patterns](references/sdk-evaluation-patterns.md) for implementation examples by language and framework.

### Step 5: Verify

Confirm the flag is properly set up:

1. **Code compiles/passes linting.** Run the project's build or lint step.
2. **Flag exists in LaunchDarkly.** Use `get-flag` to confirm it was created with the right configuration.
3. **Both code paths work.** The flag-off path preserves existing behavior; the flag-on path enables the new feature.
4. **Default value is safe.** If LaunchDarkly is unreachable, the code falls back to the default: make sure that's the existing/safe behavior.

## Updating Flag Settings

If the user wants to change flag metadata (not targeting), use `update-flag-settings`. Supported changes:

| Change | Instruction |
|--------|-------------|
| Rename | `{kind: "updateName", value: "New Name"}` |
| Update description | `{kind: "updateDescription", value: "New description"}` |
| Add tags | `{kind: "addTags", values: ["tag1", "tag2"]}` |
| Remove tags | `{kind: "removeTags", values: ["old-tag"]}` |
| Mark as temporary | `{kind: "markTemporary"}` |
| Mark as permanent | `{kind: "markPermanent"}` |

Multiple instructions can be batched in a single call. These changes are project-wide, not environment-specific.

**Important:** Metadata updates (above) are separate from targeting changes (toggle, rollout, rules). If the user wants to change who sees what, direct them to the [flag targeting skill](../launchdarkly-flag-targeting/SKILL.md).

## Important Context

- **Flag keys are immutable.** Once created, a flag's key cannot be changed. Choose carefully.
- **Flags start OFF.** Creation never enables a flag. This is a safety feature.
- **The default value in code is your safety net.** It's what gets served when the SDK can't connect to LaunchDarkly. Always use the "safe" / existing behavior as the default.
- **Follow existing codebase conventions.** The most common mistake is introducing a flag pattern that doesn't match what the team already does. Step 1 exists to prevent this.

## References

- [Flag Types and Patterns](references/flag-types.md): Boolean vs multivariate, naming conventions, configuration best practices
- [SDK Evaluation Patterns](references/sdk-evaluation-patterns.md): How to evaluate flags in each SDK, including common wrapper patterns
- [Context Availability](../launchdarkly-flag-targeting/references/context-availability.md): Which context kinds/attributes targeting can use, matched to the surface where the flag is read (relevant once the flag will target rather than being a plain on/off switch)

© launchdarkly · Apache-2.0 · launchdarkly/ai-tooling

Похожие скиллы

Все скиллы по теме «Настройка агента: память, контекст, субагенты» →
launchdarkly-flag-cleanup официальный github Субагент проверяет фиче-флаги через MCP-сервер LaunchDarkly, определяет безопасное значение по продакшену и вырезает устаревшие ветки кода с оформлением пулреквеста. 171установок feature-flags devops-skills Скилл для ИИ-агента, который помогает внедрять фиче-флаги: постепенная раскатка, A/B-тесты, kill switch. Пригодится, когда релиз нужно отделить от деплоя. CX Codex +1 329установок testing-in-production kindlmann Скилл для тестирования прямо в продакшене: фича-флаги, канареечный деплой, прогрессивный роллаут и метрики-ограничители. Пригодится, когда релиз надо растянуть, а не выкатить на всех сразу. CX Codex +1 1 000установок cleaning-up-stale-feature-flags PostHog Находит устаревшие фича-флаги в проекте PostHog и убирает код, который их проверяет. Пригодится, когда флагов накопилось много и непонятно, какие уже можно удалить. CX Codex +1 434установок firebase-remote-config-basics Google LLC Скилл помогает управлять Remote Config в приложениях на Android и iOS через Firebase CLI. Позволяет менять флаги функций и параметры без выкатки обновлений в магазины. CX Codex +1 121 300установок shipping-and-launch addyosmani Готовит деплой в прод: чек-лист перед запуском, мониторинг, поэтапный роллаут и план отката. Пригодится, когда фича уходит к реальным пользователям. CX Codex +1 58 400установок

Из того же набора29

launchdarkly-flag-discovery Проводит аудит фиче-флагов LaunchDarkly, находит устаревшие тумблеры и проверяет безопасность их удаления. Пригодится для устранения долга по флагам в проекте. CX Codex +1 4 200установок launchdarkly-flag-cleanup Безопасно удаляет фиче-флаги LaunchDarkly из кодовой базы после завершения раскатки. Скилл проверяет готовность через MCP и оставляет только активную ветку кода. CX Codex +1 4 100установок launchdarkly-flag-targeting Скилл для управления таргетингом фича-флагов LaunchDarkly: включение, процентные раскатки, правила и отдельные пользователи. CX Codex +1 4 100установок launchdarkly-metric-instrument Добавляет вызовы track() для метрик LaunchDarkly в клиентский или серверный код и проверяет отправку событий. CX Codex +1 3 200установок launchdarkly-metric-create Проведёт от выбора типа метрики до её создания в LaunchDarkly: сначала наладит события, потом заведёт метрику и проверит результат. CX Codex +1 3 200установок launchdarkly-metric-choose Помогает выбрать метрики для эксперимента, guarded rollout или release policy в LaunchDarkly и показывает, что уже подцепится автоматически. CX Codex +1 3 200установок aiconfig-variations Устаревший скилл-редирект: сам ничего не делает, только отправляет к актуальному скиллу configs-variations. Нужен, если в ваших скриптах или промптах осталось старое имя. CX Codex +1 2 800установок aiconfig-create Устаревший скилл-переадресация для старых ссылок на aiconfig-create. Он направляет к актуальному скиллу configs-create. CX Codex +1 2 800установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой