1) Problem identification. Get the target wrong and it doesn't matter how wonderful your code is. 2) Problem solving. 3) Creative thinking. Most code is science, but occasionally it takes art. You have to be willing and able to be an artist.
With these in hand, coding is a means not an ends. The obcession with code as an ends is fool's errand.
Automation? You're gonna need these base skills as well.
Certainly, these things can be taught. But some of us are wired better than others for this skills stack. We don't need more people who write code. We need more problem solvers with an occasional flare for rule breaking, creativity, etc.