How To: Add a feature to an out-of-the-box site definition

I often get asked how one should approach adding features to the out-of-the-box site definitions. On one hand, just putting in a new GUID in the onet.xml file does not seem like a big deal. On the other, Microsoft has had a stance going back to SharePoint 2003 that organizations should avoid modifying the out-of-the-box site definitions. The solution is to use a technique referred to as "feature stapling". A staple is in fact a farm level feature which builds a relationship with an existing site definition with the new feature you want to deploy. There is a great writeup on the SharePoint blog about this technique in regards to customizing My Sites. In case you are curious, the staple only impacts new sites that are created once it is activated. Here is the link:

https://blogs.msdn.com/sharepoint/archive/2007/03/22/customizing-moss-2007-my-sites-within-the-enterprise.aspx