1. Take care of my health: sleep, exercise, food, medication, socially-bonding conversation.
2. Connect to Why -- That is why a good Product Manager so valuable for programming and a clear picture of my audience curiosity so valuable for writing.
3. Recognize signs of success -- Thats what makes Test-Driven Development so valuable for programming and Question Driven Drafting so valuable for writing.
4. Get into rhythm which balances focus and exploratory de-focus -- The pomodoro technique is useful here. Also, talking with Test Engineers.
I like what Jocko Willink says; Accountability is a crutch: useful to notice and endure a problem, but something you should then you should then drive you to find the cause of the problem and incorporate a fix. That fix is part of building your personal discipline. I think the mistake a lot of people make with discipline is that they imagine it harshly -- like a drill sergeant whipping you into shape. But whips only make sense to enslave someone to do something they don't want to do. Healthy discipline feels like something effortful which nurtures you.
Your mind is a garden of your own
to terrace and irrigate,
to plant and to graft,
to water and weed and repair,
-- and yes, to artificially fertilize if needed --
so that whatever the weather,
out of your impulses
will grow the actions which bear fruit
according to what you truly value.