Williams, 22, will officially join on July 1 and follows the arrival of Cambridge United right-back Kyle Knoyle and Portsmouth midfielder Ben Close.
The pacy centre-back, who started his career at Manchester United, was among 12 players released by the Shrews at the end of last season, having been a regular alongside Aaron Pierre and Ethan Ebanks-Landell.
The Manchester-born player, who has represented England at under-19 level, made 47 appearances in all competitions last term for the Shropshire outfit.
The former Old Trafford academy graduate famously broke Darren Campbell’s 100m schoolboy record back in 2014, recording a time of 10.99 seconds to smash a figure that had stood for 25 years.
On joining Rovers, the 6ft 2in defender, who made 97 appearances for the Shrews in all competitions, said: “The club showed interest in me and with the manager (Richie Wellens) coming in the talks progressed, once we’d spoken I just wanted to get the deal done.
“The manager played a big role in me wanting to come here, he’s got big plans and his ambition matches mine.
“He said a lot of good things and he feels he can improve me, he wants hardworking, humble players which is what I think I am.”