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
- Very specific: line 16
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 …
- Very specific: line 31
Start from forge examples starter, which prints a first model with comments.
- Distinctive: line 60
Run these in order, and fix what each says before the next:
- Very specific: line 136
Before you report a result, show where it comes from and work it out another way, by hand or in your own code.
- Very specific: line 152
Every model file you wrote or changed, in full, with its file name.
- Very specific: line 162
forge calculaterewrites the file: Use --dry-run to look first. - Distinctive: line 185
Read these only when a step needs them:
- Very specific: line 189
Every MCP tool and its arguments: <https://github.com/mollendorff-ai/forge/blob/main/docs/MCP.md>
≈ “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.
Files
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 --examplesIt 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_versionis 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: "=..."}, becauseforge calculatewrites its result next to it asvalue:. - 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 functionslists 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:
forge calculate shop.yaml --dry-runprints every result and writes nothing. A mistake fails here, naming the formula (Gotchas).forge calculate shop.yamlwrites the results into the file, and keeps the file as it was inshop.yaml.bak.forge validate shop.yamlis 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 calculateThen calculate and validate again, as in step 3:
$ forge calculate shop.yaml
year.profit = 63600forge 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 * 12By 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:
- 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. - The verdict: the last
forge validatepassed (or what it said). - 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_versionfails withMissing 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 calculaterewrites the file. Use--dry-runto look first; the.bakholds the file as it was.- A model with
MC.distributions (MC.Normal(100, 10)) is forforge simulate:forge calculateandforge validaterefuse it.forge calculate --plancalculates it at its plan. - Paths after
install.sh --examplesare underforge-examples/(forge-examples/bagel/bagel.yaml), notexamples/. forge report shop.yamlshows a calculated model's scalars side by side;forge <command> --helpsays what each command takes.
With the MCP tools
The same steps, as tools. Each answer is JSON.
| Step | In a shell | With the MCP server |
| A first model | forge examples starter | forge_examples with name: "starter" |
| Look | forge calculate f.yaml --dry-run | forge_calculate with file_path, dry_run: true |
| Calculate | forge calculate f.yaml | forge_calculate with file_path |
| The verdict | forge validate f.yaml | forge_validate with file_path: read passed |
| Change | forge edit f.yaml --set a.b=1 | forge_edit with file_path, changes: [{"op": "set_value", "path": "a.b", "value": 1}] |
| Check | forge audit f.yaml a.b | forge_audit with file_path, variable: "a.b" |
| Simulate | forge simulate f.yaml | forge_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:
- The lessons, from a first model to simulations and games: https://github.com/mollendorff-ai/forge/tree/main/docs/guide
- The model file and every command: https://github.com/mollendorff-ai/forge/blob/main/docs/FEATURES.md
- Every MCP tool and its arguments: https://github.com/mollendorff-ai/forge/blob/main/docs/MCP.md
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
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.

