Imagine a magical world similar to this question, where everyone uses skeletons as soldiers.
There are mages running around searching graves for bones to summon them into skeletons.
How do I keep my remains and those of my family and friends from getting brought back to some kind of life as supposed-to-be-scary warriors if I don't want to cremate them and keep the bones largely intact for at least some years so they decay more or less naturally?
Furthermore, the solution should require only very few resources. Powerful people arrange to have their corpses guarded, but poor people need a way of protecting their corpses preferably without using magic or with very little magic (=little energy and complexity) bought somewhere. Further assume energy conservation, so search spells as well as shield spells are possible, but the further you look and the longer or more often you have to deceive someone looking, the more energy is needed.
Guarded graveyards became available but are regularly attacked or robbed as selling that many corpses is very lucrative and the few guards just get sold too.
FAQ / importing comments into the question:
Why not cremate?
Because the soul gets damaged then. Or that's what people say.
So the shape of the body must be largely intact? What about amputees? Can we remove limbs?
The bones should be preserved. What happens if they are shattered is not known (because I didn't have that idea tbh and haven't thought about it), but cremation or pulverization is bad. Casting them in metal seems like a good option, but very costly.
Who does the searching and how? Do mages pay grave robbers like medical schools used to do? Do they use area spells to locate suitable corpses? Is it acceptable to bury in alkaline soil so that decomposition is faster?
All of those as long as decomposition is not too fast (years are okay, days are not). They search themselfs, they send someone, you can even sell your remains to get some coins for your family, but that's generally despised
How do the mages reanimate a body? If you could describe the process for us we may be able to provide methods of prevention.
They say something along the lines make those bones assemble like a skeleton and attack everything that moves behind this line after I was buried there just in more words and more detail. Then the magic energy rushes out of their body depending on how much they wanted to invest and that's it. Pulling the bones out of the earth or anything can be treated as a different spell needing as much energy as it would need to do that manually (apart from the energy waste manual labour has).
So what is actually going on? They say some words and magic goes in...but what does the magic do? How does it bond to the bones and know to bond to bones rather than a stick buried underground? Perhaps there is some trick where the magic cannot tell the difference but we need to know the details in order to determine this.
The magic follows the intent of the caster so as long as the caster is focussed and has the details figured out (like this bone belongs here and should be moving d'accord with that other bone to form a leg), the spell does what it's supposed to do. A mage could use a spell to find bones but the further away they are the more energy that spell needs, so finding every bone in a graveyard that's buried within a few meters deep, yes, finding every bone in the world, definitly no. So as long as the mage can tell the difference, the magic can.
How much are bones worth to those necromancers? If guarded cemeteries are attacked and the guards are used as bones too, are the poor even save from being murdered just to get their bones? How common are those bone thefts?
Getting a cemetery worth of hundreds or thousands of skeletons is a different thing than earning a little money by murder.
Aren't skeletons a waste of magic/energy?
It's a kind of sport to have thousands of skeletons guard your tomb. Plus all the heroes running around need to be able to brag about the vast numbers of opponents they "killed". Skeletons are far from an effective use of magic, but I'm pretty sure that's so in any set of magic rules unless you make them exactly to basically allow only summoning of skeletons and almost nothing else.
How easy is it to reprogram a skeleton?
Drain the energy in there (you'll need approx. the same amount for that), put your own in. So not so easy.