The first resource I'd say would be the Eclipse Plugin for ThingWorx Extensions(available on Marketplace or here http://marketplace.thingworx.com/Items/eclipse-plugin-for-thingworx-extensions). It helps you build extensions through Eclipse to reduce common errors.
Second would advice for the Mashup. They're probably the most complex type there is so creating it in Composer and exporting it would be the best way to get the entity itself. Now you can import entities into an extension project via the plugin I mentioned.
Lastly, if you are doing this task manually, you can read the ThingWorx Extension Development Guide(link available on the mentioned plugin link above) which will show you the structure of an extension and metadata.xml file.
Hope this helps.