All skills
launchdarkly avatar

/launchdarkly-flag-discovery

@be58859 official

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.

Use this Skill: https://skilld.dev/gh/launchdarkly/agent-skills/launchdarkly-flag-discovery

This session only. Nothing lands on disk.

referencesremoval-readiness-checklist.md

≈1.1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Removal Readiness Checklist

A systematic safety check to determine whether a feature flag can be safely removed. Run through this checklist before recommending flag removal to a user.

The Checklist

1. Cross-Environment Status

Check: Use get-flag-status-across-envs to verify the flag's state in all environments.

Pass criteria:

  • Flag is inactive or launched in ALL critical environments (production, staging, etc.)
  • No environment shows new or active state

Fail criteria:

  • Flag is active in any critical environment
  • Flag is new anywhere (still being rolled out)
  • Critical environments show different states (e.g., production ON, staging OFF)

2. Configuration Consistency

Check: Use get-flag for each critical environment and compare configurations.

Pass criteria:

  • All critical environments serve the same variation (same fallthrough.variation or same offVariation)
  • No targeting rules or individual targets exist in critical environments

Caution criteria:

  • Environments serve the same variation but through different mechanisms (one via fallthrough, another via rules)
  • Simple rules exist but all resolve to the same variation

Fail criteria:

  • Critical environments serve different variations
  • Complex targeting rules exist that serve multiple variations
  • Individual targets override the default behavior

3. Dependency Check

Check: Look for prerequisites in the flag configuration. Also check if this flag appears as a prerequisite in other flags.

Pass criteria:

  • No other flags list this flag as a prerequisite
  • This flag has no prerequisites of its own (simpler removal)

Fail criteria (hard blocker):

  • Other flags depend on this flag as a prerequisite: removing it would break their targeting logic

4. Code References

Check: If available, use check-removal-readiness which includes code reference statistics. Otherwise, use get-code-references to find repositories that reference this flag.

Pass criteria:

  • No code references found, or references only exist in the current repository (about to be cleaned up)

Caution criteria:

  • Code references exist in multiple repositories: flag removal in code needs to be coordinated

Note: Code reference scanning has limitations. It tracks static string matches and may miss dynamic flag key construction (flag-${name}) or have false positives from comments/documentation.

5. Expiring Targets

Check: Look for scheduled expiring targets on the flag.

Pass criteria:

  • No expiring targets scheduled

Caution criteria:

  • Expiring targets exist: someone actively set a future removal date. Coordinate with them.

6. Flag Type

Check: The temporary field on the flag.

Pass criteria:

  • Flag is marked as temporary: it was intended to be removed

Caution criteria:

  • Flag is marked as permanent: it may be intentionally long-lived. Confirm with the user before recommending removal.

Readiness Levels

After running the checklist, categorize the result:

Safe

All checks pass. No blockers or warnings.

  • Recommend proceeding with code removal using the flag cleanup skill
  • Suggest archival in LaunchDarkly after code changes are deployed

Caution

No hard blockers, but warnings exist.

  • Present each warning with context
  • Recommend archive (reversible) over delete (permanent)
  • Suggest addressing warnings first (e.g., remove code references, then re-check)

Blocked

Hard blockers prevent safe removal.

  • Present each blocker with specifics
  • For prerequisite dependencies: user must update dependent flags first
  • For active targeting: user should toggle off and wait for a cool-down period
  • For active status: flag is still being used: don't remove

Presenting Results

Structure the assessment as:

  1. Verdict: Lead with safe / caution / blocked
  2. Blockers (if any): Each with type and actionable detail
  3. Warnings (if any): Each with type and context
  4. Forward value: What variation should replace the flag in code (only if safe or caution)
  5. Next steps: What to do now (proceed with cleanup, address warnings, resolve blockers)

Source: SKILL.md on GitHub

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    This skill provides workflow guidance and documentation for auditing LaunchDarkly feature flags via an MCP server. It contains no executable code or malicious patterns.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    5/5 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at be58859. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated 6 months ago
compatibility
Requires the remotely hosted LaunchDarkly MCP server
metadata
{
  "author": "launchdarkly",
  "version": "1.0.0-experimental"
}
  • MCP
  • launchdarkly
  • feature-flags
  • flag-audit
  • flag-cleanup
  • flag-health
  • inventory

README badge

README badge for launchdarkly/agent-skills/launchdarkly-flag-discovery

Audits LaunchDarkly feature flags to identify stale, launched, or inactive flags and assess removal readiness. Uses the LaunchDarkly MCP server to explore flag inventory, categorize cleanup candidates, and provide removal safety verdicts based on lifecycle state, staleness, and cross-environment consistency.

Generated from the current SKILL.md.

Does this skill remove flags from code or just identify candidates?
This skill only audits and identifies cleanup candidates. For actual code removal, use the launchdarkly-flag-cleanup skill.
What MCP server does this require?
The remotely hosted LaunchDarkly MCP server. Without it, the skill cannot access flag data.
Can I audit flags across multiple environments at once?
Yes. The skill can list flags in a specific environment and use get-flag-status-across-envs to check consistency across all environments.
What counts as a stale flag?
Flags with no SDK evaluations in the specified period (default 30 days), plus flags created but never evaluated and fully rolled-out flags with no recent changes. The find-stale-flags tool categorizes these separately.
How do I know if a flag is safe to remove?
Use check-removal-readiness for a specific flag. It returns a verdict (safe, caution, or blocked) based on dependencies, code references, and targeting rules.

Generated from the current SKILL.md. These answers refresh after source changes.