I just remembered: There is an "IF" template (I forget it's exact name, @SHARED_OBJECT_EXISTS maybe?) that triggers on existence of a "shared object" (any item that is wrapped with the proper templates, which all the materials in the standard base are). Some simple modification of the existing templates would automatically not generate castes for any stone that does not exist. No scripting required, simple and flexible. Basically if, say SLATE exists it would parse and insert the caste raws for the SLATE caste, else it would insert a message stating slate was missing. If you wanted to support new layer stones that mods may add it would just be a matter of adding the proper template call, Rubble would automatically cull unneeded ones. This would require some changes to the DeRubblizer addon, but nothing complicated.
I can finish templating the creature raws and make the other stuff tolerant of missing materials without making the raws much more complicated. That would make TESB First Landing compatible, which would be really cool.
Expect a patch next time I get to a library that has the needed changes for general compatibility with any base addon.
I am making a concerted effort to avoid scripting or any of the more complicated features of Rubble, I don't want something that you will have trouble working with, plus by using just the core template library this will remain compatible with Rubble versions going into the future. I will need to make some changes to the addon.meta files when Rubble 7 hits because I am changing from scripts-as-data-files to a more generic format that should be simpler to use and maintain. Technically if not for the addon.meta files the addon would be compatible with Rubble versions from... 4.x? I think? Anyway, the way things are now you won't have to worry about Rubble updates breaking anything until Rubble 7 (which is still a ways off), and that should be the only time it is a problem. Ever.