From the awesome logged-out contributor at https://www.mediawiki.org/wiki/Topic:Tqefilkhr1iqupw2:
Issue
It is currently impossible for a user to differentiate templates (either programmatically or with tools) without using categories.
Use cases
- Discourage certain templates in certain namespaces - e.g. Template:documentation (documentation type) in main namespace
- Create specific tools to target specific templates - e.g. a customized infobox editor, visualeditor / wikitext editor insert dialog for specific types of templates
- Retrieve data related to specific templates - infobox templates provide rich data that can be used in many contexts (search, translation, mobile apps, etc), but it is impossible to differentiate an infobox template from a "quote" template.
Proposed solution
Add a new property:
<templatedata> { template-type : "infobox" }</templatedata>
Categories don't really work for this because many templates are over categorized or mis-categorized.
There is a similar extension by wikia (https://github.com/Wikia/app/tree/dev/extensions/wikia/TemplateClassification) that might be worth forking. It seems to use some heuristics to automatically detect the template types, and also allows editors to overwrite those (see wikia's Help:Template types).