  We set up a framework for quantum stochastic thermodynamics based solely on
experimentally controllable, but otherwise arbitrary interventions at discrete
times. Using standard assumptions about the system-bath dynamics and insights
from the repeated interaction framework, we define internal energy, heat, work
and entropy at the trajectory level. The validity of the first law (at the
trajectory level) and the second law (on average) is established. The theory
naturally allows to treat incomplete information and it is able to smoothly
interpolate between a trajectory based and ensemble level description. We use
our theory to compute the thermodynamic efficiency of recent experiments
reporting on the stabilization of photon number states using real-time quantum
feedback control. Special attention is also payed to limiting cases of our
general theory, where we recover or contrast it with previous results. We point
out various interesting problems, which the theory is able to address
rigorously, such as the detection of quantum effects in thermodynamics.
