Actually, it can be done neither with Capitalism nor Communism. Sorry, but Communism has single points of failure which those seeking power can acquire to increase their power at the expense of everyone else. Capitalism has the same problem, but with more distributed "single points of failure".
Either could plausibly work if control were implemented via an appropriately optimizing AI, but in the first place our current AIs aren't up to the job, and in the second place, those currently holding positions of power would be reluctant to give them up...and any AI that would coerce them to do so would be unlikely to perform optimally at control (from our point of view).
A likely plausible scenario is increasingly capable AI hollowing out middle management until there are only a few humans running everything, who will eventually retire in favor of an AI rather than in favor of some other human. Calling the resulting system either Capitalism or Communism seems a bit abusive of the term, though it would likely share some characteristics of each. I call this likely as it seems already well in process, though the end-point is, at this stage, a guess.
It's worth noting that when human life is being sustained by such a system there will need to be some mechanism to limit the human population. War will be right out, but plague is a possibility, as is birth control, but birth control will tend to either be compulsory or be evolved away from. Larry Niven's "birth right lotteries" is possible, if improbable. (He even includes what happens when the system gets corrupted. I find his answer possible, but implausible.) But perhaps the population will automatically limit itself. Certainly that's the current experience in technically advanced urban countries, but I have my suspicion that this may be due to widespread sub-critical levels of poisoning with weird chemicals (weed killers, petroleum distillates, etc.).