I go through this less frequently nowadays but it always happens. Sometimes in the short run you aren't interested in programming any more. You think you are bad at it.
My bet is that if you have been in it for ~15 years you're probably going to be in it for another 30. Don't sweat it too much. I think it will turn out that regions of the brain will be like muscles. Sometimes you need to listen to your body/brain and give one muscle a break.
How many books do you read? Even when I'm sick of coding, I try to read some random programming books. There's a great quote, that when you think about who it's coming from, is pretty powerful advice: "In my whole life, I have known no wise people (over a broad subject matter area) who didn’t read all the time – none, zero." — Charlie Munger