First, the Dark Arts are, as the name implies, an art, not a science. Likewise, defending against them is. An artful attacker can utilize expected defenses against you; if you can be anticipated, you can be defeated. The rules, therefore, are guidelines. I'm going to stage the rules in a narrative form; they don't need to be, however, because life doesn't follow a narrative. The narrative exists to give them context, to give the reader a sense of the purpose of each rule.
Rule #0: Never follow the rules if they would result in a worse outcome.
Now, generally, the best defense is to never get attacked in the first place. Security through obscurity is your first line of defense. Translations of Sun Tzu vary somewhat, but your ideal form is to be formless, by which I mean, do not be a single point of attack, or defense. If there's a mob in your vicinity, the ideal place is neither outside it, nor leading it, but a faceless stranger among it. Even better is to be nowhere near a mob. This is the fundamental basis of not being targeted; the other two rules derive from this one.
Rule #1: Do not stand out.
Sometimes you're picked out. There's a balancing art with this next piece; you don't want to stand out, to be a point of attack, but if somebody is picking faces, you want to look slightly more dangerous than your neighbor, you want to look like a hard target. (But not when somebody is looking for hard targets. Obviously.)
Rule #2: Look like an unattractive target.
The third aspect of this is somewhat simpler, and I'll borrow the phrasing from HPMoR:
Rule #3: "I will not go around provoking strong, vicious enemies" - http://hpmor.com/chapter/19
The first triplet of rules, by and large, are about -not- being attacked in the first place. These are starting points; Rule #1, for example, culminates in not existing at all. You can't attack what doesn't exist. Rule #1 is the fundamental strategy of Anonymous. Rule #2 is about encouraging potential attackers to look elsewhere; Rule #1 is passive, and this is the passive-aggressive form of Rule #1. It's the fundamental strategy of home security - why else do you think security companies put signs in the yard saying the house is protected? Rule #3 is obvious. Don't make enemies in the first place, and particularly don't make dangerous enemies. It has critical importance beyond its obvious nature, however - enemies might not care if they get hurt in the process of hurting you. That limits your strategies for dealing with them considerably.
You've messed up the first three rules. You're under attack. What now? Manage the Fight. Your attacker starts with the home field advantage - they attacked you under the terms they are most comfortable in. Change the terms, immediately. Do not concede that advantage. Like Rule #1, Rule #4 is the basis of your First Response, and Rule #5 and Rule #6. The simplest approach is the least obvious - immediate surrender, but on your terms. If you're accused of something, admit to the weakest and least harmful version of that which is true (be specific, and deny as necessary), and say you're aware of your problem and working on improving. This works regardless of whether there's an audience or not, but works best if there is an audience.
Rule #4: Change the terms of the fight to favor yourself, or disfavor your opponent.
Sometimes, the best response to an attack is no response at all. Is anybody (important) going to take it seriously? If not, then the very worst thing you can do is to respond, because that validates the attack. If you do need to respond, respond as lightly as possible; do not respond as if the accusation is serious or matters, because that lends weight to the accusation. If there's no audience, or a limited audience, responding gives your attacker an opportunity to continue the attack. If there's a risk of them physically assaulting you, ignoring them is probably a bad idea; a polite non-response is ideal in that situation. (For crowds that pose a risk of physically assault you... you need more rules than I'm going to write here.)
Rule #5: Use the minimum force necessary to respond.
It's tempting to attack back: Don't. You're going to escalate the situation, and escalation is going to favor the person who is better at this; worse, in a public Dark Arts battle, even the better person is going to take some hits. Nobody wins. Instead, mine the battlefield, and make sure your opponent sees you mining the battlefield. If you're accused of something, suggest that both you and your opponent know the accused thing isn't as uncommon as generally represented. Hint at shared knowledge. Make it clear you'll take them out with you. If they're actually good at this, they'll get the hint. (This is why it's critically important not to make enemies. You really, really don't want somebody around who doesn't mind going down with you, and your use of this strategy becomes difficult.)
Rule #6: Make escalation prohibitively costly.
You might recognize some elements of martial arts here. There are similarities, enough that one is useful to the other, but they are not the same.
You're in a fight, and your opponent is persistent, or you messed up and now things are serious. What now? First, continue to Manage the Fight. Your goal now is to end the fight; the total damage you're going to suffer is a function of both the amplitude of escalation and the length of the fight. You've failed to manage the amplitude; manage the length.
Rule #7: End fights fast.
At this point you've been reasonable and defensive, and that hasn't worked. Now you need to go on the offensive. Your defense should be light and easy, continuing to react with the lightest necessary touch, continuing to ignore anything you don't need to react to; your attack should be brutal, and put your opponent on the defensive immediately. Attack them on the basis of their harassment of you, first, and then build up to any personal attacks you've been holding back on - your goal is to impart a tone of somebody who has been put-upon and had enough.
Rule #8: Hit hard.
And immediately stop. If you've pulled off your counterattack right, they'll offer up defenses. Just quit the battle. Do not be tempted by a follow-up attack; you were angry, you vented your anger, you're done. By not following up on the attack, by not attacking their defenses, you're leaving them no reasonable way to respond. Any continuing attacks can be safely ignored; they will look completely pathetic going forward.
Rule #9: Recognize when you've won, and stop.
Defense follows different rules than attack. In defense, you aren't trying to inflict wounds, you're trying to avoid them. Ending the fight quickly is paramount to this.