How to best measure the inside gap of stairs
I would measure the front and the back of each stair with a tape measure.   If they are the same you are in luck and you don't really need to do much other than make your cut.
If it is the end of summer where you live I would cut these pretty tight.   You should have to knock them into place - not forcefully.   If it is the end of winter however I would leave a 1/8&quot; gap - 1/16&quot; on each side to allow for expansion.
If you stairs are not square I wouldn't rely on a template - I would measure and map out each tread.   In years of doing houses I have ran into this twice out of 100+... and both times I could have told you that there were issue (settling caused stairs to be completely off level on older historic house).