Imams act as per command of Allah

Hadith 1:

أَحْمَدُ بْنُ مُحَمَّدٍ وَ مُحَمَّدُ بْنُ يَحْيَى عَنْ مُحَمَّدِ بْنِ الْحُسَيْنِ عَنْ أَحْمَدَ بْنِ مُحَمَّدٍ عَنْ أَبِي الْحَسَنِ الْكِنَانِيِّ عَنْ جَعْفَرِ بْنِ نَجِيحٍ الْكِنْدِيِّ عَنْ مُحَمَّدِ بْنِ أَحْمَدَ بْنِ عُبَيْدِ اللَّهِ الْعُمَرِيِ‌ عَنْ أَبِيهِ عَنْ جَدِّهِ عَنْ أَبِي عَبْدِ اللَّهِ ع قَالَ: إِنَّ اللَّهَ عَزَّ وَ جَلَّ أَنْزَلَ عَلَى نَبِيِّهِ ص كِتَاباً قَبْلَ وَفَاتِهِ فَقَالَ يَا مُحَمَّدُ هَذِهِ وَصِيَّتُكَ إِلَى النُّجَبَةِ مِنْ أَهْلِكَ قَالَ وَ مَا النُّجَبَةُ يَا جَبْرَئِيلُ فَقَالَ عَلِيُّ بْنُ أَبِي طَالِبٍ وَ وُلْدُهُ ع وَ كَانَ عَلَى الْكِتَابِ خَوَاتِيمُ مِنْ ذَهَبٍ فَدَفَعَهُ النَّبِيُّ ص إِلَى أَمِيرِ الْمُؤْمِنِينَ ع وَ أَمَرَهُ أَنْ يَفُكَّ خَاتَماً مِنْهُ وَ يَعْمَلَ بِمَا فِيهِ فَفَكَّ أَمِيرُ الْمُؤْمِنِينَ ع خَاتَماً وَ عَمِلَ بِمَا فِيهِ ثُمَّ دَفَعَهُ إِلَى ابْنِهِ الْحَسَنِ ع فَفَكَّ خَاتَماً وَ عَمِلَ بِمَا فِيهِ ثُمَّ دَفَعَهُ إِلَى الْحُسَيْنِ ع فَفَكَّ خَاتَماً فَوَجَدَ فِيهِ أَنِ‌ اخْرُجْ بِقَوْمٍ إِلَى الشَّهَادَةِ فَلَا شَهَادَةَ لَهُمْ إِلَّا مَعَكَ وَ اشْرِ نَفْسَكَ لِلَّهِ عَزَّ وَ جَلَّ فَفَعَلَ‌ ثُمَّ دَفَعَهُ إِلَى عَلِيِّ بْنِ الْحُسَيْنِ ع فَفَكَّ خَاتَماً فَوَجَدَ فِيهِ أَنْ أَطْرِقْ وَ اصْمُتْ وَ الْزَمْ مَنْزِلَكَ‌ وَ اعْبُدْ رَبَّكَ حَتَّى يَأْتِيَكَ الْيَقِينُ‌ فَفَعَلَ ثُمَّ دَفَعَهُ إِلَى ابْنِهِ مُحَمَّدِ بْنِ عَلِيٍّ ع فَفَكَّ خَاتَماً فَوَجَدَ فِيهِ حَدِّثِ النَّاسَ وَ أَفْتِهِمْ وَ لَا تَخَافَنَّ إِلَّا اللَّهَ عَزَّ وَ جَلَّ فَإِنَّهُ لَا سَبِيلَ لِأَحَدٍ عَلَيْكَ فَفَعَلَ ثُمَّ دَفَعَهُ إِلَى ابْنِهِ جَعْفَرٍ فَفَكَّ خَاتَماً فَوَجَدَ فِيهِ حَدِّثِ النَّاسَ وَ أَفْتِهِمْ وَ انْشُرْ عُلُومَ أَهْلِ بَيْتِكَ وَ صَدِّقْ آبَاءَكَ الصَّالِحِينَ وَ لَا تَخَافَنَّ إِلَّا اللَّهَ عَزَّ وَ جَلَّ وَ أَنْتَ فِي حِرْزٍ وَ أَمَانٍ فَفَعَلَ ثُمَّ دَفَعَهُ إِلَى ابْنِهِ مُوسَى ع وَ كَذَلِكَ يَدْفَعُهُ مُوسَى إِلَى الَّذِي بَعْدَهُ ثُمَّ كَذَلِكَ إِلَى قِيَامِ الْمَهْدِيِّ صَلَّى اللَّهُ عَلَيْهِ


Narrated that Abu Abd-Allah Imam Sadiq (عليه السلام) said,

Allah (عز وجل) sent a document (through Jibrael) to His Prophet (صلى الله عليه وآله) before his death. He then said, "O Muhammad, this is your will to the noble ones in your family." 

The Prophet (ص) asked, "Who are the noble ones in my family, O Jibrael?" 

Jibrael said, "They are Ali ibn Abi Talib and his sons (عليهم السلام)." 

On the document there were several seals of gold. The Prophet (ص) delivered it to Amir al-Momineen (عليه السلام) and commanded him to open one seal and follow the instructions in it. Amir al-Momineen (عليه السلام) then opened one seal and followed the instruction in it. 

Then he delivered it to his son al-Hasan (عليه السلام). He opened a seal and followed that which was in it. 

He then delivered it to al-Husayn (عليه السلام). He opened one seal and found therein instruction that asked him to rise for martyrdom with a group of people and that there will be no martyrdom for those people except along with Imam Husain (عليه السلام) and to sell himself for Allah (عز وجل), so Imam Husain (عليه السلام) did it. 

Then he delivered it to Ali ibn al-Husayn (عليه السلام). He opened one seal and found therein instructions saying lower your head and remain silent, stay in your house and worship your Lord until your death arrives. So He did the same. 

Then he delivered it to his son Muhammad ibn Ali (عليه السلام). He opened one seal and found therein instructions that asked him to speak to people and make them learn. Do not fear anyone except Allah (عز وجل) because no one can harm you. So He did the same.

And then he delivered it to his son Jafar (عليه السلام). He opened one seal and found therein instructions that asked him to speak to people, make them learn, propagate the knowledge of your family (Ahl al-Bayt) and affirm the correctness of your righteous ancestors. Do not be afraid of anyone except Allah (عز وجل) because you are secure and safe. So He did the same and then delivered it to his son Musa Kazim (عليه السلام). In the same way Musa Kazim (عليه السلام) will deliver it to the Imam after Him and this will continue up to the rising of al-Mahdi (عليه السلام).

[Source: al-Kafi, Vol. 1, Pg. 280-281]


Hadith 2:

عَلِيُّ بْنُ إِبْرَاهِيمَ عَنْ أَبِيهِ عَنْ عَبْدِ اللَّهِ بْنِ عَبْدِ الرَّحْمَنِ الْأَصَمِّ عَنْ أَبِي عَبْدِ اللَّهِ الْبَزَّازِ عَنْ حَرِيزٍ قَالَ: قُلْتُ لِأَبِي عَبْدِ اللَّهِ ع جُعِلْتُ فِدَاكَ مَا أَقَلَّ بَقَاءَكُمْ أَهْلَ الْبَيْتِ وَ أَقْرَبَ آجَالَكُمْ بَعْضَهَا مِنْ بَعْضٍ مَعَ حَاجَةِ النَّاسِ إِلَيْكُمْ فَقَالَ إِنَّ لِكُلِّ وَاحِدٍ مِنَّا صَحِيفَةً فِيهَا مَا يَحْتَاجُ إِلَيْهِ أَنْ يَعْمَلَ بِهِ فِي مُدَّتِهِ فَإِذَا انْقَضَى مَا فِيهَا مِمَّا أُمِرَ بِهِ عَرَفَ أَنَّ أَجَلَهُ قَدْ حَضَرَ فَأَتَاهُ النَّبِيُّ ص يَنْعَى إِلَيْهِ نَفْسَهُ‌  وَ أَخْبَرَهُ بِمَا لَهُ عِنْدَ اللَّهِ وَ أَنَّ الْحُسَيْنَ ع قَرَأَ صَحِيفَتَهُ الَّتِي أُعْطِيَهَا وَ فُسِّرَ لَهُ مَا يَأْتِي بِنَعْيٍ وَ بَقِيَ فِيهَا أَشْيَاءُ لَمْ تُقْضَ فَخَرَجَ لِلْقِتَالِ وَ كَانَتْ تِلْكَ الْأُمُورُ الَّتِي بَقِيَتْ أَنَّ الْمَلَائِكَةَ سَأَلَتِ اللَّهَ فِي نُصْرَتِهِ فَأَذِنَ لَهَا وَ مَكَثَتْ تَسْتَعِدُّ لِلْقِتَالِ وَ تَتَأَهَّبُ لِذَلِكَ حَتَّى قُتِلَ فَنَزَلَتْ وَ قَدِ انْقَطَعَتْ مُدَّتُهُ وَ قُتِلَ ع فَقَالَتِ الْمَلَائِكَةُ يَا رَبِّ أَذِنْتَ لَنَا فِي الِانْحِدَارِ وَ أَذِنْتَ لَنَا فِي نُصْرَتِهِ فَانْحَدَرْنَا وَ قَدْ قَبَضْتَهُ فَأَوْحَى اللَّهُ إِلَيْهِمْ أَنِ الْزَمُوا قَبْرَهُ حَتَّى تَرَوْهُ وَ قَدْ خَرَجَ‌ فَانْصُرُوهُ وَ ابْكُوا عَلَيْهِ وَ عَلَى مَا فَاتَكُمْ مِنْ نُصْرَتِهِ فَإِنَّكُمْ قَدْ خُصِّصْتُمْ بِنُصْرَتِهِ وَ بِالْبُكَاءِ عَلَيْهِ فَبَكَتِ الْمَلَائِكَةُ تَعَزِّياً وَ حُزْناً عَلَى مَا فَاتَهُمْ مِنْ نُصْرَتِهِ فَإِذَا خَرَجَ يَكُونُونَ أَنْصَارَهُ

The narrator says, I said to Abu Abd-Allah Imam Sadiq (عليه السلام), 

"May I be sacrificed for You, why is it that you the AhlulBayt (عليهم السلام) live such a short lives? Your deaths are so close to each other, even though people need you?"

The Imam said, "Indeed, each one of Us has a document which contains what he needs to act upon in his time. When that with with he was commanded is completed, he knows that his appointed time has come, so the Prophet (ص) comes to him, giving the news of his own death to him and informing him of what he has with Allah. 

And Imam Husain (عليه السلام) read his document which was given to him and the news of his death was explained to him, and there remained things in it which were not fulfilled, so He went out to fight. And those remaining matters which were not completed was that the angels had asked Allah to grant them permission to support al-Husain (عليه السلام) against his enemies which He granted them. They remained ready and prepared for it until Imam Husain (عليه السلام) was killed. The angels descended but his time was over and He was killed.

So the angels said, "Our Lord, You permitted us to descend and You permitted us to help him, so we descended, but You have taken him." 

So Allah revealed to them, "Remain at his grave until you see him come out, and then help him. And cry over him and over your missed opportunity of helping him, for indeed you have been assigned for helping him and for crying over him."

So the angels wept, consoling and grieving over what they had missed out in helping him. So when Imam Husain (عليه السلام) comes, they will be his supporters.'"

[Source: al-Kafi, Vol. 1, Pg. 283-284]