In general, there are two ways of crafting an improved version of an item:
By chance. When your companion crafts "with great success", you get a better result. For things like gear, this means it will have an open augment slot. For consumables like medpacks and mods like enhancements and armorings, you will get two of them instead of one.
Get a better version of the blueprint by reverse-engineering. If you reverse-engineer an item you crafted, you will get some of the resources used to make it, but there is also chance that you will get a blueprint for a better version of the item. This better version is better in a different way than the one from #1.
You can use #2 repeatedly, so by reverse-engineering the better version of an item (blue), you can get a blueprint for even better version of it (purple).
And #1 and #2 can be combined, so if you want to get an item with better stats and modification slots, use reverse-engineering on the normal versions until you get the better blueprint and then craft the better version repeatedly until you craft one "with great success".
The chance of crafting the better item by #1 is affected by the affection of the companion who's doing the crafting.