meleantonio/awesome-econ-ai-stuff/general-equilibrium-model-builder
Claude Code and agent skill by meleantonio/awesome-econ-ai-stuff
- community
Checking that the SKILL.md file is still in the repository.
Build and solve Walrasian general equilibrium models with theory derivations and Julia computation
Install
npx vskill@latest install meleantonio/awesome-econ-ai-stuff/general-equilibrium-model-builderSKILL.md
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:
- Number of goods ($L$): How many commodities in the economy?
- Number of consumers ($I$): How many agents?
- Preferences: What utility functions? (Cobb-Douglas, CES, Leontief, quasilinear)
- Endowments: What is each agent's initial endowment vector?
- 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)$.
Step 3: Define Walrasian Equilibrium
Definition (Walrasian Equilibrium): An allocation $(x^{1}, \ldots, x^{I})$ and price vector $p^* \in \mathbb{R}^L_{++}$ constitute a Walrasian equilibrium if:
- Utility Maximization: For each $i$, $x^{i}$ solves consumer $i$'s problem at prices $p^$
- Market Clearing: $\sum_{i=1}^{I} x^{*i} = \sum_{i=1}^{I} \omega^i$
Equivalently, the excess demand function $z(p) = \sum_{i=1}^{I} [x^i(p) - \omega^i]$ satisfies $z(p^*) = 0$.
Step 4: State Key Theoretical Results
Include the following theorems as appropriate:
Theorem (Walras' Law): For any price vector $p$: $$p \cdot z(p) = 0$$
Interpretation: The value of excess demand is always zero (budget constraints bind).
Theorem (First Welfare Theorem): Every Walrasian equilibrium allocation is Pareto efficient.
Theorem (Second Welfare Theorem): Under convexity assumptions, any Pareto efficient allocation can be supported as a Walrasian equilibrium with appropriate lump-sum transfers.
Theorem (Existence - Debreu, 1959): Under standard assumptions (continuity, strict convexity, strict monotonicity of preferences, strictly positive endowments), a Walrasian equilibrium exists.
Step 5: Generate Julia Code for Computation
Use Julia with the following structure:
Step 6: Provide Complete Example
Step 7: Visualize with Edgeworth Box
Example Prompts
Users might invoke this skill with prompts like:
- "Set up a 2-good, 3-consumer pure exchange economy with CES preferences"
- "Derive the Walrasian equilibrium conditions for a Cobb-Douglas economy"
- "Write Julia code to solve for equilibrium prices in my exchange economy"
- "Prove the First Welfare Theorem for a pure exchange economy"
- "Plot an Edgeworth box showing the contract curve and equilibrium"
- "Compute comparative statics: how does equilibrium change if endowments shift?"
Requirements
Software
- Julia 1.9+
Packages
| Package | Purpose | |
|---|---|---|
NLsolve | Nonlinear equation solver for excess demand = 0 | |
LinearAlgebra | Vector/matrix operations | |
Plots | Visualization (Edgeworth box, etc.) | |
ForwardDiff | Automatic differentiation for Jacobians |
Mathematical Background
Assumptions for Existence
Standard assumptions ensuring equilibrium existence:
- Continuity: Each $u^i$ is continuous
- Strict Monotonicity: $x \gg y \Rightarrow u^i(x) > u^i(y)$
- Strict Convexity: $u^i$ is strictly quasiconcave
- Positive Endowments: $\omega^i \gg 0$ for all $i$
Properties of Excess Demand
Under standard assumptions, $z(p)$ satisfies:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking_skills/theory/general-equilibrium-model-builder/SKILL.md
Popularity
- Repository stars
- 232
- Repository forks
- 59
- 7-day trend score
- 27
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 18 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/meleantonio/awesome-econ-ai-stuff/general-equilibrium-model-builder)