launchdarkly-flag-discovery
launchdarkly/ai-tooling
Audit LaunchDarkly feature flags to identify stale, launched, and removal-ready candidates.
What is launchdarkly-flag-discovery?
Discover and assess the health of your LaunchDarkly feature flags to understand flag debt and cleanup opportunities. Use this skill when you need to audit flag inventory, find stale or fully-rolled-out flags, or determine which flags are safe to remove.
- Search and filter flags by state (active, inactive, launched, new) and type (temporary, permanent)
- Identify stale flags that haven't been evaluated in 30+ days or were never requested
- Check flag lifecycle status and health signals across all environments
- Assess removal readiness with safety checks for dependencies, code references, and targeting rules
- Categorize flags into actionable groups: ready to remove, likely safe, needs investigation, or leave alone
How to install launchdarkly-flag-discovery
npx skills add https://github.com/launchdarkly/ai-tooling --skill launchdarkly-flag-discovery- LaunchDarkly MCP server must be configured in your environment
- Access to a LaunchDarkly project with API credentials
How to use launchdarkly-flag-discovery
- 1.Confirm the target LaunchDarkly project key with the user
- 2.Clarify the goal: broad audit, cleanup planning, or targeted investigation
- 3.Use list-flags to explore the flag landscape, or find-stale-flags to identify cleanup candidates
- 4.For specific flags, use get-flag-health or get-flag-status-across-envs to assess health signals
- 5.Categorize findings into: ready to remove, likely safe, needs investigation, or leave alone
- 6.Present results with prioritized recommendations; link to flag-cleanup skill for code removal
Use cases
- Audit the overall state of your feature flag landscape to understand scale and health
- Find temporary flags that are candidates for cleanup to reduce flag debt
- Investigate whether a specific flag is still in use or safe to remove
- Plan a flag cleanup initiative by prioritizing removal candidates by staleness and safety
- Check if a flag behaves consistently across production, staging, and other environments
- Engineering teams managing feature flag sprawl and technical debt
- DevOps and platform engineers responsible for flag hygiene
- Product managers tracking feature rollout completion and flag lifecycle
- Development teams preparing for flag removal or refactoring
launchdarkly-flag-discovery FAQ
'Launched' means a flag is fully rolled out (targeting is on, one variation served to everyone, no recent changes). 'Inactive' means the flag exists but isn't being evaluated by SDKs. Inactive flags aren't always safe to remove—they may be referenced in code that hasn't shipped yet or used as prerequisites by other flags.
Use check-removal-readiness for a structured verdict. It checks for blockers (dependent flags, active requests, targeting rules), warnings (code references, expiring targets, permanent flag type), and returns safe/caution/blocked. Always verify the verdict before removing.
A flag created but never evaluated by any SDK—likely abandoned or not yet deployed. These are typically the safest removal candidates, but verify no code references exist before deleting.
Permanent flags are designed to be long-lived (e.g., kill switches, emergency toggles). They may be inactive on purpose. Don't automatically flag them for cleanup; assess context first. check-removal-readiness will flag permanent flags as 'caution' if removal is attempted.
Use get-flag-status-across-envs to check cross-environment consistency. This pattern suggests the flag may not be fully rolled out or is in different states across environments. Investigate before removal to ensure you understand the intent.
Full instructions (SKILL.md)
Source of truth, from launchdarkly/ai-tooling.
name: launchdarkly-flag-discovery description: "Audit your LaunchDarkly feature flags to understand the landscape, find stale or launched flags, and assess removal readiness. Use when the user asks about flag debt, stale flags, cleanup candidates, flag health, or wants to understand their flag inventory." license: Apache-2.0 compatibility: Requires the remotely hosted LaunchDarkly MCP server metadata: author: launchdarkly version: "1.0.0-experimental"
LaunchDarkly Flag Discovery
You're using a skill that will guide you through auditing and understanding the feature flag landscape in a LaunchDarkly project. Your job is to explore the project, assess the health of its flags, identify what needs attention, and provide actionable recommendations.
Prerequisites
This skill requires the remotely hosted LaunchDarkly MCP server to be configured in your environment.
Required MCP tools:
list-flags: search and browse flags with filtering by state, type, tagsget-flag: get full configuration for a single flag in a specific environmentget-flag-status-across-envs: check a flag's lifecycle status across all environments
Optional MCP tools (enhance depth):
find-stale-flags: find flags that are candidates for cleanup, sorted by stalenessget-flag-health: get combined health view for a single flag (merges status + config)check-removal-readiness: detailed safety check for a specific flag
Workflow
Step 1: Understand the Project
Before diving into flag data, establish context:
- Identify the project. Confirm the
projectKeywith the user. If they haven't specified one, ask. - Understand scope. Ask the user what they're trying to accomplish:
- Broad audit? ("What's the state of our flags?")
- Targeted investigation? ("Is this specific flag still needed?")
- Cleanup planning? ("What flags can we remove?")
Step 2: Explore the Flag Landscape
Adapt your approach to the user's goal:
For a broad audit:
- Use
list-flagsscoped to a critical environment (default toproduction). - Note the total count: this tells you the scale of the flag surface area.
- Filter by
state(active, inactive, launched, new) to segment the landscape. - Filter by
type(temporary vs permanent): temporary flags are the primary cleanup targets.
For cleanup planning:
- Use
find-stale-flags: this is the most efficient entry point. It returns a prioritized list of cleanup candidates sorted by staleness, categorized as:never_requested: created but never evaluated (possibly abandoned)inactive_30d: no SDK evaluations in the specified periodlaunched_no_changes: fully rolled out, no recent changes
- Default
inactiveDaysis 30. Increase for conservative cleanup (60, 90) or decrease for aggressive cleanup (7, 14). - Default
includeOnlyistemporary. Set toallto include permanent flags.
For a targeted investigation:
- Use
get-flag-healthfor a single-flag deep dive. It merges status data with configuration context in one call, returning lifecycle state, last-requested timestamp, targeting summary, age, and whether it's temporary. - Or use
get-flagfor the full configuration including rules, targets, and fallthrough details.
Step 3: Assess Flag Health
For flags that need deeper investigation, assess health signals. See Flag Health Signals for the full interpretation guide.
Key signals to evaluate:
| Signal | What it tells you |
|---|---|
| Lifecycle state | Where the flag is in its journey (new -> active -> launched -> inactive) |
| Last requested | When an SDK last evaluated this flag: staleness indicator |
| Targeting complexity | Number of rules and targets: removal complexity indicator |
| Cross-environment consistency | Whether the flag behaves the same everywhere |
| Flag age + temporary status | Old temporary flags are strong cleanup candidates |
Use get-flag-status-across-envs to check if a flag is consistent across environments. A flag inactive in production but active in staging tells a different story than one inactive everywhere.
Step 4: Categorize and Prioritize
Group flags into actionable categories:
- Ready to remove: Inactive everywhere, temporary, no dependencies. Direct the user to the flag cleanup skill for code removal.
- Likely safe, needs verification: Launched (fully rolled out), no rule changes recently. The user should confirm the rollout is intentionally complete.
- Needs investigation: Active in some environments but not others, or has complex targeting. Don't recommend action without more context.
- Leave alone: Active flags doing their job, or permanent flags that are intentionally long-lived.
Step 5: Assess Removal Readiness (When Applicable)
If the user wants to know whether a specific flag can be removed, use check-removal-readiness. This tool orchestrates multiple API calls in parallel and returns a structured verdict:
safe: No blockers or warnings. Proceed with cleanup.caution: Warnings exist (code references, expiring targets, permanent flag type). Present and let the user decide.blocked: Hard blockers (dependent flags, active requests, targeting rules). Must resolve first.
See Removal Readiness Checklist for the full details on interpreting each signal.
Step 6: Present Findings
Structure your response based on what the user asked for:
For audits: Lead with a summary (total flags, breakdown by state and type), then highlight what needs attention, then provide specific recommendations.
For specific flags: Lead with the verdict (healthy / needs attention / ready to remove), then support it with the signals you found.
For cleanup planning: Lead with the count of cleanup candidates, prioritize by confidence (safest removals first), and link to the cleanup workflow for execution.
Important Context
- "Launched" means fully rolled out: targeting is on, a single variation is served to everyone, and no changes have been made recently. It doesn't mean "recently deployed."
- "Inactive" doesn't always mean safe to remove. The flag might be used in code that hasn't shipped yet, or referenced as a prerequisite by another flag.
- Permanent flags can be inactive on purpose. Some flags are designed to be dormant until needed (kill switches, emergency toggles). Don't automatically flag these for cleanup.
- Weights are scaled by 1000 in the API. A weight of
60000means 60%. Always convert to human-readable percentages. - This skill is for discovery, not action. If the user wants to remove a flag from code, direct them to the flag cleanup skill. If they want to change targeting, direct them to the flag targeting skill.
References
- Flag Health Signals: How to interpret lifecycle states, staleness, and health data
- Removal Readiness Checklist: Full safety assessment before recommending flag removal
Related skills
More from launchdarkly/ai-tooling and the wider catalog.

launchdarkly-flag-targeting
Control LaunchDarkly feature flag targeting, rollouts, and rules via AI agent.

launchdarkly-guarded-rollout
Configure progressive feature rollouts with automatic monitoring and rollback in LaunchDarkly.

launchdarkly-metric-choose
Choose the right metrics for LaunchDarkly experiments, guarded rollouts, and release policies.

launchdarkly-metric-create
Create LaunchDarkly metrics to measure experiment and rollout outcomes without manual setup.

launchdarkly-metric-instrument
Add LaunchDarkly metric event tracking to your codebase with guided instrumentation.

mcp-configure
Configure LaunchDarkly's hosted MCP server for feature flag management in your coding agent.