I don't like the idea of Shipyards being their own special things. I already find their special rules confusing.
I'd make shipbuilding modules modules just like any other. If you find it optimal to build massive, mobile shipyards that take their workers along with them in hab modules so you can hide them, that's your choice to make. Maybe you think it's worth building missile defenses into the shipyards themselves. Or maybe not. Shipyard design can be as interesting as ship design, if we're given the same options. This could substantially inform your overall military strategy.
Of course, if shipyards are ships, you need a way to build ships without a shipyard. So I'd make it so planets can build ships, with penalties of time and material usage (as effectively you're building the ships in open space, without specialized tools, and havingto construct temporary scaffolding on site, etc.) So if you are looking to build multiple ships of a class, building shipyard ships for that is definately preferable. But for one-off designs, or special projects (like a massive space station) you have the option to make those without having to tool up to mass-produce them. (But you'll pay for it!)