I learned that $\ce{E^\circ_{Cl^-|Ag,AgCl}, E^\circ_{Ag^+|Ag}}$ and $\ce{K_{sp}}$ of $\ce{AgCl}$ are related as $$\boxed{\ce{E^\circ_{Cl^-|Ag,AgCl} = E^\circ_{Ag^+|Ag} + \dfrac{\ce{RT}}{\ce{F}}\ln K_{sp}}}$$

I was given this proof:

For an $\ce{Ag^+|Ag}$ electrode in non-standard conditions, using the Nernst equation $$\ce{E_{Ag^+|Ag} = E^\circ_{Ag^+|Ag} - \dfrac{\ce{RT}}{\ce{F}}\ln\dfrac{[\ce{Ag}]}{[\ce{Ag^+}]}}$$

As $\ce{[Ag^+][Cl^-]=K_{sp}}$ and $\ce{[Cl^-] = 1 M (standard state)}$, so $\ce{[Ag^+]=K_{sp}}$. Also $\ce{[Ag] = 1}$ as pure solids have activity of one. 

So $$\ce{E_{Ag^+|Ag} = E^\circ_{Ag^+|Ag} - \dfrac{\ce{RT}}{\ce{F}}\ln\dfrac{1}{\ce{K_{sp}}} = E^\circ_{Ag^+|Ag} + \dfrac{\ce{RT}}{\ce{F}}\ln K_{sp}}$$

What I don't understand is the next step. In the proof, $\ce{E_{Ag^+|Ag}=E^\circ_{Cl^-|AgCl,Ag}}$ and thus the boxed equation above is proved. But why is $\ce{E_{Ag^+|Ag}=E^\circ_{Cl^-|AgCl,Ag}}$?