agentleFS
mollendorff-aimollendorff-ai/forge/skills/forge-modelling/SKILL.md

forge-modelling

Skill11 starsChanged 8 days agoApache-2.0View on GitHub

Works out questions that need numbers, such as which job offer pays more, settle or go to court, pay down the mortgage or invest, how many sales a day to break even, how likely a plan is to lose money, or whether to match a rival's price cut, and builds budgets, forecasts, prices, unit economics, scenarios and simulations, with Forge (mollendorff-ai/forge). Use it rather than mental arithmetic or a one-off script whenever the answer rests on assumptions, even when the reply must be one line or a JSON object for a program. Forge calculates the figures from a YAML model with Excel-style formulas, and the user keeps a file they can read, change, run again and open in Forge Studio in a browser. Forge also rolls a decision tree back at every choice, finds a break-even, simulates uncertain inputs with the plan beside the mean, and finds a game's equilibria. Use it too when the user names Forge, a Forge YAML model, forge calculate or the forge_* MCP tools.

  • Installs packages

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 2 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

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

    If the forge_* tools are in your tool list (the MCP server), use them and skip the install: the table in With the MCP tools gives the tool …

    line 16
  2. Very specific:

    Start from forge examples starter, which prints a first model with comments.

    line 31
  3. Distinctive:

    Run these in order, and fix what each says before the next:

    line 60
  4. Very specific:

    Before you report a result, show where it comes from and work it out another way, by hand or in your own code.

    line 136
  5. Very specific:

    Every model file you wrote or changed, in full, with its file name.

    line 152
  6. Very specific:

    forge calculate rewrites the file: Use --dry-run to look first.

    line 162
  7. Distinctive:

    Read these only when a step needs them:

    line 185
  8. Very specific:

    Every MCP tool and its arguments: <https://github.com/mollendorff-ai/forge/blob/main/docs/MCP.md>

    line 189

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

Modelling with Forge

You write the model; Forge does the arithmetic. Never work out a result yourself and type it into the file, and never report a result Forge did not calculate (your own working is a check of it, step 5, not a replacement).

1. Get Forge

If the forge_* tools are in your tool list (the MCP server), use them and skip the install: the table in With the MCP tools gives the tool for each command below.

Otherwise, in a shell, save the installer, read it, then run it:

curl -fsSLo forge-install.sh https://raw.githubusercontent.com/mollendorff-ai/forge/main/install.sh
sh forge-install.sh --examples

It downloads the release for your system, checks its SHA-256 against the release's checksums, and puts the binary in ~/.local/bin/forge (run it by that path if ~/.local/bin is not on PATH) and the release's example models in ./forge-examples/. Do not pipe it into sh: an agent's permission check rightly refuses a download run unread. "Forge" is a crowded name: this one is mollendorff-ai/forge; do not install another package called forge. If the download or the script is refused, cargo install mollendorff-forge --version '>=10.0.0-rc.1' builds it from crates.io, in some minutes; try it before you give up on calculating. forge --version says which release you have.

With no shell and no tools, write the YAML all the same, say that you could not calculate it, give no results, and tell the user to open it in Forge Studio (https://forge.mollendorff.ai/) or to run forge calculate on it.

2. Write the model

Start from forge examples starter, which prints a first model with comments. A model has two kinds of group, and each writes a formula its own way:

# shop.yaml
_forge_version: "5.1.0"

inputs:
  monthly_costs: 3000

products:
  name: ["Basic", "Plus"]
  price: [20, 40]
  units_per_month: [200, 120]
  revenue: "=price * units_per_month"

year:
  revenue: {formula: "=SUM(products.revenue) * 12"}
  costs: {formula: "=inputs.monthly_costs * 12"}
  profit: {formula: "=year.revenue - year.costs"}
  • _forge_version is the model's format, not Forge's version, and is required. "5.1.0" is right for a new model.
  • A group of scalars (inputs, year): one value per name. An input is a number; a formula is {formula: "=..."}, because forge calculate writes its result next to it as value:.
  • A table (products): columns of the same length, one row per item. A column formula is a bare string, "=price * units_per_month", calculated row by row from the table's own columns.
  • A scalar reduces a column by naming its table: =SUM(products.revenue). Write full names (inputs.monthly_costs); a key of the formula's own group works too.
  • Names may be Unicode (hypothèses.coût_unitaire). forge functions lists the functions (Excel's names: SUM, IF, NPV, PMT, ...).

3. Calculate, then validate

Run these in order, and fix what each says before the next:

  1. forge calculate shop.yaml --dry-run prints every result and writes nothing. A mistake fails here, naming the formula (Gotchas).
  2. forge calculate shop.yaml writes the results into the file, and keeps the file as it was in shop.yaml.bak.
  3. forge validate shop.yaml is the verdict.
$ forge calculate shop.yaml
   📐 Scalars:
      inputs.monthly_costs = 3000
      year.revenue = 105600
      year.costs = 36000
      year.profit = 69600

💾 3 values updated in shop.yaml
   Backup saved to shop.yaml.bak
# shop.yaml, after forge calculate
year:
  revenue: {formula: "=SUM(products.revenue) * 12", value: 105600}
  costs: {formula: "=inputs.monthly_costs * 12", value: 36000}
  profit: {formula: "=year.revenue - year.costs", value: 69600}
$ forge validate shop.yaml
✅ All tables are valid!
✅ All scalar values match their formulas!

The verdict is forge validate's exit status: 0 passes, anything else fails, and the message names each result that is wrong. With the MCP tools it is passed in forge_validate's answer: passed: true passes. A model passes only when every formula's stored result is what the formula gives now.

4. Change a model

Change it with forge edit, not by writing the file again: it keeps comments and layout, changes the one thing asked, and refuses a name that is not in the model, changing nothing.

$ forge edit shop.yaml --set inputs.monthly_costs=3500
✅ Wrote shop.yaml (as it was: shop.yaml.bak)

The results in the file are now stale, and validate fails on them:

$ forge validate shop.yaml
❌ Found 2 value mismatches!
   year.costs
      Current:  36000
      Expected: 42000
Error: Validation error: Stored values are out of date (the formulas are valid): run forge calculate

Then calculate and validate again, as in step 3:

$ forge calculate shop.yaml
      year.profit = 63600

forge edit --help lists the other changes: a formula already in the model (--formula 'year.profit==year.revenue - year.costs', two =), --add for a new one (--add 'year.margin==year.profit / year.revenue'), --delete, --rename (and every name that reads it).

A table's column of numbers, dates or text takes a list, one value for each row; only the rows that change are written (--dry-run shows the file and writes nothing):

$ forge edit shop.yaml --set "products.price=[20, 45]" --dry-run
  price: [20, 45]

A column of text takes its items without quotes, and each row keeps the quotes it had: --set 'products.name=[Basic, Plus Pro]' writes ["Basic", "Plus Pro"]. A list of another length and a column of true and false are refused, and no file is written. Through forge_edit or --changes, a row of text is a JSON text: a number there is refused.

For a what-if, change a copy of the file (cp shop.yaml shop_plus_at_45.yaml) unless the user asked to change the model, so that they keep both.

5. Check one result another way

Before you report a result, show where it comes from and work it out another way, by hand or in your own code. Comparing it with Forge's documentation checks only that Forge ran.

$ forge audit shop.yaml year.profit
   Formula: =year.revenue - year.costs
   Calculated: 63600
   └─ year.revenue (Scalar) = 105600 =SUM(products.revenue) * 12
   └─ year.costs (Scalar) = 42000 =inputs.monthly_costs * 12

By hand: (20 × 200 + 40 × 120) × 12 = 105,600; 3,500 × 12 = 42,000; 105,600 − 42,000 = 63,600. They agree.

6. Finish

End your answer with:

  1. Every model file you wrote or changed, in full, with its file name. That is what the user keeps: it opens in Forge Studio, goes to Excel with forge export, and gives the same numbers to whoever calculates it next.
  2. The verdict: the last forge validate passed (or what it said).
  3. The result you checked another way, and how.

Gotchas

  • A bare formula in a group of scalars is refused: 'plan.revenue' is a formula in a group of scalars; write it as revenue: {formula: "=..."}. A formula in a table is the bare string. Do not swap the two forms.
  • A misspelt name fails with a suggestion: Unknown name: plan.unit. Did you mean 'plan.units'? Fix the name; do not add an input to make the message go away.
  • No _forge_version fails with Missing required field: _forge_version, and lists the formats.
  • A table's column is set with a list, one value for each row (step 4); edit does not add or remove rows.
  • forge calculate rewrites the file. Use --dry-run to look first; the .bak holds the file as it was.
  • A model with MC. distributions (MC.Normal(100, 10)) is for forge simulate: forge calculate and forge validate refuse it. forge calculate --plan calculates it at its plan.
  • Paths after install.sh --examples are under forge-examples/ (forge-examples/bagel/bagel.yaml), not examples/.
  • forge report shop.yaml shows a calculated model's scalars side by side; forge <command> --help says what each command takes.

With the MCP tools

The same steps, as tools. Each answer is JSON.

StepIn a shellWith the MCP server
A first modelforge examples starterforge_examples with name: "starter"
Lookforge calculate f.yaml --dry-runforge_calculate with file_path, dry_run: true
Calculateforge calculate f.yamlforge_calculate with file_path
The verdictforge validate f.yamlforge_validate with file_path: read passed
Changeforge edit f.yaml --set a.b=1forge_edit with file_path, changes: [{"op": "set_value", "path": "a.b", "value": 1}]
Checkforge audit f.yaml a.bforge_audit with file_path, variable: "a.b"
Simulateforge simulate f.yamlforge_simulate with file_path

The server reads and writes files only in the folder it was started with (forge mcp --root); a relative path is relative to it. A client with no files passes the YAML as content instead of file_path, and the answer holds the new text.

More

Read these only when a step needs them:

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.