Stale Flag Remover
Find stale feature flags, prove which variant won, and remove the flag and its dead code path in small, verified diffs.
Before & after
Same prompt, same agent — the only difference is the skill.
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.
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
---
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)More development skills
View all Development skills →Performance Bottleneck Profiling: Node, Python, Go
Classifies a slowdown, gives exact profiler commands, reads the output, and proves the fix with same-conditions p95/p99 numbers.
Feature Scaffolding with Working Tests
Turn a short feature spec into code, runnable tests, and integration wiring that match your existing project.
Feature Flag Rollouts and Kill Switches
Design staged flag rollouts, verify rollback paths, and audit flag debt with explicit defaults, gates, and retirement plans.
Microcontroller Firmware and RTOS Engineering
Build and debug MCU firmware with bounded ISR/RTOS timing, safe DMA ownership, and measured power budgets.