# General Equilibrium Model Builder

Build and solve Walrasian general equilibrium models with theory derivations and Julia...

- Repository: https://github.com/brycewang-stanford/Auto-Empirical-Research-Skills (4869 stars)
- Category: Engineering
- License: see repository
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill general-equilibrium-model-builder -g -a claude-code -y`
Codex: `npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill general-equilibrium-model-builder -g -a codex -y`
Cursor: `npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill general-equilibrium-model-builder -g -a cursor -y`
Gemini CLI: `npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill general-equilibrium-model-builder -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add brycewang-stanford/Auto-Empirical-Research-Skills`

## Description

Build and solve Walrasian general equilibrium models with theory derivations and Julia computation

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# General Equilibrium Model Builder

## Purpose

This skill helps economists build, analyze, and numerically solve **Walrasian General Equilibrium (GE)** models. It covers both the theoretical foundations (existence, uniqueness, welfare theorems) and computational implementation in Julia for finding equilibrium prices and allocations.

**Current Scope**: Pure exchange economies (no production). Future versions will extend to production economies, Arrow-Debreu with uncertainty, and dynamic models.

## When to Use

- **Theory Development**: Formalizing a pure exchange GE model for a paper
- **Teaching**: Creating examples for microeconomic theory courses
- **Computation**: Numerically solving for equilibrium prices and allocations
- **Welfare Analysis**: Evaluating Pareto efficiency and social welfare
- **Comparative Statics**: Analyzing how equilibrium changes with parameters

## Instructions

### Step 1: Understand the Economic Environment

Before generating any model, ask the user:

1. **Number of goods** ($L$): How many commodities in the economy?
2. **Number of consumers** ($I$): How many agents?
3. **Preferences**: What utility functions? (Cobb-Douglas, CES, Leontief, quasilinear)
4. **Endowments**: What is each agent's initial endowment vector?
5. **Output format**: Theory derivation, Julia code, or both?

### Step 2: Set Up the Theoretical Framework

A **pure exchange economy** $\mathcal{E}$ is characterized by:

$$\mathcal{E} = \left\{ (u^i, \omega^i)_{i=1}^{I} \right\}$$

where:
- $u^i: \mathbb{R}^L_+ \to \mathbb{R}$ is consumer $i$'s utility function
- $\omega^i \in \mathbb{R}^L_+$ is consumer $i$'s endowment vector
- $L$ is the number of goods
- $I$ is the number of consumers

**Consumer's Problem**: Given prices $p \in \mathbb{R}^L_{++}$, consumer $i$ solves:

$$\max_{x^i \in \mathbb{R}^L_+} u^i(x^i) \quad \text{s.t.} \quad p \cdot x^i \leq p \cdot \omega^i$$

The solution yields the **Marshallian demand** $x^i(p, p \cdot \omega^i)$.

The rest: https://github.com/brycewang-stanford/Auto-Empirical-Research-Skills/blob/HEAD/skills/09-meleantonio-awesome-econ-ai-stuff/_skills/theory/general-equilibrium-model-builder/SKILL.md
