How does flavor change in weak interaction works with $Z$ and $W^{\pm,0}$? How does flavor change in weak interaction works with $Z$ and $W^{\pm,0}$?
I'm completely confused of how could weak interaction just "approximately" conserve the flavor, but $u,d,s,c$ could be just changed seemingly randomly. 
For example, (https://en.wikipedia.org/wiki/Weak_interaction#Charged-current_interaction) showed that $W^-$ was used to mediate $d\rightarrow u$ and $c\rightarrow s$, where its decay contained $e^- +\overline{\nu}_e$...
Is there a default makeup(composition) of $W,Z$ at all? How could $W,Z$ just flip flavors without constrains? Is there any rule at all?
 A: The rule is called quantum mechanics, it depends on the postulates and the mathematical formulation with wave functions leading to probabilities of interaction.
If there is a probability non zero for a specific interaction, it will happen, in order  to fulfill the probability spectrum. 
Probabilities are controlled not only by the form of the wavefunctions in the boundary conditions of the interaction, but also by conservation laws: energy, momentum, angular momentum, and a plethora of quantum number conservation as charge, baryon number , lepton number ... If these are conserved during the interaction, it will have a probability of happening.
In the specific case, the weak interaction does not conserve  flavor, charge and lepton number are, so if it is energetically possible, the quarks can change flavor through weak interaction.
The W and Z are elementary point particles in the standard model of particle physics. They are gauge bosons and carry no quantum numbers. In the link you gave note the example diagram. Weak interactions do not conserve flavor, so there is flavor change to an energetically (by the energy in the interaction) allowed one. Baryon number, lepton number  and charge are conserved in the weak interaction. The interaction shown has a probability of happening, that is why the neutron is not stable.
