agentleFS
alanvaa06alanvaa06/forge-master/skills/budget/SKILL.md

budget

Skill2 starsChanged 5 months agoMITView on GitHub

Estimate the token cost of an approved-shape plan before it is frozen. Reads the PRD and the plan, produces a per-phase Budget Matrix (tier/process/AC-count drivers → estimated token range), flags phases whose cost contradicts their tier/process tag, and writes principled phase_budget / run_budget values into the plan's Run Config. Optional, informative, never a gate. Use after plan-design has decomposed phases but before gate-2 approval, or when the user says "estimate the budget", "how much will this cost", or "/forge-master:budget".

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. Co4an/claude-auto★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository6 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Timing matters: Run AFTER plan-design has decomposed phases but BEFORE gate-2 approval — the budgets you write become part of the FROZEN …

    line 20
  2. Very specific:

    Read the target docs/forge/plans/plan-NNN.md: phases, their tier, process, covers (AC IDs), depends_on, and any ## Parallel Groups.

    line 25
  3. Very specific:

    Read the PRD docs/forge/prd/NNN-name.md for AC complexity (a multi-clause Given/When/Then costs more than a one-liner).

    line 26
  4. Very specific:

    Read docs/context/lessons.md — if past runs recorded actual phase costs, calibrate against them instead of priors.

    line 27

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

budget — Token Budget Matrix (optional, before gate 2)

<!-- markers: ## Budget Matrix · phase_budget · run_budget · order-of-magnitude · OPTIONAL · gate 2 · never a gate -->

Turn the plan's hand-waved budget heuristics into principled numbers. You estimate the token cost of each phase from signals already in the plan, present a matrix, and fill the phase_budget / run_budget fields the loop already consumes (phase_budget → early-escalation signal; run_budget → clean-stop cap).

This step is OPTIONAL. Small plans (few light phases) don't need it — the default heuristics are fine. When the plan looks small, say so and offer the choice as a lettered list (mark one Recommended) rather than deciding silently:

This plan is small (few light phases). Estimate the budget? a) Skip — Recommended, default heuristics are fine here; return to gate 2 b) Run the matrix anyway — you want a cost ceiling set with eyes open

It is worth running when the plan is large, has heavy phases, declares parallel groups, or the user wants a cost ceiling set with eyes open — recommend (b) in those cases.

Timing matters. Run AFTER plan-design has decomposed phases but BEFORE gate-2 approval — the budgets you write become part of the FROZEN contract, approved by the human alongside the phase list. Never edit an already-frozen plan; if invoked on one, re-open it explicitly for re-approval.

It is NOT a gate and NEVER blocks. Estimates are rough by nature. Present ranges and order-of-magnitude, never false precision. The human still decides at gate 2.

Step 1 — Load inputs

  • Read the target docs/forge/plans/plan-NNN.md: phases, their tier, process, covers (AC IDs), depends_on, and any ## Parallel Groups.
  • Read the PRD docs/forge/prd/NNN-name.md for AC complexity (a multi-clause Given/When/Then costs more than a one-liner).
  • Read docs/context/lessons.md — if past runs recorded actual phase costs, calibrate against them instead of priors.

Step 2 — Estimate per phase (drivers, not guesses)

Estimate each phase from these drivers. Treat the anchors as order-of-magnitude priors, not promises:

drivereffect on cost
tierjunior = small/cheap model, low effort · senior = top model, high effort (roughly an order more)
processlight = one implement + test-after + commit cycle · heavy = phase spec + a red-green TDD cycle PER covered AC + an independent review pass (several × light)
# covered ACsheavy cost scales ~linearly per AC (one cycle each); light scales weakly
review iterationsheavy phases may loop on blockers — add headroom, don't assume first-pass
files touchedmore files in the plan notes / cited File Map rows → more context per dispatch

Express each phase as a RANGE (low–high), not a point. State your anchors so the estimate is reproducible.

Step 3 — Build the Budget Matrix

Present:

| Phase | tier | process | #AC | est. tokens (low–high) |
|-------|------|---------|-----|------------------------|
| P1    | ...  | ...     | ... | ...                    |
| TOTAL |      |         |     | sum(low) – sum(high)   |

For parallel groups, note that members spend concurrently — the TOTAL token cost is unchanged, but wall-clock compresses; do not double-count.

Step 4 — Flag tag/cost contradictions

A phase tagged junior/light whose estimate lands high is probably mis-tagged. Flag it and recommend bumping the tag at plan time — re-tagging now is free; discovering it via runtime escalation costs K wasted red iterations first. This feeds the same triage discipline as lessons.md.

Step 5 — Write the budgets into the plan

With the matrix agreed, fill the plan's Run Config:

  • phase_budget: a per-phase soft signal — set near the high end of a typical phase's estimate (exceeding it early-escalates, it is not a kill).
  • run_budget: a safety CAP, not a prediction — set to TOTAL high estimate × a headroom factor (e.g. 1.3). On exhaustion the loop stops cleanly with a report. Frame both to the user in those terms: signal vs cap.

Step 6 — Hand back

The matrix is informative AND it has filled the contract's budget fields. Tell the user the numbers are estimates with wide error bars, then return to plan-design's gate 2 — the human approves the phases AND these budgets together. budget never approves anything itself and never blocks the run.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.