See Parameter Playground for a reasonably comprehensive set of examples for parameters. Creating a parameter works the same way for UI Widgets and Rule Templates. Using them in the rule is a simple find and replace. If you have a parameter named “foo”, everywhere in your code that {{foo}} appears will be replaced with what ever the user enters for that parameter.
That’s really all there is to it: creating the YAML same as it appears for a UI rule and then adding the parameters section and parameter replacements.