Measure

From melodic-software/claude-code-plugins · View interactive version

Measure is an AI agent skill from the GitHub repository melodic-software/claude-code-plugins. Verify a measurable-improvement claim against a baseline captured BEFORE the change. Two metric families (`performance`: wall time, memory, allocations, throughput, latency; `metrics`: complexity, coverage, coupling), each with a `baseline` phase at planning time and a `compare` phase after the chan

How to use this skill

Skill file

Arguments. [performance|metrics] [baseline|compare]. e.g., /verification:measure performance, /verification:measure metrics baseline

Purpose

/verification:measure answers "did the claimed improvement actually happen, by how much?". It measures a delta (before → after) against a baseline captured before the change. It is the measurable-delta twin of /verification:confirm (which confirms intent/outcome) and is distinct from a review gate (which reviews design quality for ship-readiness on an absolute axis).

Core rule: never claim improvement without a baseline captured before the change. If no baseline exists, report honestly, "Baseline not captured. Current measurement: X. Cannot quantify improvement.", and never fabricate a delta.

Two-phase model

The measurement mechanism is SSOT here; the planning stage routes to it when a plan states a measurable goal, /verification:confirm redirects improvement claims to it.

| Phase | Stage | Who invokes | What it does |

|-------|-------|-------------|--------------|

| baseline | planning time (plan states a measurable goal) | /verification:measure <family> baseline | Capture pre-change measurements → store under the topic's memory-tier baselines/ + record baseline + target in the plan |

| compare | after the change (default phase) | /verification:measure <family> | Re-measure under the same conditions → compare to the stored baseline → verify the claim |

Baseline storage: the topic's memory tier. <memory_dir>/<slug>/baselines/ (default .work/), placed per the lifecycle artifact protocol (CODE2). Baselines are machine-bound measurements and are never committed, and the plan never cites their path. The plan (<memory_dir>/<slug>/PLAN.md) records the baseline values + target; the comparison summary surfaces in the plan and the PR body.

Behavior baselines. Recorded outputs captured before a rewrite, the old-implementation side of /verification:confirm refactor's differential evidence for a Replace, are not a third family: they use this same baselines/ storage and the same rule, captured before the change and never after the fact. Outputs recorded from the new implementation compare it with itself and are not a baseline. Such a baseline proves sameness with the old behavior, not correctness.

Measurement tooling: use whatever harness the consuming project wires; when none exists, run both phases manually per the context-file discipline. Do not add a harness speculatively.

Mode dispatch

Parse $ARGUMENTS for a metric family first, then a phase (baseline / compare; default compare).

| Signal | Family | Read |

|--------|--------|------|

| performance, "is it faster", "before/after" runtime numbers, memory / allocations / throughput / latency | performance | context/performance.md |

| metrics, "is it simpler/cleaner", complexity / coverage / CRAP / coupling / duplication | metrics | context/metrics.md |

No family argument → infer from the claim: runtime-resource claims → performance; code-shape claims → metrics. If the claim is ambiguous ("more efficient"), ask which resource before measuring.

Each context file owns its family's full discipline: claim-to-metric mapping, measurement methodology, report template, verdict vocabulary, and pitfalls.

Prerequisite. Green mechanical state (both phases)

Measuring broken code is meaningless, and a baseline captured on a broken tree poisons every later comparison. Before either phase, baseline capture or compare, confirm the mechanical pass is green: reuse a /toolchain:check (if enabled) or /verification:confirm Stage-1 result from this conversation if nothing changed since; otherwise invoke /toolchain:check (if enabled) via the Skill tool, or run the project's own build/test command when it is absent. Do not reimplement build/test/lint here.

Integration

| Condition | Action |

|-----------|--------|

| An approved plan states a measurable goal | Run the baseline phase before implementation |

| Improvement claimed without data (in /verification:confirm, review, or conversation) | Redirect here. performance or metrics per the claim |

| Verdict is DEGRADED or NOT CONFIRMED | Surface immediately; the claim does not hold. Fix or withdraw it |

| Measurement complete | Feed the comparison table into the /verification:confirm outcome report; surface the summary in the plan artifact / PR body |

Record the verdict for the head it judged

Once a compare verdict is final, store it for the commit it judged, so the pull request ready

report can name it:

bash "${CLAUDE_PLUGIN_ROOT}/scripts/confirm-verdict.sh" record --of measure --head <sha> --verdict '<verdict>' --claim '<claim>'

the NOT CONFIRMED or INCONCLUSIVE the family file gives that case; otherwise the family's

verdict word.

uncommitted changes, not that head. Say it was not recorded and why.

The record is advisory. It never gates the ready flip, and a commit after it leaves the new head

with no verdict. A baseline phase records nothing.

What this skill does not do

Next

Gotchas

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.