A Framework for Learning and Reusing Robotic Skills