Agonist is a classification used to describe a muscle that causes specific movement or possibly several movements to occur through the process of its own contraction. This is typically a term designated for skeletal muscles. Agonists are also referred to, interchangeably, as "prime movers", since they are the muscles being considered that are primarily responsible for generating a specific movement.
For an agonist to be effective as a mover in the skeletal system, it must actually cross one or more structure(s) that can move. This is typically where the muscle crosses a joint by way of a connecting tendon. As the myofibrils of a muscle are excited into action and then contract, they will create tension and pull through the tendon and pull the lever arm of bone on the opposite side of the joint closer to the muscle's origin.
An agonist muscle can shorten, as the triceps brachii does during the up phase of a push-up (elbow extension). During the down phase of a push-up, the same triceps brachii actively controls elbow flexion while lengthening. It is still the agonist. While resisting gravity during lengthening, the triceps brachii is still the prime mover, or controller, of the joint action. For both of those movements the elbow flexor muscles are the antagonists.