The CommonsDelinker (https://commons.wikimedia.org/wiki/User:CommonsDelinker) delinks images from Wikimedia projects when these get deleted on Commons. No development has been happening on it and it's barely maintained. Wikidata is not supported yet, for this we have T66794. Lots of other parts are hacked up code, outdated code (pywikibot compat instead of core) or just plain broken. Maybe it's better to implement the functionality as a MediaWiki extension and completely drop the Delinker.
Basic workflow:
- File gets deleted on Commons
- Delinker goes over all usage and removes the file usage
Of course you could also add new use cases like restoring images when a file gets restored:
- File gets deleted on Commons
- Delinker goes over all usage and removes the file usage
- File gets restored
- Delinker reverts all the delinks of the file (probably only where delinker made the last edit)
- Creating a log of delinks/restores
Other nice functionality could be the notification of projects that files are up for deletion or the ability to do a global replace of an image.