TITLE: Functoriality of the module of Kähler differentials
QUESTION [6 upvotes]: In Eisenbud's Commutative Algebra, at the start of Chapter 16, he describes the module of Kähler differentials: given a ring $R$ and an $R$-algebra $S$, we have the associated $S$-module $\Omega_{S/R}$. This comes equipped with an $R$-module homomorphism $d: S \to \Omega_{S/R}$, called the universal $R$-linear derivation, which satisfies an associated universal property.
He goes on to state that the module of Kähler differentials is functorial in the following sense: given a commutative diagram of rings
$\require{AMScd}$
\begin{CD}
R @>>> R'\\
@V{}VV @VVV\\
S @>>> S',
\end{CD}
where $S$ is an $R$-algebra, and $S'$ is an $R'$-algebra, there is a commutative square of abelian groups
$\require{AMScd}$
\begin{CD}
S @>>> S'\\
@V{d}VV @VV{d}V\\
\Omega_{S/R} @>>> \Omega_{S'/R'},
\end{CD}
where $S \to S'$ is the associated $R$-algebra homomorphism, $\Omega_{S/R} \to \Omega_{S'/R'}$ is an $S$-module homomorphism, and $d$ denotes the universal derivation in each context.
As Eisenbud notes, this is quite complicated to state. I am curious if this can be rephrased in a simpler way. My question can be stated concisely as follows:

As the module of Kähler differentials is functorial, we should be able to understand it as a functor of the form $\Omega_{-/-}: \mathscr{C} \to \mathscr{D}$. In this context, what are the categories $\mathscr{C}$ and $\mathscr{D}$?
Once question 1 is answered, how do you understand the universal property of the module of Kähler differentials in this categorical framework?

REPLY [3 votes]: $\newcommand\Mod{\operatorname{Mod}}\newcommand\cRng{\operatorname{cRng}}\newcommand\Kappa{\mathrm{K}}\require{AMScd}$Let $A$ be a commutative ring.
Let $\operatorname{Mod}_A$ be the category such that:

the objects are pairs $(B,M)$ where $B$ is an $A$-algebra and $M$ is a $B$-module;
the morphisms are pairs $(\varrho,\varphi):(B,M)\to(C,N)$ where $\varrho:B\to C$ is an $A$-algebra homomorphism and $\varphi:M\to N$ is a $B$-module homomorphism (where $N$ is a $B$-module by scalar restriction trough $\varrho$).

Let $\cRng_A$ denote the category of (commutative, associative, unitary) $A$-algebras and $\Xi_A:\Mod_A\to\cRng_A$ be the functor such that:

If $(B,M)\in\Mod_A$, then $\Xi_A(B,M)$ is the commutative $A$-algebra on the $A$-module $B\times M$ with multiplication defined for $b,b'\in B$ and $x,x'\in M$ by
$$(b,x)(b',x')=(bb',xb'+bx')$$
If $(\varrho,\varphi):(B,M)\to(C,N)$ in $\Mod_A$, then $\Xi_A(\varrho,\varphi)$ is the homomorphism of $A$-algebras $\varrho\times\varphi:B\times M\to C\times N$.

Let $\Kappa_A:\cRng_A\to\Mod_A$ the functor such that such that:

if $B$ is an $A$-algebra $B$, then $\Kappa_A(B)=(B,\Omega_A(B))$.
if $\varrho:B\to C$ is an homomorphism of $A$-algebras, then there exists an homomorphism of $B$-modules $\Omega_A(\varrho)$ making the following diagram commutative:
\begin{CD}
B@>>>C\\
@VdVV@VVdV\\
\Omega_A(B)@>>>\Omega_A(C)
\end{CD}

Let $B\in\cRng_A$ and $(C,N)\in\Mod_A$.

The forgetful functor $\Mod_A\to\cRng_A$ is a fibration.
The forgetful functor $\Mod_A\to\cRng_A$ is a cofibration.
$[\varrho,\delta]:B\to C\times N$ is an homomorphism of commutative $A$-algebras if and only if $\varrho:B\to C$ is an homomorphims of $A$-algebras and $\delta:B\to N$ is a derivation.
We have an adjunction $\Kappa_A:\cRng_A\rightleftarrows\Mod_A:\Xi_A$.
We have a bijection
\begin{align}
\hom_{\Mod_A}((B,\Omega_A(B)),(C,N))&\xrightarrow\sim\hom_{\cRng_A}(B,C\times N)\\
(\varrho,\varphi)&\mapsto[\varrho,\varphi\circ d]
\end{align}
We have an isomorphism of $C$-modules $\Omega_A(B)\otimes_AC\cong\Omega_C(B\otimes_AC)$.