AGENT SKILLBY LAUNCHDARKLY
Launchdarkly flag targeting
AT A GLANCE
Launchdarkly flag targeting is an agent skill for growth. You're using a skill that will guide you through changing who sees what for a feature flag. It is published by launchdarkly in the launchdarkly/agent-skills GitHub repository (18 stars) under the Apache-2.0 license. Install it with: npx skills add launchdarkly/agent-skills --skill launchdarkly-flag-targeting
- SOURCE REPOSITORY
- launchdarkly/agent-skills (opens GitHub in a new tab)
- REPO STARS
- SOURCE REPOSITORY
- LICENSE
- Apache-2.0
- CATEGORIES
- SKILL.MD SIZE
- 7.9 KB124 LINES
QUICK ANSWER
- WHAT IT IS01
- You're using a skill that will guide you through changing who sees what for a feature flag. The value is a focused slice of growth marketing judgment, useful when several similar skills cover the same ground.
- INPUTS02
- Context for growth marketing: your goals, audience, constraints, and any source material the skill asks for.
- OUTPUT03
- A ready-to-use result for growth marketing: the analysis, copy, or recommendations the agent produces.
INSTALL
One command adds this skill from its source repository.
npx skills add launchdarkly/agent-skills --skill launchdarkly-flag-targetingREAD THE SKILL.MD BELOW BEFORE YOU RUN IT. SKILLS INSTRUCT YOUR AGENT.
SKILL.MD
The full file, as published in the source repository. Copy it, download it or open it on GitHub.
ON THIS PAGE · 11
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 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 targeting
Optional 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 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
offVariationto 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-flagwith 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 (opens in a new tab) 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 |
Step 3: Run the Safety Checklist#
Before applying changes, especially in production, run through the Safety Checklist (opens in a new tab). 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
approvalUrlif provided. - Offer to create an approval request using
create-approval-requestwith the same instructions (returned in theinstructionsfield of the response). - Do NOT attempt to bypass approval or auto-approve.
- See Approval Workflows (opens in a new tab) 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: Specifyon: trueoron: false, theenv, and acomment.update-rollout: UserolloutType: "percentage"with human-friendly weights (e.g., 80 for 80%) that sum to 100, orrolloutType: "variation"with avariationIndex.update-targeting-rules: Instructions supportaddRule,removeRule,updateRuleVariationOrRollout,addClauses,removeClauses,reorderRules.update-individual-targets: Instructions supportaddTargets,removeTargets,addContextTargets,removeContextTargets,replaceTargets.
See Targeting Patterns (opens in a new tab) for detailed instruction examples.
Step 5: Verify#
After applying changes, confirm the result:
- Fetch the updated flag. Use
get-flagagain 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
trueto 25% of users andfalseto 75%." - "Beta users now see variation A. Everyone else gets the default (variation B)."
- "The flag is now ON in production, serving
- 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 (opens in a new tab) reference to:
- Create an approval request with
create-approval-requestusing theinstructionsfrom the blocked response - Inform the user about the pending approval and share the approval request details
- Check on approval status later with
list-approval-requestsif requested - Apply the request with
apply-approval-requestonce a reviewer has approved it (reviewStatus is "approved") - Verify the result with
get-flagafter applying
Important Context#
update-rolloutuses 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 (opens in a new tab), not targeting changes.
References#
- Targeting Patterns (opens in a new tab): Rollout strategies, rule construction, individual targeting, and cross-environment copying
- Safety Checklist (opens in a new tab): Pre-change verification, approval workflows, environment awareness
- Approval Workflows (opens in a new tab): Creating, checking, and applying approval requests
FAQ
07 QUESTIONS
01What is the Launchdarkly flag targeting agent skill?
You're using a skill that will guide you through changing who sees what for a feature flag. It is listed under growth in the 100xLab agent skills directory.
02How do I install Launchdarkly flag targeting in Cursor, Claude Code, or Codex?
Run npx skills add launchdarkly/agent-skills --skill launchdarkly-flag-targeting in the project where you want it, then ask your agent for the skill by name. The --skill flag installs only Launchdarkly flag targeting, not every skill in the repository.
03What does the Launchdarkly flag targeting SKILL.md cover?
The SKILL.md includes sections on Prerequisites, Core Concept: Evaluation Order, Workflow, Step 1: Understand Current State, Step 2: Determine the Right Approach and Step 3: Run the Safety Checklist. Read the full text on this page or in plain markdown at /resources/agent-skills/launchdarkly-agent-skills--launchdarkly-flag-targeting--rfm023/raw.
04Which agents can use Launchdarkly flag targeting?
Launchdarkly flag targeting installs with the cross-agent skills installer (npx skills add), which sets it up for agents such as Claude Code, Cursor and Codex. Each agent loads the SKILL.md when you ask for the skill by name.
05What license is Launchdarkly flag targeting under?
The launchdarkly/agent-skills repository declares the Apache-2.0 license. Read the license file in the repository before you copy or redistribute the skill.
06Is Launchdarkly flag targeting free to use?
Reading, copying and installing Launchdarkly flag targeting costs nothing: it is published in a public GitHub repository under the Apache-2.0 license. Reuse and redistribution follow that license.
07Where is the source of Launchdarkly flag targeting?
Launchdarkly flag targeting comes from https://github.com/launchdarkly/agent-skills, which has 18 GitHub stars. The SKILL.md is at https://github.com/launchdarkly/agent-skills/blob/HEAD/skills/feature-flags/launchdarkly-flag-targeting/SKILL.md. The author is launchdarkly.
Need an agent workflow built around your stack?
Tell us the workflow you want automated. We reply within 4 working hours (IST).
ATTRIBUTION
Launchdarkly flag targeting was written by its original authors and is published in launchdarkly/agent-skills (opens GitHub in a new tab) under the Apache-2.0 license. All rights stay with the original authors.
100xLab did not write, maintain or endorse this skill. This page lists it for discovery. Repo stars belong to the source repository, not to the skill. Review any skill before you install it.