After the creation of the SBRP usage report which has a section listing all unreferenced SBRP packages, it is feasible to automate the cleanup of unreferenced packages.
This can be done incrementally:
- Create tooling for dev's to run locally that reads the report and deletes the unreferenced packages
- Create a pipeline that will run on a schedule and open a PR to remove any unreferenced packages
Note: The report does have some false positives. These are cases where packages are referenced outside of a nuget project.assets.json file. These would have to be excluded via some mechanism - either in the reporting infra or in the cleanup tool.