Towards Robust Skill Generalization: Unifying LfD and Motion Planning