Chiral perturbation theory at the quark level