Control LaunchDarkly feature flag targeting including toggling flags on/off, percentage rollouts, targeting rules, individual targets, and copying flag configurations between environments. Use when the user wants to change who sees a flag, roll out to a percentage, add targeting rules, or promote config between environments.
72
88%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Passed
No known issues
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.
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 changestoggle-flag: turn targeting on or off for a flag in an environmentupdate-rollout: change the default rule (fallthrough) variation or percentage rolloutupdate-targeting-rules: add, remove, or modify custom targeting rulesupdate-individual-targets: add or remove specific users/contexts from individual targetingOptional MCP tools:
copy-flag-config: copy targeting configuration from one environment to anothercreate-approval-request: create an approval request when direct changes are blockedlist-approval-requests: check on pending approval requests for a flagapply-approval-request: apply an already-approved approval requestBefore making any targeting changes, understand how LaunchDarkly evaluates flags. This determines what your changes actually do:
offVariation to everyone. Nothing else matters.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.
Before changing anything, check what's already configured.
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?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 wants | Tool | Notes |
|---|---|---|
| "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 clause | Rules 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 |
Before applying changes, especially in production, run through the Safety Checklist. The key checks:
requiresApproval: true:
approvalUrl if provided.create-approval-request with the same instructions (returned in the instructions field of the response).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.
After applying changes, confirm the result:
get-flag again to verify the new state.true to 25% of users and false to 75%."When any mutation tool returns requiresApproval: true, the direct change was blocked because the environment requires approvals. Follow the Approval Workflows reference to:
create-approval-request using the instructions from the blocked responselist-approval-requests if requestedapply-approval-request once a reviewer has approved it (reviewStatus is "approved")get-flag after applyingupdate-rollout uses human-friendly percentages. Pass 80 for 80%, not 80000. The tool handles the internal weight conversion.24e9c7e
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.