Preparation- All of the above. Start with a good washing then do a lot of scraping. Sanding depends on the shingles. Do they have a natural desirable texture? Sanding will get rid of any surface texture.
Use a good oil based wood primer. Prime with a brush to just the exposed wood. If there is more exposed wood that paint then prime the entire surface.