Agent skill

Measure Before You Fix

by garrytan in garrytan/gbrain

Before fixing a slow/stale/timeout alert, measure the step yourself.

MITAuto-check passedProductivity & Automation

Install Measure Before You Fix

skills CLI
$ npx skills add garrytan/gbrain --skill measure-before-you-fix -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install garrytan/gbrain measure-before-you-fix --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/garrytan/gbrain.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/measure-before-you-fix .claude/skills/measure-before-you-fix && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
measure-before-you-fix
GitHub stars
31k
Token cost
~2.5k tokens
SKILL.md length
1,198 words
Files
2
Skills in repo
47
Repo updated
First seen
Licence
MIT

At a glance

Before fixing a slow/stale/timeout alert, measure the step yourself.

  • Works in 5 steps: Read the alert's own numbers. They often… → Time the suspect step directly. Isolate… → Compare measured vs. budgeted. Grep… → …
  • Tasks that involve Scheduled and recurring tasks
  • SKILL.md covers The rule, Contract, Procedure and The threshold-mismatch failure…, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Measure Before You Fix is an agent skill from garrytan/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.

Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file.

It sits in Productivity & Automation, covering Scheduled and recurring tasks. The repository describes itself as: Garry's Opinionated OpenClaw/Hermes Agent Brain. The licence is MIT.

When your agent uses it

  • Tasks that involve Scheduled and recurring tasks

Example prompts

  • “/measure-before-you-fix”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Read the alert's own numbers. They often contradict the theory already.
  2. Time the suspect step directly. Isolate the smallest unit that the alert
  3. Compare measured vs. budgeted. Grep every timeout in the wrapper, not
  4. Check the alert threshold against the authoritative one. Before
  5. Only now design the fix — against the number you measured.

What it can do on your machine

Read from SKILL.md and the folder at commit f250a51. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are bash and javascript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Measure Before You Fix loads about 2.5k tokens when it runs. Until then it costs about 92 tokens; SKILL.md has 1,198 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~92
When it runs · the whole SKILL.md, loaded when a task matches
~2.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from garrytan/gbrain at commit f250a51, republished under its MIT licence (© garrytan). 1,198 words, ~2,512 tokens.

Download SKILL.mdSave it as .claude/skills/measure-before-you-fix/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
measure-before-you-fix
description
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.
version
1.0.0
triggers
keeps timing out, ETIMEDOUT, why is this data stale, freshness alert, wedged, job is slow, sync is stuck, raise the timeout
mutating
false
writes_pages
false
upstream
measure-before-you-fix@fc834ee

Measure Before You Fix

Convention: see conventions/brain-first.md — before re-deriving a diagnosis, search the 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 (--all hides 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

  1. 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.)

  2. Time the suspect step directly. Isolate the smallest unit that the alert blames, and run it with a clock:

    bash
    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).

  3. Compare measured vs. budgeted. Grep every timeout in the wrapper, not just the default in the helper signature:

    bash
    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.

  4. 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.

  5. 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:

js
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 flight" — verify whether recovery is in fact running before believing it (ps for the worker; check the launch flag; gbrain jobs list for queued work).
  • "Already up to date" in the step output. That step is not your bottleneck.

When it fails

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.
Show full SKILL.md (471 more words)Show less

Anti-Patterns

  • Raising a timeout to fix a stall. If the step is genuinely hung, a bigger budget just hangs longer. Measure, then decide between "needs more time" and "is wedged" — they have opposite fixes. (gbrain's sync stall watchdog makes the same distinction natively: it keys on forward progress, not elapsed time.)
  • Rewriting a pipeline on an unmeasured starvation theory. Splitting steps to fix starvation that does not exist adds surface area and fixes nothing.
  • Trusting the alert's causal claim. Alerts report symptoms accurately and causes badly. The staleness number is real; the reason attached to it is a guess.
  • Skillifying or persisting a root cause you have not measured. A confident wrong diagnosis baked into a playbook is worse than the original bug.

Known failure modes handled

  • Triple-wrong diagnosis on a freshness alert. A cron monitor paged repeatedly about two sources (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.
  • Contention-theory corollary caught in the same pass: a CPU-contention worry about a deprioritized (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.

Output Format

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">

Dedup (sharp boundaries)

  • GStack 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.
  • smoke-test (host-side) — binary post-restart health checks with auto-fix. Boundary: smoke-test answers "is it up after a restart"; this skill answers "is this slow/stale claim even true".
  • 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.

© garrytan, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/measure-before-you-fix of garrytan/gbrain.

  • SKILL.md
  • routing-eval.jsonl

Open the folder on GitHubat commit f250a51

Compare with similar skills

Measure Before You Fix next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Measure Before You Fix compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Measure Before You Fix this skillgarrytan/gbrain31k—~2.5kAutomated safety check: PassMIT
ScheduleTinyAGI/tinyagi3.6k—~1.4kAutomated safety check: PassMIT
Send User MessageTinyAGI/tinyagi3.6k—~829Automated safety check: PassMIT
Cron Opsczl9707/build-your-own-openclaw1.9k—~593Automated safety check: PassMIT
X Bookmarkssharbelxyz/x-bookmarks289—~2kAutomated safety check: NotesNone
Wp Wpcli And OpsAutomattic/agent-skills2112 repos~988Automated safety check: PassNone

Similar skills

  • Schedule

    TinyAGI/tinyagi

    Create, list, and delete scheduled tasks (recurring or one-time) that send messages to agents.

    3.6k GitHub stars~1.4k tokensUpdated 6 mo ago
    Productivity & AutomationAuto-check passed
  • Send User Message

    TinyAGI/tinyagi

    Send a proactive message to a paired user via their channel (Discord, Telegram, or WhatsApp).

    3.6k GitHub stars~829 tokensUpdated 6 mo ago
    Productivity & AutomationAuto-check passed
  • Cron Ops

    czl9707/build-your-own-openclaw

    Create, list, and delete scheduled cron jobs. An agent skill from czl9707/build-your-own-openclaw.

    1.9k GitHub stars~593 tokensUpdated 3 mo ago
    Productivity & AutomationAuto-check passed
  • X Bookmarks

    sharbelxyz/x-bookmarks

    Fetch, summarize, and manage X/Twitter bookmarks via bird CLI or X API v2.

    289 GitHub stars~2k tokensUpdated 7 mo ago
    Productivity & AutomationAuto-check: notes
  • Wp Wpcli And Ops

    Automattic/agent-skills

    A skill your agent uses when working with WP-CLI (wp) for WordPress operations: safe search-replace, db export/import, plugin/theme/user/content management, cron, cache flushing, multisite, and…

    211 GitHub starsUsed in 2 repos~988 tokens
    Productivity & AutomationAuto-check passed
  • Ohdear

    ohdearapp/ohdear-cli

    Manage Oh Dear website monitoring using the ohdear CLI. An agent skill from ohdearapp/ohdear-cli.

    141 GitHub stars~1.1k tokensUpdated 1 mo ago
    Productivity & AutomationAuto-check passed

More from garrytan/gbrain

All 47 skills in this repo
  • Traces a factual error the user points out back to its source (a brain page, a memory file, SOUL.md or USER.md, or a hallucination) and fixes that source instead of just noting the correction.

    31k GitHub stars~3.4k tokensUpdated today
    Auto-check passed
  • Searches and writes a company-wide knowledge brain through the gbrain CLI, so durable decisions and facts about people, projects and history stay findable beyond one session.

    31k GitHub stars~875 tokensUpdated today
    Auto-check passed
  • Idea Ingest

    garrytan/gbrain

    Ingest links, articles, tweets, and ideas into the brain. An agent skill from garrytan/gbrain.

    31k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Sends what your notes already know about a topic to Perplexity, so the cited web search reports only what is new, such as entity updates or deal changes.

    31k GitHub stars~2k tokensUpdated today
    Auto-check: notes
  • Schema Unify

    garrytan/gbrain

    Migrate a brain from gbrain-base (or any pack) to gbrain-base-v2's 14-canonical-type taxonomy via gbrain onboard --check + the unify-types Minion handler.

    31k GitHub stars~3.4k tokensUpdated today
    Auto-check passed
  • Skillpack Check

    garrytan/gbrain

    Run gbrain skillpack-check to produce an agent-readable JSON health report for the gbrain install.

    31k GitHub stars~1.4k tokensUpdated today
    Auto-check passed

Questions about Measure Before You Fix

What does Measure Before You Fix do?

Before fixing a slow/stale/timeout alert, measure the step yourself. Measure Before You Fix is an agent skill from garrytan/gbrain. Before fixing a slow/stale/timeout alert, measure the step yourself.

When should I use Measure Before You Fix?

Measure Before You Fix fits situations like: tasks that involve Scheduled and recurring tasks.

How do I install Measure Before You Fix in Claude Code?

Run `npx skills add garrytan/gbrain --skill measure-before-you-fix -a claude-code`. Or copy the skill folder (skills/measure-before-you-fix in garrytan/gbrain) into .claude/skills/measure-before-you-fix in your project. Claude Code loads it when a task matches its description.

How do I install Measure Before You Fix in Codex?

Run `npx skills add garrytan/gbrain --skill measure-before-you-fix -a codex`. Or copy the skill folder (skills/measure-before-you-fix in garrytan/gbrain) into .agents/skills/measure-before-you-fix in your project. Codex loads it when a task matches its description.

Can I use Measure Before You Fix in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add garrytan/gbrain --skill measure-before-you-fix -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/measure-before-you-fix, .gemini/skills/measure-before-you-fix, .github/skills/measure-before-you-fix and .opencode/skills/measure-before-you-fix in your project.

What does Measure Before You Fix need to run?

SKILL.md names no scripts, command-line tools or credentials: Measure Before You Fix is instructions for the agent only.

Does Measure Before You Fix access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Measure Before You Fix safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Measure Before You Fix use?

Measure Before You Fix is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Measure Before You Fix use?

About 2.5k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Measure Before You Fix?

Skills that share tags, products or a category with Measure Before You Fix: Schedule (TinyAGI/tinyagi, 3.6k stars), Send User Message (TinyAGI/tinyagi, 3.6k stars), Cron Ops (czl9707/build-your-own-openclaw, 1.9k stars) and X Bookmarks (sharbelxyz/x-bookmarks, 289 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Measure Before You Fix?

garrytan (a GitHub user) maintains it in garrytan/gbrain, which has 30,736 GitHub stars. The repository holds 47 skills in this directory. The repository was last updated on October 10, 2026.

Source: garrytan/gbrain on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.