Solution (source code)

= Solution

Write $h_{ij}={}^{(3)}g_{ij}$, and retain only first-order <scalar cosmological perturbations>. The inverse <induced metric> and inverse <lapse function> are
$$
h^{ij}=a^{-2}\bigl[(1+2\Phi)\delta^{ij}-2\delta^{ik}\delta^{j\ell}E_{,k\ell}\bigr],\qquad N^{-1}=\bar N^{-1}(1-\Psi).
$$
The flat background spatial connection vanishes, and $N_i=-a^2B_{,i}$ is already first order. Consequently
$$
N_{i|j}=-a^2B_{,ij}+O(\text{perturbation}^2).
$$
The comma on $B_{,i}$ matters: this is the <gradient> of the scalar <shift vector> potential, not an unrelated vector field. Substituting the time <derivative> of $h_{ij}$ into the negative <extrinsic curvature> convention gives
$$
K_{ij}=-\frac{a^2}{\bar N}\left[\frac{\dot a}{a}\bigl((1-2\Phi-\Psi)\delta_{ij}+2E_{,ij}\bigr)-\dot\Phi\delta_{ij}+\dot E_{,ij}-B_{,ij}\right].
$$
Raising the first index with the perturbed inverse <induced metric> is essential. Its $\Phi$ and $E$ terms cancel the corresponding terms multiplying the background <Hubble parameter>, leaving
$$
K^i{}_j=-H\delta^i_j+\left(\frac{\dot\Phi}{\bar N}+H\Psi\right)\delta^i_j+\frac1{\bar N}\delta^{ik}(B-\dot E)_{,kj}.
$$
For the <scalar shear potential> $\chi=a^2(\dot E-B)/\bar N$, raised spatial derivatives mean $\partial^i=a^{-2}\delta^{ij}\partial_j$ to the required order. Thus the final term is $-\partial^i\partial_j\chi$. Taking the <trace> identifies the <scalar expansion perturbation>:
$$
K=-3H+\kappa,\qquad \kappa=3\left(\frac{\dot\Phi}{\bar N}+H\Psi\right)-\Delta\chi,\qquad \Delta=a^{-2}\nabla^2.
$$
Separating the <trace> and trace-free parts now yields
$$
\boxed{K^i{}_j=-H\delta^i_j+\frac\kappa3\delta^i_j-\left(\partial^i\partial_j-\frac\Delta3\delta^i_j\right)\chi.}
$$
All signs follow from the source's $dx^i-N^i dt$ <shift vector> convention and negative <extrinsic curvature> definition.