PurposeAccording to leadership trait theory, leaders’ personality traits are stable factors in organizational situations and exert significant effects on employees’ organizational behaviors. However, studies related to this topic are very limited. In this study, from the leadership trait perspective and based on social identity theory and social exchange theory, the influencing mechanisms of leaders’ prosocial tendencies on affiliation-oriented and challenge-oriented organizational citizenship behaviors are investigated. Specifically, leadership prosocial tendency, affective commitment and workplace ostracism are selected as the independent variable, mediating variable and moderating variable, respectively.MethodsThe data collection is conducted in two stages in which the leader–employee pairing method is adopted. Ultimately, 347 valid questionnaires are collected from 73 teams. Later, the hierarchical regression analysis and bootstrap methods are used to test the study’s hypotheses.ResultsLeadership prosocial tendencies have significant positive effects on affective commitment (β = 0.282, p < 0.001), affiliation-oriented (β = 0.648, p < 0.001) and challenge-oriented organizational citizenship behaviors (β = 0.521, p < 0.001). There is a significant positive effect of affective commitment on affiliation-oriented (β = 0.103, p < 0.05) and challenge-oriented organizational citizenship behaviors (β = 0.122, p < 0.05). At the same time, the influence of leadership prosocial tendencies on affiliation-oriented (β = 0.619, p < 0.001) and challenge-oriented organizational citizenship behaviors (β = 0.487, p < 0.001) remains significant. In other words, affective commitment partially mediates the relationships between leaders’ prosocial tendencies and affiliation-oriented, challenge-oriented organizational citizenship behaviors. Workplace ostracism plays a negative moderating role between leaders’ prosocial tendencies and affective commitment (β = −0.098, p < 0.05). Furthermore, workplace ostracism can also mediate the mediating role of affective commitment with 95% bias-corrected confidence intervals [−0.146, −0.017] and [−0.114, −0.003].ConclusionThe results show that leaders’ prosocial tendencies have significant positive effects on both affiliation-oriented and challenge-oriented organizational citizenship behaviors. Affective commitment partially mediates the relationships between leaders’ prosocial tendencies and affiliation-oriented and challenge-oriented organizational citizenship behaviors. Workplace ostracism significantly negatively moderates the relationship between leaders’ prosocial tendencies and affective commitment. Moreover, the study verifies that the mediating effect of workplace ostracism on affective commitment has a significant moderating effect.