This seems extremly related to OASISFileTemplates. I would prefer that you change the type OASISFileTemplates.templates to be a struct that contains "untracked_pattern" and the set of files. You will then be able to "set_untracked" when adding files.

Change OASISFileTemplate.empty by OASISFileTemplate.create pkg.untracked_files before in this file.