usage-review
Usage review
Measure the owner's real T3 Code usage, check whether changes from earlier runs worked, and turn patterns that clear the evidence bar into at most one draft PR in this repository. Merging stays with the owner. A weekly scheduled task runs this from the default branch's skills/ tree.
The state folder ~/.local/state/usage-review/, written $STATE below, holds baseline.json (the last run's metrics, for week-over-week comparison), shipped.json (every change a run proposed, as metric contracts with frozen baselines), private-names.txt (names the owner adds for the public check), remotes.txt (SSH hosts such as user@host, one per line, for other machines whose T3 Code threads count too; each needs Node 24 or later on its SSH path and a clone of this repository at the same path under its home as the main checkout here), and runs/<date>/, written $RUN. Scripts are in this skill's scripts/ folder, run with node, and document their flags in their header comments.
This repository is public and the threads hold client work. Everything published, meaning changed files, commit messages, and the PR title and body, carries counts and paraphrased patterns only: no quoted thread text, client, project, or people names, other repositories' URLs, or ticket ids.
1. Begin
Read the repository's AGENTS.md. Take the lock with mkdir $STATE/lock, which fails when another run holds it. When it fails and the folder is less than two days old, stop and report its age; when it is older, a run died holding it, so remove it, take it again, and say so in the report. Read baseline.json and shipped.json when they exist.
Complete when: this run holds the lock, and the baseline and shipped changes are loaded or known to be absent.
2. Measure
Create $RUN with mkdir -p, then run extract.ts --days 7 --out $RUN/messages.jsonl > $RUN/extract.json, adding --remote <host> for each line of $STATE/remotes.txt when it exists, then metrics.ts --in $RUN/messages.jsonl --out $RUN/metrics.json --shipped $STATE/shipped.json, leaving out --shipped before the first change ships. Owner messages are typed request, steer (sent while a run was active), answer, or unpaired (the run before it left no final reply); menu metrics and assistant length use answer rows only. Every later extract.ts run, and step 6's public-check.ts, takes the same --remote flags. A host that can't be reached fails the run: report it, remove the lock, and stop, since a week missing a machine's messages would distort the baseline. With fewer than 30 owner messages, report "too little data", remove the lock, and stop.
Complete when: messages.jsonl, extract.json, and metrics.json exist in $RUN, or the run stopped on an unreachable host or too little data.