Did Muhammad (sawas) leave a Will (testament)?
The Prophet Muhammad pbuhap said to Ali bin Abi Talib on the night of his death,
“O Father of Al-Hassan, bring me a pen and a paper”, and he dictated his will until he came to a position where he said, “O Ali, there will be twelve Imams after me and after them there will be twelve Mahdis. You, O Ali, are the first of the twelve Imams, Allah has named you in his heavens Ali Al- Mortatha, The Prince of the Believers, the Grand Truthful, the Bright Differentiator between truth and falsehood, the trusted, and the Mahdi (the rightly guided). These names may not to be truly attributed to other than you. O Ali, you are my successor over my family, their living and their deceased, and over my women. Whomever you affirm shall find me tomorrow, and whomever you reject I am innocent of her. I will not see her and she will not see me on the Day of Resurrection. And you are the successor (Khalifa) upon my nation after me. If death approaches you, hand it over to my son Al-Hassan the very beneficial. Then if death approaches him, let him hand it over to my son Al- Hussein, the martyr, the pure, the assassinated. Then if death approaches him, let him hand it over to his son, the master of the worshippers, Ali. Then if death approaches him, let him hand it over to his son, Muhammed Al-Baqir. Then if death approaches him, let him hand it over to his son, Jafar Al-Sadiq. Then if death approaches him, let him hand it over to his son, Musa Al-Kathum. Then if death approaches him, let him hand it over to his son, Ali Al-Retha. Then if death approaches him, let him hand it over to his son Muhammad, the trustworthy, the pious. Then if death approaches him, let him hand it over to his son Ali, the advisor. Then if death approaches him, let him hand it over to his son Al-Hassan, the virtuous. Then if death approaches him, let him hand it over to his son, Muhammad the Entrusted of the Holy Family of Muhammad peace be upon them. So these are the twelve Imams. Then after him, there will be twelve Mahdis. So if death approaches him, let him hand it over to his son, the first of the close ones, he has three names, one like mine and my father’s: Abdullah (servant of Allah), Ahmad and the third name is The Mahdi (rightly guided). He is the first of the believers.” [Sheikh Al-Toosi, Al-Ghayba p.150]
The Will
هل ترك محمد (ص) وصية؟
أخبرنا جماعة (هؤلاء الجماعة ذكرهم الشيخ الطوسي في مواضع اخرى وما ذكرته عن أبي عبد الله الحسين بن سفيان البزوفري فقد أخبرني به أحمد أبن عبدون والحسين بن عبيد الله (الغضائري) عنه) خاتمة الوسائل ص30)، عن أبي عبد الله الحسين بن علي بن سفيان البزوفري ، عن علي بن سنان الموصلي العدل ، عن علي بن الحسين ، عن أحمد بن محمد بن الخليل ، عن جعفر بن أحمد المصري ، عن عمه الحسن بن علي ، عن أبيه ، عن أبي عبد الله جعفر بن محمد ، عن أبيه الباقر ، عن أبيه ذي الثفنات سيد العابدين ، عن أبيه الحسين الزكي الشهيد ، عن أبيه أمير المؤمنين عليه السلام قال : قال رسول الله صلى الله عليه وآله وسلم – في الليلة التي كانت فيها وفاته – لعلي عليه السلام : يا أبا الحسن أحضر صحيفة ودواة . فاملا رسول الله صلى الله عليه وآله وسلم وصيته حتى انتهى إلى هذا الموضع فقال : يا علي إنه سيكون بعدي اثنا عشر إماما ومن بعدهم إثنا عشر مهديا ، فأنت يا علي أول الاثني عشر إماما سماك الله تعالى في سمائه: عليا المرتضى ، وأمير المؤمنين ، والصديق الاكبر ، والفاروق الاعظم ، والمأمون ، والمهدي ، فلا تصح هذه الاسماء لاحد غيرك . يا علي أنت وصيي على أهل بيتي حيهم وميتهم ، وعلى نسائي : فمن ثبتها لقيتني غدا ، ومن طلقتها فأنا برئ منها ، لم ترني ولم أرها في عرصة القيامة ، وأنت خليفتي على أمتي من بعدي فإذا حضرتك الوفاة فسلمها إلى ابني الحسن البر الوصول ، فإذا حضرته الوفاة فليسلمها إلى ابني الحسين الشهيد الزكي المقتول ، فإذا حضرته الوفاة فليسلمها إلى ابنه سيد العابدين ذي الثفنات علي ، فإذا حضرته الوفاة فليسلمها إلى ابنه محمد الباقر ، فإذا حضرته الوفاة فليسلمها إلى ابنه جعفر الصادق ، فإذا حضرته الوفاة فليسلمها إلى ابنه موسى الكاظم ، فإذا حضرته الوفاة فليسلمها إلى ابنه علي الرضا ، فإذا حضرته الوفاة فليسلمها إلى ابنه محمد الثقة التقي ، فإذا حضرته الوفاة فليسلمها إلى ابنه علي الناصح ، فإذا حضرته الوفاة فليسلمها إلى ابنه الحسن الفاضل ، فإذا حضرته الوفاة فليسلمها إلى ابنه محمد المستحفظ من آل محمد عليهم السلام . فذلك اثنا عشر إماما ، ثم يكون من بعده اثنا عشر مهديا ، فإذا حضرته الوفاة فليسلمها إلى ابنه أول المقربين (وفي مصادر اول المهديين) له ثلاثة أسامي : اسم كاسمي واسم أبي وهو عبد الله وأحمد ، والاسم الثالث : المهدي ، هو أول المؤمنين.
كتاب الغيبة للشيخ الطوسي رحمه الله الصفحة 150
http://www.almahdyoon.org/wasiya