Whatever compass direction your contour is, that is how I would chose your garden length.
I don't understand this. How does contour direction influence garden length? By "length", do you mean the direction of the long axis of the hypothetical rectangular garden beds?
The direction of the contour lines on my lot are roughly S-N, which is how I set up my garden beds. The footpaths are on contour so that they hold water. My microswales are on contour as well and all the rest of the area in the upper half of the lot consists of the garden beds, which are irregularly shaped.
Do I plant rows of plants in the garden beds in the S-N direction?