Shear matrix using vector
Shear transform is a bit different that other transforms like Rotation and Scale. Angles and lengths between points is not preserved for instance. According to Wikipedia Shear is defined as:


  In plane geometry, a shear mapping is a linear map that displaces each point in fixed direction, by an amount proportional to its signed distance from the line that is parallel to that direction and goes through the origin. This type of mapping is also called shear transformation, transvection, or just shearing.


So we usually use Shear to distort a group of points. Try to use Shear as the local transform of an object and you will see some unexpected distortion. I am not entirely sure why, but it has to do with how blender interrupt the transformation.