/gbrain:measure-before-you-fix runs instead · from gbrain
Enforces measure-first triage for temporal alerts (stale, timeout, wedged) from gbrain doctor, autopilot, sync, and cron monitors. Runs a stopwatch measurement before any timeout raise or pipeline rewrite.
This skill never runs in Claude Code
It ships in gbrain at plugin/, but /gbrain:measure-before-you-fix (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
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.
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.
This skill guarantees:
--all hides which member is slow).gbrain doctor's warn/fail lines) before the system is declared unhealthy.Read the alert's own numbers. They often contradict the theory already.
(Locks: none means 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-embed
Run it on the specific named entity, not the aggregate. A whole-brain run
hides which member is slow; --source source-a answers the question.
Cross-check state with gbrain 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 via GBRAIN_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.
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.
ps for the worker; check the launch flag;
gbrain jobs list for queued work).Follow the agent operator protocol for any gbrain error code, exit code, [AGENT] block or notice block. Specific to this skill:
gbrain doctor warns or fails: record the exact check and threshold before declaring the system unhealthy; the doctor's 24h/72h sync-freshness thresholds may differ from a cron monitor's.gbrain sources status shows held items or lock_busy: that is the measured cause; fix it and re-measure instead of raising timeouts.source-a, source-b) reported hours-stale.
Three successive root causes were asserted and a wrapper rewrite approved —
before any measurement. The measurement:
time gbrain sync --source source-a --no-embed finished in single-digit
seconds with "Already up to date" (same for source-b), and
gbrain sources status showed every source synced that morning. Every
theory died at once. Actual cause: the monitor alerted at its
act-threshold, hours below gbrain doctor's authoritative warn line. The
fix was two lines (ALERT_HOURS = max(ACT_HOURS, WARN_HOURS)), not a
rewrite. Lesson: when a page repeats about a system that measures healthy,
suspect the thresholds before the system.nice'd) step was equally unfounded — the step
finished in seconds while the host was under sustained concurrent load.
Contention theories need the same stopwatch as staleness theories.The output is a measurement verdict (conversation-level; this skill writes no brain pages). Only after the verdict is a fix proposed, sized against the measured number:
## Measurement verdict
- Alert: <the alert text and which monitor emitted it>
- Claim: <the temporal claim, e.g. "source-a 14h stale">
- Measured: <exact command> → <duration> (<key output, e.g. "Already up to date">)
- Budgeted: <timeout constant + any call-site override, file:line>
- Thresholds: monitor act-line <X>h vs doctor warn-line <Y>h → <match | MISMATCH>
- Verdict: false page on healthy system | needs more time | wedged | genuine regression
- Fix: <the change, justified by the measured number — or "none; adjust the alert line">
investigate — systematic debugging of code bugs ("why is this
broken", 500 errors, wrong output). Boundary: investigate root-causes code
behavior; this skill is the measure-first gate for temporal ops alerts
(stale/timeout/freshness/wedged) that runs before any timeout or threshold
is touched. If the stopwatch confirms a genuine slowness or regression, hand
off to investigate with the measured number.skills/maintain/SKILL.md — runs brain health checks and repairs
(doctor, extraction, dream cycle). Boundary: maintain emits and acts on
health output; this skill governs how to respond when one of those checks
pages, before budgets or wrappers change.skills/cron-scheduler/SKILL.md — schedules monitors and jobs.
Boundary: cron-scheduler decides when monitors run; this skill supplies
the act-line vs alert-line rule their thresholds must encode.skills/conventions/test-before-bulk.md — trial-before-bulk for
mutations. Same spirit (evidence before action), different object: that
convention gates bulk writes; this skill gates timeout/threshold/pipeline
changes.What SKILL.md sets; muted values are Claude Code's defaults
Use when the user asks: "keeps timing out", "ETIMEDOUT", "why is this data stale", "freshness alert", "wedged".
Three short reads, in order
npx claudepluginhub weiping/gbrain-cn --plugin gbrain148 skills in this plugin
/academic-verifyVerify a research claim or academic citation by tracing it through publication → methodology → raw data → independent replication. Routes through perplexity-research for the actual web lookup, then formats results as a citation-checked brain page. Use when a book/article/conversation cites a study and you want to confirm the claim is real, replicated, and accurately characterized./archive-crawlerUniversal archivist for personal file archives (Dropbox/B2/Gmail-takeout/local-mount/hard-drive-dump). Filters for high-value content (the user's own writing, ideas, relationships) and surfaces it interactively. REFUSES TO RUN without an explicit gbrain.yml `archive-crawler.scan_paths:` allow-list./article-enrichmentTransform raw article text dumps in the brain into structured pages with executive summary, verbatim quotes, key insights, why-it-matters, and cross-references. Replaces walls-of-text with quotable, actionable brain pages./ask-userReusable pattern for presenting the user with explicit choices and gating
execution until they respond. Used by other skills when a decision point
requires human input before proceeding. Platform-agnostic — works on
Telegram (inline buttons), Discord, CLI, or any agent with a message tool.
/blog-ingestFeed and whole-publication ingestion: turn an entire blog, newsletter, or
RSS/Atom archive into brain source pages. Covers feed discovery, pagination
walking, normalization to a common article shape, canonical-URL dedup,
idempotent re-runs, 429 pacing, and empty-husk repair. This is the
PUBLICATION-scope skill — a single article URL routes to idea-ingest
instead. Per-article enrichment hands off to the brain-ingest-gate skill;
public posts only (gated content is skipped, never worked around).
/book-mirrorTake any book (EPUB/PDF), produce a personalized chapter-by-chapter analysis. Each chapter is summarized with brief quotes (The Chapter) and mirrored back to the reader's actual life (The Mirror) using brain context. The mirror observes and resonates — a friend pointing out parallels, NOT a consultant rearranging the reader's life, NOT a therapist assigning homework. The reader decides what to do about it. Layout is a top-aligned HTML table or stacked sections, never a bare markdown pipe table (pipe tables center-misalign uneven columns). Output is a single brain page at media/books/<slug>-personalized.md plus an optional PDF via brain-pdf.6 plugins in 3 repositories ship this exact skill · first indexed Oct 9, 2026
Other plugins' skills for the same job