In China's early-modern period (11th–14th centuries), a large number of divine codes (guilü 鬼律, or tianlü 天律) were revealed to adepts in the context of the new exorcistic ritual traditions (daofa 道法) of that period. Their texts prescribed how humans and spirits should behave; and laid out the mechanisms of divine punishments in case of any breach. After introducing the corpus of these codes, the article explores the moral charter they outline for priests. It argues that this moral discourse is contiguous with that of a genre called morality books (shanshu 善書), and shows how priestly codes gradually entered general circulation and thereby became morality books. An important link between the two genres is spirit-writing. During the earlymodern period priests used spirit-writing for producing ritual documents (including moral exhortations from the gods), but later the technique became generalized and was used to mass-produce morality books.
Daoism, morality books, spirit writing, daofa, exorcistic rituals, heavenly codes