Solve the Alien Probe puzzle
Wolfram Language (Mathematica), 36 34 33 30 bytes
#-1|#&amp;~Array~#~Tuples~3/.#-&gt;0&amp;

Try it online!
Returns a length-\$n^3\$ list of \$\{x|x',y|y',z|z'\}\$ colorings.
Verify with a \$n\times n\times n\$ matrix output.

Explanation:
Consider a cube \$x\$th from the front in some initial configuration. If the frontmost layer of cubes is painted \$1\$, the second \$2\$, etc., so that the color number increments with each shift, the front face of the cube will be painted \$x\$. After one more shift, the cube will be in the backmost layer, so the back face is painted \$x+1\$.
The same logic applies in other dimensions, so we can paint the cube at position \$(x,y,z)\$ with colors \$(x,y,z,x+1,y+1,z+1)\$ (modulo \$n\$).
#-1|#&amp;~Array~#~Tuples~3         (* 3-tuples of {0|1, 1|2, ..., n-1|n} *)
                       /.#-&gt;0&amp;  (* and replace n with 0. *)