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.
Linen is a search-engine friendly community platform. We offer integrations with existing Slack/Discord communities and make those conversations Google-searchable.