Questions to Ask Before Writing A Bazel Rule
What does your rule do? Does it already exist?
What files, if any, does it take as inputs?
What tool does it use? A compiler? A shell script?
Is the tool deterministic? Does every invocation of the tool with the same inputs generate the same outputs?
What output files does it generate?
Does the rule depend on the outputs of other rules using providers?
Does the rule provide inputs to other rules using providers?
What actions do you need to construct in order to generate the output files from the input files using the tool?