Machiavelli's Il Principe (c.1513) was far from innovative. Writers since classical times had produced works that explained the proper behavior—or improper behavior—of rulers. The genre was called specula principum, or "mirrors for princes." These took the form of instruction books, often aimed at a young ruler who was just coming into power, or could be biographies of rulers who should (or should not) be emulated.
The reign of Charlemagne seems to have motivated the desire to "raise the bar" for rulers and inspired many writers to produce mirrors for their local rulers in the 9th century. Charlemagne's life was, of course, the example to be followed as far as Einhard's Vita Karolini (Life of Charles) was concerned. No one wanted to see the Carolingian empire suffer after Charlemagne's demise, and so his descendants had no lack of advice. His son Louis the Pious was the target of one speculum by Smaragdus of Saint-Mihiel; Louis' son Pepin I of Aquitaine was the target of one by Jonas of Orléans; Louis' grandson Lothair II of Lotharingia was addressed by Sedulius Scottus in a work called "On Christian Rulers."
Alcuin of York, a prolific writer and famous teacher, wrote De virtutibus et vitiis (On virtues and vices, c.799) for Count Wido of Brittany. A friend of Alcuin's, whom he met at Charlemagne's school in Aachen, was Paulinus of Aquileia who wrote the Liber exhortationis (Book of exhortations, 795), for Count Heiric (Eric) of Friuli. Paulinus (c.730-802) had been born in the Friuli region of northeast Italy and he and Heiric were friends, so he felt entitled to tell Heiric a thing or two, including advising him to free his slaves. (Having slaves was common.) Paulinus also wrote an elegy when Heiric was killed in 799.
Mirrors for princes were popular right through the Renaissance by scholars who felt qualified to give advice to powerful men. We know of ones that were written for the future Henry VIII (by John Skelton; a copy exists in the British Museum), for King Charles V of Spain (1516, by Erasmus), for King Christian IV of Denmark-Norway (1597, by Johann Damgaard), and King James I of England wrote one for his eldest son, Henry, who died of typhoid at 18; maybe Charles I read it when he ascended the throne.