Yu Ningji (庾凝績) was an official of the Chinese Five Dynasties and Ten Kingdoms period state Former Shu, serving as the director of palace communications (Shumishi) during the late reign of its founder Wang Jian (Emperor Gaozu), and continuing to be powerful early in the reign of Former Shu's next and last emperor Wang Zongyan.
Little is known about Yu Ningji's family background, other than that he was a younger second-cousin of the more well-known Former Shu official Yu Chuansu, who served as a chancellor during the reigns of both of Former Shu's emperors, Wang Jian and Wang Zongyan.
During Wang Jian's reign
At one point during Wang Jian's reign, Yu Ningji became an imperial scholar (翰林學士, Hanlin Xueshi). By 917, he was serving as the chief imperial scholar (翰林學士承旨). In the fall that year, the powerful eunuch Tang Wenyi (唐文扆) accused then-director of palace communications Mao Wenxi of overreaching, Wang Jian exiled Mao and replaced him with Yu on an acting basis. Later in the year, Wang Jian officially made Yu director of palace communications, and also made him the minister of civil service affairs (吏部尚書, Libu Shangshu). When Wang Jian became deathly ill in summer 918, Wang Jian, after exiling Tang after accusations by his adoptive son Wang Zongbi, whom he was intending to entrust his son and crown prince Wang Yan to, that Tang was intending to seize power, put Yu in charge of matters of finance, civil service, and justice, while putting the eunuch Song Guangsi in charge of military dispatches. Shortly before his death, he further made Song director of palace communications — while the historical records were silent as to whether, simultaneously, Yu remained as director of palace communications as well, or whether Yu was relieved of that post and only serving as minister of civil service affairs. After Wang Jian's subsequent death, Wang Yan took the throne as emperor. Wang Jian's last edict, naming the officials whom he entrusted the new, young emperor to, did not name Yu among the officials. (The ones named were Song and Wang Zongbi, as well as Wang Jian's other adoptive sons Wang Zongyao (王宗瑤), Wang Zongwan (王宗綰), and Wang Zongkui (王宗夔).)
During Wang Yan's reign
However, whether Yu Ningji remained as director of palace communications or not, he remained in charge of matters of justice, for it was apparently he who oversaw the subsequent demotion and punishment of the chancellor Zhang Ge, a major political ally of Tang Wenyi's, after Tang was executed shortly after Wang Yan took the throne. It was Yu who proposed to exile Zhang to Heshui Base (合水鎮, in modern Ngawa Tibetan and Qiang Autonomous Prefecture, Sichuan). He further ordered Gu Chengyan (顧承郾), the prefect of Mao Prefecture (茂州), which Heshui belonged to, to spy on Zhang, hoping further chances to accuse Zhang. After Gu declined to do so (after being warned by the wife of the general Wang Zongkan (王宗侃), who was also an adoptive son of Wang Jian's, that doing so exposed Gu himself to reprisals later as well), Yu found an excuse to punish Gu. That was the last historical reference to Yu, and it was not known when he died.