Play of a game and it's expertise comes from it's rules. In any game, the rules form it's axioms and there are no violations to them. In the game of life, there are no violations to it's basic rules of physics as no one can bypass it. At behavioral level, they are extremely complex, we as humans can approximate that any possibility comes under the realm of physics. Any rule designed above it is not enforced by nature and is imperfect, so it has to be enforced by responsible humans.
One will not kill another human. For enforcing this rule, a group of people, let's call them police, have to be made responsible for penalizing violations. In this system everything is done by police. They classify people who die naturally, from those who were killed. They agree upon a penalty to violation of this rule along with everyone. There are false positives, like innocent who are thought to have committed taking the life of another and killers who're roaming free since they cunningly hid the information and enforcing is imperfect. Since the innocents are way more than guilty, disbelieving the truth mistakes would be sufficiently large. If there are many rules, say 100, making these group of people understand those rules, procedure of their enforcement and how the rules in turn affect one another is a gigantic task. This is the reason why any system with a large set of rules above evolution will be extremely inefficient and unjust, as those wielding power will have major power over don't. This would degrade the life of an average human within the system.
Law arises as a result of having superior survival characteristics as that of having support of a large number of people. Rigveda, an old Indian law book, as it relied on Sanskrit has books which augment it namely Rigveda Bhashya which defines what words have what meanings like a dictionary and Rigveda Bhashya Bhumika which more or less defines Geography of those times. In Indian context, we can clearly visualize what the word 'mobile' would've meant 100 years ago and today. 100 years ago, it would mean something which can be moved but today, one cannot think of anything other than cell phones.
Since no one can violate physics, it would be fair to everyone. However, ideas, like that of government, after their mere mention and that by John Maynard Keynes of centrally managing money are extremely detrimental. They are best kept within one's head and never blurted out. When someone isn't aware of some idea of preserving power, the system is much more fair but once such a system which preserves power through suppressing is implemented, it gets much more difficult to reverse it.
An ideal law system will improve the life of an average living thing, typically thought as a group of plants and animals above a certain degree of biological complexity say like those which have a brain or a biological mechanism for signalling pain. For enforcing the principle of Swarajya, i.e. enforcing our own decisions in our life, a being should be able to keep secrets like those of protecting his business secret, protecting himself from leaks of visuals while bathing, etc. for preserving respect, which implies he/she should own their home and body completely, i.e. no one should be able to say insert some virus and threaten death and no one should be able to bug their intimate areas. This in turn implies having safe consumables like those of food and medicines.
Thinking of a crime is not evil, doing is, since the brain is their property. They can think whatever they want to. Thus, a person who has nuked the whole world in his thoughts is not a criminal. If he merely ends up being in a bad scenario, law should be able to protect him. A lot of people have many evil thoughts. Thus unmeasurable intentions should be less of a factor in law. Even words which don't have much long term effect on society hardly are evil. The issue of designing such a law is that all patterns which can be predicted can be weaponised. For any known imperfectly implemented rule, the systematic distrust evolves further to make the game fair. Say, there is some hypothetical country where theft is not illegal, then the people initially would be unhappy that their stuff is stolen but they'd evolve to understand that theft is common and they'd develop tactics against it by having traps and themselves stealing from the others. Since everybody assumes theft is a normal part of life there, the system is fair.
Thus, law must define clearly what is a criminal(someone who breaks any law) while preserving that a person can earn a living. Men form a system according to words of law which in turn incentivizes men who would be selected in future in the system and thereby ensure justice. A civilian in the system must understand ideally, what are his/her acceptable tactics and strategies with which he can potentially climb the decided upon social order and whether he's a criminal or not. Intentions are invisible and there is some leeway for judges to decide the sentence based on their crime based on probability. But the system cannot be designed in a way that always, the judge would be ideal thereby placing absolute trust in the judge. Ultimately, choices are subtler forms of discrimination and in each action, there is some leaning towards imbalance. One can only prevent stronger imbalances by law and at one point one has to stop and recognize that it's too subtle to the point of being a normal action and rely on ethics of people and people defending themselves. When such subtlety is criminalized, normal action for earning a living become criminal which is unacceptable!
10th October 2022
P.S. I haven't read any philosophies of law and I cannot care less of reading a million pages of 100 philosophers before me to conclude possibly that some philosopher has already said this.