Automate pattern generation