How to write pre & post process scripts

Here’s the authoritative source on custom commands