I don't have yt code, but I agree that this would be a useful standard derived field to add. As for the methodology, the shock detection algorithm that is used in a lot of codes looks for regions where there is compression and a pressure jump (to separate shocks from rarefactions). Most PPM or similar hydro codes (even those that are not directionally split) will do this check in 1-d when determining whether to apply flattening to shocks (to prevent their self-steepening from making them too steep), and then look in all directions to figure out if a zone should be flattened. You want to do a single multi-d shock detection, which will mean computing the velocity divergence and the pressure jump in the normal direction. Here's the code we use in Castro which inherits some ideas from other codes (Flash, and the ppm papers). Look for the subroutine shock().