Al-Kāfi

Hadith 1038
twelve-imamsdawud
4ـ مُحَمَّدُ بْنُ أَحْمَدَ عَنْ مُحَمَّدِ بْنِ خَالِدٍ عَنِ النَّضْرِ بْنِ سُوَيْدٍ عَنْ يَحْيَى الْحَلَبِيِّ عَنْ عِمْرَانَ بْنِ أَعْيَنَ عَنْ جُعَيْدٍ الْهَمْدَانِيِّ عَنْ عَلِيِّ بن الحسين (عَلَيْهما السَّلام) قَالَ سَأَلْتُهُ بِأَيِّ حُكْمٍ تَحْكُمُونَ قَالَ حُكْمِ آلِ دَاوُدَ فَإِنْ أَعْيَانَا شَيْ‏ءٌ تَلَقَّانَا بِهِ رُوحُ الْقُدُسِ.
4. Muhammad ibn Ahmad has narrated from Muhammad ibn Khalid from al-Nadr ibn Suwayd from Yahya al-Halabi from ‘Imran ibn A‘yan from Ju‘ayd al-Hamadani who has said the following. “Once I asked Ali ibn al-Husayn (a.s.), “By what mean do you issue judgments?” The Imam (a.s.) said, “We judge by the laws of Allah and the judgment of the family of David. If a case would frustrate us the Holy Spirit inspires us with its laws.”
Source: Shaykh Muḥammad b. Yaʿqūb al-Kulaynī