Action Plan for Writing Code
Extending the idea from Know Your Next Commit.
Before staring a new feature, refactoring code, or fixing a bug, I open up a text file, and write down what I plan to do in a single line of text. For each project I have a text file called "todo.txt". This will become the commit message when the work is complete.
For new features, this will be too large for a single commit, so split the task down into smaller more manageable pieces, and write a line for each piece. This helps me think about how I will solve the problem as whole before touching any code.
I then rearrange the pieces in the order I plan to code them.
Along the way, I invariably find additional task; maybe I find a method that should be renamed, or a piece of code that is now redundant. Do not get side tracked, write it down in the list of sub-tasks, and continue with the sub-task at hand. As each sub task is completed. check it into the source control, cutting the commit message from "todo.txt".
If you don't already have such a "todo.txt" list, I think you will be pleasantly surprised how it can improve flow.
For my own small personal projects may "todo.txt" file also acts as my "New Features" list, as well as my "Bug Tracking" list. It is by far the most heavily edited file in the project.