This thing was called the Polyus. It was to be an anti-sattelite, anti-spacecraft weapons platform. It was also capable of dispensing nuclear (yes, nuclear weapons) space mines. Also, it was to have an onboard laser system for sighting a modified (reduced recoil) 23mm autocannon, almost identical to the Soviet anti-aircarft cannon carried on various air defense tracks, and aircraft.
From what I can gather, Polyus was something the Soviet Strategic Rocket Forces had pondered about for a long time. When the Reagan Administration initiated research into SDI with the stated goal of deploying anti-ballistic missile platforms in space, this caused the Soviets to accelerate the program. The one and only flight of Polyus (an unarmed 'boiler plate' prototype) was apparently "rushed" and could easily have led to mistakes.
Here is an excellent source for info related to Polyus:
http://www.astronautix.com/craft/polyus.htm
Nice photos of Polyus mated to the Energia booster by the way!
It's a good thing that neither side got really serious about orbiting weapons platforms in space--it could have made things quite a bit unhealthier for astronauts and cosmonauts. Especially if the shooting started!