Open Visual Studio to Create new Project:
ex: mycompany.template
After that come like this photo to select the needs feature
Create Custom Project with selected feature:
After creates the Project, find all selected feature in the solution explorer Visual Studio
Template Studio For WPF
https://marketplace.visualstudio.com/items?itemName=TemplateStudio.TemplateStudioForWPF
You need to create your own custom template wizard implementation.
Check out this awnser.
In order to create optional files based on the users input i would create a base project template with all the mandatory files, and then i would create an item template with the indidual optional files. Here is an example.
If you have any questions feel free to ask.