This document presents a method called DECOR for automatically generating detection algorithms for design defects from specifications. DECOR involves a 10-step process where design defects are specified using rule cards that describe structural and semantic properties more precisely. A framework called SAD then parses the rule cards, builds models of the defects, and visits the models to generate detection algorithms. Preliminary results applying DECOR to detect blobs and spaghetti code in open-source programs show detection precisions ranging from 20-82% depending on the defect and project.