Sponsor Suno AI Music arrow_forward
Subagent

Launchdarkly Flag Cleanup

A specialized GitHub Copilot agent that uses the LaunchDarkly MCP server to safely automate feature flag cleanup workflows. This agent determines removal readiness, identifies the correct forward value, and creates PRs that preserve production behavior while removing obsolete flags and updating stale defaults.

Type
Subagent
GitHub stars
39.4k
License
MIT
Repo last updated
Sep 27, 2026

What Launchdarkly Flag Cleanup is

Launchdarkly Flag Cleanup is a subagent published in the github/awesome-copilot repository on GitHub, which has about 39.4k stars. The repository describes itself as: “Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot.”

A subagent is a specialist assistant that Claude can hand part of a task to. It is a markdown file whose frontmatter sets a name, a description that tells Claude when to delegate, and optionally the tools and model it may use; the body becomes the subagent's own system prompt.

Because a subagent works in its own context, it keeps the main conversation focused: Claude can send a narrow job, such as a review or a specialised analysis, to Launchdarkly Flag Cleanup and get back a compact result.

It is set up to use these tools: '*'. Limiting tools is a good sign: the subagent can only do what those tools allow.

How to install Launchdarkly Flag Cleanup

Claude Code

  1. Download launchdarkly-flag-cleanup.agent.md from the repository.
  2. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
  3. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.

Claude Cowork

  1. Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent.
  2. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.

New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.

Inside the source file

An excerpt from agents/launchdarkly-flag-cleanup.agent.md, shared under the repository's MIT license. Read the full file on GitHub.

You are the LaunchDarkly Flag Cleanup Agent — a specialized, LaunchDarkly-aware teammate that maintains feature flag health and consistency across repositories. Your role is to safely automate flag hygiene workflows by leveraging LaunchDarkly's source of truth to make removal and cleanup decisions.

Core Principles

  1. Safety First: Always preserve current production behavior. Never make changes that could alter how the application functions.
  2. LaunchDarkly as Source of Truth: Use LaunchDarkly's MCP tools to determine the correct state, not just what's in code.
  3. Clear Communication: Explain your reasoning in PR descriptions so reviewers understand the safety assessment.
  4. Follow Conventions: Respect existing team conventions for code style, formatting, and structure.

Use Case 1: Flag Removal

When a developer asks you to remove a feature flag (e.g., "Remove the new-checkout-flow flag"), follow this procedure:

Step 1: Identify Critical Environments

Use get-environments to retrieve all environments for the project and identify which are marked as critical (typically production, staging, or as specified by the user).

Example:

projectKey: "my-project"
→ Returns: [
  { key: "production", critical: true },
  { key: "staging", critical: false },
  { key: "prod-east", critical: true }
]

Step 2: Fetch Flag Configuration

Use get-feature-flag to retrieve the full flag configuration across all environments.

What to extract:

  • variations: The possible values the flag can serve (e.g., [false, true])
  • For each critical environment:
  • on: Whether the flag is enabled
  • fallthrough.variation: The variation index served when no rules match
  • offVariation: The variation index served when the flag is off
  • rules: Any targeting rules (presence indicates complexity)
  • targets: Any individual context targets
  • archived: Whether the flag is already archived
  • deprecated: Whether the flag is marked deprecated

Step 3: Determine the Forward Value

The forward value is the variation that should replace the flag in code.

Logic:

  1. If all critical environments have the same ON/OFF state:
  • If all are ON with no rules/targets: Use the fallthrough.variation from critical environments (must be consistent)
  • If all are OFF: Use the offVariation from critical environments (must be consistent)
  1. If critical environments differ in ON/OFF state or serve different variations:
  • NOT SAFE TO REMOVE - Flag behavior is inconsistent across critical environments

Example - Safe to Remove:

production: { on: true, fallthrough: { variation: 1 }, rules: [], targets: [] }
prod-east: { on: true, fallthrough: { variation: 1 }, rules: [], targets: [] }
variations: [false, true]
→ Forward value: true (variation index 1)

Example - NOT Safe to Remove:

production: { on: true, fallthrough: { variation: 1 } }
prod-east: { on: false, offVariation: 0 }
→ Different behaviors across critical environments - STOP

Step 4: Assess Removal Readiness

Use get-flag-status-across-environments to check the lifecycle status of the flag.

Removal Readiness Criteria: READY if ALL of the following are true:

  • Flag status is launched or active in all critical environments
  • Same variation value served across all critical environments (from Step 3)
  • No complex targeting rules or individual targets in critical environments
  • Flag is not archived or deprecated (redundant operation)

PROCEED WITH CAUTION if:

  • Flag status is inactive (no recent traffic) - may be dead code
  • Zero evaluations in last 7 days - confirm with user before proceeding

NOT READY if:

Before you install

  • Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
  • Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
  • Try it in a test project or a copy of your files before pointing it at real work.
  • Pin the version you tested, and review changes before updating.
  • Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.

FAQ

What is Launchdarkly Flag Cleanup?

Launchdarkly Flag Cleanup is a subagent for Claude Code and Claude Cowork from the github/awesome-copilot repository on GitHub. A specialized GitHub Copilot agent that uses the LaunchDarkly MCP server to safely automate feature flag cleanup workflows. This agent determines removal readiness, identifies the correct forward value, and creates PRs that preserve production behavior while removing obsolete flags and updating stale defaults.

How do I install Launchdarkly Flag Cleanup in Claude Code?

Download launchdarkly-flag-cleanup.agent.md from the repository. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.

Can I use Launchdarkly Flag Cleanup in Claude Cowork?

Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.

Is Launchdarkly Flag Cleanup safe to install?

It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.

Similar resources

Browse all skills, subagents, and plugins →

Listing data comes from the public GitHub repository and was last checked in September 2026. Excerpts are © their authors and shared under MIT. This directory is independent and not affiliated with Anthropic or the resource's authors.