Find and remove stale feature flags that are permanently enabled, permanently disabled, or abandoned. Use when the user says "clean up feature flags", "remove the old flags", or after a feature has been fully rolled out for more than a sprint.
npx @senso-ai/shipables install KeyanVakil/feature-flag-cleanupFeature flags are temporary. Someone has to clean them up. Today it's you.
Find every feature flag in the codebase. Search for:
featureFlags., flags., isEnabled(, getFlag(, FEATURE_, FF_ldClient.variation(, useFlags(, useLDClient(useGate(, checkGate(, statsig.checkGate(For each flag found, classify it:
| Classification | Signal |
|---|---|
| Always-on | Default is true and no code path sets it false |
| Always-off | Default is false, feature never shipped, code path is dead |
| Actively used | Referenced in flag service/dashboard with active experiments |
| Abandoned | Referenced in code but doesn't exist in the flag service |
| Graduated | Shipped to 100% of users, no longer needs a flag |
For each always-on or graduated flag:
For each always-off or abandoned flag:
For each actively used flag: leave it alone, document it.
After cleanup, run a search to confirm no remaining references to removed flag names.
FLAGS FOUND: X total
REMOVED (always-on / graduated):
- FLAG_NEW_CHECKOUT — removed, kept new checkout flow
- FLAG_DARK_MODE — removed, dark mode now default
REMOVED (always-off / abandoned):
- FLAG_EXPERIMENTAL_SEARCH — removed, deleted dead code (~200 lines)
LEFT ALONE (active):
- FLAG_PRICING_TEST — active A/B test, leave it
NET CODE DELETED: ~X lines