I am no expert here, just to help me remember this, I imagine rolling the rod 360 degree on paper. That means diameter * pi for one side of the square triangle. The other square side is the thread pitch.
So the leading angle is inverse tangent of thread pitch divides the diameter * pi.
Angle = inverse tangent ( pi * Diameter / pitch)
Making the relieve a degree or two smaller as other said. However, depending on how "tall" the cutting bit end, it may need to have more than a few degrees smaller, or bevel at the bottom a little.
For the cutting shape, since this is a "forming" tool, it must have the exact shape as that of the thread.
For advance, only advance on the leading edge on any thread types, which is 0 degree for square thread. For standard thread, instead of 30 degree, they do it 29.5. I read on it and some explains it's for some "pressure" produced from the trailing side. I don't know if that is true.
It's definitely not good to accidentally go above 30, so 29.5 would be on a safe side.