A nonlinear mathematical programming approach together with the finite element method and homogenization technique is developed to implement kinematic shakedown analysis for a microstructure under cyclic/repeated loading. The macroscopic shakedown limit of a heterogeneous material with anisotropic constituents is directly calculated. First, by means of the homogenization theory, the classical kinematic theorem of shakedown analysis is generalized to incorporate the microstructure representative volume element (RVE) chosen from a periodic heterogeneous or composite material. Then, a general yield function is directly introduced into shakedown analysis and a purely kinematic formulation is obtained for determination of the plastic dissipation power. Based on the mathematical programming technique, kinematic shakedown analysis of an anisotropic microstructure is finally formulated as a nonlinear programming problem subject to only a few equality constraints, which is solved by a generalized direct iterative algorithm. Both anisotropy and pressure dependence of material yielding behavior are considered in the general form of kinematic shakedown analysis. The purely kinematic approach based on the kinematic shakedown analysis has the advantage of less computational effort on field variables and more convenience for displacement-based finite element implementation. The developed method provides a direct approach for determining the reduced macroscopic strength domain of anisotropic heterogeneous or composite materials due to cyclic or repeated loading.