Hacky one-kind term inference. Writes full gh/ghi files.