The basic definition of a covariant derivative for a Lie algebra valued n-form $\alpha \in \Omega^n(P)\otimes T_eG$ with $P$ a principle bundle with base space a manifold $M$, and $T_eG$ the Lie algebra of the fiber $G$ is
$$ D\alpha(x_1, ..., x_{n + 1}) = d\alpha(x_1^H, ..., x_{n + 1}^H) $$
Where $x = (x_1, ..., x_{n+1}) \in T_qP$ and $x^H \in H_qP$, being this the horizontal tangent space at $q \in P$ such that $T_qP = V_qP\oplus H_qP$ and $V_qP \subset T_qG$ the vertical tangent space. Also, $d$ is the exterior derivative map $d: \Omega^n \rightarrow \Omega^{n + 1}$
In Nakahara's "Geometry, Topology and Physics" the equation (10.47) stands that for any Lie algebra valued n-form defined on $M$, $\eta$, you can write
$$ D\eta = d\eta + [A, \eta] = d\eta + A\wedge\eta - \eta\wedge A \tag1$$
Where $A = S_i^*\omega$ with $S_i: U_i\subset M \rightarrow P$ and $\omega$ is the connection 1-form.
I tried to prove it aplying $S_i^*$ to $D\alpha$ since $S_i^*\alpha$ is a Lie algebra valued n-form defined on $M$, after defining $D$ in a more suitable way:
$$ D\alpha = d\alpha + \sum_{i = 1}^n(-1)^{i + 1}\omega(x_i)\wedge \alpha(x_1, ..., \hat{x}_i, ..., x_n) \tag2$$
Where the hat over $x_i$ means that that vector doesn't appear on $\alpha$
I think this is the right way to define $D$ due to the answer in Covariant derivative: QFT vs. Math
But if you apply $S_i^*$ to Eq. (2) and call $\eta = S_i^*\alpha$ you get
$$ D\eta = d\eta + \sum_{i = 1}^n(-1)^{i + 1}(S_i^*\omega(x_i))\wedge (S_i^*\alpha(x_1, ..., \hat{x}_i, ..., x_n)) = \\ d\eta + \sum_{i = 1}^n(-1)^{i + 1}A(x_i)\wedge \eta(x_1, ..., \hat{x}_i, ..., x_n) $$
Therefore, Eq. (2) is equal to Eq. (1) only in the case $\eta \in \Omega^1(M)\otimes T_eG$, i.e. just for $n = 1$. Nevertheless, Nakahara ensures that is true for any n.
Is Eq. (2) wrong or maybe my interpretation of commutator in Eq. (1)? How can you write in terms of a connection 1-form the covariant derivative for any Lie algebra valued n-form such that when defining on $M$ (i.e., after using $S_i^*$) leads you to Eq. (1)?
Eq(2) is problematic. Firstly, you omitted the pushfoward of the representation which is important. The correct formula is $$D\alpha=d\alpha+\rho_*A\wedge\alpha.$$ Secondly, in the answer you quote, the formula $$\rho_*A\wedge\omega(X_0,\dots,X_k)=\sum_{i=0}^n(-1)^i\rho_*A(X_i)\omega(X_0,\dots,\hat{X_i},\dots,X_k)$$ is just unwinding the definition of exterior product in terms of alternating multilinear function. You cannot compare the form (which is a function) with the value of function.
In the case of matrix Lie group and adjoint representation, the map $\rho:G\to \text{Aut}(\mathfrak{g})$ is just given by $\rho(g)(X)=gXg^{-1}$, thus the Lie bracket comes out as you push forward the representation at identity, so that $\rho_*(A)(B)=[A,B]=AB-BA$.
As a result, in your notation, $$D\alpha=d\alpha+\rho_*\omega\wedge\alpha=d\alpha+\omega\wedge\alpha-\alpha\wedge \omega,$$ thus $$S_i^*(D\alpha)=dS_i^*\alpha+S_i^*\omega\wedge S_i^*\alpha-S_i^*\alpha\wedge S_i^*\omega=d\eta+[A,\eta]$$