NEW Browse AI tools across categories — updated daily. See what's new →

Launchdarkly Flag Targeting

Control LaunchDarkly feature flag targeting including toggling flags on/off, percentage rollouts, targeting rules, individual targets, and copying flag…

Version1.0.0
LicenseMIT
Token count~2,425
UpdatedJun 5, 2026

Install

Quick install

via npx skills · works with 57+ agents
npx skills add https://github.com/launchdarkly/ai-tooling/tree/HEAD/skills/feature-flags
Or pick agent:
npx skills add launchdarkly/ai-tooling --skill launchdarkly-flag-targeting --agent claude-code
npx skills add launchdarkly/ai-tooling --skill launchdarkly-flag-targeting --agent cursor
npx skills add launchdarkly/ai-tooling --skill launchdarkly-flag-targeting --agent codex
npx skills add launchdarkly/ai-tooling --skill launchdarkly-flag-targeting --agent opencode
npx skills add launchdarkly/ai-tooling --skill launchdarkly-flag-targeting --agent github-copilot
npx skills add launchdarkly/ai-tooling --skill launchdarkly-flag-targeting --agent windsurf
More install options

Shorthand — useful for multi-skill repos:

npx skills add launchdarkly/ai-tooling --skill launchdarkly-flag-targeting

Manual — clone the repo and drop the folder into your agent's skills directory:

git clone https://github.com/launchdarkly/ai-tooling.git
cp -r ai-tooling/skills/feature-flags ~/.claude/skills/
How to use: Once installed, ask your agent to "use the launchdarkly-flag-targeting skill" or describe what you want (e.g. "Control LaunchDarkly feature flag targeting including toggling flags on/off, per"). Requires Node.js 18+.

launchdarkly-flag-targeting

Control LaunchDarkly feature flag targeting including toggling flags on/off, percentage rollouts, targeting rules, individual targets, and copying flag…

launchdarkly-flag-targetingby launchdarkly

Control LaunchDarkly feature flag targeting including toggling flags on/off, percentage rollouts, targeting rules, individual targets, and copying flag…

npx skills add https://github.com/launchdarkly/ai-tooling --skill launchdarkly-flag-targetingDownload ZIPGitHub

LaunchDarkly Flag Targeting & Rollout

You're using a skill that will guide you through changing who sees what for a feature flag. Your job is to understand the current state of the flag, figure out the right targeting approach for what the user wants, make the changes safely, and verify the resulting state.

Prerequisites

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

Required MCP tools:

  • get-flag: understand current state before making changes
  • toggle-flag: turn targeting on or off for a flag in an environment
  • update-rollout: change the default rule (fallthrough) variation or percentage rollout
  • update-targeting-rules: add, remove, or modify custom targeting rules
  • update-individual-targets: add or remove specific users/contexts from individual targeting

Optional MCP tools:

  • copy-flag-config: copy targeting configuration from one environment to another
  • create-approval-request: create an approval request when direct changes are blocked
  • list-approval-requests: check on pending approval requests for a flag
  • apply-approval-request: apply an already-approved approval request

Core Concept: Evaluation Order

Before making any targeting changes, understand how LaunchDarkly evaluates flags. This determines what your changes actually do:

  • Flag is OFF -> Serve the offVariation to everyone. Nothing else matters.
  • Individual targets -> If the context matches a specific target list, serve that variation. Highest priority.
  • Custom rules -> Evaluate rules top-to-bottom. First matching rule wins.
  • Default rule (fallthrough) -> If nothing else matched, serve this variation or rollout.

This means: if you add a targeting rule but the flag is OFF, nobody sees the change. If you set a percentage rollout on the default rule but there's an individual target, that targeted user bypasses the rollout.

Workflow

Step 1: Understand Current State

Before changing anything, check what's already configured.

  • Confirm the environment. "Turn it on" without specifying an environment is ambiguous. Always confirm which environment the user means. Default to asking rather than assuming.
  • Fetch the flag. Use get-flag with the target environment to see:
  • on: Is targeting currently enabled?
  • fallthrough: What's the default rule? (variation or percentage rollout)
  • offVariation: What serves when the flag is off?
  • rules: Any custom targeting rules?
  • targets: Any individually targeted users/contexts?
  • prerequisites: Any flags this depends on?
  • Assess complexity. A flag with no rules and no individual targets is simple. A flag with multiple rules, targets, and prerequisites needs more care.

Step 2: Determine the Right Approach

Based on what the user wants and what you found, choose the right tool and strategy. See Targeting Patterns for the full reference.

Common scenarios:

User wantsToolNotes"Turn it on"toggle-flag with on: trueSimplest change"Turn it off"toggle-flag with on: falseServes offVariation to everyone"Roll out to X%"update-rollout with rolloutType: "percentage"Weights must sum to 100"Enable for beta users"update-targeting-rules: add a rule with clauseRules are ANDed within, ORed between"Add specific users"update-individual-targetsHighest priority, overrides all rules"Full rollout"update-rollout with rolloutType: "variation"Serve one variation to everyone"Copy from staging"copy-flag-configPromote tested config to production

Step 3: Run the Safety Checklist

Before applying changes, especially in production, run through the Safety Checklist. The key checks:

  • Right environment? Double-check you're targeting the intended environment.
  • Approval required? Some environments require approval workflows. If any mutation tool returns requiresApproval: true:
  • Inform the user that this environment requires approvals.
  • Share the approvalUrl if provided.
  • Offer to create an approval request using create-approval-request with the same instructions (returned in the instructions field of the response).
  • Do NOT attempt to bypass approval or auto-approve.
  • See Approval Workflows for the full process.
  • Prerequisite flags? If this flag has prerequisites, they must be met before targeting works as expected.
  • Rule ordering impact? If adding rules, consider where they fall in evaluation order. Rules evaluate top-to-bottom, first match wins.
  • Include a comment. Always add an audit trail comment, especially for production changes.

Step 4: Apply Changes

Use the appropriate tool for the change. Key notes:

  • toggle-flag: Specify on: true or on: false, the env, and a comment.
  • update-rollout: Use rolloutType: "percentage" with human-friendly weights (e.g., 80 for 80%) that sum to 100, or rolloutType: "variation" with a variationIndex.
  • update-targeting-rules: Instructions support addRule, removeRule, updateRuleVariationOrRollout, addClauses, removeClauses, reorderRules.
  • update-individual-targets: Instructions support addTargets, removeTargets, addContextTargets, removeContextTargets, replaceTargets.

See Targeting Patterns for detailed instruction examples.

Step 5: Verify

After applying changes, confirm the result:

  • Fetch the updated flag. Use get-flag again to verify the new state.
  • Confirm what the user expects. Describe the resulting targeting in plain language:
  • "The flag is now ON in production, serving true to 25% of users and false to 75%."
  • "Beta users now see variation A. Everyone else gets the default (variation B)."
  • Check for side effects. If there are rules or individual targets, make sure the change interacts correctly with them.

Handling Approval-Required Environments

When any mutation tool returns requiresApproval: true, the direct change was blocked because the environment requires approvals. Follow the Approval Workflows reference to:

  • Create an approval request with create-approval-request using the instructions from the blocked response
  • Inform the user about the pending approval and share the approval request details
  • Check on approval status later with list-approval-requests if requested
  • Apply the request with apply-approval-request once a reviewer has approved it (reviewStatus is "approved")
  • Verify the result with get-flag after applying

Important Context

  • update-rollout uses human-friendly percentages. Pass 80 for 80%, not 80000. The tool handles the internal weight conversion.
  • Weights must sum to 100. For percentage rollouts, the weights across all variations must total exactly 100.
  • Rule ordering matters. Rules evaluate top-to-bottom. Reordering rules can change behavior without changing any individual rule.
  • Individual targets are highest priority. They override all rules and the default. Adding someone as an individual target means rules don't apply to them.
  • "Launched" flags are still ON. A flag with status "launched" is serving a single variation to everyone. If you want to remove the flag, use the cleanup skill, not targeting changes.

References

  • Targeting Patterns: Rollout strategies, rule construction, individual targeting, and cross-environment copying
  • Safety Checklist: Pre-change verification, approval workflows, environment awareness
  • Approval Workflows: Creating, checking, and applying approval requests

More skills from launchdarkly

aiconfig-agent-graphsby launchdarklyCreate and manage agent graphs — directed graphs of AI Configs connected by edges with handoff logic. Use when building multi-agent workflows where configs…aiconfig-ai-metricsby launchdarklyInstrument an existing codebase with LaunchDarkly AI Config tracking. Walks the four-tier ladder (managed runner → provider package → custom extractor +…aiconfig-createby launchdarklyCreate and configure AI Configs in LaunchDarkly. Helps you choose between agent vs completion mode, create the config, add variations with models and prompts,…aiconfig-custom-metricsby launchdarklyCreate, track, retrieve, update, and delete custom business metrics for AI Configs. Covers full lifecycle: define metric kinds via API, emit events via SDK,…aiconfig-migrateby launchdarklyMigrate an application with hardcoded LLM prompts to a full LaunchDarkly AI Configs implementation in five stages: audit the code, wrap the call, move the…aiconfig-online-evalsby launchdarklyAttach judges to AI Config variations for automatic LLM-as-a-judge evaluation. Create custom judges, configure sampling rates, and monitor quality scores.aiconfig-projectsby launchdarklyGuide for setting up LaunchDarkly projects in your codebase. Helps you assess your stack, choose the right approach, and integrate project management that…aiconfig-snippetsby launchdarklyCreate and manage prompt snippets — reusable text blocks referenced inside AI Config variation prompts. Keeps common instructions, personas, and guardrails…

---

Source: https://github.com/launchdarkly/ai-tooling/tree/HEAD/skills/feature-flags/launchdarkly-flag-targeting
Author: launchdarkly
Discovered via: mcpservers.org

SKILL.md source

---
name: launchdarkly-flag-targeting
description: Control LaunchDarkly feature flag targeting including toggling flags on/off, percentage rollouts, targeting rules, individual targets, and copying flag…
---

# launchdarkly-flag-targeting

Control LaunchDarkly feature flag targeting including toggling flags on/off, percentage rollouts, targeting rules, individual targets, and copying flag…

# launchdarkly-flag-targetingby launchdarkly
Control LaunchDarkly feature flag targeting including toggling flags on/off, percentage rollouts, targeting rules, individual targets, and copying flag…

`npx skills add https://github.com/launchdarkly/ai-tooling --skill launchdarkly-flag-targeting`Download ZIPGitHub

## LaunchDarkly Flag Targeting & Rollout

You're using a skill that will guide you through changing who sees what for a feature flag. Your job is to understand the current state of the flag, figure out the right targeting approach for what the user wants, make the changes safely, and verify the resulting state.

## Prerequisites

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

Required MCP tools:

* `get-flag`: understand current state before making changes

* `toggle-flag`: turn targeting on or off for a flag in an environment

* `update-rollout`: change the default rule (fallthrough) variation or percentage rollout

* `update-targeting-rules`: add, remove, or modify custom targeting rules

* `update-individual-targets`: add or remove specific users/contexts from individual targeting

Optional MCP tools:

* `copy-flag-config`: copy targeting configuration from one environment to another

* `create-approval-request`: create an approval request when direct changes are blocked

* `list-approval-requests`: check on pending approval requests for a flag

* `apply-approval-request`: apply an already-approved approval request

## Core Concept: Evaluation Order

Before making any targeting changes, understand how LaunchDarkly evaluates flags. This determines what your changes actually do:

* Flag is OFF -> Serve the `offVariation` to everyone. Nothing else matters.

* Individual targets -> If the context matches a specific target list, serve that variation. Highest priority.

* Custom rules -> Evaluate rules top-to-bottom. First matching rule wins.

* Default rule (fallthrough) -> If nothing else matched, serve this variation or rollout.

This means: if you add a targeting rule but the flag is OFF, nobody sees the change. If you set a percentage rollout on the default rule but there's an individual target, that targeted user bypasses the rollout.

## Workflow

### Step 1: Understand Current State

Before changing anything, check what's already configured.

* Confirm the environment. "Turn it on" without specifying an environment is ambiguous. Always confirm which environment the user means. Default to asking rather than assuming.

* Fetch the flag. Use `get-flag` with the target environment to see:

* `on`: Is targeting currently enabled?

* `fallthrough`: What's the default rule? (variation or percentage rollout)

* `offVariation`: What serves when the flag is off?

* `rules`: Any custom targeting rules?

* `targets`: Any individually targeted users/contexts?

* `prerequisites`: Any flags this depends on?

* Assess complexity. A flag with no rules and no individual targets is simple. A flag with multiple rules, targets, and prerequisites needs more care.

### Step 2: Determine the Right Approach

Based on what the user wants and what you found, choose the right tool and strategy. See Targeting Patterns for the full reference.

Common scenarios:

User wantsToolNotes"Turn it on"`toggle-flag` with `on: true`Simplest change"Turn it off"`toggle-flag` with `on: false`Serves offVariation to everyone"Roll out to X%"`update-rollout` with `rolloutType: "percentage"`Weights must sum to 100"Enable for beta users"`update-targeting-rules`: add a rule with clauseRules are ANDed within, ORed between"Add specific users"`update-individual-targets`Highest priority, overrides all rules"Full rollout"`update-rollout` with `rolloutType: "variation"`Serve one variation to everyone"Copy from staging"`copy-flag-config`Promote tested config to production

### Step 3: Run the Safety Checklist

Before applying changes, especially in production, run through the Safety Checklist. The key checks:

* Right environment? Double-check you're targeting the intended environment.

* Approval required? Some environments require approval workflows. If any mutation tool returns `requiresApproval: true`:

* Inform the user that this environment requires approvals.

* Share the `approvalUrl` if provided.

* Offer to create an approval request using `create-approval-request` with the same instructions (returned in the `instructions` field of the response).

* Do NOT attempt to bypass approval or auto-approve.

* See Approval Workflows for the full process.

* Prerequisite flags? If this flag has prerequisites, they must be met before targeting works as expected.

* Rule ordering impact? If adding rules, consider where they fall in evaluation order. Rules evaluate top-to-bottom, first match wins.

* Include a comment. Always add an audit trail comment, especially for production changes.

### Step 4: Apply Changes

Use the appropriate tool for the change. Key notes:

* `toggle-flag`: Specify `on: true` or `on: false`, the `env`, and a `comment`.

* `update-rollout`: Use `rolloutType: "percentage"` with human-friendly weights (e.g., 80 for 80%) that sum to 100, or `rolloutType: "variation"` with a `variationIndex`.

* `update-targeting-rules`: Instructions support `addRule`, `removeRule`, `updateRuleVariationOrRollout`, `addClauses`, `removeClauses`, `reorderRules`.

* `update-individual-targets`: Instructions support `addTargets`, `removeTargets`, `addContextTargets`, `removeContextTargets`, `replaceTargets`.

See Targeting Patterns for detailed instruction examples.

### Step 5: Verify

After applying changes, confirm the result:

* Fetch the updated flag. Use `get-flag` again to verify the new state.

* Confirm what the user expects. Describe the resulting targeting in plain language:

* "The flag is now ON in production, serving `true` to 25% of users and `false` to 75%."

* "Beta users now see variation A. Everyone else gets the default (variation B)."

* Check for side effects. If there are rules or individual targets, make sure the change interacts correctly with them.

### Handling Approval-Required Environments

When any mutation tool returns `requiresApproval: true`, the direct change was blocked because the environment requires approvals. Follow the Approval Workflows reference to:

* Create an approval request with `create-approval-request` using the `instructions` from the blocked response

* Inform the user about the pending approval and share the approval request details

* Check on approval status later with `list-approval-requests` if requested

* Apply the request with `apply-approval-request` once a reviewer has approved it (reviewStatus is "approved")

* Verify the result with `get-flag` after applying

## Important Context

* `update-rollout` uses human-friendly percentages. Pass 80 for 80%, not 80000. The tool handles the internal weight conversion.

* Weights must sum to 100. For percentage rollouts, the weights across all variations must total exactly 100.

* Rule ordering matters. Rules evaluate top-to-bottom. Reordering rules can change behavior without changing any individual rule.

* Individual targets are highest priority. They override all rules and the default. Adding someone as an individual target means rules don't apply to them.

* "Launched" flags are still ON. A flag with status "launched" is serving a single variation to everyone. If you want to remove the flag, use the cleanup skill, not targeting changes.

## References

* Targeting Patterns: Rollout strategies, rule construction, individual targeting, and cross-environment copying

* Safety Checklist: Pre-change verification, approval workflows, environment awareness

* Approval Workflows: Creating, checking, and applying approval requests

## More skills from launchdarkly
aiconfig-agent-graphsby launchdarklyCreate and manage agent graphs — directed graphs of AI Configs connected by edges with handoff logic. Use when building multi-agent workflows where configs…aiconfig-ai-metricsby launchdarklyInstrument an existing codebase with LaunchDarkly AI Config tracking. Walks the four-tier ladder (managed runner → provider package → custom extractor +…aiconfig-createby launchdarklyCreate and configure AI Configs in LaunchDarkly. Helps you choose between agent vs completion mode, create the config, add variations with models and prompts,…aiconfig-custom-metricsby launchdarklyCreate, track, retrieve, update, and delete custom business metrics for AI Configs. Covers full lifecycle: define metric kinds via API, emit events via SDK,…aiconfig-migrateby launchdarklyMigrate an application with hardcoded LLM prompts to a full LaunchDarkly AI Configs implementation in five stages: audit the code, wrap the call, move the…aiconfig-online-evalsby launchdarklyAttach judges to AI Config variations for automatic LLM-as-a-judge evaluation. Create custom judges, configure sampling rates, and monitor quality scores.aiconfig-projectsby launchdarklyGuide for setting up LaunchDarkly projects in your codebase. Helps you assess your stack, choose the right approach, and integrate project management that…aiconfig-snippetsby launchdarklyCreate and manage prompt snippets — reusable text blocks referenced inside AI Config variation prompts. Keeps common instructions, personas, and guardrails…

---

**Source**: https://github.com/launchdarkly/ai-tooling/tree/HEAD/skills/feature-flags/launchdarkly-flag-targeting
**Author**: launchdarkly
**Discovered via**: mcpservers.org

Related skills 6

caveman

★ Featured

Ultra-compressed communication mode. Cuts token usage ~75% by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.

juliusbrussee 167k
Development

secure-linux-web-hosting

★ Featured

Use when setting up, hardening, or reviewing a cloud server for self-hosting, including DNS, SSH, firewalls, Nginx, static-site hosting, reverse-proxying an app, HTTPS with Let's Encrypt or ACME clients, safe HTTP-to-HTTPS redirects, or optional post-launch network tuning such as BBR.

xixu-me 155k
Development

readme-i18n

★ Featured

Use when the user wants to translate a repository README, make a repo multilingual, localize docs, add a language switcher, internationalize the README, or update localized README variants in a GitHub-style repository.

xixu-me 155k
Development

lark-shared

★ Featured

Use when first setting up lark-cli, running auth login, switching user/bot identity (--as), handling permission denied or scope errors, needing to update lark-cli, or seeing _notice in JSON output.

larksuite 155k
Development

improve-codebase-architecture

★ Featured

Find deepening opportunities in a codebase, informed by the domain language in CONTEXT.md and the decisions in docs/adr/. Use when the user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable.

mattpocock 151k
Development

paper-context-resolver

★ Featured

Optional RigorPilot helper for README-first deep learning repo reproduction. Use only when the README and repository files leave a narrow reproduction-critical gap and the task is to resolve a specific paper detail such as dataset split, preprocessing, evaluation protocol, checkpoint mapping, or runtime assumption from primary paper sources while recording conflicts. Do not use for general paper summary, repo scanning, environment setup, command execution, title-only paper lookup, or replacin...

lllllllama 127k
Development