Generally, your bot has to implement the GTP protocol (
http://senseis.xmp.net/?GTP). Once you're at the link, click on the link on that page for "kgsGTP" to see the KGS-specific details, for instance.
[Update] Searching on this forum for "bot" or "GTP" could also be profitable. Here's a thread that gives links to open-source (or maybe not) go engines that implement GTP, so you may be able to find some code that will get you started:
viewtopic.php?f=18&t=10665&hilit=gtp+botFinally, here is a list of links from the KGS Computer Go room. There may be something useful here:
Discuss & test computer Go
http://www.michna.com/kgsbot.htmDownload bot client from:
http://www.gokgs.com/download.jsphttp://www.computer-go.info/http://senseis.xmp.net/?KGSbotshttp://www.lysator.liu.se/~gunnar/gtphttp://www.computer-go.org/mailman/list ... mputer-go/http://cgos.boardspace.net/