It is narrated that when the Commander of the Faithful Ali Ibn Abi Taleb (peace be upon both of them) was about to die on the twenty first of the month of Ramadan on the year 40 AH, after being betrayed by the most miserable of the wretched "Ibn Muljam Al-Muradi" who has striked Imam Alī with a poisoned blade to the back of the head while he was about to get up from his prostration when leading dawn prayers in the Great Mosque of Kufa. He (peace be upon him) gathered the members of his family and recommended his elder son Imam Al-Hassan (peace be upon him).
Al-Zarandi narrated: When Imam Ali (peace be upon him) was about to die, he asked for inkwell and paper and asked this will to be written:
In the name of Allah , the Entirely Merciful, the Especially Merciful.
I advise you to fear God, and not to pursue this vicious world even though it may try to entice you. Do not seek it though it may seek you and do not grieve over and long for things which this world refuses you. Always speak the truth, and work constantly for the eternal reward and blessings of God. Be an enemy of tyrants and oppressors and be a friend and support of those who are oppressed. To you, to my other children, to my relatives and to all who receive these words of mine, I advise to fear God and to be pious, to have fair and honest dealings with one another and improve mutual relations because I have heard your grandfather, the Prophet Mohammad (Allah's prayers be upon him an dupon his holy Household) often say: “To remove mutual enmity, ill-feeling and hatred among people is better than all the prayers and fasting of many years.”
Fear God when the question of helpless orphans arises. You should not let them be full some time and hungry some other times. So long as you are there to guard and protect them, they should not be ruined or lost. Fear God with respect to your neighbors, for your prophet constantly enjoined us to be good to the neighbor, so much so that we thought that he may even decree that they had the right to inherit from us. Fear God in respect of the Holy Qur’an, lest others should excel and surpass you in following its tenets and in acting according to its orders. Fear God so far as prayers are concerned because prayers are the pillars of your religion.
Fear God in the matter of His House (Ka’bah). Let it not be deserted because if it is deserted, you (the Muslims) will be troubled with chastisement. Fear God in the matter of struggle in the path of God with your properties, lives, and tongues. Develop mutual liking, friendship and love and help one another. Take care that you do not spurn and treat one another badly and unsympathetically. Exhort people to do good and abstain them from evil, otherwise the vicious and the wicked will be your overlord and if you willingly allow such persons to be your rulers then your prayers will not be heard by God. O sons of ‘Abd al-Muṭṭalib: Let there be no retaliation for the act of my murder, except against the individual who committed the act. Do not seek vengeance against the community of Muslims under the slogan “The Commander of the Faithful has been murdered” nor inflict any harm on anyone, save my murderer. If I should die because of his strike against me, then strike him with a sword a single time, as he did to me. Do not mutilate or torture the man, for I have heard the Prophet of God (may the peace and blessings of God be upon him and his family) say: “Never mutilate or torture any living being, even if it be a vicious dog.”