Automatic code generation with minion tasks