If you put an add_requirement at the top of the generate method, you get the very confusing error "Output "foo" was not defined."
Took me a while to figure out what was wrong. We should either give a better error, or make it possible to add requirements earlier.