Took me a few days to look at this properly, but this should be a solid start.
First of all there’s a shortcut for Apple’s shortcuts app.
When run it gives you an option to record a log entry or view a log.
When you choose to record an entry it pops up a list, that you can tailor, that you select you activity from. It then looks for a JSON file in the Shortcuts folder (you could make this a sub-folder of your choosing) and attempts to load it in and convert it to a dictionary. The shortcut then will look up the value for the activity in the dictionary. It will effectively be zero if there was no file or no entry yet in the file for that activity. The activity’s value is then incremented by one and the dictionary converted back into JSON and writes/overwrites the JSON file for the week.
The read log option allows you to select a date and based on that date figures out which file to read in. If there is no file for that week, it will purposefully pop up an error. If there is a file, it will read it in, iterate over the key value pairs and write you some more human readable output to explain how you spent your time that week.
The file name is quite simple and you may find there is a need to add your own suffix to make it easier to manage the files. As it currently stands the file name is “yyyy-ww.json” where yyyy is the year, ww is the week of the year and json is the file extension.
In terms of scheduling, there are a few ways to do this, but I think the easiest way is potentially to use Launch Center Pro and its inbuilt scheduling options. That’s an in-app purchase, but if LCP isn’t the sort of thing you would make use of, then you could consider asking Siri to “remind me to run this” against the shortcut, or use Due, or perhaps a calendar, IFTTT and a push notification service that uses actionable notifications. There are a few discussions on this forum about that sort of stuff.
Hope that helps.