Question: When did the science of Uṣūl al-Fiqh appear? And likewise the science of Uṣūl al-Dīn?
Answer (and Allah is the Grantor of success): The science of Uṣūl al-Fiqh has been manifest since the era of the Companions. As for the science of Uṣūl al-Dīn, the Commander of the Faithful Imam ʿAlī ibn Abī Ṭālib (Peace be Upon Him) spoke about the principles of Uṣūl al-Fiqh, as found in Nahj al-Balāghah. He mentioned the narrators of ḥadīth and divided them into several categories, and he mentioned the general and the specific, the abrogating and the abrogated, and he said: “Let no one give fatwā to the people except one who knows the abrogating and the abrogated, and the general and the specific, and so on.”
The Imams of the Ahl al-Bayt mentioned the principles of Uṣūl al-Fiqh in their books. Al-Hādī Yaḥyā ibn al-Ḥusayn spoke about analogical reasoning (qiyās), causes (ʿilal), and the conditions for the validity of analogy in al-Majmūʿah al-Fākhirah. He also spoke about the Sunnah, the mass-transmitted (mutawātir) reports, and solitary (āḥād) reports; he spoke about consensus (ijmāʿ), about definitive and speculative issues, about the consensus of the Ahl al-Bayt, and about the authority of the Commander of the Faithful Imam ʿAlī (Peace be Upon Him).
Likewise, with respect to Uṣūl al-Dīn, the book Nahj al-Balāghah—most of it—consists of the foundations of religion.
Yes, the principles of Uṣūl al-Fiqh were scattered. When the era of codification arrived, the scholars recorded them and gathered them into a book. The first to codify them, as they say, was Imām al-Shāfiʿī, may Allah have mercy on him.
And after that, it is impossible for one ignorant of the principles of Uṣūl al-Fiqh to know the laws of what is lawful and unlawful and the rest of the rulings. How can one ignorant of the science of Uṣūl al-Fiqh and its principles know that the form of command in one place indicates obligation, in another recommendation, in another permissibility, or threat, and so on?
The forms of prohibition are likewise: he cannot distinguish between one form and another. Whoever does not know the specific and the general—how can he distinguish between general and specific laws? Whoever does not know specification—what will he do when the general and the specific conflict?
Whoever does not know preference (tarjīḥ) and its causes—what will he do when evidences and indications conflict? Whoever does not know abrogation and what is connected to it—what will he do when the abrogating and the abrogated conflict?
Whoever does not know linguistic subjects—how will he be guided to the meanings of metaphor and literal usage, explicit texts and apparent meanings, indications by implication and allusion, and the concepts of discourse?
Whoever does not know the mujmal and the mubayyan and what is connected to them—how will he be guided to acting upon them?
Whoever does not know the rulings of analogy—how will he be guided to knowing rulings that are almost countless?
And so on, and so on.
And after all this, the reference point of most principles of Uṣūl goes back to language: the chapter of generality and specificity is linguistic; likewise the absolute and the restricted; the chapter of explicit and implied meaning is linguistic; the mujmal and the mubayyan are linguistic; the chapter of literal and metaphorical usage is linguistic; and the chapter of commands and prohibitions is linguistic.
Source: Min Thimār al-ʿIlm wa al-Ḥikmah vol.3