From beginner internet research there is no technical prevention for Onychomadesis itself. Onychomadesis can happen randomly, possibly by heredity. The only way to prevent it is if it is not caused randomly is to NOT get any localized nail fold infections, nail fungus, bacterial, or yeast infections in the fingers or toes. Also DO NOT DAMAGE the nail matrix in any way. ALSO it is crucial that you do not get any systemic diseases as some of these are known causes also with distress in the womb.