See https://www.wikidata.org/wiki/Wikidata:Edit_groups. It requires adding a string in edit summaries.
Wikidata is the database behind Wikipedia. Pywikibot has a scripts like scripts/newitem.py that create and edit items in this database. Most of them (should) use WikidataBot class present in pywikibot/bot.py.
This task is to
- add a config parameter in config2.py with a small explanation in comment
- if the bot runs on wikidata (self.site == pywikibot.Site('wikidata', 'wikidata')), generate a random hexadecimal 10 char string at its initialization (in __init__)
- if summary is defined (if 'summary' in kwargs), use this value as a suffix of kwargs['summary'] value in WikidataBot.user_edit_entity()
The kwargs['summary'] value should look after processing like my very informative edit summary ([[:toollabs:editgroups/b/CB/89ead4fe|details]]), where the my very informative edit summary part is the old kwargs['summary'], and ([[:toollabs:editgroups/b/CB/89ead4fe|details]]) the suffix added with the random string in it. Note that the [[ ]] will create a like to an external tool.
This should add the prefix in the summary of item creation and claim addition. More work will be needed for adding it to qualifier and reference edits (will wait for T112577, out of scope for now).
See the "For custom bots" section of https://www.wikidata.org/wiki/Wikidata:Edit_groups/Adding_a_tool.