Pretty much anything I can find, I guess. There’s no set "way" to do it, and you can’t just duplicate and change some variables to make it different. The best documentation (besides Shaun & Jason) is probably the existing code.
Basicly, MODX uses connectors to provide an access point for AJAX requests to get access to processors - which are the PHP codes that do the actual stuff. What this means is that when you are building something in jQuery, and want to do something (for instance create a new resource), you don’t have to code that all over again. Just AJAX the data to the connector (connectors/index.php) passing an action ("resource/create") and all the data you have (+ the mod auth key thingy). The connector will forward it to the processor and do the actual stuff.
With HandyMan I don’t want to send it with AJAX, so what I do is just create a regular form which posts to the current page and the php running that page uses $modx->runProcessor() which is sort of a connector. So you don’t have to code your own script - just use what’s already there, and work on the top layer (interface) and the code that sends the data off. So in theory you don’t even need JavaScript.
You’re free to check out the source for HandyMan on Github - it’s being built using jQuery Mobile:
https://github.com/Mark-H/HandyMan