Diagrams in coupled-cluster theory: Algebraic derivation of a new diagrammatic method for closed shells