The first step in 2D skeletal animation is natural rigging, with the understanding that we are limited to a 2D plane. This creates an interesting situation where we may have to rig a human sprite figure but we have to restrict its motions to this plane. For some motions and gestures, this may require dynamic tweaking of the skeleton, such as the lengths of the bones, to make things look proper.
In general, however, you can say that animating a 2D skeleton is mostly the same as animating a 3D skeleton, with just one dimension less. This means reducing the number and size of variables, including those in vector shaders, although it's also perfectly fine to just keep the third dimension and not use it.