How can I find good tactics problems? Say you have a database of a lot of games.

How would you go about finding good tactics problems? I suppose you would search until there was a spot where the score shifted, and there was only one good move on the previous move. But that isn't the whole story, sometimes you need to go back a couple of moves to find where the tactic really started.

For now, ideas of how to do this manually is fine (with the help of an analysis engine), but automating this process is the idea.
One approach might be to go through all the moves of a high level game, and if the engine evaluation changes significantly, then save the position for human review.  

In this case, "significantly" is probably half a pawn or more, although you could also require it to be one full pawn for easier tactics.  

The rationale behind only looking at high level games is that the score will really only change significantly with a blunder.  High level games won't have obvious blunders (i.e. hanging a piece) so the blunders will possibly be a not-so-obvious tactic.  

This won't be perfect, but it might get some positions worth looking at "by hand".

Just one more note - if you allow the chess engine to search to a sufficient depth (14-16 in most positions should be good) - then you won't have to worry about missing the start of the tactic.  The engines will be able to see most tactics, even if they are complicated.