There are a number of preconceptions that need to be cleared away in order to get at a useful answer.
- Religion is not reducible to faith, belief, ethics, or philosophy.
- Religion does not necessarily have anything to do with "gods" in whatever sense.
- "Miracle" is an extremely narrow and specific type of event that is properly limited to Christianity (though arguably also to Judaism and/or Islam); it is again not generalizable.
- "Magic" is a well-nigh impossible category, even worse than "religion," and as such there's no way to make blanket assertions about their intersections.
- The "war between science and religion" is a 19th-century invention, principally American; there is no intrinsic conflict.
- There is no generally-accepted scholarly definition of religion, nor is it likely that there ever will be.
Once you accept these points, which are broadly accepted by professional scholars of religion (which is very different from "religious scholars" or "theologians"), the question of "designing a religion" changes dramatically. One can hardly give a "right" answer to this, but there are some general guideposts worth considering by way of preliminaries.
Religion is universal
Any of the various semi-functional definitions of religion references a set of phenomena that appear to exist and have existed among all human societies in all places and times. We do not know of strong counter-examples. This has a number of interesting implications:
- A society truly without religion is deep in fantasy territory, arguably harder to imagine and formulate than extraterrestrial alien societies.
- Religion is not intrinsically bound up with technology, science, etc., but at the same time it is not intrinsically distinct from these things either.
- Religious phenomena tend to be recognizable to one's neighbors. Albeit the category "religion" as we know it is a sixteenth-century European invention, some of the most ancient extant texts already reference neighboring peoples as having gods, temples, sacrifices, and so forth, in some cases (notably Egyptian ones) offering translations: "Among the Greeks, Isis is usually known as Aphrodite, and is offered the following sacrifices...."
Religion is ordinary
Most of the phenomena we think of as "religious" are embedded in everyday life and concerns. Fertility, health, death, marriage, hunting, crops, and so forth tend to get a lot of attention in religious systems. This runs contrary to an old (but utterly false) notion that religion is about explaining or accounting for the extraordinary, i.e., the old wheeze that religion comes about because people see lightning and get scared or whatever. On the contrary, religious expressions, when they can be called explanations or accounts in the first place, tend to provide explanations and origins for the utterly ordinary: why do humans eat animals? why do humans excrete? why don't we have three buttocks?
Religion is not falsifiable
Religious systems do not necessarily make any claims that could be tested in any way whatever. When they do make such claims, they tend to be accurate within reasonable limits, e.g., claims about the natural world and its various phenomena. (The causes attributed to these phenomena are likely at variance with modern scientific explanations, but the phenomena described are usually accurate enough, and sometimes stunningly so.) The usual supposition is that any falsifiable and totally false claim will tend to die out over time, because it becomes obvious to everyone that it's false. On the other hand, bear in mind that "correlation does not imply causation" is a logical principle that most people simply do not seem to grasp, and that a claim based on its reversal is not likely to be easily falsifiable. (E.g., "the sun comes up every morning because we sacrifice to the gods every night" isn't falsifiable, since nobody's going to just stop doing all sacrifices to find out, and even if you did one could always suppose that the next tribe over did their sacrifices, QED.)
Religion is not intrinsically about explanation or fear
This is a very old theory, of course, but it doesn't seem to work in the real world. The overwhelming majority of extant etiological myths (myths about where something came from) do not provide an "explanation" in any kind of straightforward sense. Natural phenomena that are genuinely terrifying to a given people may well have little direct representation in their myths or rituals. While one can certainly argue that religious behaviors do in some sense provide some people with some kind of psychological support with respect to some sorts of insecurities, that's so broad as to be useless (and in no sense exclusive to religious phenomena however defined).
So... how do you go about designing a religion?
Let's think about this as a process rather than a checklist.
In all likelihood, you already have some vague notions about what you want, so write those down. Probably this is stuff about gods and whatnot, perhaps a creation myth or something. The next step, however, needs to be about ordinary people in their ordinary lives. If in some way these gods are important to these people, what is it that the latter do? Why?
The answer does not have to be "worship." That doesn't really mean anything much. Think about the gods as people for a minute, however strange and powerful. If I'm an ordinary male person, is my relationship with a given god akin to that I have with my friend? my brother? my father? my chief or king? my wife? my lover? Does my wife have the same kind of relationship, and is it to the same god? (Gods don't have to have consistent sexes, you know.) Do I get involved with more than one god? Perhaps, for example, I talk to my personal or family god in a chatty sort of way every few days when I am alone, kind of keeping him up to date on my life. I don't really expect a lot from him, and he doesn't expect a lot from me, but we're sort of buddies. I gather that my wife and the other ladies have quite a different way of relating to a singular goddess, but that's female mysteries and I don't really want to know -- I'm sure it's icky, since my impression is that a lot of it happens when all the ladies head off to that forbidden longhouse west of town for a few days once a month. (Which is not to say that I don't know about menstruation, just that it's none of my business.)
Probably the next thing I'd do is consider the ritual specialists, i.e., the people who have a professional involvement with and special knowledge of the gods. Are they chosen (and by whom), or do they choose, or are they hereditary? Does it depend on their functions (healers, shamans, rainmakers, judges, etc.)? Probably they have some special limitations on their conduct, be it clothing that they must or must not wear, actions they may not perform, times of the year when they must behave specially, etc. All of this is going to seem perfectly ordinary to everyone, as they've seen it all their lives, but at the same time it may be invested with special emotional significance: gravity, fear, excitement, etc.
What do these priests or whatever do publicly? Chances are, sacrifice: pretty much everybody sacrifices, worldwide, usually but not always in blood. What happens to the bodies? Probably they're eaten, but by whom? The priests? the poor? the king? everyone communally? What range of things are sacrificed -- is it just one small set of animals (e.g., domesticated mammals, wild fowl, humans) or is it pretty general? Does it depend on the god to whom the sacrifice is dedicated? Is there any general understanding of or theory about why we should sacrifice? (Note: it doesn't necessarily make the gods happy; it could feed them, or keep them asleep, or keep them bound to us....)
I would now continue by thinking about the sorts of social structures such a system of ritual practices might entail. If there is a large priesthood performing constant sacrifices, as in ancient Jerusalem, you're bound to have a whole economy built around the animals and around ensuring that the priests can keep doing this. If priestly knowledge is held to be reasonably consistent or entwined with knowledge in general, as was sort of the case in ancient Egypt and medieval western Europe, these priests are going to need to run schools and training facilities. If priests are also in charge of healing, they're going to have to have ways to ensure that the sick and wounded have access to them (or the reverse). And if they have to do all these things, there are going to have to be a lot of them and they're going to need to be reasonably well paid or supported by everyone else, because how else can they carry the load on all these jobs? Meanwhile, if everybody has his or her own personal god that is in some sense a manifestation of a reasonably limited set of gods, how are these people clustered, and where do they get their personal gods? Perhaps they go on vision quests or something like that to find their affiliation, or it's passed from father to son, mother to daughter, or perhaps a man gains his first god from his father and a second from his wife's father, at which time he must return his first god to his father....
Keep thinking about the practicalities, about what ordinary people do in ordinary life, and what sort of role these small-scale ordinary sorts of behaviors and rites might play. Big festival gatherings of huge numbers of people can be very expensive, even dangerous, but they probably happen periodically. In whose honor? Why? What happens? Who pays for it? On whose territory does it happen? Is that a prestigious thing?
Eventually you will have a quite complicated and detailed religious system that looks a great deal more like actual religion in the actual world than the overwhelming majority of "fantasy" religions do. You may or may not have gods with specific zones of control; for that matter, you may or may not have gods! There may be no Big Ideas or Important Tenets or anything like that -- there usually aren't, as it happens. But what you will certainly have is a lot of ordinary people doing things that seem somewhat peculiar from our point of view but which seem utterly unremarkable to them. If somebody else from the world comes across the sea and meets them, the new guys are going to have a completely different system, but they'll very rapidly make rough translations, ranging from "ok, so your god Blarg is like our god Yarg, except Yarg drinks snake blood and Blarg apparently just eats fruit and has four heads. Funny old world, eh?" to "ok, so you have disgusting notions like feeding fruit to your four-headed freako thing, instead of giving snake blood to Yarg like decent people." Whatever.
A note on research and modeling
I would advise you to stay away from very close modeling on extant examples unless you know a great deal about them. Most particularly, I advise you to stay away from "fantasy religions" that are essentially mildly retouched versions of Christianity and Islam. If you are going to do research about religion in the real world, I would suggest starting with premodern China, pre-colonial South Asia, and/or any of the many indigenous American cultures. Do note, however, that one reason to choose these examples is because they are riven by huge numbers of very complicated -- and to an outsider, sometimes frankly bizarre -- distinctions that may or may not seem to play a big role in this or that person or group's life. When you encounter something in your reading that tells you what "Hindus" or "the Chinese" or "American Indians" think or feel or believe, in broad-stroke terms, either stop reading or become hyper-skeptical: what you're reading is claiming a generalization that spans culture-groups which don't generalize at all well.
References
For religious system design and concepts, the bar for scholarly currency can be set somewhat lower than in professional circles. And quite obviously, it should not be necessary to take an advanced degree in religious studies just to achieve your goals. That said, a great deal of the best scholarship is going to be frankly inaccessible, as it is highly technical. A few suggestions:
For clarity, precision, and a kind of mental bolt of lightning, one cannot do better than Émile Durkheim, The Elementary Forms of Religious Life (1912). I advise reading Carol Cosman's wonderful translation available from Oxford University Press, which captures Durkheim's voice and trims out a good deal of material that won't be helpful for most non-scholarly readers. Once you've read Durkheim, your way of thinking about religion will be profoundly altered -- for the better.
For a remarkable (if somewhat dated and problematic) attempt to get at "how religious cultures think," a number of the works of Mircea Eliade remain excellent. I would advise beginning with The Sacred and the Profane, which is accessible and short. One can then follow up with any of his more narrowly-focused books on initiation, yoga, alchemy, shamanism, etc. Personally, I would suggest reading Patterns in Comparative Religion instead: it's a strange book, and long, but you will end up with an amazing sense of just how wildly varied religious expressions actually are. Especially if you are inclined to think negatively about religion, Eliade's take will be a valuable counter.
Those looking for a litany of examples can certainly make use of Sir James Frazer's The Golden Bough, but be sure to discard any of his theoretical interpretations and formulations (notably chaps. 3-4 and the final chapter), which (as Durkheim will have demonstrated to you) are simply unworkable.
Claude Lévi-Strauss's The Savage Mind, despite the execrable translation and the unquestionable difficulty and density of working one's way through it, is to my mind the single best attempt to think one's way into what traditional religious societies actually think like. But it's a stunningly hard book, and I don't advise you to read it until you've already read Durkheim at the very least.
I do not recommend Joseph Campbell, despite his undoubted popularity, intelligence, and charming prose. He is in essence proposing Eliade's view as a normative theology for the mid-late 20th century, not interpreting the data as he finds it.