--- name: simulate-mip description: Run a Moonwell governance proposal simulation against the canonical fork command (DO_VALIDATE=true DO_PRINT=true DO_BUILD=true DO_RUN=false forge script ... --ffi). Pass the MIP folder name as the argument (e.g. /simulate-mip mip-x51a). Verifies the .sh is executable, sources it, picks the right template, and runs the sim with FOUNDRY_PROFILE=ci. disable-model-invocation: true --- # Simulate MIP User-only skill that runs a proposal simulation with the canonical command from `.claude/rules/proposals.md`. ## Argument Single argument: the MIP folder name (e.g. `mip-x51a`, `mip-b59`). If no argument is provided, list every entry in `proposals/mips/mips.json` with `id: 0` (in-development proposals) and ask which one to simulate. ## Steps ### 1. Resolve paths - Folder: `proposals/mips//` - Shell script: `proposals/mips//.sh`, where `` is the folder name with the `mip-` prefix stripped (e.g. `mip-b59` → `b59.sh`, `mip-x47` → `x47.sh`, `mip-x51a` → `x51a.sh`). Suffix letters are preserved verbatim. - If the folder doesn't exist, list folders under `proposals/mips/` that start with the same prefix and ask the user to pick. - If the proposal has no `.sh` (its `mips.json` `envpath` is `""` — e.g. `mip-x52/` only carries `.sol` + `.md`), skip the source step in §4 and run the standalone simulation directly via the artifact path from `mips.json`. ### 2. Verify shell-script exec bit ```bash test -x "" || (echo "marking executable for ffi"; chmod +x "" && git update-index --chmod=+x "") ``` ### 3. Pick the template Read the `.sh` to find `FOUNDRY_SCRIPT` or check `mips.json` for the `path` field — the artifact name maps to a template under `proposals/templates/`. Common cases: - `RewardsDistribution.sol/RewardsDistributionTemplate.json` → `proposals/templates/RewardsDistribution.sol` (contract `RewardsDistributionTemplate`) - `MarketUpdate.sol/MarketUpdateTemplate.json` → `proposals/templates/MarketUpdate.sol` (contract `MarketUpdateTemplate`) - `MarketAddV3.sol/MarketAddV3.json` → `proposals/templates/MarketAddV3.sol` - standalone (e.g. `mip-x51a.sol/mipx51a.json`) → `proposals/mips//.sol` (where `` is the folder name without the `mip-` prefix) ### 4. Run the sim ```bash source proposals/mips//