I like the concept, you could also detect the compose file name automatically.
Or write down hashes for tag even if compose don’t use your variables so reading from compose, so people would not need to relay on the script but could use it as additional backup
“There are only 10 types of people in the world: those who understand binary and those who don’t.”
https://www.exploringbinary.com/there-are-10-types-of-people/