measure-before-you-fix
Fungsinya
Skill ini mengajari agent Anda untuk mengukur langkah yang lambat sebelum mengubah apa pun. Skill ini ditujukan bagi orang yang menjalankan pekerjaan data otomatis dan menerima peringatan bahwa sesuatu sudah usang, kehabisan waktu, atau tertinggal.
Kapan dipakai
- βSaat peringatan menyatakan bahwa sebuah pekerjaan sudah usang, kehabisan waktu, lambat, atau tertinggal berjam-jam.
- βKetika seseorang ingin menaikkan batas waktu atau menulis ulang pipeline sebagai respons terhadap peringatan.
- βSaat sinkronisasi atau pemeriksaan terjadwal melaporkan masalah kesegaran data dalam sistem Anda.
Link skill
https://github.com/garrytan/gbrain/blob/master/plugin-variants/gbrain-coding/skills/measure-before-you-fix/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βPeringatan sinkronisasi menyatakan kita tertinggal enam jam. Ukur langkah yang lambat sebelum kita mengubah pengaturan apa pun.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent mengukur durasi langkah yang dicurigai sekali dengan pengukuran seperti stopwatch. Hanya setelah tahu durasi sebenarnya, agent mengusulkan perbaikan, dan sering kali hasilnya menunjukkan bahwa dugaan awal keliru.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum
Apakah pengaturan timeout saya langsung diubah?
Tidak. Agent mengukur langkah itu terlebih dahulu dan tidak mengusulkan perbaikan struktural sebelum memiliki durasi yang nyata.
Apakah agent memeriksa insiden sebelumnya?
Ya. Agent mencari catatan sebelumnya tentang peringatan yang sama di brain Anda, karena peringatan yang berulang sering sudah memiliki penjelasan yang tercatat.
Apakah ini hanya untuk gbrain?
Skill ini ditulis untuk peringatan gbrain, seperti pemeriksaan doctor dan watchdog sinkronisasi.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 31k
- Peringkat
- #9263
- Lisensi
- MIT
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
gbrain
31kMemungkinkan agent Anda mencari fakta tentang orang, proyek, dan keputusan di basis pengetahuan bersama perusahaan, serta menyimpan catatan penting.
brain-ingest-gate
31kMemeriksa konten baru terhadap basis pengetahuan yang sudah ada sebelum ditambahkan, untuk menghindari duplikat dan menyelesaikan entitas bernama lebih dulu.
brain-link-discipline
31kMemastikan agent Anda menyertakan tautan yang berfungsi ke setiap halaman basis pengetahuan yang dilaporkannya, dalam pesan yang sama, agar Anda bisa langsung membukanya.
brain-ops
31kMemberi agent Anda rutinitas inti untuk basis pengetahuan: memeriksa konteks yang ada terlebih dahulu, menyimpan catatan eksplisit beserta sumbernya, dan menautkan halaman terkait.
Skill serupa
openclaw-update
394kMembantu agent Anda memperbarui OpenClaw Gateway yang sudah ada, dengan memilih metode pembaruan yang sesuai cara pemasangannya dan menjaga sesi Anda tetap berjalan.
diagnose-gateway
394kMembantu agent Anda mencari tahu mengapa OpenClaw Gateway gagal dengan memeriksa pengaturan, channel, dan port tanpa mengubah apa pun.
crabbox-apps
394kMembantu agent Anda membuka dan menjalankan aplikasi di mesin cloud sementara, lalu menampilkan tampilannya di panel samping chat Anda.