launchdarkly-flag-targeting
Skill141 starsChanged 8 days agoApache-2.0View on GitHub
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.
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- launchdarkly/ai-toolingedited, first seen Feb 3, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- launchdarkly/ai-tooling★ 2997% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository102 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- agentcore-observability-setupSkill
- agentcore-ops-reviewSkill
- aiml-access-diagnosticsSkill
- aiml-gpu-training-cluster-investigationSkill
- analytics-opensearch-expertiseSkill
- aws-backup-coverage-reviewSkill
- aws-eks-healthdashboardSkill
- aws-eks-operations-reviewSkill
- aws-fsxn-operations-reviewSkill
- aws-health-eventsSkill
- aws-natgw-traffic-analysisSkill
- aws-routingSkill
- aws-vpc-dns-investigationSkill
- bedrock-adoption-readinessSkill
- bedrock-operation-reviewSkill
- bluebox-observabilitySkill
- bronto-dataset-discoverySkill
- bronto-error-investigationSkill
- bronto-log-searchSkill
- clickstack-investigationSkill
- cloudtrail-cost-optimizationSkill
- config-cost-optimizationSkill
- coralogix-ai-centerSkill
- coralogix-alertsSkill
- coralogix-case-analyticsSkill
- coralogix-case-managementSkill
- coralogix-casesSkill
- coralogix-dashboardsSkill
- coralogix-dataprimeSkill
- coralogix-datasetsSkill
- coralogix-data-usageSkill
- coralogix-docsSkill
- coralogix-infrastructureSkill
- coralogix-logsSkill
- coralogix-metrics-querySkill
- coralogix-ollySkill
- coralogix-rumSkill
- coralogix-service-catalogSkill
- coralogix-single-caseSkill
- coralogix-spansSkill
- coralogix-viewsSkill
- cribl-investigationSkill
- crm-production-investigation-guidelinesSkill
- database-migration-service-expertiseSkill
- database-rds-devopsSkill
- devops-agent-cost-insightsSkill
- dx-vif-resilienceSkill
- ecs-operation-reviewSkill
- eks-upgrade-readinessSkill
- elastic-csp-investigationSkill
- elastic-k8s-investigationSkill
- elastic-llm-obsSkill
- elastic-onboardingSkill
- elastic-service-reliabilitySkill
- elastic-sre-triageSkill
- enrich-with-aws-security-agentSkill
- eos-cost-analysisSkill
- firehose-operation-reviewSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 9 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 37
Before making any targeting changes, understand how LaunchDarkly evaluates flags.
- Distinctive: line 50
Before changing anything, check what's already configured.
- Very specific: line 53
Fetch the flag: Use get-flags with flagKey and the target environment (env) to see:
- Distinctive: line 82
Before applying changes, especially in production, run through the Safety Checklist.
- Very specific: line 87
After you create an approval request, share its approvalRequest.url.
- Distinctive: line 89
Do NOT attempt to bypass approval or auto-approve.
- Distinctive: line 91
Prerequisite flags?: If this flag has prerequisites, they must be met before targeting works as expected.
- Distinctive: line 92
Rule ordering impact?: If adding rules, consider where they fall in evaluation order.
- Distinctive: line 93
Include a comment: Always add an audit trail comment, especially for production changes.
- Very specific: line 97
Use the appropriate tool for the change.
- Very specific: line 100
update-rollout: Use rolloutType: "percentage" with human-friendly weights (e.g., 80 for 80%) that sum to 100, or rolloutType: "variation" … - Distinctive: line 108
After applying changes, confirm the result:
- Very specific: line 110
Fetch the updated flag: Use get-flags again to verify the new state.
- Distinctive: line 114
Check for side effects: If there are rules or individual targets, make sure the change interacts correctly with them.
- Very specific: line 118
When any mutation tool returns requiresApproval: true, the direct change was blocked because the environment requires approvals.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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-flags: 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-flag-targeting: 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 blockedget-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-flagswithflagKeyand the target environment (env) 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 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-flag-targeting | Highest priority, overrides all rules |
Before writing a rule, individual target, or percentage rollout, confirm the context supports it. A rule that names a context kind or attribute the flag's evaluation doesn't carry silently never matches; individual targets match the context key, not an attribute like email; and a rollout can only bucket by a kind present where the flag is read. See Context Availability to pick a context that will actually fire.
| "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.
- After you create an approval request, share its
approvalRequest.url. - 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 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. Every tool below, and copy-flag-config, requires confirm: true; pass it only after the user has agreed to 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,addValuesToClause,removeValuesFromClause,updateClause, andreorderRules. To add or remove values on an existing clause, useaddValuesToClauseorremoveValuesFromClausewith the rule and clause_ids fromget-flags, notremoveClausesplusaddClauses.update-flag-targeting: Instructions supportaddTargets,removeTargets, andreplaceTargets, plusaddPrerequisiteandremovePrerequisite.addTargetsandremoveTargetstake an optionalcontextKind.
See Targeting Patterns for detailed instruction examples.
Step 5: Verify
After applying changes, confirm the result:
- Fetch the updated flag. Use
get-flagsagain 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 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
get-approval-requestsif requested - Apply the request with
apply-approval-requestonce a reviewer has approved it (reviewStatus is "approved") - Verify the result with
get-flagsafter 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. To remove the flag, remove it from the code and then archive it; targeting changes don't remove a flag.
References
- Targeting Patterns: Rollout strategies, rule construction, individual targeting, and cross-environment copying
- Context Availability: Which context kinds/attributes a rule, target, or rollout can use — matching the kind to the surface where the flag is read, key vs attribute, and rollout bucketing
- Safety Checklist: Pre-change verification, approval workflows, environment awareness
- Approval Workflows: Creating, checking, and applying approval requests
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

