Grimes decodes contemporary morals, educating as she entertains. Mosley plays Balzac, illuminating social change by showing that people have always been the same. Crime is the language, but the human condition is what's examined. For the former, all you need is an honorable loner walking the mean streets, preferably an ex-cop or a disaffected war vet, equally adept at cracking wise and cracking heads. It helps to add good looks, a pal on the police force, fearlessness, and instant-on sexual prowess.
Generic blondes are a good idea, and turning down cash from bad guys never hurts.
Booze is a plus, but drugs are taboo. Sara Paretsky is just one of several outstanding women writers carving out a distinctive niche on that turf. The cozy formula also has restrictive elements. The protagonists tend to be more urbane and educated, and of more refined personal habits. Clues are a requirement, and part of the fun is the reader's participation in the solution.