The blackening of the wounded area of the cuticle or the surface of invading pathogens, parasites or parasitoids, resulting from a proteolytic cascade leading to the de novo synthesis and deposition of melanin.