SwiftPM + canImport

Sounds like you want cross-import overlays, which have been pitched but are not a finished, publicly available feature: