You may gain skill even failing an action; though, it can vary per skill.
Stamina affects skill gain. If The less stamina you have at the beginning of an action the more skill you will receive. As long as you have less than 30 at least 1% stamina, at the beginning of the action you will gain half as much receive skill. It's recommended to have full If you perform actions at 0% stamina when you start an actionreceive no skill. Action time also affects skill gain. The longer the action, the more skill you gain for that action.
Nutrition also affects skill gain. If you have above 60% nutrition you gain a 1%, or if you have above 70% nutrition you gain a this bonus changes to 5% skill bonusAt at 70% Nutrition you gain that 1% becomes 5%nutrition.
===Family skills===