Apparently the key was to use "$skin =
$wgUser->getSkin();"...
Correction; apparently the key was to use
$this->set('catlinks', $this->getCategories());
inside the execute() method.
I've updated the example accordingly:
http://www.mediawiki.org/wiki/Manual:Skinning/Example
(I'm still composing my skin, that's why didn't notice this omissions
before.)
-- F.