Repair theory: A generative theory of bugs in procedural skills