How will I ensure that the selectors are stable?
You can use full selectors and or use anchors or wildcards
While working with selectors you need refresh pages/changes layouts and see it is working or not.
Normally when we move the code from lower environment to upper environment due to miss match of application selectors tends to get change, some time you need to solve the issue on upper environment or request identical application in all environment which is not feasible some time.
Try to use partial selectors and anchors if possible.