There are a pantload of recommendations on tamping, but the one recommendation common to all is... practice! And... The most optimal way of tamping depends on every individual pull: the beans (freshness and grind), your skill, machine, etc. -- any guides are just general recommendationsat that moment.
Ultimately, the goal (and most important part, in my belief) is to pack the grounds uniformly. Any non-uniformity in your puck will allow water to flow more through certain areas than others, giving you non-uniform extraction across your grounds (some over- and some under-extracted). For example, if your tamper isn't level, you'll end up with a "slanted" puck; if your grounds are packed more loosely in some places than others... these can yield un-even pucks.
That said, here's a few other common recommendations, some of which you mentioned in the question:
- Add the grounds uniformly and smooth before tamping. This gives you an even bed of grounds so you can tamp evenly.
- 15 kg / 30 lb. of pressure. A bath scale could help until one gets this "by feel".
- Use a heavy tamper. This helps you control all of the other parameters.
- Aim for sinking the tamp approximately as far as the bevel (a general rule).
- Twisting is not necessary (some do at the end of the compression for "polishing", but not necessary).
Then there's some controversial bits:
- "Knocking" is something I totally don't understand. The idea is to tap the portafilter so as to somehow redistribute the grounds after tamping. I feel like it would just mess up a good puck, but some recommend it either to ensure uniformity of compression of the bottom and top of the puck. This is far more advanced than my skill/technique; hopefully someone else could chime in., or to get grounds off of the side of the portafilter. More discussion at link [4].
- On the "North, South, West, East" topic: this illustrates tamping at four points around the portafilter. Since the tamp is slightly smaller than the portafilter, the theory is that tamping at points around the sides helps to prevent grounds from creeping up around the tamp (up the side of the portafilter). It seems to me that an appropriate sized tamp will alleviate most of this, but it seems like a reasonable recommendation. Some guides (e.g., below) recommend this, others don't. More at [1].
A few articles on different takes on tamping: