Clarification on the Clausius inequality In Atkins' Physical Chemistry the criteria for spontaneity using Gibbs energy was calculated using the Clausius inequality:

$$\mathrm dS ≥ \frac{\mathrm dq}{T},$$

and at constant pressure, $\mathrm dq = \mathrm dH.$ Thus, $\mathrm dH - T\,\mathrm dS$ is negative.

So, if we define a function $G = H - TS$ at constant pressure and temperature, we get

$$\mathrm dG = \mathrm dH - T\,\mathrm dS ≤ 0,$$

which we use as a criteria for spontaneity.

My issue with this argument is that it implies that the Clausius inequality is for spontaneous processes only, otherwise we would end up with $\mathrm dG ≤ 0$ for all processes.

However, the derivation of the inequality simply used the fact that

$$|\mathrm dW_\mathrm{reversible}| &gt; |\mathrm dW_\mathrm{irreversible}|$$

when the system does work.

So, where is it implied that the derivation is for spontaneous processes only?
Denbigh, in his book the Principles of Chemical Equilibrium, considers the case where "(a)the only heat transferred to the system is from a reservoir which remains at the constant temperature T; (b) the initial and final temperatures of the system are equal, and are equal to the temperature T of the reservoir; (c) apart from the system, the only other body with has undergone a change of volume at the end of the process is at a constant pressure p (e.g. a surrounding fluid such as the atmosphere); (d) the initial and final pressures are equal, and are equal to p."

For this situation, from the first law, we have
$$\Delta U=q-w$$ so that, from the definition of Gibbs free energy, it follows that:  $$\Delta G=q-w+p\Delta V-T\Delta S$$
Applying the Clausius inequality to this situation yields:
$$\Delta S=\frac{q}{T}+\sigma$$where $\sigma\geq0$ is the entropy generated, with the = sign applying if the process is reversible and the > sign applying if the process is irreversible or spontaneous.  If we combine the previous two equations, we obtain:$$w=-\Delta G+p\Delta V-T\sigma$$ So, for any process path between two specified end states of a system under these pressure and temperature constraints, the maximum work over and above p-V work is $-\Delta G$, and all other irreversible cases will involve less work (over and above $p\Delta V$).