Skip to content

rshade/finfocus / agent-skills/finfocus-budget

finfocus-budget

Unverified

Configure, check, and troubleshoot FinFocus budget thresholds. Use when setting cost.budgets in config.hujson, reading budget health, filtering scopes with --budget-scope, or making cost projected, cost actual, or overview exit non-zero in CI. Triggers on: "finfocus budget", "budget threshold", "exit-on-threshold", "budget health", "scoped budget", "cost.budgets", or a CI gate on FinFocus cost.

FileKindSize
SKILL.mdskill md4.4 KB
finfocus-budget.skillbinary6.8 KB
references/budget-cli.mdmarkdown4.0 KB
references/budget-config.mdmarkdown3.8 KB
references/budget-health.mdmarkdown2.5 KB

references/budget-config.md

View on GitHub
# Budget configuration

`cost.budgets` lives in `config.hujson`. `finfocus config init` creates the
project file (`$PROJECT/.finfocus/config.hujson` plus `.gitignore`) when a
`Pulumi.yaml` is found, and the global file otherwise. Resolution order is
`--project-dir`, `FINFOCUS_PROJECT_DIR`, the nearest `Pulumi.yaml`, then
`~/.finfocus/`. Project keys replace global keys. Missing keys are inherited.

## Scopes

| Scope | Key | Match |
| --- | --- | --- |
| Global | `global` | Required when any other scope is set |
| Provider | `providers.<name>` | Case-insensitive provider name |
| Tag | `tags[]` | Selector `key:value` or `key:*`, plus `priority` |
| Type | `types.<pulumi-type>` | Exact, case-sensitive type token |

Each scope uses the same fields:

| Field | Rule |
| --- | --- |
| `amount` | Required to enable. `0` disables. Negative is rejected |
| `currency` | ISO code. Empty inherits the global currency. A mismatch is an error |
| `period` | Empty or `monthly`. Anything else is rejected |
| `alerts` | `{ "threshold": number, "type": "actual" or "forecasted" }`. Empty uses 50%, 80%, and 100% actual |
| `exit_on_threshold` | Optional bool. Nil inherits the parent `cost.budgets` value |
| `exit_code` | Optional integer 0-255. Nil inherits the parent, which defaults to 1 |

Parent `cost.budgets` may also set `exit_on_threshold` and `exit_code` for
scopes that do not set their own.

Tag selectors match `^[a-zA-Z0-9_-]+:(\*|[a-zA-Z0-9_-]+)$`. When one resource
matches several tag budgets, only the highest `priority` receives the cost.
Equal priorities are ordered by selector, and a warning is emitted.

## Examples

Global gate:

```hujson
{
  "cost": {
    "budgets": {
      "global": {
        "amount": 500,
        "currency": "USD",
        "exit_on_threshold": true,
        "exit_code": 2,
        "alerts": [{ "threshold": 100, "type": "forecasted" }]
      }
    }
  }
}
```

Providers, with one shared exit setting:

```hujson
{
  "cost": {
    "budgets": {
      "global": { "amount": 15000, "currency": "USD" },
      "providers": {
        "aws": { "amount": 8000 },
        "gcp": { "amount": 5000 },
        "azure": { "amount": 2000 }
      },
      "exit_on_threshold": true,
      "exit_code": 1
    }
  }
}
```

Tags and a type. Tag spend stays `$0` until cost results carry tags. The
validator warns:

```text
tag-based budgets are configured but tag allocation is not yet fully implemented; tag budgets will show $0 spend until tag data is available in cost results
```

```hujson
{
  "cost": {
    "budgets": {
      "global": { "amount": 10000, "currency": "USD" },
      "tags": [
        { "selector": "team:platform", "priority": 100, "amount": 3000 },
        { "selector": "env:prod", "priority": 50, "amount": 5000 },
        { "selector": "cost-center:*", "priority": 10, "amount": 1000 }
      ],
      "types": {
        "aws:ec2/instance:Instance": { "amount": 2000 },
        "aws:rds/instance:Instance": {
          "amount": 3000,
          "exit_on_threshold": true,
          "exit_code": 6
        }
      }
    }
  }
}
```

## Environment

| Variable | Effect |
| --- | --- |
| `FINFOCUS_BUDGET_EXIT_ON_THRESHOLD` | `strconv.ParseBool` value stored on the global scope |
| `FINFOCUS_BUDGET_EXIT_CODE` | Integer stored on the global scope |

These write the global scope. CLI flags on that same scope override them.
They leave `cost.budgets.exit_on_threshold` and provider, tag, and type exit
fields unchanged, so they do not control those exit decisions. There is no `FINFOCUS_BUDGET_AMOUNT`
or `FINFOCUS_BUDGET_CURRENCY` reader.

## Errors the loader returns

- `global budget is required when scoped budgets are defined`
- `scoped budget currency must match global budget currency`
- `invalid tag selector format`
- `budget amount cannot be negative`
- `budget period must be 'monthly'`
- `exit code must be between 0 and 255`
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