ON Tuesday, the UK Supreme Court, in a unanimous decision, put an end to Boris Johnson ’s little experiment in the arbitrary prorogation of Parliament .

The next day Parliament resumed its sitting; the attempt to subvert parliamentary democracy was, for the time being, thwarted.

On first glance, the Supreme Court’s decision looks like an assertion of judicial strength.

It could even be interpreted as a sign of the vitality of the unwritten constitution. In times of grave institutional turmoil, when self-restraint has been abandoned and the conventions on which the whole system depends are no longer honoured, an emboldened judiciary can step into the breach. It can discern, in the common law, constitutional principles of parliamentary democracy that protect us from the most egregious misuse of prime ministerial power.

READ MORE: Karin Goodwin: Lady Hale knows being an ex-barmaid isn't to be sniffed at

Yet the fact remains that the Supreme Court is an exceedingly vulnerable institution. In taking the bold step it did, it has put its head above the parapet. Within a few hours pot-shots were already being taken.

“Sources close to the Prime Minister” made snide remarks casting doubt upon the independence, integrity and credibility of the judiciary.

Some Tory MPs suggested that the Supreme Court should be abolished – to be put on the constitutional chopping block along with the Human Rights Act and possibly the Scotland Act too – after a General Election.

This does not happen in normal, healthy constitutional democracies. That is because in most countries, the Supreme Court owes its existence not to a bare parliamentary majority that can create and destroy at will, but to a written constitution that can be amended only by special super-majoritarian procedures.

Likewise, a Bill of Rights would be embedded in a constitution and not capable of being discarded when politically convenient by a well-whipped government majority.

But we have no such guarantees. All the foundations of parliamentary democracy stand just one vote away from oblivion.

The sovereign parliament giveth and the sovereign parliament taketh away.

While the Supreme Court may have interpreted parliamentary sovereignty in expansive and novel ways, it has nevertheless reaffirmed the absolute dependence of all our rights and institutions upon the parliamentary majority.

To say, therefore, that parliamentary sovereignty is a cornerstone of the British constitution is almost a contradiction in terms. Sovereign power is, by definition, not constitutionally constrained power.

The primary aim of this column is not to chronicle the terminal decline of existing constitutional arrangements within the United Kingdom. That would be a passive, negative exercise. I’m more interested in looking to the future – using the UK’s current constitutional woes as an object lesson in how to do things better in an independent Scotland.

So let us now turn to examine the role, powers and composition of an apex court in any future Scottish constitution.

The first thing to say is that under a written constitution, which serves as the supreme and fundamental law, the highest courts would have to ensure the supremacy of the Constitution over any statute that is repugnant to it.

READ MORE: Gerry Hassan: No quick fix for crisis gripping UK democracy

In Scotland, the courts already perform this role in relation to Acts of the Scottish Parliament – as most famously demonstrated by the AXA case in 2011.

There would be a shift in the locus of sovereignty (from the Westminster Parliament to the people of Scotland), but there need be little change, in principle, to the process by which the constitutionality of Acts of the Scottish Parliament might be challenged.

Secondly, there must be a mechanism for judicial appointments that combines neutrality and independence with professional quality, while not ignoring things such as balance and inclusivity.

For that purpose, the constitutions of many countries establish a Judicial Service Commission (or similar body) with a mandate to control the selection and appointment of judges. Such a body exists in the Judicial Appointments Board for Scotland.

I’m not suggesting it is a perfect arrangement, but that it is good enough to be constitutionalised, and so protected against attempts by any future government to undermine it.

Thirdly, judicial tenure of office must be safeguarded, while also having a mechanism in place that can, if necessary, enable the removal of a judge on grounds such as neglect of duty or misbehaviour.

This might involve some combination of an assessment by an independent tribunal, followed by a parliamentary vote – as it does under section 95 of the Scotland Act.

The details might be quibbled over, but the essential thing is that these rules be elevated, in an independent Scotland, above the reach of ordinary majorities.

They should not rest on mere Acts of Parliament, but on a constitution that cannot easily be changed by the government of the day.

A strong, respected, independent judiciary is fundamental to a well-functioning democracy. These principles should accordingly be recognised and protected in the future constitution.