| name | toil-mining |
| description | Mine caller-supplied usage history for repeated toil and emit ranked evidence. Triggers: "mine toil", "find repeated operational work". |
| practices | ["sre","lean-startup"] |
| hexagonal_role | supporting |
| consumes | [] |
| produces | ["toil-candidates-report"] |
| context_rel | [{"kind":"supplier-to","with":"automation-shape-routing"}] |
| skill_api_version | 1 |
| user-invocable | true |
| context | {"window":"fork","intent":{"mode":"task"},"sections":{"exclude":["HISTORY"]},"intel_scope":"topic"} |
| metadata | {"capabilities":["toil_mining"],"effects":["write_toil_candidates"],"canonical_status":"canonical","disposition":"keep_specialist","tier":"meta","dependencies":[],"stability":"experimental"} |
| output_contract | ranked toil evidence report, inline by default; optional artifact under .agents/scratch/toil-mining/ |
Toil Mining — rank repeated friction
Mine explicitly supplied session, shell, RTK, or CASS history without modifying
the sources. The result is evidence for a caller; this skill does not file work,
schedule automation, or mutate a tracker.
Constraints
- Read-only over the supplied sources, because the skill gathers evidence and
must never become a mutation lane.
- No work creation: it never files a tracker item, schedules automation, or
names an owner, because those are caller decisions the evidence informs.
- Measured, not remembered: every count, cost, and error rate is read from the
supplied history, so recency and salience cannot masquerade as frequency.
- Observations stay separate from recommendations, so a caller can re-weigh the
ranking without inheriting an unstated conclusion.
Procedure
- Record the input sources, time window, filters, and query.
- Normalize repeated human actions while excluding documented machine echoes
and generated repetitions. For caller-supplied Codex JSONL, use the
deterministic helper below rather than an ad hoc transcript scan.
- Cluster equivalent actions and preserve representative evidence references.
- Score each cluster from measured frequency and observed pain such as elapsed
time, failure count, interruption, or token cost.
- Emit a ranked report and stop.
Each candidate must contain a measured count, source references, confidence in
the clustering, pain evidence, and the smallest plausible automation shape.
Separate observations from recommendations.
Repetition threshold: measured, not remembered
A cluster qualifies as toil only above a measured floor: at least three
occurrences in the supplied window, each resolvable to a source reference. Two
occurrences are a coincidence; a vivid memory of "doing this constantly" with
one resolvable instance is an anecdote. The named failure mode is
salience mining — ranking by how annoying the last occurrence felt rather than
by count, which surfaces yesterday's irritation over the quiet weekly drain.
If the supplied history cannot establish the count, report the candidate as
below-threshold with its actual measured count; never round an impression up
to a frequency.
Weighted priority: frequency x cost x error-proneness
Rank clusters by the product of three measured factors, not by any single one:
- frequency — occurrences per window, from the cluster count;
- cost — median elapsed time or token cost per occurrence, from the
evidence, not from recall;
- error-proneness — fraction of occurrences showing a failure, retry, or
correction in the source.
Score each factor from cited evidence and show the three inputs next to every
composite score so the caller can re-weigh them. A factor the history cannot
support is reported as unmeasured — scored at the floor, never guessed at the
midpoint. The named failure mode is frequency-only ranking: a daily two-second
nuisance outranking a weekly half-hour error-prone ritual because only one
axis was measured. The product form exists precisely so that a high-frequency,
near-zero-cost, never-fails cluster ranks where it belongs: low.