In the news recently, it has been discovered that the fast burst radio waves are coming from magnetars.
It is doubtful that a habitable planet could form anywhere near one, but such a star would be an unbelievably huge source of energy. Since they do not have the same hazards to space as black holes (their gravity is not really out of the ordinary), it appears that something could peacefully co-exist around one of them. However, apparently they have a tendency to tear atoms apart that get too close.
Also, for Sci-Fi speculation, just exploring the ramifications of quantum physics around such a star would be interesting.
So, if a massively huge generation ship, built in or on say a very large asteroid or 'baby planet', with tens or even hundreds of thousands of humans, happened to wander by, how close could this ship get, without being destroyed, or everyone aboard being killed?
The 'how' of 'how is this generation ship moved' is not within the scope of this question. Just assume that it can be moved around, under control, with relative (pun intended) ease.