measure-before-you-fix
Was er macht
Dieser Skill bringt deinem Agenten bei, einen langsamen Schritt zu messen, bevor er etwas ändert. Er ist für Leute, die automatisierte Datenjobs betreiben und Warnungen bekommen, dass etwas veraltet, abgelaufen oder im Rückstand ist.
Wann du ihn nutzt
- ✓Wenn eine Warnung meldet, dass ein Job veraltet, abgelaufen, langsam oder Stunden im Rückstand ist.
- ✓Wenn jemand als Reaktion auf eine Warnung ein Timeout erhöhen oder eine Pipeline umschreiben will.
- ✓Wenn ein Sync oder eine geplante Prüfung ein Aktualitätsproblem in deinem System meldet.
Link zum Skill
https://github.com/garrytan/gbrain/blob/master/plugin-variants/gbrain-coding/skills/measure-before-you-fix/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Der Sync-Alarm sagt, wir sind sechs Stunden im Rückstand. Miss den langsamen Schritt, bevor wir irgendwelche Einstellungen ändern.”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Der Agent misst den vermuteten Schritt einmal mit einer stoppuhrartigen Messung. Erst wenn er die echte Dauer kennt, schlägt er eine Lösung vor, was oft zeigt, dass die erste Idee falsch war.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von GitHub.
Measure Before You Fix
Convention: see conventions/brain-first.md — before re-deriving a diagnosis,
searchthe brain for prior incidents of the same alert. A recurring alert usually has a recorded verdict already.
Route here on any alert whose claim is temporal — "X is stale", "step timed out", "pipeline wedged", "job is slow", "N hours behind". These alerts invite an immediate structural fix (raise the timeout, split the step, reorder the pipeline). Do the measurement first. It is almost always cheaper than the fix, and it frequently invalidates it. (Routing is a harness convention, not a mechanical guarantee — the contract below is the discipline that makes it stick.)
On gbrain surfaces this covers: gbrain doctor staleness checks (e.g. sync
freshness, cycle freshness), autopilot cycle alerts, the sync stall watchdog
(reason: 'stall_timeout'), and any cron monitor built on top of them.
The rule
One stopwatch measurement of the suspect step, before any code change.
If you cannot state the measured duration of the thing you claim is slow, you do not yet know the root cause, and any fix you write is a guess wearing a diff.
Contract
This skill guarantees:
- No structural fix (timeout raise, step split, pipeline reorder, wrapper rewrite) is proposed before a measured duration of the blamed step exists.
- The measurement targets the specific entity the alert named, not the
aggregate (
--allhides which member is slow). - The alert's threshold is compared against the authoritative one
(
gbrain doctor's warn/fail lines) before the system is declared unhealthy. - The verdict explicitly distinguishes "needs more time" from "is wedged" — they have opposite fixes.
- Read-only: this skill changes no timeouts, thresholds, or code. It produces a measurement verdict that sizes the fix; the fix itself is a separate, now-informed change.
Procedure
Read the alert's own numbers. They often contradict the theory already. (
Locks: nonemeans it isn't lock contention. Note it and drop that branch.)Time the suspect step directly. Isolate the smallest unit that the alert blames, and run it with a clock:
time gbrain sync --source source-a --no-embedRun it on the specific named entity, not the aggregate. A whole-brain run hides which member is slow;
--source source-aanswers the question. Cross-check state withgbrain sources status(per-source sync lag).Compare measured vs. budgeted. Grep every timeout in the wrapper, not just the default in the helper signature:
grep -n "timeoutMs\|timeout:" <the wrapper or cron script>A generous per-call override makes the helper's default irrelevant. Check the call site before blaming the default.
Check the alert threshold against the authoritative one. Before concluding the system is broken, confirm the alerter and the audit agree on what "bad" means.
gbrain doctor's sync-freshness check defaults to 24h warn / 72h fail (env-overridable viaGBRAIN_SYNC_FRESHNESS_WARN_HOURS/GBRAIN_SYNC_FRESHNESS_FAIL_HOURS); a cron monitor paging at 12h is speaking below the authoritative warn line. A monitor that acts early is correct; a monitor that speaks at its act-line is a false-positive generator.Only now design the fix — against the number you measured.
The threshold-mismatch failure mode
A cron monitor legitimately acts earlier than the doctor fails, to keep drift out of FAIL territory. That is good design. The bug is reusing the act-threshold as the alert-threshold: everything between "act" and "warn" becomes a recurring page about a healthy system.
Separate the two constants. Act at the aggressive line, speak at the authoritative one:
const ACT_HOURS = Number(env.MONITOR_ACT_HOURS || 12); // act early — fine
const ALERT_HOURS = Math.max(ACT_HOURS, DOCTOR_WARN_HOURS); // speak at the audit's line
Symptom to recognize instantly: a repeating alert whose numbers sit below the doctor's own warn line, while the underlying resource looks fine when queried directly.
Red flags that you are theorizing, not diagnosing
- You have a root cause but no measured duration.
- Your fix is a rewrite and you have not run the step once.
- You revise the theory twice without taking a new measurement between revisions.
- The alert says "no recovery in flig
Häufige Fragen
Ändert er meine Timeout-Einstellungen sofort?
Nein. Er misst den Schritt zuerst und schlägt keine strukturelle Lösung vor, bevor er eine echte Dauer hat.
Prüft er frühere Vorfälle?
Ja. Er durchsucht dein Brain nach früheren Notizen zum selben Alarm, denn ein wiederkehrender Alarm hat oft eine dokumentierte Erklärung.
Ist das nur für gbrain?
Er wurde für gbrain-Alarme geschrieben, etwa Doctor-Prüfungen und Sync-Watchdogs.
Details
Originalbeschreibung des Autors
Before fixing a slow/stale/timeout alert, measure the step yourself. Kill the theory with a stopwatch, not a code change. Measure-first ops triage for temporal alerts (stale, timeout, freshness, wedged, N hours behind) from gbrain doctor, autopilot, sync, and cron monitors — runs BEFORE any timeout raise, threshold change, or pipeline rewrite.
repo: garrytan/gbrain
Beliebtheit
- GitHub-Sterne
- 31k
- Platz im Ranking
- #9263
- Lizenz
- MIT
- Aktualisiert
- 2.11.2026
Kommentare
- …
Weitere Skills aus diesem Repository
gbrain
31kLässt deinen Agenten in einem gemeinsamen Firmenwissens-Gehirn nach Fakten zu Personen, Projekten und Entscheidungen suchen und dauerhafte Notizen darin speichern.
brain-ingest-gate
31kPrüft neue Inhalte gegen ein bestehendes Wissens-Gehirn, bevor sie hinzugefügt werden, um Dubletten zu vermeiden und benannte Entitäten vorab zu klären.
brain-link-discipline
31kSorgt dafür, dass dein Agent jede Gehirn-Seite, über die er berichtet, im selben Beitrag mit einem funktionierenden Link versieht, damit du sie sofort öffnen kannst.
brain-ops
31kGibt deinem Agenten die Grundroutine für ein Wissens-Gehirn: zuerst vorhandenen Kontext prüfen, ausdrückliche Notizen mit Quelle speichern und verwandte Seiten verlinken.
Ähnliche Skills
openclaw-update
394kHilft deinem Agenten, ein bestehendes OpenClaw-Gateway zu aktualisieren, mit der Methode, die zu deiner Installation passt, während deine Sitzung weiterläuft.
diagnose-gateway
394kHilft deinem Agenten herauszufinden, warum dein OpenClaw-Gateway fehlschlägt, indem er Einstellungen, Kanäle und Ports prüft, ohne etwas zu ändern.
crabbox-apps
394kHilft deinem Agenten, eine App auf einer temporären Cloud-Maschine zu öffnen und auszuführen und ihre Ansicht in deinem Chat-Seitenpanel zu zeigen.