agentleFS
tatashbartatashbar/Economic-Modeling-Studio/.agents/skills/build-dsge/SKILL.md

build-dsge

Skill4 starsChanged 6 days agoMITView on GitHub

Builds a DSGE model (small, medium or large) from approved spec: derivation, code, solution, tests, IRFs.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    If a required input is ABSENT, that part is NOT ASSESSED — NO DATA: do not estimate or invent it.

    line 26
  2. Very specific:

    Collaboration: Follow .claude/docs/collaboration-protocol.md: ask questions first, present options, get approval before writing files, and …

    line 28
  3. Distinctive:

    Check signs and magnitudes against empirical benchmarks (VARs, local projections) and explain every deviation through a mechanism

    line 65
  4. Distinctive:

    Write tests and hand over to estimation and validation

    line 67
  5. Distinctive:

    Write the model spec and a short model card.

    line 69
  6. Distinctive:

    After the derivation: confirm the equation list and the frictions before coding

    line 73
  7. Distinctive:

    After calibration: confirm the steady-state targets and any parameter labelled as an assumption

    line 74
  8. Distinctive:

    After the first impulse responses: confirm the mechanics make economic sense before extending the model

    line 75
  9. Distinctive:

    Every parameter has a source or an explicit assumption with a sensitivity check

    line 94

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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
<!-- Generated from .claude/skills/build-dsge/SKILL.md by tools/sync_agents.py. Edit the source, then run the script. -->

/build-dsge — Build DSGE

Category: Build · Primary agent: open-economy-dsge-specialist

Builds a DSGE model (small, medium or large) from approved spec: derivation, code, solution, tests, IRFs.

Arguments: whatever the user wrote after the command name.

Purpose

Turn an approved model specification into a working, documented and tested dynamic stochastic general equilibrium model that is ready for estimation and independent validation. The output is not a forecast or a policy answer; it is a model whose steady state, dynamics and policy experiments behave as the specification says, with every parameter sourced and every friction justified.

Use it when the question needs structure: expectations and policy rules matter, a counterfactual policy or regime change is involved, welfare must be compared, or shocks have to be identified through theory rather than statistics.

Do not use it when a semi-structural gap model answers the question (/build-semi-structural), when the task is pure short-term forecasting (/estimate-bvar, /nowcast), or when distribution across households is central (/build-hank).

Before you start

  1. Check required inputs. For each input below record FOUND or ABSENT (never 'assumed'):
    • Approved model-spec
    • Calibration plan If a required input is ABSENT, that part is NOT ASSESSED — NO DATA: do not estimate or invent it; name what is missing and which skill produces it. If all required inputs are absent, stop and say so.
  2. Check confidentiality. Identify the data classification level of the inputs (.claude/docs/confidentiality-and-ai-use.md). Do not proceed with restricted or confidential data in a way the policy does not allow.
  3. Collaboration. Follow .claude/docs/collaboration-protocol.md: ask questions first, present options, get approval before writing files, and update production/session-state/active.md after each approved section.
  4. Confirm the model class and toolchain. Small, medium or large (.claude/docs/model-classes.md) sets the depth of every step below. Agree the toolchain (Dynare/MATLAB, Julia, Python) with the user and check it is approved in studio-config.yaml.

Agents

  • open-economy-dsge-specialist — primary agent; coordinates the work and integrates results
  • perturbation-solution-specialist — Solves DSGE models by perturbation (1st-3rd order), pruning, and verifies determinacy and accuracy
  • matlab-dynare-engineer — Engineers MATLAB, Dynare, IRIS, RISE and Octave codebases; legacy model maintenance and migration
  • financial-frictions-dsge-specialist — Builds DSGE models with financial frictions
  • symbolic-derivation-specialist — Derives and verifies model equations with computer algebra
  • ipf-micro-specialist — Builds microfounded IPF models with FX intervention, capital flow rules and occasionally binding external constraints

Each agent is defined in .claude/agents/<name>.md. If your tool runs subagents, run these agents as subagents, in parallel where the steps are independent; otherwise read each agent's file and apply its instructions in turn. Subagents only write to the paths named in your instructions.

Key design decisions (present options, let the user choose)

DecisionTypical optionsWhat it changes
Size of the modelsmall (3-equation core), medium (Smets–Wouters type), large (multi-sector, multi-agent)Data needs, estimation feasibility, validation depth
Open-economy closuredebt-elastic premium, endogenous discount factor, portfolio costPersistence of external adjustment
Pricing of tradeproducer-, local- or dominant-currencyStrength of expenditure switching and pass-through
Frictionshabits, investment adjustment costs, wage rigidity, financial accelerator, collateral constraintsFit and amplification; each needs a stylized fact
Solution orderfirst order; second/third order with pruning; piecewise-linear or global for occasionally binding constraintsValidity for welfare, risk and constraint questions
Policy blockTaylor-type, inflation-forecast targeting, exchange-rate terms, fiscal rulesDeterminacy region and policy experiments

Workflow

  1. Implement the model in the chosen toolchain (Dynare/Julia/Python) with a clean parameter block
    • Derive optimization problems, first-order conditions, market clearing and, for open economies, the balance of payments; keep derivations in docs/models/<name>/derivation.md
    • For medium and large models, verify the derivation symbolically before coding
    • Separate files for parameters, steady state, model equations, shocks and run scripts; no hard-coded numbers in equations
  2. Compute steady state; verify residuals and Blanchard-Kahn conditions
    • Derive the steady state analytically where possible and check it numerically
    • Map each steady-state ratio to its data target in the calibration sheet and report the gap
    • Report the determinacy region of the policy rule, not only that the baseline is determinate
  3. Solve at the chosen order; check accuracy with Euler errors
    • First order for standard impulse responses and forecasts; higher order with pruning when risk, welfare or asymmetry matter
    • Occasionally binding constraints: solve explicitly and show where they bind
  4. Produce IRFs for standard shocks; compare to spec expectations
    • Standard set: productivity, demand/preference, cost-push, monetary policy, fiscal, and for open economies foreign demand, foreign rate, risk premium, terms of trade and commodity prices
    • Check signs and magnitudes against empirical benchmarks (VARs, local projections) and explain every deviation through a mechanism
    • Produce variance decompositions and second moments versus data
  5. Write tests and hand over to estimation and validation
    • Tests: steady-state residuals, identities (resource constraint, balance of payments, government budget), determinacy, IRF signs, reproducibility of a stored baseline
    • Write the model spec and a short model card; record versions and seeds
  6. Register the model as a lego set (/lego-map): a baseplate plus bricks with declared studs (variables, units, timing) and stubs, so components can later be attached, detached or swapped

Checkpoints with the user

  • After the derivation: confirm the equation list and the frictions before coding
  • After calibration: confirm the steady-state targets and any parameter labelled as an assumption
  • After the first impulse responses: confirm the mechanics make economic sense before extending the model

Common pitfalls

  • Adding frictions to improve fit without a documented stylized fact
  • Leaving the open-economy unit root unaddressed, or choosing a closing device that dominates dynamics
  • Reporting welfare from a first-order solution
  • Calibrating to a non-representative period (crisis, commodity boom) without saying so
  • Treating shocks that absorb misspecification (for example, large risk-premium shocks) as structural explanations

Output

models/dsge/<name>/ (+ model.lego.json)

The folder holds the parameter, steady-state, model and run files, the test suite, the calibration sheet, the derivation note, the impulse-response pack and the lego manifest. Documentation goes to docs/models/<name>/. Every run saves its results to output/<run-id>/ in the model folder, with a run log (.claude/rules/model-code.md).

Gate / verdict

  • Determinacy verified
  • Steady-state ratios match targets
  • Accuracy report present
  • Lego manifest passes python tools/lego.py check
  • Every parameter has a source or an explicit assumption with a sensitivity check
  • Impulse responses have documented signs and magnitudes with a mechanism for each

Suggested next steps

  • /estimate-dsge
  • /validate-model
  • /lego-map

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.