Impossible questions! A good melody is one that people like. But since you won't get people to agree on whether an existing melody is a good one or not it will have to be what YOU like. You only need detailed rules for what notes should be there and what follows what and how long they last and that sort of thing if you're a computer or a robot trying to write music.
For people music isn't a mathematical or logical exercise. So if you're human first listen a lot then just try something. If it sounds good to you then go with it. If it sounds good to some other people too then you're a real musician.
Steve