I’ve only ever written shaders for materials, is there a way I can write a post effect or something similar that is only applied to a render layer?
You could write a postprocessing script - see examples here
which apply shader to a full screen quad … you could write one of these.
See an example here: http://playcanvas.github.io/#graphics/post-effects.html
You can use these scripts using engine directly by code, as the example above. Or you can use them in the Editor and set them up on the camera.