Back when I started writing Scripts for Photoshop, uhm, five or six years ago, I’d have loved having a (set of) templates to borrow code from. Luckily 90% of scripts around aren’t binary encoded, so you can peep at the structure of publicly available JSX files from talented contributors, or ask in the forums, or find your own way yourself.
Still, it’s kind of bizarre to me that while Boilerplate code is the norm for most of the stuff related to web development, there’s nothing similar in the ExtendScript ecosystem, as far as I know.
I’ve started devoting some of my (copious, of course) spare time uploading my take on Boilerplate code for Photoshop Scripts on my GitHub account. Everything’s still in an early, alpha stage, but you can already find there a little something written on CoffeeScript.
Time permitting I will expand the repository, so check back and feel free to fork and contribute!