I worked at a fortune 500 where IT was a support role and we had lots of people who were not that technically proficient. I really did have to deal with people who were incompetent programmers. Rookie mistake all over the place. Global variables in JavaScript. Check. Not using version control. Check.
What you describe is not incompetence at all. It just sounds like this person has aspirations for management and you don't. Personally, I believe that it's best to lead from the front meaning that one should demonstrate to the people he/she is trying to lead that one really knows their stuff.
That being said, it sounds like now this person actually is responsible for managing you now so it appears their tactics paid off. Unless this person is asking you to write bad code or implement designs that don't make sense, there's really no issue other than your resentment towards this person. you got to let it go. That stuff is poison.