I have to agree with Oleg in relation to the Kirov assassination in December 1934; the claims that it was organised by Stalin do not rest on any firm evidence, although historians like J Arch Getty do not dismiss absolutely the possibility that Stalin might have been involved.
So far as I know, the claim that Stalin had organised the assassination was first made by the exiled Trotsky, in the context of the ongoing propaganda campaign that he was waging from abroad against Stalin. Trotsky based his accusation on the claim that Kirov was a credible rival to Stalin, and that the majority of the Party Central Committee had voted for Kirov to replace Stalin; furthermore, that Kirov was very popular in Leningrad, was a more humane person than Stalin, and opposed many of the latter's excesses. Those claims were later taken up by Khrushchev in his de-Stalinisation campaign post-1956.
However, recent research into archival sources has shown that Kirov was not really a rival to Stalin at all, and that there had in fact been no vote to replace Stalin by Kirov. Furthermore, Kirov's rule over Leningrad was quite brutal, and he was a loyal servant of Stalin in carrying out repressive measures there. Thus, there is no reason why Stalin would have seen Kirov as a threat, or wanted him removed.
Of course, Stalin did later purge huge numbers of his loyal servants. But he did it by accusing them of treason and putting them on trial, not by having them secretly assassinated. So if Stalin had wanted to get rid of Kirov, he could have done it by having him arrested; assassination was not his normal modus operandi.
Stalin's actions immediately after the assassination are better explained in terms of Stalin's paranoid fears about plots and conspiracies, and his natural conclusion that the assassination of Kirov was part of a conspiracy that was ultimately aimed at killing him. Thus, from his own point of view, the mass arrests and executions of Leningrad NKVD officers and Party members was a defensive measure; since they had failed to protect Kirov from the assassin, then they might at worst be conspirators and at best could not be relied on to protect Stalin from conspiracy, real or imagined.
It is not necessary to interpret Stalin's actions in terms of his having guilty knowledge of the assassination, in fact the opposite; it came as a shock to him, played on his paranoid fears, and caused him to lash out at imaginary enemies.
Furthermore, the purge instituted by Stalin after the assassination was fully in the tradition of the normal Soviet response to traumatic events. Whenever there was a disaster, such as a train crash or a mine explosion, or even a failure to fulfil the plan through breakdowns of equipment, it was normal to assume that the events or failures were the work of malign forces called "wreckers", often described as agents of hostile foreign powers; the invariable response was to seek out the "wreckers", usually identified as the people in charge of whatever had gonme wrong, accuse them of being agents of the enemy, put them on trial, at which they nearly always confessed, and then execute the condemned in a sort of cleansing ritual. The whole process was reminiscent of medieval witch-hunts, in which disasters such as disease or crop-failure were blamed on agents of Satan.
Thus, when Stalin had the Leningrad NKVD purged, he was acting in the normal Soviet pattern; there had been a traumatic event caused by a disastrous failure of security, the local NKVD was responsible for security but had failed to enforce it, hence they were guilty of incomptence at best and conspiracy at worst, and deserved the most severe measure of punishment.
Finally, the records of the interrogation of the assassin show him to have been a deranged individual with a personal grudge against Kirov, whom he had been stalking for some time. The actual killing was adventitious; Kirov had gone to his office unexpectedly (which is why his bodyguard was not with him; the latter had not been informed of Kirov's movements), and had run into the assassin, who was just hanging about. The assassin then seized the opportunity to shoot Kirov with his pistol, which he possessed legally.
In the broad scheme of things, it is not certain whether the assassination of Kirov was the turning-point that it was claimed to be. In the immediate aftermath there was a large-scale purge of the Leningrad Party and NKVD, with many executions, but then things calmed down again in the course of 1935.
There may in fact be no connexion between the Kirov assassination and its aftermath, and the Great Terror which really began in 1937 with the sudden purging of the Red Army high command, and grew in intensity until its termination at the end of 1938. The Great Terror might have had quite separate causes, that have still not been fully explained.
Of course, Stalin did use the Kirov assassination during the Great Terror as a justification for his mass purging of the Party, in that his victims were accused of participating in a grand conspiracy that had Kirov as its first victim and was ultimately aimed at eliminating Stalin himself. But that was most probably a case of Stalin exploiting an event rather than his causing it.