Question: I work in a small but growing team of UX designers developing a suite of web applications. It's become obvious that we would benefit from a common pattern library, but are unsure how to get started or what tool we should use.

We want something that we can collaborate on and also share with visual designers and developers - so adding detail such as notes, graphics and snippets of code would be useful.

Has anyone had experience of building a library like this, do you have any tips or recommendations?

Answer: 
We currently use a wiki that we have customized. It allows us to create detailed specs (flow charts, images, code snippets, comments, a history etc) that anyone with an account can access. Within this we have pixel specs and a library of common UI elements that are linked to pages (if needed) that explain the interaction in greater depth.
I've worked with various approaches to such libraries from creating graffle stencils to full design repos complete with wikis and working code widgets. If you have the resource and time, the latter does have some real benefits as fully coded examples can be useful in clarifying the patterns more comprehensively e.g. you can see how elements are not only rendered by how they behave on interaction. A compartmentalised approach to your coded pattern library means you can also scoop out the examples and play around with variants on colour etc for your testing. Creating the patterns in actual working code and hosting them online, where your whole team can access them, also pays dividends. However, saying all this, I appreciate going to this level of detail has an overhead and is not always appropriate for all organisations and projects... sometimes some astute screen grabbing and consistent notation can suffice; the trick then is to get it into a format that is easy to navigate and access, otherwise you are less likely to use it ;)