As I said earlier, you:
1. Have some things that are off limits to the general modularity of the sytem. I used the example of not having a skill-based character system that could replace a class-based one, as an obvious place to keep a single structure. But there would need to be others. Modules can't just hang in space with anything you can imagine. They need to be attached at points that are designed to support the attachment.
2. The things picked as modules need to tie back into something you can label, so that you can use the label to stand for all the possible modules. For example, depending on the module, with a "longsword" you might only be able to roll a d20, add a modifier made of STR mod + a few other things, beat AC, and if you hit, do 1d8 + mods. Pick a more complex module, and you can do more with that "longsword". But it stays a longsword.
Naturally, both of those requirement feed off each others, as well. That is a big part of what makes them work. Because you can't just do this for "longsword", which is easy, but it also has to work for "flaming longsword +3" or whatever. Note, that might mean that certain options were out. If you want three particular modules (because you like what they bring), then having +N weapons may not work. That's a trade off.
Nor is the effect limited to things as singular and concrete as a "longsword". You can do the same thing with class labels, role labels, race labels, spell schools, effect keywords, etc. Whatever is worth making static in the structure and attaching a label to, so that they things around it can vary.