Stop AI from taking control of your code

I have been running full AI-mode on a few projects for a few weeks now. I just now paused to take a look at the overall code, and the situation is bad. Here are some ways to fix and prevent this situation.