A model is proposed that explains the evolution of behavioral routines and the emergence of the firm as a system of routines. The model builds on the cognitive-affective systems theory of personality in which situational contingency and variation are fundamental. The paper contributes to organizational theory by offering a new approach to the integration of individual behavior and the emergence of routines and organizational form. The paper also contributes a new perspective on the theory of the firm, and re-conceives the individual-opportunity nexus that underpins entrepreneurship. The implications for future research on these topics are discussed.