Economic-Modeling-Studio
AGENTS.md4 starsChanged 6 days agoMITView on GitHub
This project turns a coding-agent session into a coordinated economic modeling studio: 127 specialist agents, 94 workflow commands, path-scoped rules, templates and guardrails. It covers small, medium and large models across semi-structural, structural (DSGE, HANK, multi-country), input-output / CGE / trade, climate and energy, econometric, and data-driven and AI-based approaches. These instructions apply to any coding agent: Claude Code, Codex, Cursor, Grok Build, Gemini CLI / Antigravity, GitHub Copilot and others that read AGENTS.md. The user is the decision maker.…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 32,671 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository210 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .cursor/rules/ai-ml-code.mdcCursor rule
- .cursor/rules/code-translation.mdcCursor rule
- .cursor/rules/data-pipelines.mdcCursor rule
- .cursor/rules/documentation.mdcCursor rule
- .cursor/rules/dsge-code.mdcCursor rule
- .cursor/rules/econometrics-code.mdcCursor rule
- .cursor/rules/eviews-code.mdcCursor rule
- .cursor/rules/forecasts.mdcCursor rule
- .cursor/rules/gempack-code.mdcCursor rule
- .cursor/rules/lego-manifests.mdcCursor rule
- .cursor/rules/llm-code.mdcCursor rule
- .cursor/rules/model-code.mdcCursor rule
- .cursor/rules/notebooks-and-scripts.mdcCursor rule
- .cursor/rules/r-code.mdcCursor rule
- .cursor/rules/restricted-data.mdcCursor rule
- .cursor/rules/rl-code.mdcCursor rule
- .cursor/rules/sectoral-trade-climate-code.mdcCursor rule
- .cursor/rules/semi-structural-code.mdcCursor rule
- .cursor/rules/stata-code.mdcCursor rule
- .cursor/rules/tests.mdcCursor rule
- .cursor/rules/validation.mdcCursor rule
- adoptSkill
- ai-auditSkill
- backtestSkill
- build-abmSkill
- build-causal-mlSkill
- build-cgeSkill
- build-climate-macroSkill
- build-deep-forecasterSkill
- build-drl-policySkill
- build-dsgeSkill
- build-financial-programmingSkill
- build-fpasSkill
- build-game-modelSkill
- build-hankSkill
- build-io-samSkill
- build-llm-agentsSkill
- build-llm-pipelineSkill
- build-multicountrySkill
- build-neural-solverSkill
- build-rag-kbSkill
- build-semi-structuralSkill
- build-sfcSkill
- build-trade-modelSkill
- calibrate-modelSkill
- calibration-planSkill
- carbon-pricing-analysisSkill
- chart-packSkill
- climate-scenarioSkill
- code-inventorySkill
- code-reviewSkill
- country-typologySkill
- create-exerciseSkill
- data-requirementsSkill
- debt-decompositionSkill
- debt-sustainabilitySkill
- design-trainingSkill
- distributional-analysisSkill
- equivalence-testSkill
- The first 60 shown.
The file
We split this AGENTS.md into the rules it gives an agent
10 rules. About 0 are common, 2 are distinctive, and 8 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.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Read production/session-state/active.md and production/stage.txt if they exist.
- Very specific: line 11
If there is no active task, offer the start command (onboarding and routing) or help (what exists).
- Very specific: line 12
If the user brings a research note, plan, objective or brief, in any form and with or without data files, offer research-plan: it reads the …
- Very specific: line 13
If the user wants code translated to another language or software (a folder path or an uploaded folder, and a target), offer …
- Very specific: line 52
Collaborate, don't decide autonomously: Ask → options → decision → draft → approval → write.
- Very specific: line 54
No fabrication: Never invent data, parameters, citations or results.
- Distinctive: line 55
Benchmark first: Every complex or AI model is compared with a simple, transparent benchmark.
- Distinctive: line 57
Uncertainty is part of the result: No forecast, scenario or estimate leaves the studio without uncertainty and key assumptions.
- Very specific: line 59
Raw data is immutable: Never change, move or delete a file in data/raw/.
- Very specific: line 84
Keep production/session-state/active.md current: task, completed sections, decisions, next step.
≈ “Common” is an estimate: at least 1 in 5 of the 41,581 AGENTS.md 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
Economic Modeling Studio — Instructions for Coding Agents
This project turns a coding-agent session into a coordinated economic modeling studio: 127 specialist agents, 94 workflow commands, path-scoped rules, templates and guardrails. It covers small, medium and large models across semi-structural, structural (DSGE, HANK, multi-country), input-output / CGE / trade, climate and energy, econometric, and data-driven and AI-based approaches.
These instructions apply to any coding agent: Claude Code, Codex, Cursor, Grok Build, Gemini CLI / Antigravity, GitHub Copilot and others that read AGENTS.md.
The user is the decision maker. Agents advise, build and challenge; they do not decide economics or policy. Agents are organized by area of expertise, not by reporting lines.
At the start of a session
- Read
production/session-state/active.mdandproduction/stage.txtif they exist. Resume from them. - If there is no active task, offer the
startcommand (onboarding and routing) orhelp(what exists). - If the user brings a research note, plan, objective or brief, in any form and with or without data files, offer
research-plan: it reads the note, inventories any data (python tools/intake.py), and turns the note into modeling tasks run with the studio's skills. - If the user wants code translated to another language or software (a folder path or an uploaded folder, and a target), offer
translate-code: the source is never changed, and the translation is tested against the source's outputs (python tools/translate.py,docs/code-translation.md).
Commands, agents and rules
| What | Where | How to use it |
| Workflow commands (94) | .claude/skills/<name>/SKILL.md, mirrored to .agents/skills/ and .grok/skills/ | Invoke by name: /name in Claude Code, Cursor, Grok and Gemini; $name in Codex. Any agent can also read the file and follow it. Catalog: docs/skill-catalog.md |
| Specialist agents (127) | .claude/agents/<name>.md | Run as subagents where your tool supports them; otherwise read the agent's file and apply its instructions. Roster: docs/agent-roster.md |
| Path-scoped rules | .claude/rules/*.md, mirrored to .cursor/rules/ | Before editing a file, follow every rule whose paths match it (table below) |
| Process documents | .claude/docs/ | Collaboration protocol, coordination, phase gates, risk levels, model classes, confidentiality |
The files under .agents/, .grok/ and .cursor/rules/ are generated. Edit the sources in .claude/, then run python tools/sync_agents.py.
<!-- BEGIN GENERATED: rules -->| When you work on | Follow |
models/ai/** | .claude/rules/ai-ml-code.md |
translations/** | .claude/rules/code-translation.md |
data/**, pipelines/**, src/data/** | .claude/rules/data-pipelines.md |
docs/** | .claude/rules/documentation.md |
models/dsge/**, models/multicountry/** | .claude/rules/dsge-code.md |
models/econometrics/** | .claude/rules/econometrics-code.md |
**/*.prg, **/*.wf1 | .claude/rules/eviews-code.md |
forecasts/** | .claude/rules/forecasts.md |
**/*.tab, **/*.cmf, models/**/gtap*/** | .claude/rules/gempack-code.md |
models/**/model.lego.json, lego/** | .claude/rules/lego-manifests.md |
models/llm/** | .claude/rules/llm-code.md |
models/** | .claude/rules/model-code.md |
notebooks/**, scripts/** | .claude/rules/notebooks-and-scripts.md |
**/*.R, **/*.Rmd, **/*.qmd | .claude/rules/r-code.md |
data/restricted/**, data/confidential/** | .claude/rules/restricted-data.md |
models/ai/**/*drl*/**, models/ai/**/*rl*/** | .claude/rules/rl-code.md |
models/io-sam/**, models/cge/**, models/trade/**, models/climate/** | .claude/rules/sectoral-trade-climate-code.md |
models/semi-structural/**, models/fpas/**, models/financial-programming/** | .claude/rules/semi-structural-code.md |
**/*.do, **/*.ado | .claude/rules/stata-code.md |
tests/**, **/test_*.py, **/*_test.jl, **/test_*.m, **/tests/testthat/**, **/test-*.R | .claude/rules/tests.md |
validation/** | .claude/rules/validation.md |
<!-- END GENERATED: rules -->Non-negotiable rules
- Collaborate, don't decide autonomously. Ask → options → decision → draft → approval → write. See
.claude/docs/collaboration-protocol.md. - Independence. The builder of a model never validates it.
- No fabrication. Never invent data, parameters, citations or results. Missing inputs →
NOT ASSESSED — NO DATA. - Benchmark first. Every complex or AI model is compared with a simple, transparent benchmark.
- Reproducibility. Seeds, versions, data vintages, and a one-command replication path for every released result. Model code lives in files, and every run saves its results to the model's
output/<run-id>/folder with a run log. - Uncertainty is part of the result. No forecast, scenario or estimate leaves the studio without uncertainty and key assumptions.
- Confidentiality. Respect data classification levels. Never read
data/restricted/. No restricted or confidential data in prompts, logs or external services without written authorization. See.claude/docs/confidentiality-and-ai-use.md. - Raw data is immutable. Never change, move or delete a file in
data/raw/; write a new vintage or a processed version. - AI outputs are claims until verified. LLM-produced numbers, citations and code need source traceability and tests.
- No release without review. See
.claude/docs/phase-gates.mdand.claude/docs/model-risk-levels.md.
Model classes and workflow
Small, medium and large models share one lifecycle with different depth: Concept → Design → Build → Estimate → Validate → Release/Operate. See .claude/docs/model-classes.md. Settings live in studio-config.yaml.
Lego view (modular models)
Models are represented as a lego set: one baseplate (the core model) plus bricks (components such as a trade sector or a carbon-pricing block) that connect through studs (declared variables with units and timing). A needed input that no brick provides runs on a documented stub, so a model works without optional components and a brick can be attached, detached or swapped without breaking it. The manifest is models/<family>/<name>/model.lego.json, the engine is python tools/lego.py, and the catalog is lego/catalog/. Commands: lego-map, lego-show, lego-add, lego-detach, lego-swap, lego-check, lego-brick. Every build-* command registers a manifest. Always show the plan (dry run) and get approval before --apply. Record a brick's validation result only with python tools/lego.py validate <manifest> <brick> --report <path>. Bricks stack vertically with no limit on levels; python tools/lego.py arrange <manifest> --apply builds the picture as a stepped pyramid (positions only, never wiring). Declare what each brick is made of (variables, equations, parameters, shocks, data, constraints) with python tools/lego.py elements <manifest> <brick> --from-mod <file> or --set; the picture colours studs by these elements and check flags non-square bricks, unsourced parameters and unverified constraints. The tool checks wiring only; economics stays with calibration and validation. Guide: docs/lego.md.
Directory map
| Path | Purpose |
models/<family>/<name>/ | Model code: semi-structural, fpas, financial-programming, dsge, multicountry, io-sam, cge, trade, climate, sfc, abm, games, ai, llm, econometrics; with model.lego.json (not needed for estimation-only econometric models) |
lego/ | Brick catalog, shared port definitions and worked examples for the lego view |
data/{raw,processed,external,restricted} | Data by classification; raw is immutable; restricted is protected |
forecasts/ | Forecast rounds, nowcasts, scenarios, DSAs, stress tests, trade and climate analyses |
validation/ | Independent validation reports and audits |
docs/ | Briefs, model docs, notes, references, training, templates (docs/templates/) |
production/ | Session state, gates, milestones, retrospectives, releases, model registry |
tests/ | Tests for model code and pipelines |
.claude/ | Source of agents, commands, rules, hooks, process documents and Claude Code settings |
.agents/, .grok/, .cursor/ | Generated copies for other agents, and Cursor hooks |
Session state
Keep production/session-state/active.md current: task, completed sections, decisions, next step.
Guardrails
The guard scripts in .claude/hooks/ block destructive commands, reads of restricted data and secrets, and changes to existing raw data. They run automatically in Claude Code (.claude/settings.json) and Cursor (.cursor/hooks.json). In every tool, the git pre-commit guard blocks committing restricted data, raw data and secrets: enable it once with git config core.hooksPath .githooks. Where no hook runs, the rules above still apply.
Scope note
This is a template for work with public data. Before using non-public data, follow your organization's IT and data-governance requirements (see .claude/docs/confidentiality-and-ai-use.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.

