General formulation of pionic decays in the quark model