Add sockets to meshes, retrieve them:
Spawn stuff at location, offset it by the other piece’s socket location to align them.
Mine should be much more simpler and gives me more control on how I want the levels to generate to some extent.
For something more advanced, it’s hard to not recommend Wave Function Collapse - it’s a staple of procedural generation. Too many applications to list them.