Here is what the rule looks like to us and how we specify it to the app I'm writing.
I was wondering can you take any commutative diagram $J$ and apply this rule to a subgraph matching $A \xrightarrow{a} B \xrightarrow{b} C$ in place, all the while leaving another commutative diagram. Or does adding in the hypotenuse sometimes break commutativity of a larger diagram?
If it preserves commutativity, what is a simple proof?

Consider any two parallel paths.
Change every occurance of the new arrow $b\circ a$ to the subpath $a, b$.
Since the original diagram commutes, the composition of the two changed paths coincide.
Consequently, the new diagram is commutative, as well.