For a normal flat putt, a good starting position for the golf ball is about 2 inches inside your front foot. This allows for the ball to be struck after the putter has reached it’s lowest point of the swing.
When facing a down-hill putt, play the ball slightly further ahead (perhaps 1 inch inside the front foot) so the putter will make contact with the ball with a little more loft than normal, thus making a somewhat softer impact.
The opposite is true when making an uphill putt. Moving the ball slightly backward in your stance will allow for the club face to be slightly less lofted and cause the ball to leave the club face with top spin which will help the ball up the slope without actually having to make a significantly harder swing. The less force in the swing the more accuracy will can be maintained.