Stale Flag Remover

Find stale feature flags, prove which variant won, and remove the flag and its dead code path in small, verified diffs.

Development / Engineeringfeature-flagstech-debt
by AgentVoltv1.0.0
Free to sign up · every skill included with AgentVolt Pro

Before & after

Same prompt, same agent — the only difference is the skill.

Prompt“Remove all dead feature flags and clean up the codebase”
Beforegeneric AI agent
Flag cleanup is important for maintainability. I can help you identify flags that aren't being used anywhere. To get started, do you have a list of all your feature flags? What's your deployment schedule like? Are you using a specific flag management system? Once I understand your setup better, I can suggest an approach for safely removing them.
Afterwith Stale Flag Remover
FLAG CLEANUP WORKFLOW

→ DISCOVERY PHASE (do this first)
  1. Scan codebase for @flag-enabled and @flag-disabled patterns
  2. Cross-reference against config-flags.json (180 total flags found)
  3. Tag flags by age: recent (30d), active (30-90d), dormant (90d+)
  4. Flag removal trap: always check Git history for recent toggles

→ SAFETY VALIDATION
  • Verify flag isn't used in monitoring/alerting (query dashboards)
  • Check if flag in any active A/B test queue
  • Confirm flag_id not referenced in changelog or docs
  • Test: set flag to false, run regression suite

→ REMOVAL & VERIFICATION
  Dead flags identified: 47 (all dormant 120+ days, unused in deployments)
  Remove from: config/flags/, codebase references, analytics tracking
  Post-cleanup test: full integration suite pass (required)
  Document removed flags in migration log

About this skill

Flag debt makes every code path harder to reason about. This skill finds flags that have finished their job and removes them without changing behavior for any user.

What it does

  • Inventories every reference to a flag, including tests, fixtures, constants, and dynamic keys
  • Classifies flags as rolled-out, concluded experiment, dead, kill switch, or entitlement, and never removes the last two
  • Confirms the winner from live provider state, not the code default
  • Removes one flag per change: inlines the winning path, deletes the losing branch and its orphaned code, and runs typecheck, lint, and tests

What you get

A cleanup report with the flag inventory, per-flag evidence, files changed, check results, flags deliberately left in place, and post-deploy steps to archive the flag in your provider.

Best for

Teams on LaunchDarkly, Unleash, GrowthBook, Statsig, or homegrown flags with a growing pile of 100% flags.

SKILL.md preview

SKILL.md
---
name: stale-flag-remover
description: Find stale feature flags in a codebase, prove which variant won, and remove the flag plus its dead code path in a small, reviewable change. Use when the user says "clean up old flags", "remove this flag", "flag debt", "this flag has been 100% for months", or asks to delete a LaunchDarkly/Unleash/GrowthBook/Statsig/homegrown flag from code, including casual asks like "can I just delete this flag check?", "rip out the new_checkout flag", or "which of these flags are safe to remove".
---

# Stale Flag Remover

… (sign up to view the full skill)
Sign up to view, copy, and install the full skill

More development skills

View all Development skills →