Go through the changes merged since the last cleanup, delete what can be deleted, merge what can be merged, then ship it.
- Set the scope: find the commit from the last cleanup and list the changes merged after it.
- Read them one by one, and ask these questions:
- What did it disable or replace? Were the old code, tests, sentences in the docs, and config all deleted? If it was only "turned off" or "hidden", the mechanism is still there.
- Did it add safeguards? Locks, retries, fallbacks: is there a real incident or documentation backing them? If not, delete them.
- Is the same thing written twice? Is it patching for a one-off case?
- Did it make the docs false?
- Do the work: one change per area, and in the description write what was deleted, why it could be deleted, and how it was verified. Follow the normal shipping process.
- Wrap up: if there is nothing for the user to decide, end quietly. For things they need to decide (such as deleting a table that has data), ask with a card.