See https://github.com/jschuh/klipper-macros (some seem to have been merged into klipper examples or have same functionality as them).