A beautiful hadith with a reliable chain, that explains what the Prophet (sawa) said about the 12 Imams (as):

قال رسول الله صلى الله عليه وآله لأمير المؤمنين عليه السلام: اكتب ما املي عليك، فقال: يا نبي الله أتخاف علي النسيان؟ قال: لست أخاف عليك النسيان وقد دعوت الله لك أن يحفظك ولا ينسيك، ولكن اكتب لشركائك، قال: قلت: ومن شركائي يا نبي الله قال: الأئمة من ولدك، بهم تسقى أمتي الغيث، وبهم يستجاب دعاؤهم، وبهم يصرف الله عنهم البلاء ، وبهم ينزل الرحمة من السماء، وهذا أولهم وأومأ بيده إلى الحسن بن علي، ثم أومأ بيده إلى الحسين عليه السلام ثم قال: والأئمة من ولده
Abu Ja’far (as) has said via his fathers that Rasool-Allah (sawa) said to Amir Al-Momineen (as):
‘Write what I dictate to you’. He (Ali) said: ‘O Prophet of Allah! Do you fear my forgetfulness?’ So he said: ‘I am not fearing the forgetfulness over you, and I have supplicated to Allah for you that you would memorise and will not forget, but write for your associates (shurakaa’ik)’. He (Ali) said: ‘And who are my associates, O Prophet of Allah?’ He said: ‘The Imams (as) from your sons, whom though my community would quench itself from the rain, and whom though their supplications would be answered, and whom though Allah (swt) would remove the afflictions, and whom though the Mercy would descend from the sky, and this one is the first of them’ – and he (sawa) gestured by his hand towards al-Hassan (as), then he gestured towards al-Hussain (as) and said: ‘The Imams (as) from his sons’.

Sanad: al-Sadooq, from his Father, from his Father, from ‘Sa’ad bin Abdullah narrated to us, from Ahmad bin Muhammad bin Isa, from al-Husayn bin Saeed, from Hamaad bin Isa, from Ibrahim bin Umar al-Yamani, from abu al-Tufayl who said the above hadith

References: al-Amaali al-Sadooq, Assembly 63, Hadith #1 (See First Image below); Kamaal al-Deen, Page 119, Amali al-Toosi, Page 282; `ilal al-Sharaa’i`, Volume 1, Page 208; al-Khisal, Page 257; Bihar al-Anwar, Volume 36, Page 232 Hadith #14 (link)

Grading: Sh. Haadi al-Najafi says the chain is Good/Hassan (الرواية حسنة سنداً) [Mawsu`at Ahadeeth Ahlulbayt (as), Volume 11, Page 339] (See Second Image below)