Order of spinors in an equation for a Feyman diagram or contraction I'm going over scattering theory in Peskin and Schroeder book, in his chapter on fermion scattering he wrote a specific contraction and the equation describing it

One thing he didn't mention is the order of spinors inside the equation. I tried doing the calculation myself and I ended up with something similar, the only difference is the order of the two spinors in the middle of the equation, I got $\bar{u}(k')u(p)$ instead of $u(p)\bar{u}(k')$ which I think makes sense, because you get an outgoing Fermion from $\big<k'|\bar{\psi}$ on the left side of the equation and an incoming Fermion $\psi|p\big>$ on the right side. Am I missing something?
And on a related note If I'm given a specific diagram, how do I determine the order of the spinors? because I couldn't find anything about this in Feynman rules.
 A: As Jeanbaptise pointed out in his comment, consider one of the $\bar \psi \psi$ operators within the matrix element. $\bar \psi$ will contract with an outgoing spinor, and produce a spinor state $\bar u$. Likewise, $\psi$ will contract with an incoming spinor and product a state $u$. Just as $\bar \psi$ and $\psi$ were contracted, so must these two states $\bar u u$. (I am leaving out momentum and polarization dependence in the spinor states)
So if $\bar \psi$ contracts with $\langle k'|$, and $\psi$ contracts with $|k\rangle$, we will get $\bar u (k') u (k)$. Then for the other $\bar\psi \psi$ operator we will likewise get $\bar u (p') u (p)$. Each of these two contractions is a scalar. Therefore we will get $\left( \bar u (p') u (p) \right)\left( \bar u (k') u (k)\right)$.
A: Here is how I think about this kind of question. It helps me to reintroduce the fermionic indexes to keep track of what is happening. Let us consider
\begin{equation}
\frac{(-ig)^2}{2} \langle \mathbf{p^{\prime}} | \langle \mathbf{k^{\prime}}| \int d^4x \bar{\psi}_{\alpha}(x) \psi_{\alpha}(x) \int d^4 y \bar{\psi}_{\beta}(y) \psi_{\beta}(y) | \mathbf{p} \rangle | \mathbf{k} \rangle
\end{equation}
with the contractions as denoted in eq. 4.115. The incoming fermion $|\mathbf{k} \rangle$ is associated, by the LSZ reduction formula, to
\begin{equation}
-i \int d^4 z_1 \bar{\psi}(z_1)(i \gamma^{\mu} \overleftarrow{{\partial}}_{\mu} + m) u(\mathbf{k}) e^{- i k \cdot z_1}
\end{equation}
When this contracts with $\psi_{\alpha}(x)$, we get something proportional to $u_{\alpha}(\mathbf{k})$. For the outgoing $\langle \mathbf{k}^\prime |$, we likewise obtain something proportional to $\bar{u}_{\alpha}(\mathbf{k}^{\prime})$, the $\bar{u}$ coming from the LSZ reduction formula.  Likewise, the final expression will have a term $u_{\beta}(\mathbf{p})$ and another one $\bar{u}_{\beta}(\mathbf{p}^{\prime})$. Why did we put on the indexes? First, all of these are just numbers and can be commuted. So our amplitude is proportional to
\begin{equation}
\bar{u}_{\alpha}(\mathbf{k}^{\prime}) u_{\alpha}(\mathbf{k}) \bar{u}_{\beta}(\mathbf{p}^{\prime}) u_{\alpha}(\mathbf{p})
\end{equation}
Second, looking at this last equation, it is clear that $\bar{u}(\mathbf{k}^{\prime})$ is contracted with $u(\mathbf{k})$ (both have $\alpha$ indexes). This happens because the $\bar{\psi}_{\alpha}(x) \psi_{\alpha}(x)$ term in the amplitude links these two spinors. Likewise, $\bar{u}(\mathbf{p}^{\prime})$ is contracted with $u(\mathbf{p})$. We can suppress the indexes
\begin{equation}
\bar{u}(\mathbf{k}^{\prime})u(\mathbf{k}) \bar{u}(\mathbf{p}^{\prime})u(\mathbf{p}) 
\end{equation}
Note that this is not equal to
\begin{equation}
\bar{u}(\mathbf{k}^{\prime}) u(\mathbf{p}) \bar{u}(\mathbf{p}^{\prime}) u (\mathbf{k}) = \bar{u}_{\alpha}(\mathbf{k}^{\prime}) u_{\alpha}(\mathbf{p}) \bar{u}_{\beta}(\mathbf{p}^{\prime}) u_{\beta}(\mathbf{k})
\end{equation}
which is a wrong result. The rule is: for an incoming fermion with momentum $\mathbf{p}$, put a $u(\mathbf{p})$. Then follow the fermionic line and associate with each vertex or propagator the appropriate spinorial matrix (eg. $\gamma^{\mu}$ from QED vertex, $(\gamma^{\mu}k_{\mu} + m)$ from the fermionic propagator). The line will end in an incoming antifermion or some outgoing fermion (in any case, this will be associated with some $\bar{u}(\mathbf{q})$), so the final expression will be
\begin{equation}
\bar{u}(\mathbf{q}) * \text{ terms from vertexes and propagators } * u(\mathbf{p})
\end{equation}
Note that this is a full contraction of the fermionic indexes, as it should be to produce a number in the end. The trick is to follow each fermionic line of the Feynman diagram, from beginning to end.
