Preheat oven to 350 degree F (175 degree C). Coat a 2 quart casserole dish with cooking spray.
Heat oil in a large skillet over medium heat. Cook onion in oil for 5 minutes, stirring frequently. Stir in the ground beef and basil, and cook and stir for 5 more minutes. Mix in the garlic, green beans, and tomatoes, and simmer for 5 minutes. Transfer beef mixture to prepared dish.
In a mixing bowl, mix together the mashed potatoes, egg, and water. Spread evenly over meat mixture.
Bake in a preheated oven for 15 to 20 minutes, or until potatoes start to brown on top. Sprinkle with cheese, and continue cooking for 5 minutes.