Believe it or not, there really is no trick to compression spring design.
The key in designing a compression spring is to stay linear during deflection. Simply put, the compression spring should produce the same load for every inch it moves. For example, if a compression spring has a 10 pound rate, it should deliver 10 pounds for every inch of deflection, i.e. at 2inches it should produce 20 pounds of force and at 3 inches it should produce 30 pounds of force, etc.
As we know, spring design is rarely performed in a perfect world. In the real spring design world, the rate line is rarely linear. This is due to the fact that the rate is produced by active coils in the spring. As the spring deflects, active material stays constant. As the spring gets closer to solid, end coils begin to deaden and more material begins to deaden until all coils are dead at solid. The rate increases as the spring gets closer to solid, due to the compression spring losing its coil count, thus producing a non-linear compression spring rate graph.