Labour will only win again if we learn the right lessons from our devastating defeat. First, deal with weaknesses early and decisively. We were collectively negligent in not adequately addressing the view that our excessive spending and borrowing caused the deficit. Beyond the deficit, we should have been more robust in defending our record. If our 13 years were to be falsely defined as mediocre, why should we be given another chance after only five years? We took too long to agree necessary new policies on immigration, welfare, low pay and corporate tax dodging.

Second, define our overall message and keep repeating it. For too long we had a collection of individual policies, not an overall message of how Labour would be different.

Third, we must resist the temptation to make false choices between different groups of voters. Whether it is middle class or working class, English or Scottish. To win again, Labour must build a mainstream majority of support which reaches out to people who would view themselves in all of those categories.

It is right that our failure to explain our plan for wealth creation and set out how we were going to create the jobs of the future left a big hole in our story. We should have sought a partnership with business rooted in rights and responsibilities. By focusing much of our rhetoric on the top 2% and the bottom 10%, the squeezed middle felt we were silent on their ambitions and insecurity.

We have to address these issues, but also the alienation working-class potential Labour supporters feel from the political elite. This alienation in Scotland started small many years ago but culminated in the carnage of this election. Of course, the alienation is partially about low pay, job insecurity and immigration, but it is also about much more than that.

Perhaps the greatest challenge facing us in the years ahead will be our capacity to keep the United Kingdom together

We must have zero tolerance of Labour MPs and councillors who attend parliament and the town hall but fail to work hard in their local communities. We must promote leaders and spokespeople who reflect a broader range of backgrounds. We cannot split the difference between a centralised state and devolution of power and resources. Instead, we must be unequivocally in favour of maximum devolution to local government and communities. The nature of families, faith and community may have changed, but remain the bedrock of many people’s lives. Public services like the NHS and schools need investment and valued staff but also a louder voice and greater control for patients and parents.

Perhaps the greatest challenge facing us in the years ahead will be our capacity to keep the United Kingdom together. Ensuring the majority in all parts of our country feel they are getting a fair deal and combining head and heart in a patriotism that can defeat nationalism. One-nation Labour could have been the vehicle to make this case and win the argument. Sadly, it was allowed to wither, written off as a failed brand when it was meant to be a project every bit as profound as the development of New Labour.

David Cameron’s appalling but sadly politically effective divide-and-rule approach to the union leaves a vacuum that Labour should fill. If he is unwilling to do so, we should proceed with our proposed constitutional convention. This should provide a strong voice for Northern Ireland and Wales as well as England and Scotland. It should consider all options including a federal state.

Finally, it would be wrong to elect a leader without allowing sufficient time for a serious debate about what needs to change. This requires our leadership election to take place in September. There is no need for us to repeat the mistakes of 2010. Shadow cabinet members should be expected to hold the government to account and rebut Tory attacks.

The criteria I will apply to my choice of leader will be: who is likely to command maximum public support as a potential prime minister against a new Tory leader? Ideology matters, and most definitely a willingness to be straight with the party and electorate about the lessons that need to be learned, but so does the ability to connect emotionally with the electorate.

Unlike some, I don’t believe those who have served as special advisers should be disqualified. However, all candidates must demonstrate a willingness to build a diverse team. Closed cliques – whether advisers who served during the Blair-Brown years, or 2010-intake MPs – are unhealthy and will lead to poor decisions and further public alienation.

It is the Tories, not we, who are the “born to rule” party. We need the right leader supported by the right team to take the fight to the Tories and win the argument about the future. We can do it – but only if we learn the right lessons from the past.