measure-before-you-fix
하는 일
이 스킬은 에이전트가 무엇인가를 바꾸기 전에 느린 단계를 측정하도록 가르칩니다. 자동화된 데이터 작업을 운영하며 오래됨, 시간 초과, 지연 알림을 받는 사람을 위한 스킬입니다.
사용하는 경우
- ✓알림이 작업이 오래되었다, 시간 초과되었다, 느리다, 몇 시간 뒤처졌다고 말할 때.
- ✓알림에 대응해 시간 제한을 올리거나 파이프라인을 다시 쓰려고 할 때.
- ✓동기화나 예약 점검이 시스템의 최신성 문제를 보고할 때.
스킬 링크
https://github.com/garrytan/gbrain/blob/master/plugin-variants/gbrain-coding/skills/measure-before-you-fix/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“동기화 알림에서 6시간 뒤처졌다고 합니다. 설정을 바꾸기 전에 느린 단계를 측정해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 의심되는 단계를 한 번 스톱워치처럼 측정합니다. 실제 소요 시간을 알고 나서야 수정안을 제안하며, 처음 생각이 틀렸음이 드러나기도 합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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
자주 묻는 질문
제한 시간 설정을 바로 바꾸나요?
아닙니다. 먼저 단계를 측정하고, 실제 소요 시간을 알기 전에는 구조적 수정을 제안하지 않습니다.
과거 사건도 확인하나요?
네. 같은 알림에 대한 이전 메모를 브레인에서 찾습니다. 반복되는 알림에는 기록된 설명이 있는 경우가 많기 때문입니다.
gbrain에서만 쓰나요?
이 스킬은 doctor 점검과 동기화 감시 같은 gbrain 알림을 위해 작성되었습니다.
상세 정보
작성자의 원본 설명
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
인기도
- GitHub 스타
- 31k
- 순위
- #9263
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
gbrain
31k에이전트가 공유 회사 지식 브레인에서 사람, 프로젝트, 결정에 관한 사실을 검색하고, 지속적인 메모를 저장하도록 돕습니다.
brain-ingest-gate
31k새 콘텐츠를 지식 브레인에 추가하기 전에 기존 내용과 비교해 중복을 막고, 고유 명칭을 먼저 확인합니다.
brain-link-discipline
31k에이전트가 브레인 페이지를 보고할 때 같은 메시지에 각 페이지의 작동하는 링크를 포함해, 바로 열어 볼 수 있게 합니다.
brain-ops
31k지식 브레인의 기본 루틴을 제공합니다. 먼저 기존 맥락을 확인하고, 메모는 출처와 함께 저장하며, 관련 페이지를 연결합니다.
비슷한 스킬
openclaw-update
394k에이전트가 설치 방식에 맞는 방법을 골라 기존 OpenClaw Gateway를 업데이트하고, 세션이 계속 작동하도록 돕습니다.
diagnose-gateway
394k에이전트가 설정, 채널, 포트를 확인해 OpenClaw Gateway가 왜 실패하는지 찾되, 아무것도 바꾸지 않도록 돕습니다.
crabbox-apps
394k에이전트가 임시 클라우드 머신에서 앱을 열고 실행한 뒤, 그 화면을 채팅의 측면 패널에 보여 주도록 돕습니다.