I don’t know of anything either. Various people have thought about “automatic legend generation” (GitHub - gravitystorm/mapnik-legendary: A legend generator for Mapnik stylesheets is one example), but generating a legend for an OSM Carto style automatically is difficult because “what appears at what zoom level” is determined by a number of factors:

o What’s in the “project.mml” or similar file (it includes a bunch of SQL select statements)

o What’s in the .mss file for each layer (includes zoom level tests among others)

o What’s in the lua style file that might map certain features to certain others or exclude them