if you are referring to a classical 2-stage opamp (diff-pair+common source output stage), then under some common assumptions (I think the output stage gain has to dominate):
- the compensation resistor has to be equal to 1/gm of the output stage,
- the capacitor can be chosen by sweeping it until the loop gain pole have split enough to ensure stability