DocsBlog
jessyecs / feature-flag-assistant
feature-flag-assistant

feature-flag-assistant

feature-flagslaunchdarklycleanup
Authors
Jessye Coleman-Shapiro
Jessye Coleman-Shapiro@jessyecs
Details
Visibility
public
Deployments
4
Build Number
fd73037a
Updated
Mar 24, 2026
Integrations
AnthropicGitHub
Capabilities
Identify LaunchDarkly flags fully rolled out to 100% in production for 2+ weeks
Identify LaunchDarkly flags with zero code references
Provide actionable cleanup recommendations
Send bi-weekly scheduled flag audit reports to Slack
More agents
ReadMe

Feature Flag Helper Agent

Helps engineering teams identify stale LaunchDarkly feature flags for cleanup.

Capabilities

Fully Rolled Out Flags

Flags that have been serving 100% of production traffic to their "on" variation for 2+ weeks. The surrounding conditional code can be deleted and the "on" path hardcoded.

Orphaned Flags (No Code References)

Flags that appear in LaunchDarkly but have zero references in any scanned repository. These can be deleted directly from LaunchDarkly.

Scheduled Slack Reports

A bi-weekly audit report is automatically posted to a configured Slack channel. The report highlights flags that newly crossed the 2-week rollout threshold and the 5 oldest flags still awaiting cleanup. The report schedule is configured at deploy time via the UI.

Required Configuration

Set the following secrets before running:

VariableRequiredDescription
LAUNCHDARKLY_API_KEYYesLD REST API key with reader role
LAUNCHDARKLY_PROJECT_KEYNoLD project key (default: default)
LAUNCHDARKLY_PRODUCTION_ENVNoLD production environment key (default: production)
GITHUB_REPONoRepository to search for flag code references (owner/repo)
SLACK_NOTIFY_CHANNELNoSlack channel ID or name to post scheduled audit reports to

The LaunchDarkly API key needs:

  • reader access to Flags
  • reader access to Code References (for the no-code-refs tool)

Code References must be enabled in your LaunchDarkly project and at least one repository scan must have run for the orphaned-flag tool to return data.

Example Prompts

  • "Which feature flags can I clean up?"
  • "Show me flags that have been fully rolled out to production for over 2 weeks"
  • "List all flags with no code references"
  • "Give me details on the flag my-flag-key"