This design proposes a Skylark API for custom command line flags, multiarch binaries, and other configuration controls as a component of 
Bazel's Configurability Roadmap. The intention is to implement this by mid-summer.
https://docs.google.com/document/d/1vc8v-kXjvgZOdQdnxPTaV0rrLxtP2XwnD2tAZlYJOqw/edit?usp=sharing
If you want to write Skylark rules that can do neat multiplatform things, this is the design doc for you.
Some already known discussions that will have to happen in review (either in the doc or on this thread):
- How to encourage most transitions to be platform transitions while still allowing the possibility of non-platform transitions when the need makes sense
- How to roll out increased Skylark powers without compromising build speed, cacheability, and correctness
- How "feature flags", which are an evolving interface for user-defined configuration, fit in
Cheers and happy reviewing!