How to enlarge/reduce size of window like the rectangle app?

Here is a simple example how you can achieve this with the "Custom Move / Resize" action: