Skip to content

rshade/finfocus / agent-skills/cost-drift

cost-drift

Unverified

Compare actual and projected spend for a Pulumi stack with the FinFocus CLI, flag drifting resources against thresholds in .cost-check.yml, explain likely causes, track the trend, and write a COST_DRIFT.md report. Reads machine-readable JSON, checks the CLI version, and names what to do when the CLI, a billing plugin, credentials, or a Pulumi preview is missing. Use when investigating a cost overrun, validating projections against reality, or watching spend drift in CI. Triggers on: "cost drift", "actual vs projected", "why is spend higher than expected", "drift report", "COST_DRIFT.md".

FileKindSize
SKILL.mdskill md5.3 KB
cost-drift.skillbinary9.8 KB
references/cli-contract.mdmarkdown3.2 KB
references/drift-explanations.mdmarkdown4.6 KB
references/failure-modes.mdmarkdown2.3 KB
references/report-template.mdmarkdown1.9 KB
references/thresholds.mdmarkdown2.6 KB

references/thresholds.md

View on GitHub
<!-- Copyright 2025-2026 Richard Shade. Licensed under Apache-2.0. -->
<!-- SPDX-License-Identifier: Apache-2.0 -->

# Drift thresholds and CI exit codes

## `.cost-check.yml`

The `drift:` section lives in the same file as the `cost-check` thresholds.
Every key is optional. A missing key uses the default.

```yaml
currency: USD
drift:
  drift_pct: 10
  drift_absolute: 50
```

| Key | Default | Unit | Flags when |
| --- | --- | --- | --- |
| `drift.drift_pct` | 10 | percent | `abs(costDrift.percentDrift)` is above it |
| `drift.drift_absolute` | 50 | per month | `abs(costDrift.delta)` is above it |
| `currency` | USD | code | the currency the amounts are written in |

A value that is not a non-negative number is an error. If `currency` differs
from `summary.currency`, skip `drift_absolute` and say why.

## What the CLI limits

The CLI emits `costDrift` only for a drift above 10%. A `drift_pct` below 10
therefore cannot flag anything the CLI did not already report. Keep the key,
and add a report caveat when it is below 10. Rows without `costDrift` are
shown in the non-drifting table with actual and projected values and a drift
column that reads `within 10%`, `new or deleted`, or `insufficient data`.

## No overall drift

The skill reports no overall drift percentage. `summary.totalActualMTD` and
`summary.projectedMonthly` are summed independently, so dividing one by the
other mixes unlike things: the CLI skips actuals for rows with `status`
`creating`, but their projection is in the projected total, and missing actuals
on other rows do the same. Scaling the actuals to a month does not help,
because a resource created inside the window makes the elapsed time too long
for it. On a stack whose resources are days old, the result reads as a large
underspend that the CLI does not report on any row. A `total_drift_pct` key in
an existing file is ignored.

## Baseline for the trend

The previous `COST_DRIFT.md` gives the earlier drifting-resource count and
actual total. Without one, the trend section is omitted.

## CI exit codes

The skill runs inside an agent, so its own exit status belongs to the agent
runner. CI should read one of two things.

1. The result line at the end of the run:

   | Line | Meaning |
   | --- | --- |
   | `COST_DRIFT_RESULT: PASS` | Data present, nothing flagged. |
   | `COST_DRIFT_RESULT: DRIFTING` | Data present, at least one flag. |
   | `COST_DRIFT_RESULT: ERROR (<kind>)` | No trustworthy drift figure. Kinds are in [failure-modes.md](failure-modes.md). |

2. The CLI's own exit code, when the pipeline runs `finfocus` directly.
   Codes are in [cli-contract.md](cli-contract.md).
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 196kUpdated Claude CodeCodexVerifiedInstall