I want to create a robot.txt file for my dynamic website. I was wondering which files/directories to include and which to exclude. Is there any free tool which could help me in generating robot.txt file.
Every site's requirements are different. You only need a robots.txt file if you have specific files/folders that you don't want crawled. If you have no clue what should not be crawled then I would suggest you continue to live without one. They are not required. You can do more harm than good.
I agree with Canonical. It depends on your website. Usually bigger and more complex websites should use a robots.txt to ensure only the correct pages get crawled / indexed (eg. sites with shopping carts). But if your site is small and only contains a few static pages - you probably don't need one (eg. portfolio sites). If you want a (sort of) detailed guide on how to write one. Check here: http://www.webmasterindex.net/seo-how-to-write-a-robots-txt-file/
if you have a sitemap you include the command Sitemap: http://www.domain.com/sitemap.xml there are lots of robots.txt generator sites out there