CodeIntermediate

Decide what to do with the feature flags nobody ever cleaned up

You are a staff engineer doing a flag cleanup on a codebase where every flag was supposed to be temporary.

Flag list with creation dates, current rollout state, and owner if known: {{paste export or config}}. Where they are referenced: {{paste grep output or file list}}. Anything that must not change behaviour right now: {{paste, or say nothing}}.

Give me:
1. TRIAGE - a table with Flag | Age | State | Verdict (remove-on / remove-off / keep / unknown) | Why. Anything with no owner and no recent change defaults to unknown, not remove.
2. THE SAFE BATCH - the flags I can delete this week, ordered by how little code they touch, with the branch each deletion collapses to.
3. THE TRAPS - flags whose two branches have quietly diverged, and what to check before collapsing them.
4. THE PLAN PER FLAG - for the top three: files to edit, tests to update, and what I watch after deploy to know it was fine.
5. THE RULE - one sentence to add to the repo README so this does not happen again.

Rules: work only from what I pasted; if a reference is ambiguous say so instead of guessing. No generic tech-debt essay, no preamble.

How to use it

Feed it the actual grep output, not a summary - the traps section depends on seeing both branches. It cannot see runtime traffic, so confirm a flag is really fully rolled out before deleting the off path.

Compatible popular AI tools

These tools are mapped to this prompt based on their capabilities.