Were the Buddhist texts written by Sakyamuni himself?

No, they were recited and recorded by his disciples after the Buddha’s death. In the year of the Buddha’s Parinibbana, his five hundred disciples headed by Ven. Mahakassapa held an assembly at Saptaparna Cave near Rajagaha to compile and edit the Buddha’s teachings for posterity. At the assembly Ven. Ananda recited the Suttas preached by the Buddha, Ven. Upali recited the Vinaya established by the Buddha, and Ven. Mahakassapa recited, and latter supplemented, the Abhidamma which is an exposition and study of the Buddhist creeds. The Sutta, Vinaya and Abhidamma comprise Tipitaka. The word Pitaka originally meant basket for containing things. 


7.jpg


The compilation of Sutta, Vinaya and Abhidamma into Tipitaka is something like the designation of Jing (classics), Shi (history), Zi (academic schools) and Ji (miscellany) as the “Four Treatures” in China. This Buddhist school council was termed the First Samgiti. Samgiti is generally rendered as “Jieji” in Chinese, while its original meaning in Sanskrit or Pali is “sangha meeting”. The ancient Chinese translators used the word “Jieji” to mean “recital”, which implies both the collection of Dhamma, and the assembly of people. The Tipitaka was not written down at that time, so it was passed on by oral recital. (From Essentials of Buddhism: Questions and Answers)