The Risala of al-Shafii is usually described as the first systematic treatment of the sources of Islamic law, and the description holds if it is read as an argument rather than as a textbook. The problem it addresses is that jurists in different cities were reaching different rulings and justifying them in incompatible ways: by the practice of their own city, by the opinions of Companions, by their own sense of what was reasonable.
The Risala answers with an order of priority. The Quran comes first. The sunna of the Prophet, established by authenticated reports, comes second, and is not subordinate to the Quran but explains and supplements it, so a ruling may rest on a hadith even where the Quran says nothing. Consensus comes third. Analogy, qiyas, comes fourth and is the only legitimate form of independent reasoning: a jurist extends an existing ruling to a new case by identifying the reason behind it, and may not simply prefer an outcome.
Two exclusions do as much work as the inclusions. Al-Shafii rejected the practice of a city as a source in its own right, which is where he parted from the Maliki tradition, and he attacked istihsan, juristic preference, as reasoning without a rule, which is where he parted from the Hanafis. Whether he single-handedly created Islamic legal theory or gave a name and an order to a synthesis already under way is a live question in the modern field, and the second reading now has rather the better of it.
Sources Al-Risala fi Usul al-FiqhMuhammad ibn Idris al-Shafii with The Canonization of Islamic Law: A Social and Intellectual HistoryAhmed El Shamsy