Look into iommi (https://docs.iommi.rocks). It does similar things imo.
Disclaimer: I'm one of the authors of iommi.
Disclaimer: I'm one of the authors of iommi.
Thank you for developing this! I'll let you know how it goes and try to contribute where I can