Normally (for fermions and scalars) we can simply use the decomposition of tensor products of gauge group representations to find invariant terms that we can write into the Lagrangian.
For example for fermions living in some representation $R$ of a given gauge group $G$, we can compute
$$ R \otimes R = R_1 \oplus R_2 \oplus \ldots ,$$
where $R_1$, $R_2$ denote some other representations of the gauge group.
The sum on the right-hand side does normally not contain the $1$ dimensional representation, because that would mean that bare mass terms for fermions are allowed. (In other words we can get sth gauge invariant using only the fermions). A term like $ \bar R \otimes R$ does always contain the $1$ dimensional representation, but is forbidden by Lorentz invariance.
Nevertheless, we can use the sum on the right-hand side in order to determine which Higgs representations can be used to generate mass terms for the fermions after symmetry breaking. For example if some Higgs fields live in $\bar R_1$, we can write
$$R \otimes R \otimes \bar R_1 = (R_1 \oplus R_2 \oplus \ldots ) \otimes \bar R_1 = R_1 \otimes \bar R_1 \oplus \ldots = 1 \oplus \ldots $$
In addition, we can use decomposition like this to write down the Higgs potential. For example if in addition to $\bar R_1$ Higgs fields in the representation $ R_1$ exists we can see from
$$ R_1 \otimes R_1 = 1 \oplus \ldots $$
that such a term is allowed by gauge invariance.
Bosons are said to live in the adjoint representation $A$, but according to this answer to not transform according to any representation of the gauge group at all.
But then, how can we determine which terms involving gauge bosons are allowed in the Lagrangian?
How can we make sure that, for example, a gauge kinetic term for the Higgs fields living in some representation $H$
$$ (A\otimes H)^\dagger (A \otimes H)$$
is actually gauge invariant, if it is not enough to check as described above that we can get a $1$ dimensional representation from the tensor product because the gauge groups do not really transform according to adjoint rep?
(Of course it's possible to do everything by brute force using the usual transformation laws but for some large gauge group this is a nearly impossible task)