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

flag-and-release-change — скилл для Claude Code

Скилл flag-and-release-change для Claude Code ведёт изменение в PR от решения о флаге до автоматического релиза. Работает с флагом LaunchDarkly и веткой PR.

Apache-2.0 267 установок ★ 32 обновлён 2026-11-11

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

Что делает flag-and-release-change

Скилл читает diff pull request, решает, нужен ли feature flag, создаёт флаг LaunchDarkly в состоянии OFF и добавляет защиту вокруг нового пути в коде. Затем он записывает автоматический релиз, который сработает после слияния PR по политике окружения.

Рабочий процесс разделён на план и реализацию. В плане скилл изучает изменения, выбирает ключ и тип флага, определяет окружения и показывает план релиза; ничего не меняется до явного одобрения. Для работы нужны удалённый MCP-сервер LaunchDarkly, git с доступом к репозиторию PR и доступные скиллы создания флага и релиза.

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

  • решить, нужно ли закрыть изменение feature flag
  • создать флаг LaunchDarkly в состоянии OFF
  • добавить проверку флага в код PR
  • записать автоматический релиз после слияния PR
  • связать план изменения и релиза в одном workflow

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

  • Проведи изменение в этом PR через флаг LaunchDarkly: сначала покажи план, затем жди моего одобрения.
  • Изучи diff PR, создай флаг в состоянии OFF и добавь проверку вокруг нового пути после моего подтверждения.
  • Подготовь автоматический релиз для флага после слияния PR и покажи планы по окружениям.

Как установить flag-and-release-change

1Через Skills CLI (Vercel)

npx skills add launchdarkly/ai-tooling --skill flag-and-release-change -a claude-code

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

~/.claude/skills/flag-and-release-change/SKILL.md

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

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

Вопросы о flag-and-release-change

Как установить flag-and-release-change в Claude Code?

Выполните npx skills add launchdarkly/ai-tooling --skill flag-and-release-change -a claude-code, затем откройте ~/.claude/skills/flag-and-release-change/SKILL.md.

Что делает flag-and-release-change?

Скилл проводит изменение в pull request через весь процесс: оценивает необходимость флага, создаёт его, добавляет защиту в код и записывает автоматический релиз после слияния PR.

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

Нужны удалённый MCP-сервер LaunchDarkly, git с доступом на чтение и push в репозиторий PR, а также скиллы launchdarkly-flag-create и flag-release. До реализации требуется явное одобрение плана.

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

SKILL.md · Apache-2.0
---
name: flag-and-release-change
description: "Drive a pull request's change end to end: decide it's flag-worthy, create the guarding flag, wire the new code path behind it on the PR branch, and record an automated release so the change ships safely when the PR merges. A portable orchestrator that composes should-flag-change, launchdarkly-flag-create, and flag-release. Keywords: flag a PR, wrap change in a flag, dark launch, kill switch, auto-release, automated rollout, end-to-end flag workflow."
license: Apache-2.0
compatibility: Requires the remotely hosted LaunchDarkly MCP server and a git CLI with access to the PR's repository
metadata:
  author: launchdarkly
  version: "0.1.0"
---

# Flag & Release a PR Change

You're using a skill that takes a pull request whose change should ship behind a feature flag and drives it end to end: decide it needs a flag, create the guarding flag, wire the new behavior behind it on the PR's branch, and record an **automated release** so the change ships safely once the PR merges.

**The deploy is not the release.** The merge ships the control path — the flag is created OFF, so deployment always serves the pre-change behavior. The *release* is the flag operation the automated rollout performs afterward, governed by the environment's policy. Creating the flag OFF and recording the release are deliberately separate things.

This skill is a **portable PR orchestrator**. It doesn't own the flag mechanics or the release mechanics — it composes three focused skills and adds the PR workflow (read the diff, work in a clone, push to the branch) plus the plan→implement sequencing:

| Step | Owned by | This skill's role |
|------|----------|-------------------|
| Decide *whether* to flag | [`should-flag-change`](../should-flag-change/SKILL.md) (advisory, read-only) | Act on a "yes"; make the call yourself if it wasn't run |
| Create the flag + wire the code | [`launchdarkly-flag-create`](../launchdarkly-flag-create/SKILL.md) | Invoke it against the change; don't re-teach flag creation or SDK patterns |
| Record the release | [`flag-release`](../flag-release/SKILL.md) | Hand off once the flag exists and the code is pushed; don't re-teach rollout mechanics |

Don't duplicate any composed skill's mechanics here. This skill's only unique content is the **PR wrapper** (clone, three-dot diff, commit/push to the branch) and the **plan→implement** flow that stitches the three together.

> **Automation note.** An orchestrating harness (e.g. a PR pipeline) can skip this skill and invoke the three composed skills directly — `should-flag-change` → `launchdarkly-flag-create` → `flag-release` — driving the git and sequencing itself. This skill is the portable, human-in-the-loop path for a developer working a PR by hand.

You work in two phases — **plan**, then **implement** — and you check in with the user in between. **Never create or modify anything during the plan phase.**

## Prerequisites

- The remotely hosted LaunchDarkly MCP server.
- A `git` CLI that can read and push to the PR's repository.
- The composed skills available: [`launchdarkly-flag-create`](../launchdarkly-flag-create/SKILL.md) (flag creation + code wiring) and [`flag-release`](../flag-release/SKILL.md) (recording the rollout). [`should-flag-change`](../should-flag-change/SKILL.md) is used if the flag decision hasn't been made.

MCP tools are used *via the composed skills* — `create-flag`/`get-flags` through flag-create, `match-release-policies`/`create-automated-rollout-config` through flag-release. This skill calls none directly.

## Working With the Pull Request

Work from a clone so you can read the change and push the flag wiring back to its branch. Use the git access the user already set up for this repository. Never ask for, print, or store tokens, and do not search environment variables, `.env` files, or credential files for them.

```bash
git clone https://github.com/<owner>/<repo>.git && cd <repo>
git fetch origin pull/<pr_number>/head
git diff origin/HEAD...<head_sha>       # three-dot: change relative to the PR's base
```

The three-dot diff (`base...head`) shows exactly what the PR introduces. Read the changed files you need to understand the change and its risk. Stay in this clone through both phases — in implement you edit, commit, and push here. Full PR mechanics (clone, three-dot diff, commit/push to the branch): [references/pr-wiring.md](references/pr-wiring.md).

## Plan Phase

**Create nothing in this phase.**

1. **Confirm it should be flagged.** If [`should-flag-change`](../should-flag-change/SKILL.md) already ran, act on its verdict. Otherwise apply the same judgment: favor a flag for user-facing or risky changes; skip config-only, dependency-bump, infra, test-only, or docs changes. If a flag clearly isn't warranted, say so and stop.
2. **Understand the change and conventions.** Read the three-dot diff and changed files — what does it do, what's the blast radius? Then follow **flag-create's Step 1** to learn how this codebase already uses flags (SDK, wrapper, key constants, naming). Don't reinvent that exploration here.
3. **Design the flag.** Usually a single boolean kill-switch around the new path (flag-create's [flag-types](../launchdarkly-flag-create/references/flag-types.md) covers the choice). Don't propose more flags than the change needs. If Step 1 (or `should-flag-change`) surfaced a **dependency on a parent flag/feature that isn't live yet**, note it — the release step can couple them with a prerequisite.
4. **Plan the release.** Follow [`flag-release`](../flag-release/SKILL.md)'s plan phase: pick target environments, preview each with `match-release-policies`, and capture the human's **release intent** (release on merge / hold / `notBefore` / segment / prerequisite). Don't re-derive the rollout model here — that's flag-release's job.
5. **Present the combined plan and stop.** Summarize: the flag (`key`, `name`, boolean, tags) and why it gates *this* change; where in the code the guard goes; the per-environment release plan + captured intent (and anything to be *held*). Then wait. Revise on feedback; proceed only on clear approval. Ask a focused question if you're genuinely missing something (project key, environments, a missing policy) rather than guessing.

## Implement Phase

Only after approval:

1. **Create the flag and wire the code** using [`launchdarkly-flag-create`](../launchdarkly-flag-create/SKILL.md) (its Steps 3–4): flag created OFF with the agreed key/tags, guarding evaluation added with a safe default matching the codebase's pattern. **Fail closed on creation errors:** only an "already exists" result is success-via-reuse. Any *other* create-flag failure (auth, permissions, not-found, server error) is a hard stop — do **not** wire the code, record the release, or report success. A false "flag created" yields a green PR referencing a flag that doesn't exist, worse than an honest failure. Surface the error and stop.
2. **Add paired flag-on / flag-off tests.** If the repo has a test suite, add a test for each state of the wrapped path — flag ON serves the new behavior, flag OFF preserves the old — matching the repo's framework and flag-mocking convention. Run them and continue only once green. Scope the tests to the flagged path, not general coverage. If the repo has no tests, skip and say so.
3. **Commit and push to the PR branch.** Commit the wiring and push to the PR's existing branch so it lands in the same PR — don't open a new PR or touch the base branch. See [references/pr-wiring.md](references/pr-wiring.md).
4. **Record the release** by handing off to [`flag-release`](../flag-release/SKILL.md)'s implement phase: it records the automated rollout, honoring the captured intent (holding any environment the intent doesn't clear) and returns a `config_id`. Don't re-teach the rollout mechanics here.
5. **Report** the whole change: flag key + LaunchDarkly link (created OFF); the file(s)/code path wired; the tests added; the per-environment release plan + `config_id`; what was **held** (and why) versus what releases on merge. Report only what you verified.

## Edge Cases

| Situation | Action |
|-----------|--------|
| Change isn't flag-worthy | Explain why (config-only, dep bump, infra, test-only, docs) and stop. Don't create a flag. |
| Flag already exists | Reuse it — "already exists" is success. Wire the existing key; don't duplicate. |
| Flag creation fails for any other reason (auth, permissions, 5xx) | Hard stop. Don't wire code, record a release, or claim success — surface the error. |
| Codebase has no LaunchDarkly SDK | Wiring can't evaluate a flag — SDK install is separate ([onboarding/sdk-install](../../onboarding/sdk-install/SKILL.md)). |
| Guarding needs more than a boolean | Prefer a boolean kill-switch. Only go multivariate if the change serves distinct variants; see flag-create's [flag-types](../launchdarkly-flag-create/references/flag-types.md). |
| Release-specific cases (hold/`notBefore`, prerequisites, no matching policy, duplicate config, no useful metric) | Handled by [`flag-release`](../flag-release/SKILL.md) — see its edge cases. |

## What NOT to Do

- **Don't create anything in the plan phase.** Plan proposes; implement creates.
- **Don't re-document flag creation, SDK guarding, or rollout mechanics here** — those are [`launchdarkly-flag-create`](../launchdarkly-flag-create/SKILL.md) and [`flag-release`](../flag-release/SKILL.md). Link to them.
- **Don't turn the flag on yourself.** The recorded release owns that; creating the flag OFF is the point.
- **Don't over-flag.** One kill-switch beats several speculative flags.
- **Don't handle or print credentials.** Use the user's existing git access; never read tokens from the machine.

## References

- [references/pr-wiring.md](references/pr-wiring.md): PR mechanics — clone, three-dot diff, committing to the PR branch. *(This skill's only unique reference.)*
- [`should-flag-change`](../should-flag-change/SKILL.md): the flag-worthiness decision.
- [`launchdarkly-flag-create`](../launchdarkly-flag-create/SKILL.md): flag creation + per-SDK guarding patterns.
- [`flag-release`](../flag-release/SKILL.md): recording the automated rollout (and its [auto-release.md](../flag-release/references/auto-release.md) release model).

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

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

Все скиллы по теме «Настройка агента: память, контекст, субагенты» →
launchdarkly-flag-cleanup официальный github Субагент launchdarkly-flag-cleanup проверяет фиче-флаги через MCP-сервер LaunchDarkly, определяет безопасное значение по продакшену и вырезает устаревшие ветки кода с оформлением пулреквеста. CX Codex +1 171установок release tobi Агентов, который управляет релизами проекта: проверяет CHANGELOG.md, обновляет зависимости, ставит git-хуки и режет релиз по команде. Запускается по /release 1.0.5 или /release patch. CX Codex +1 2 200установок ship-change mralexivy Скилл ship-change для Claude Code ведёт изменение от issue до слитого PR. Он включается перед исправлением, новой функцией, правкой документации или рефакторингом. CX Codex +1 ★ 80звёзд репо release-skills JimLiu Автоматизирует подготовку релизов, анализ коммитов и обновление версий в проектах на Node.js, Python или Rust. Сгенерирует ченджлог и создаст GitHub Release. CX Codex +1 26 100установок auto-release-manager Dev-GOM Скилл auto-release-manager для Claude Code обновляет версии, собирает CHANGELOG и доводит релиз до тега и пуша. Автоматизирует повторяющийся релизный ритуал в каждом репозитории. CX Codex +1 3установок cmux-release manaflow-ai Скилл cmux-release автоматизирует подготовку релизов cmux: собирает журнал изменений из пулл-реквестов и обновляет версии проекта. CX Codex +1 5 000установок

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

Весь набор →
create-graph Скилл create-graph для Claude Code и Codex строит графики наблюдаемости и дашборды по логам, метрикам, трейсам и ошибкам. Запрашивает ключи, показывает предпросмотр диаграммы и добавляет её на дашборд. CX Codex +1 708установок create-fix-pr Скилл create-fix-pr для Claude Code ищет первопричину сбоя по трассировкам или логам и готовит минимальный pull request в GitHub. Закрывает точечные баги без лишнего рефакторинга. CX Codex +1 702установок alert-investigation Скилл alert-investigation для Claude Code, Codex и Cursor разбирает сработавшие алерты в мониторинге. Анализирует метрики через LaunchDarkly MCP и отделяет системный шум от реального инцидента. CX Codex +1 700установок should-flag-change Скилл should-flag-change смотрит на диф и окружающий код и говорит, стоит ли прятать изменение за фича-флагом LaunchDarkly. Только совет: сам флаги не создаёт и не переключает. CX Codex +1 278установок flag-release Скилл flag-release для Claude Code, Codex, Cursor и других агентов фиксирует автоматический роллаут существующего LaunchDarkly-флага, чтобы изменение вышло после мержа PR без ручного переключения. CX Codex +1 275установок launchdarkly-flag-drift Скилл launchdarkly-flag-drift для Claude Code выявляет расхождения между запасным значением флага в коде и правилом по умолчанию в LaunchDarkly. Помогает обновить дефолтные аргументы SDK без удаления проверок флага. CX Codex +1 259установок launchdarkly-flag-qualitative-feedback-setup Скилл launchdarkly-flag-qualitative-feedback-setup добавляет сбор отзывов о вариантах feature flag в JavaScript/TypeScript-проект. Он нужен для виджета Give Feedback и события $ld:feedback. CX Codex +1 217установок launchdarkly Помогает управлять фиче-флагами LaunchDarkly и настраивать конфигурации AgentControl прямо из сессии Claude Code. ★ 32звёзд репо

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

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