We have the homebrew-x11 tap for this reason so let's migrate everything
without any reverse dependencies. Ideally I'd also like to migrate
everything that's :recommended and the GTK formulae through there too
(or to a dedicated homebrew-gtk).
We're (finally) working on a documented public API for Homebrew. It's currently a work in progress; a bunch of public stuff is documented and a bunch of private stuff is undocumented. Sorry about that!
The main class you should look at is {Formula}. Assume everything else is private for now.