The contigency was this.
Most of the Soviet Staff actually expected Moscow to fall. As a result Kubyshev was designated as the temporary capital in case the city fell. It was about 600 miles or so to the east and pretty much all of the Soviet Staff and Stavka were there, including Molotov and even Lenin.
A skeleton force remained in Moscow along with an armored train to escort Stalin and the Generals to safety in case all failed.
Moscow itself was booby trapped. 1200 buildings including the Kremilin Govt. Buildings and even the Bolshoi Theatre were rigged with explosives as these were the first buildings which would have surely been visited by the German High Command.
Partisan groups were already set up to continue the fight and were even given special assignments after the city fell.
The biggest problem that the Germans might have very well faced was getting out of the city if ever captured. Germany would have lost a tremendous amount of men and reinforcements would have been minimal if any.
Example: In the first 6 months on the Eastern Front, Germany suffered 1 million casualties but only received 200 thousand replacements. At the same time the Red Army ( while suffering casualties ) actually grew in size by 2 million.
Hope this helps
