Without a doubt Lee was the best strategist that the Confederacy had. His two largest mistakes were Malvern Hill and Gettysburg. Jackson was probably among the top, if not the best tactical fighter. Jackson’s campaign in the Valley stands out to historians even today. He tied up four federal armies and soundly defeated three of them. Jackson however failed for reasons still unexplained today in the peninsula campaign. Other confederate generals belong on this list, Longstreet, Clebourne, and Stuart. That is probably the best ranking I can come up with.
For the Union Side Grant may not have been a superior tactician or particularly brilliant but he understood what the brilliant McClellan failed to understand. Grant new that time and attrition would defeat the south. Sherman is often reviled as a less than average fighter but his “March to the Sea” did almost as much damage to the Confederacy as the Vicksburg and Gettysburg battles. Buford was a superior cavalry commander and his untimely death due to pneumonia was a serious loss to the Union.
The worst commanders are pretty easy for me though. For the Confederacy Braxton Bragg is probably in last place. For the Union Ambrose Burnside or John Pope. Toss up between those two.