Prisoners at risk of being homeless offered more help
Prisoners at risk of becoming homeless on leaving jail are to be given more support to find a secure home, amid concern about their rehabilitation.
Communities Minister Lesley Griffiths said planning would start two months before an inmate was due for release.
Shelter Cymru welcomed the introduction of measures to prevent homelessness.
Campaigners have voiced frustration that prison leavers are still being housed in B&Bs a year after a woman was killed by a homeless ex-offender.
A review is taking place into the mental health support given to Matthew Williams, 34.
He died following his arrest for attacking Cerys Yemm, 22, at the Sirhowy Arms Hotel in Argoed, Caerphilly county, in November 2014.
Ms Griffiths said the national pathway was the first of its kind in the UK and was set up following the Housing (Wales) Act, which gives local authorities a duty to prevent homelessness.
It clarifies and co-ordinates the roles and responsibilities of all authorities involved with people leaving custody.
"Wales has been recognised for the forward-thinking approach we have taken to preventing homelessness," said Ms Griffiths.
"The National Pathway puts us ahead of the rest of the UK in terms of our efforts to prevent prison leavers from becoming homeless or ending up in B&Bs.
"The Pathway is already being used by some organisations, with very positive results."
Jennie Bibbings, campaigns manager for Shelter Cymru, said the introduction of homeless prevention services into prisons was a step in the right direction.
But she said ministers had a "huge task" on their hands co-ordinating the work of all the agencies involved.
"Some prison leavers still aren't getting their homelessness dealt with in a timely way," she said.
"We're concerned that they no longer have priority for accommodation from local authorities - they have to prove they are vulnerable," she added.