Large-scale low earth orbit (LEO) satellite constellation projects are increasingly adopting inter-satellite links (ISLs) to enable their autonomous and collaborative operation. Due to the large number of satellite constellation network nodes and their continuous movement in orbit, the network nodes may not remain visible to each other at all times, so the ISL-building choices among satellites are diverse and vary with time. As a result, maintaining a network topology requires onboard planning and management. In this paper, we creatively propose an onboard centralized ISL-building planning scheme with the goal of autonomous topology management. A multi-antenna visibility calculation method that takes the antenna installation angle and the turntable rotation threshold into account is provided for the visibility calculation procedure. Additionally, the link-building planning process is modeled using integer linear programming (ILP); however, to tackle the computational complexity problem of ILP, a link-building planning method based on topology stability optimization is presented. The simulation results show that the proposed onboard centralized ISL-building planning scheme can operate among satellites to successfully realize network status collection, visibility calculation, link-building planning, and planning result distribution, as conducted by the dynamic primary satellite. Moreover, the inter-plane link-building planning method based on topology stability optimization improves the network topology stability on the basis of reducing the network delay.