launchdarkly-flag-targeting
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.
Security Assessment
Detected risks:
About launchdarkly-flag-targeting
A LaunchDarkly skill for controlling feature flag targeting, including toggling flags on and off, percentage rollouts, custom targeting rules, individual targets, and copying flag configurations between environments. It applies when a user wants to change who sees a flag, roll out to a percentage, add targeting rules, or promote configuration between environments. The skill requires the remotely hosted LaunchDarkly MCP server, and its job is to understand the current flag state, pick the right targeting approach, make changes safely, and verify the resulting state.
It relies on a set of MCP tools: get-flag to inspect current state, toggle-flag to turn targeting on or off, update-rollout to change the default (fallthrough) variation or percentage rollout, update-targeting-rules to add or modify custom rules, and update-individual-targets for specific users or contexts. Optional tools cover copy-flag-config to promote configuration between environments and an approval workflow via create-approval-request, list-approval-requests, and apply-approval-request. A core concept is evaluation order: if the flag is off, the offVariation is served to everyone; otherwise individual targets take highest priority, then custom rules top-to-bottom with first match winning, then the default fallthrough rule. This means a rule added while the flag is off changes nothing, and individual targets bypass percentage rollouts.
The workflow has five steps: understand current state (confirming the environment and fetching the flag), determine the right approach using a scenario-to-tool table, run a safety checklist, apply changes, and verify. The safety checklist double-checks the environment, handles approval-required environments (when a mutation returns requiresApproval or requiresApproval: true, it informs the user, shares the approval URL, and offers to create an approval request rather than bypassing approval), accounts for prerequisite flags and rule ordering, and always adds an audit-trail comment. Important context includes that update-rollout uses human-friendly percentages (80 means 80%), weights must sum to exactly 100, rule ordering can change behavior without changing any rule, and individual targets override all rules and the default. Detailed examples live in reference files for targeting patterns, the safety checklist, and approval workflows.
FAQ
What does this skill require to operate?
It requires the remotely hosted LaunchDarkly MCP server to be configured, along with tools like get-flag, toggle-flag, update-rollout, update-targeting-rules, and update-individual-targets, plus optional tools for copying config and approval workflows.
How does LaunchDarkly evaluate a flag?
In order: if the flag is OFF, the offVariation is served to everyone; otherwise individual targets win first, then custom rules top-to-bottom (first match wins), then the default fallthrough rule. So a rule added while the flag is off changes nothing.
How are percentage rollouts specified?
update-rollout uses human-friendly percentages, so you pass 80 for 80% (not 80000), and the weights across all variations must sum to exactly 100. The tool handles the internal weight conversion.
What happens in approval-required environments?
If a mutation tool returns requiresApproval: true, the change is blocked. The skill informs the user, shares the approval URL, and offers to create an approval request with create-approval-request; it does not bypass or auto-approve, and can later list and apply approved requests.
Why do individual targets matter so much?
Individual targets are the highest priority and override all rules and the default rule. Adding someone as an individual target means custom rules and percentage rollouts no longer apply to them.
Install launchdarkly-flag-targeting
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
launchdarkly/agent-skills