In this chapter, we present a novel method for incremental learning robot complex task representation, identifying repeated skills, and generalizing to new environment by heuristically segmenting the unstructured demonstrations into movement primitives that modelled with a dynamical system. The proposed method combines the advantages of recent task representation methods for learning from demonstration in into an integrated framework. In particular, we use the combination of finite state machine and dynamical movement primitives for complex task representation, and investigate the Bayesian nonparametric hidden Markov model for repeated skill identification. To this end, a robot should be able to identify its actions not only when failure or novelty occurs, but also as it executes any number of skills, which helps a robot understand what it is doing at all times. Two complex, multi-step robot tasks are designed to evaluate the feasibility and effectiveness of proposed methods. We not only present the results in task representation, but also analyzing the performance of skill identification by various nonparametric models with various modality combinations.