From the Architect's Perspective
I had a similar experience over the past year, providing support for several newbie devs who were maintaining an application I wrote.
Your main objective is to teach them how to be productive while working with your code.
Don't underestimate how useful it will be to walk them through* the process of setting up their development environment, establishing workflows (bug tracker, source control), etc. If you spell this out in step-by-step fashion you can almost guarantee they'll do it, and it'll make everything easier.
Likely, new devs are going to start small and tweak features or fix bugs. So keep it simple and write some use cases. I.e.
- "You want to add new feature X, this is how you do it."
- "You are asked to change the way old feature Y works, this is where to look."
- "I planned to add new feature Z, these are the functions and/or classes you'll need to use, and it should be attached to ..."
In hindsight, I'd definitely provide some diagrams about how the software works, from a big picture perspective. Full UML might be a bit overkill (presuming anyone knows how to read it anyway), but I think a few simple flow diagrams should suffice.
*By "walk through" I mean "write an explanation". If it's written down, no one can forget it. Also, if you have time, make yourself (reasonably) available for questions. It helps. ;)
From the Maintainer's Perspective
I'm currently maintaining a huge amount of undocumented (and poorly-designed) code, and even though I have a good idea of the top-level stuff, there are a lot of implementation details that are very frustrating.
Things you should avoid (or clearly document if you can't undo them):
- Vague variable names
- Global variables (what changed it?)
- Over-purposed functions (one function does everything!)
- Non-obvious flow or control structures (nested conditional includes inside giant conditional code blocks, for instance)
If you know there are a few things you kludged together to meet a deadline or work around a bug, be sure to provide some well-composed prose that explains how it works, if you can't just refactor it entirely.