What does the diode in this D flip-flop "One-shot" do?
Figure 1. D flip-flop table with the only two conditions of interest highlighted.
Since the D input is permanently high there are only two conditions of interest.

CL going high will set Q.
R going high will reset Q.

R and C in your sample circuit will have a time constant given by $$ \tau = RC = 1M \times 0.1 \mu = 0.1~s $$

On each rising edge of CL, Q will turn on for about 0.1 s, R will go high and Q will turn off again.
The diode provides a rapid discharge path for C so that the circuit won't be held in RESET mode for the next 0.1 s and is ready to be re-triggered.
Maximum pulse detection rate without skipping pulses will be in the order of \$ \frac {1}{\tau} = \frac {1}{0.1} = 10~Hz \$.