All of the buildings and all of the cars were once just a dream in somebody's head -Peter Gabriel, "Mercy Street," 1986Building a problem solver and acquiring the knowledge needed to operate it are the two central goals of knowledge engineering. To achieve these goals, knowledge engineers construct models of the domain and of the task of interest. The various approaches used for modeling, however, have so far failed to define methods and techniques that can be applied across domains and tasks, and to produce models that can be reused in future applications. In this article, we propose that both of these objectives can be achieved by the use of building blocks called mechanisms. We examine the composition of mechanisms and also show how these mechanisms can be manipulated to construct problemsolving methods. We present PROT~GC-II, a knowledge-acquisition shell that uses problem-solving methods to drive the modeling of tasks, the automatic generation of knowledge-acquisition tools, and the control flow of the problem solver. The modeling of tasks, within the context of P R O T !~G~-I I , is illustrated with two examples: one from the game domain and another from the medical-therapy domain. In addition, we introduce the conceptual basis for a library of mechanisms that serves as a repository of reusable knowledge components.