I'm a believer in code everyday. It doesn't need to be more than a few seconds long for it to count. Leave an editor open and add a function if that's all you have today.
Could you explain why you believe daily code contributions are beneficial? If one can only feel inclined to add a simple function then it could be indicative of burnout, and thus time off is needed, not a gamified-obligation to write code.
It builds a habit and moves you closer to your overall goal. It's similar to a common suggestion for writers who want to write a book: open an editor and write at least one sentence per day. Or doing at least one push-up every day.
No more zero days, so to speak.
Starting is often the hardest part. An easy task makes it harder for you to talk yourself out of it. It also keeps the ball rolling.
I think the OP meant "code" in its purest sense - writing something for themselves, not necessarily pushing the contributions to GitHub as a part of gamification.
You don't have to do it if you're disciplined. I struggle with it and I find tiny daily habits useful.
Habits have context. I do gardening and I have a habit of checking my garden beds for weeds and diseases every day. I don't do it in winter when it's freezing and nothing is growing. I'll pick it up again in spring.
You don't have to game the system you've created. The habits are for you, not the other way around.
If you have nothing to fix you obviously don't need a productivity hack. It's called being done and you should either retire or move on to something else.
It helps me avoid procrastination. "Don't break the chain" is the only productivity hack that has actually worked. Even if you only need to do the bare minimum it helps you to get started (which is the hardest part for professional procrastinators), so it seldom stops there.
also time off is just good for you...