Agent skill

cost-diff

Snapshot delta between two cost-summary JSON outputs. PR-level cost regression detection — answers "what changed between these two specific snapshots?". Pairs with cost-summary's stable JSON contract.

rUv71,307★ · +1,002/wk · 3 repos on radarProfile →
claude-codecodexcan modify filesMIT
Install
npx skills add ruvnet/ruflo --skill cost-diff --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 5 KB
Bundled scripts: none
Allowed tools: Bash
Path: plugins/ruflo-cost-tracker/skills/cost-diff/SKILL.md
Open the folder on GitHub →
Where it comes from
Source: ruvnet/ruflo
Stars: 67,015 · +629 this week
Language: TypeScript
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

PR-level cost regression detection. Where cost-counterfactual compares to HYPOTHETICAL baselines (always-haiku/sonnet/opus) and cost-burn compares latest bucket to PRIOR MEAN, cost-diff compares two SPECIFIC known-good snapshots. | Question | Skill | |---|---| | "What would we have spent at always-X?" | `cost-counterfactual` | | "Is daily burn accelerating vs prior mean?" | `cost-burn` | | "Did THIS PR add spend vs main?" | **`cost-diff`** ← this | ## Algorithm Implementation: [`scripts/diff.mjs`](../../scripts/diff.mjs). Consumes the stable JSON contract from `cost summary --format json`. 1. Load `--baseline` and `--current` JSON snapshots. 2. Sanity check: both must have `total_cost_usd` + `sessionCount` (cost-summary shape). 3. Per-key delta: `byTier` (haiku/sonnet/opus) and `byModel` (each model). 4. Each entry tagged `added` / `removed` / `changed` based on baseline / current zero-ness. 5. Sort table by `|delta|` descending so the biggest movers are at the top. 6. `--alert-on-pct N`: exit 1 when `total_pct > N`. 7. `--alert-on-usd N`: exit 1 when `total_delta_usd > N`. Both can be set; first to trigger wins. ## PR-gate workflow ```bash # Capture baseline (e.g. on main, via the

What's inside
Steps it walks through
  1. Algorithm
  2. PR-gate workflow
  3. --alert-on-class-pct (iter 86)
  4. Smoke transcript (synthetic baseline + current)
  5. Exit codes
  6. Status column
  7. Composition with cost-summary
Commands it runs
Capture baseline (e.g. on main, via the cost-tracker-smoke CI workflow)
cost summary --format json > baseline.json
On the PR branch, capture current state
cost summary --format json > current.json
cost diff --baseline baseline.json --current current.json \
cost diff --baseline ... --current ... \
More from ruflo
All skills →
About this skill
What does the cost-diff skill do?

Snapshot delta between two cost-summary JSON outputs. PR-level cost regression detection — answers "what changed between these two specific snapshots?". Pairs with cost-summary's stable JSON contract.

How do I install it?

Run `npx skills add ruvnet/ruflo --skill cost-diff --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ruvnet/ruflo, a repository with 67,015 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going