This paper describes a modular approach for the construction of fault-tolerant agreement protocols. The approach is based on a generic consensus service. Fault-tolerant agreement protocols are built using a client-server interaction, where the clients are the processes that must solve the agreement problem, and the servers implement the consensus service. This service is accessed through ``a generic consensus filter'', customized for each specific agreement problem. We illustrate our approach on the construction of various fault-tolerant agreement protocols such as non-blocking atomic commitment, group membership, view synchronous communication and total order multicast. Through a systematic reduction to consensus, we provide a simple way to solve agreement problems. In addition to its modularity, our approach enables efficient implementations of agreement protocols, and precise characterization of the assumptions underlying their liveness and safety properties.