A general algebraic construction is established, which underlies the previously proposed consistent equations of interacting gauge fields of all spins in 3 + 1 dimensions. This construction makes a verification of the consistency (gauge invariance) of the higher-spin equations trivial and indicates how these equations can be generalized to higher dimensions and/or conformal-type higher-spin theories.