Records of the Three Kingdoms
Wei Yan, courtesy name Wenchang, was from Yiyang. He entered Shu with Liu Bei as a subordinate commander and won repeated merit. When Liu Bei became king of Hanzhong, people expected Zhang Fei to hold it. Liu Bei used Wei Yan. Wei Yan said that if Cao Cao brought the whole realm he would hold it for the king, and if a subordinate brought a hundred thousand he would swallow them.
On the northern campaigns he proposed splitting the army out of the Ziwu valley straight at Chang’an. Zhuge Liang refused. In 234, after Zhuge Liang died, Wei Yan and the chief clerk Yang Yi each accused the other of rebellion. Yang Yi had Ma Dai kill Wei Yan, and the three clans were exterminated. Chen Shou says Wei Yan’s courage exceeded other men’s and his temper was proud. Whether the Ziwu proposal would have worked is still argued.
Romance of the Three Kingdoms
The bone of rebellion is the mark the novel plants in Wei Yan from the start. Zhuge Liang leaves a sealed order. Yang Yi lures Wei Yan into shouting “who dares kill me,” and Ma Dai kills him from behind.
A feud between colleagues becomes fate. In the novel the Ziwu plan is the evidence that he was not trusted.
Reference: Wikipedia · Wei Yan