Design and research a short-range anti-ship missile as you normally would, then design a sensor buoy of any kind and add one or more of that missile to it as a second stage, with a separation range not exceeding its maximum range or the range at which you expect the sensor to detect its target. When a enemy fleet that is detected by the mine crosses the separation range threshold (or transits a JP/LP that's within the separation range of the mine), the second stage(s) will launch, targeting the strongest sensor contact (so all mines deployed in one place will target a single enemy ship, as such, you might want to place your minefields incrementally so the enemy fleet would not trip all your mines at once) and the buoy stage will persist until the second stage either hits, misses, or target moves out of the sensor range. As such, it's not necessary to have sensors on the second stage. I would also suggest to have a separation range a few mkm below the maximum sensor range so the mine could achieve an intercept even if the target happens to reverse its course. Here's an example:
A 2.7 mkm difference between sensor and separation range will allow the payload to strike a ~17kkm/s target that starts running away upon payload separation (not that I saw it happen yet) and ECCM on the buoy stage actually helps against enemy Sensor Jammers.