All skills
launchdarkly avatar

/launchdarkly-flag-cleanup

@be58859 official

Safely remove a feature flag from code while preserving production behavior. Use when the user wants to remove a flag from code, delete flag references, or create a PR that hardcodes the winning variation after a rollout is complete.

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

This session only. Nothing lands on disk.

README.md

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

LaunchDarkly Flag Cleanup Skill

An Agent Skill for safely automating feature flag cleanup workflows using LaunchDarkly as the source of truth.

Overview

This skill teaches agents how to:

  • Determine if a feature flag is ready for removal
  • Calculate the correct forward value to preserve production behavior
  • Safely remove flag references from code
  • Create well-documented pull requests

Installation (Local)

For now, install by placing this skill directory where your agent client loads skills.

Examples:

  • Generic: copy skills/feature-flags/launchdarkly-flag-cleanup/ into your client's skills path

Prerequisites

This skill requires the remotely hosted LaunchDarkly MCP server to be configured in your environment. The remote server provides higher-level, agent-optimized tools that orchestrate multiple API calls and return pruned, actionable responses.

Refer to your LaunchDarkly account settings for instructions on connecting to the remotely hosted MCP server.

Usage

Once installed, the skill activates automatically when you ask about flag cleanup:

Remove the `new-checkout-flow` feature flag
Is the `dark-mode` flag ready to be cleaned up?
Clean up stale feature flags in this codebase

Structure

launchdarkly-flag-cleanup/
├── SKILL.md
├── marketplace.json
├── README.md
└── references/
    ├── pr-template.md
    └── sdk-patterns.md

Related

License

Apache-2.0

Source: SKILL.md on GitHub

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    This skill provides a secure, structured workflow for automating feature flag cleanup using LaunchDarkly. It incorporates mandatory user confirmation steps before code modifications and relies on official vendor-hosted tools for data accuracy.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    3/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"
}

README badge

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

Safely removes a feature flag from code while preserving production behavior by querying LaunchDarkly to determine the correct forward value, finding all flag references, and replacing conditional branches with hardcoded variations. Targets teams using LaunchDarkly's MCP server and requires the remotely hosted LaunchDarkly service for the `check-removal-readiness` and `get-flag` tools.

Generated from the current SKILL.md.

Does this skill work with any LaunchDarkly SDK or only specific ones?
The skill handles multiple SDK patterns (variation(), boolVariation(), useFlags(), etc.) across different languages and frameworks. See the SDK Patterns reference for the full list of supported patterns.
What happens if the flag is configured differently across environments?
If critical environments differ in ON/OFF state or serve different variations, the skill will not proceed with removal. You must resolve the inconsistency in LaunchDarkly first.
Can this skill delete the flag from LaunchDarkly after code removal?
The skill can archive the flag (reversible) using archive-flag, or permanently delete it using delete-flag. Archival is preferred because deletion is irreversible.
What if code references the flag with a dynamic key like flag-${id}?
Automated removal may be incomplete with dynamic flag keys. The skill will flag this as needing manual review.
Does this skill require internet connectivity to LaunchDarkly?
Yes. The skill requires the remotely hosted LaunchDarkly MCP server to be configured in your environment to query flag state and perform removal readiness checks.

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