Williams, 34, will then take on an ambassadorial role with the Welsh region for an initial two-year period.
Williams retired from Test rugby in December after winning 87 caps and scoring a Wales record 58 tries.
Williams' current Ospreys contract was not due to expire until the end of the 2012-13 season, but agreement has now been reached on a new arrangement.
In addition to his new Ospreys role, Williams will take up a similar post with long-term Ospreys partners the Cuddy Group, plus his media commitments and personal business interests.
Williams said: "My future with the Ospreys was never in doubt.
"Things like this take time to sort out, but I am just delighted that I'm going to continue being a part of the region I love, the Ospreys."
And Ospreys managing director Mike Cuddy added: "Shane has been a tremendous servant to the region throughout his long career, and I've no doubt whatsoever that he can be an even bigger success off the field than he was on it.
"I'm looking forward to working closely with Shane the businessman for the next 15 years, just as I have with Shane the rugby player for the last 15."
Williams was named the International Rugby Board's player of the year in 2008, while he was also a Test Lion, helped Wales win Six Nations Grand Slams in 2005 and 2008 and featured in three World Cup campaigns.
He made his Test debut against France during the 2000 Six Nations tournament, and toured with the Lions to New Zealand in 2005 and South Africa four years later.
Gilbert has released a new line of rugby cleats. The Gilbert Virtuo 8S is part of the exciting new product. Check it out.
The entire All Blacks apparel line has been updated for 2013/14. Check out the New Zealand All Blacks polo.
The Nike Tiempo is a solid rugby cleat and one of few styles still made from full-grain natural leather.
The Gilbert Blitz 8S rugby cleat is a great cleat at a great price of $69.99. Get a new pair of cleats today.
A cool looking all black rugby cleat with the high performance adidas is known for. Get in the Gear!
Wear the crest of the British and Irish Lions on your t-shirt. A great look for the summer.
$29.99
The All Blacks Performance t-shirt is black with hints of blue from the training jersey. Very Cool.
The New Zealand All Blacks training jersey for 2013/14. Get in the Gear!
The USA Rugby Pro Alternate rugby jersey is perfect for any fan of the Eagles. Get yours to wear during the summer Test matches.
The NEW All Blacks 2013/14 jersey has arrived at World Rugby Shop. Dare to wear the colors of the All Blacks.