The codingthewheel.com website shows how to roll your own poker bot. I've only lightly skimmed the pages. It seems a little light on details but the framework is probably all there. Anyway, for your perusal.
Also, apart from the poker aspect is his view on writing specs. In his "You Can't PDF Your Way to Good Software" section he writes "The likelihood of a specification document's actually being read varies inversely with its length."