If you have a SPICE netlist, you should use it to ...
# magic
t
If you have a SPICE netlist, you should use it to annotate the ports with the right order, or you can just set the port index. If you have a LEF file, you can use it to annotate the ports with class, use, etc.; but since you're creating standard cells, I would expect that you are generating your own port properties and then creating LEF.