I learned that $E^\circ_\ce{Cl^-|Ag,AgCl}, E^\circ_\ce{Ag^+|Ag}$ and $K_\mathrm{sp}$ of $\ce{AgCl}$ are related as $$\boxed{E^\circ_\ce{Cl^-|Ag,AgCl} = E^\circ_\ce{Ag^+|Ag} + \frac{RT}{F}\ln K_\mathrm{sp}}$$
I was given this proof:
For an $\ce{Ag^+|Ag}$ electrode in non-standard conditions, using the Nernst equation $$E_\ce{Ag^+|Ag} = E^\circ_\ce{Ag^+|Ag} - \frac{RT}{F}\ln\frac{[\ce{Ag}]}{[\ce{Ag^+}]}$$
As $\ce{[Ag^+][Cl^-]}=K_\mathrm{sp}$ and $\ce{[Cl^-]} = \pu{1 M} \ \text{(standard state)}$, so $\ce{[Ag^+]} = K_\mathrm{sp}$. Also $\ce{[Ag] = 1}$ as pure solids have activity of one.
So, $$E_\ce{Ag^+|Ag} = E^\circ_\ce{Ag^+|Ag} - \frac{RT}{F}\ln\frac{1}{K_\mathrm{sp}} = E^\circ_\ce{Ag^+|Ag} + \frac{RT}{F}\ln K_\mathrm{sp}$$
What I don't understand is the next step. In the proof, $E_\ce{Ag^+|Ag} = E^\circ_\ce{Cl^-|AgCl,Ag}$ and thus the boxed equation above is proved. But why is $E_\ce{Ag^+|Ag} = E^\circ_\ce{Cl^-|AgCl,Ag}$?