The true commandment is "Thou shalt not murder".
It doesn't say "kill" in the original language.
Killing is a whole different thing from murder.
Moses didn't provide different catagories for murder, some worse than others.
Self defence isn't a transgression.
Defence of the innocent is required. They give medals for defence of the innocent.