A. My "rules of thumb" are few. Here are some of them:
For commercial ships:
1. Engines should usually be ~40-50% of the size of the ship. Why so large? Engine cost is proportional to the square of its power rating, up to 100% power, and so - for most commercial ships - it pays to drop the rating and upsize. Other advantages include: faster construction of ships that are cheap compared to their size, more fuel-efficient engines, and reduced engine research costs.
2. Look for opportunities to off-load the engines to dedicated tugs. For starters, anything that stays in one place for years at a time really ought to be a station.
For warships:
1. Most warship designs benefit from a focus on both a single mission and a single combat range. Field ships that know what they're about.
1a. That is not to say that putting point-defence on a beam battleship is wrong - it's not. However, if you put most of your point-defence on dedicated ships, you can tailor fleets to either be better at stopping missile spam, or better at lighting up enemies, depending on local opposition. Indeed, you can send in the point-defence craft (or heavily shielded and/or armoured stuff, whichever) to beat off the missiles, with the beam boys kept safely out of trouble until things settle down.
1b. Same story with combat ranges. Move weapons having sufficiently different ranges to different ships. Move the ships to their optimal combat ranges - when conditions are favorable.
Warning: adopting this proposal, while it makes ship design easier, does mean that you need to be more mindful of both fleet organization and battlefield positioning.
2. Look for ways to off-load non-mission components and costs to other ships or stations. Your ship design might not need...
a. A full sensor suite. Sensors are among the most expensive items around for their size, and you only need to see the enemy once, so be smart about how you achieve redundancy.
b. Armament (especially if expensive) that doesn't carry out the primary mission.
c. Luxurious deployment time, multi-year maintenance life, abundant fuel, or quite that many missile reloads. Why burn fuel carrying more fuel?
d. Engines. If it doesn't have to move often, can a tug tow it around? Even if you do want it to move, can you park it behind a jump gate or Lagrange point and wait in ambush? Or just give it extra long-range missiles and hit first?
e. Heavy armour. At high tech levels, shields are king - as pointed out previously by nuclearslurpee.
f. Jump drives. Alternatives include dedicated jump squadron ships, unarmed jump ship support, or building a gateway.
3. For mobile warships, start with engines totaling 30% of the mass of the ship ... but then focus on the mission, not the rule. Reduce size (down to 20-25%) for slower ships, and also for lower-range ships with little need for fuel and thereby reduce costs. Increase size (up to ~40%) for faster ships, and also for ships needing more range.
B. Considering the OP's examples of advice others might proffer:
"warships should be 25% engine": My warships are either fast or slow - and they know which one they are. If fast, they have something like 30% to 45% of space devoted to engines. Superior speed means a better chance of imposing your preferred combat range on the enemy, and that might be half the victory right there. However, I also build a lot of "monitors" - warships with puny engines (often ~20% of total size) that tank and dish out a lot of damage for their cost.
"the ideal engine-to-fuel ratio is 3:1": I seldom put anything like that amount of fuel on my ships, because they either will (almost) always have tanker support (mobile ships), or hop from station to station (defensive ships). Exceptions might include survey ships, scouts, and long-range raiders - but even for these I tend to find ways to get a tanker involved.
"4 layers of armour for every 4k tons": For me, armor is all about the mission (and the combat range). Early on, I put a lot of armour on. Later, it's mostly about the shields.
"20b km range is enough for most warships": Range on my warships varies dramatically. 20b km would be at the upper end for my "typical" design, but I have had occasion to go much higher for armed raiders and convoy protection ships.
C. Considering a few Rules of Thumb from other posters in this thread:
Jorgen_CAB:
"I usually divide up war ships in terms of mission tonnage and none mission tonnage. Mission tonnage is weapons, magazines, hangars and sensors while the rest is armour, engines, fuel, crew quarters and engineering sections. If you can have about 40-50% mission tonnage you are probably alright for a balanced main capital or escort warship.":
I'd second this thinking.
Lord Solar:
"15% of mass weapons on a warship."
I would almost never have so few weapons on a warship. My warships are born so that others might die and might easily devote 30-40% of total space to either "open fire" or "time to reload" (with apologies to Schlock Mercenary).
nuclearslurpee:
Agreed with most, especially on shields, maint. life, and armor. One point of difference is with missile design; there are major advantages to large, multi-warhead missiles, the most important of which are range and closing speed.
xenoscepter:
Sage advice on always having at least two engines.