Individuals who experience motor impairment after stroke are able to partially restore motor control through rehabilitation, which achieves long-term recovery through repeated short-term adaptation. The customization of rehabilitation tasks is crucial for enhancing the effectiveness of rehabilitation by promoting the patient’s awareness of motor impairments and reducing compensatory behaviors, which is currently dependent on the expertise of physiotherapists. The development of rehabilitation robots aims to alleviate the workload of physiotherapists and has the potential to offer accurate assessments of both short-term adaptation and long-term recovery in stroke patients. In this paper, we propose a framework for automated patient evaluation and task planning during robotic rehabilitation. A motor control model was proposed to capture the patient’s motor control process. By adjusting its state and parameters, a digital twin of the patient can be generated and updated, providing insight into the level of adaptation and rehabilitation progress. The digital twin is then utilized to plan customized rehabilitation tasks, which can effectively reduce uncertainty and ambiguities during patient evaluation, and improves patient’s adaptation during rehabilitation. The digital twin framework and the task planning algorithms were validated using human subject and simulation experiments.