Minecraft wiki entry for Defense, associated text: Create a 1 (or more) block wide hole in your wall and shoot the spider (or attack with your sword). When the spider gets killed, shoot the skeleton. You can also try an arrow dispenser trap instead of shooting them yourself.