https://wiki.archlinux.org/title/XDG_Base_Directory
PS. I don't know about Mac but Windows also have similar directories although more of a mess.
There's no reason to save artifacts or local user config along with data.