The chemical reactions and pathways involving diterpene phytoalexins, a class of diterpene formed in plants in response to fungal infection, physical damage, chemical injury, or a pathogenic process; they are sometimes referred to as plant antibiotics. Diterpenes are unsaturated hydrocarbons containing 20 carbon atoms and 4 branched methyl groups and are made up of isoprenoid units.