NOW that the independence referendum is firmly on the backburner after the SNP’s General Election setback, Nicola Sturgeon is being urged to get back to the day job. But anyone who thinks she’ll concentrate all her attention on education and health has another thing coming.

Tomorrow’s Queen’s Speech and the Great Repeal Bill (GRB) will open two years of the most detailed constitutional wrangling

The GRB, which everyone managed to forget about during the General Election, will repatriate all the multifarious powers that have accrued to Brussels over the past 40 years and translate them into UK law. It will then, and only then, distribute competences back to the devolved administrations. At least, this is the intention of the UK Government and the Brexit Secretary, David Davis.

Legal experts like Professor Alan Page of Dundee University warn that this is going to eat up the energies, not just of the UK civil service but also the Scottish Government. It is a massive task.

Take the environment. New agencies will have to be set up to replace the European Environment Agency that sets policy for the whole of the community. The Common Agricultural Policy (CAP), which consumes up to 40 per cent of the EU budget, will be replaced by a common UK agricultural policy.

Then there is the question of Holyrood’s constitutional standing post-Brexit. Before the referendum was announced in March, the Scottish Government claimed that the draft GRB represented an unacceptable Westminster “power grab”.

Powers over fishing, farming, environment and justice, said Ms Sturgeon, should go direct to Holyrood, as per the Scotland Act.

At least, such is the Scottish Government’s interpretation of Schedule 5 of the Scotland Act, 1998. It is clearly not the way the Brexit Secretary, David Davis, sees it. As far as the UK Government is concerned, sovereignty resides at Westminster and did not ever leave it. The Scotland Act 2016 helpfully states that Westminster will not “normally” legislate in such a way as to cut across Holyrood’s powers. Brexit is not normal. So, you’ll have had your legislative consent.

Scotland is being assured that more powers will be devolved to Holyrood but there is no certainty about this, let alone about the money. Under the CAP, Scottish farmers receive around £400 million in support payments.

Under the new UK-wide agricultural policy, decisions will have to be taken about whether or not these subsidies continue at their present rate. Scotland receives around 17 per cent of all the CAP payments to UK farmers.

Under the Barnett formula, if that is what determines the level of subsidies in future, that could be nearly halved.

This will of course be subject to negotiation and the Scottish Government is going to have to put together a negotiating team capable of arguing its case line by line. In many ways, the issue of Scottish independence, being a binary choice, was a simpler matter to deal with. The GRB will also force the SNP leader to defend devolution rather than proselytise about independence.

But the Scottish Government’s hand has been strengthened by the General Election and the failure of Theresa May to win her “strong and stable” mandate.

The negotiations with the European Union, which were supposed to be about playing hard ball with Brussels bureaucrats, have turned into an exercise in compromise and fudge.

No longer can the Prime Minister convincingly argue that no deal is preferable to a bad deal; the UK is now looking for the least worst deal it can get.

And when it comes to a legislative consent motion on the GRB, which everyone seems to agree will have to happen eventually, Holyrood may be in a position to win concessions. Under the Sewel convention, Holryood has to give consent for its powers to be altered by Westminster.

If the Scottish Parliament refuses to endorse the GRB, then it is up to the House of Commons either to change the legislation or overturn Holyrood’s consent motion.

If the Tories had a 100-seat majority, this would have been pretty straightforward.

But now that the UK Government has no majority at all it will be more difficult to tell Holyrood to get lost.

Labour MPs and, whisper it, the Democratic Unionists, might opt to side with the Scottish Parliament and refuse to overturn a Scottish legislative consent motion.

That would be a very interesting constitutional problem, the solution to which is beyond my knowledge of constitutional law.

But what we do know is that both Holyrood and Westminster are going to be fully occupied with negotiating the GRB for the next two years.

It will be an exhausting process during which the United Kingdom constitution will be remade.

And make no mistake: the present devolution settlement, with sovereignty divided between Holyrood and Westminster, could be the first casualty.