Can you see if this thread helps to get the normal example working?
If that does work then you’ll have to define your new distribution and the derivatives. However, if you can get it running in pure Stan first autodiff will take care of the derivatives (though this will be slower).