The first lesson is simple: assume the worst. If you think that a regime will collapse quickly, plan for it to last a long time. If you expect a peaceful transition, plan for a violent one. And if you hope that unarmed monitors will be enough once hostilities are over, prepare for a well-armed peacekeeping force to be deployed. Optimistic predictions of the post-Saddam Iraq encumbered the planning process and meant the US-led coalition was unprepared for the contingencies that arose. That mistake cannot be repeated.
The second lesson is about the utility of force. Military might can achieve many things, but it has clear limits. In Iraq, it was the combination of a military surge and negotiations with insurgents which created the basis for stability. Similarly in Afghanistan it will be a political process not force, which produces a lasting and reasonably peaceful settlement. In other words, be prepared to swap force for politics.
A third lesson is about friends and foes. Those who are wearing white hats now may soon turn out to prefer a darker shade of headgear; and vice-versa. This isn't to say that there is no distinction between people. There is. But look at Hamid Karzai and Nuri al-Maliki. They have been the West's allies, but now they pursue policies that we don't agree with. Expect the same to happen in a post-Gaddafi Libya.
Fourthly, beware of the Civil Service. The upper echelons of the bureaucracy are ill-prepared for the challenges of warfare and post-conflict stabilisation, despite recent conflict. They struggle to speak honestly about the real situation to politicians; and therefore few required changes take place. So politicians should consult widely and challenge departmental advice. Above all, listen to people who tell you uncomfortable truths.
Fifth, be clear be aware of "inflection points". That is, what forthcoming events will allow you to change tack or moderate policies? For Libya, they include the Egyptian presidential elections, a new Arab League secretary general etc. These "inflection points" can allow governments to review policy or, at worst, face a new context that they are ill prepared to handle – best to plan for them.
And sixth, don't forget that a very small but committed force of dissidents can wreak havoc post-Gaddafi. However the end comes for the Colonel, make sure that his loyalists have cause to join the new Libya and not mount a rear-guard action that will destabilise the country.
The final lesson is harder to heed: success depends on them, not you. In the end, countries drag themselves towards stability when domestic forces mature, decent leaders emerge or governments are given sufficient incentives to behave in a constructive way. Outsiders have an important role to play in providing incentives, but real stability comes from communities themselves.