# Physics Simulator Vitest Verification

> Prove your physics simulation obeys real-world laws with rigorous math tests using Vitest and TypeScript.

Physics Simulator Vitest Verification is a paid AI agent skill on Agensi by Andres Lopez, in Testing & Debugging. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $4 (one-time purchase)
- Creator: [Andres Lopez](https://www.agensi.io/creators/andruu)
- Category: [Testing & Debugging](https://www.agensi.io/skills/testing-debugging)
- Version: 1.0
- Last updated: 2026-12-04
- Security: scan passed (2026-12-04); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/physics-simulator-vitest-verification
- Tags: testing, typescript, simulation, physics, vitest

## What it does

- Writes tests that check for energy conservation over thousands of simulation steps
- Detects math errors across 25 orders of magnitude using relative error formulas
- Verifies vector calculus rules like zero divergence to ensure field accuracy
- Calculates convergence rates to prove your math gets more accurate as you refine it
- Creates benchmarks for physical constants and standard SI units to prevent unit errors

## Who it's for

- **Educational software developers building physics labs:** Verify that your virtual experiments follow real laws of nature before students use them. Try: "Write tests for a virtual pendulum to make sure gravity and energy loss are calculated correctly."
- **Scientific simulation researchers using TypeScript:** Stop relying on visual checks and start using math to prove your simulation works. Try: "Create a test suite for a magnetic field simulation that checks for zero divergence."
- **Game developers building realistic engines:** Ensure your game physics are stable over thousands of steps without exploding. Try: "Check if my car suspension physics drift or lose energy over a long simulation run."

## About this skill

This skill helps you prove that your scientific or physics software follows the laws of nature. It moves beyond simple visual checks to verify that your math is actually right. Your AI agent will help you write tests that check for energy conservation, correct units, and mathematical accuracy across different scales.

### How it works
1. You describe the physics law or simulation you are building to your AI agent.
2. The skill analyzes the math and suggests specific checks like energy balance or vector calculus rules.
3. Your AI agent writes code using the Vitest tool to run these checks automatically.
4. You get a set of tests that tell you exactly where your math fails, even after thousands of steps.

### Frameworks & tools
This skill works with the Vitest testing tool and TypeScript code. It uses mathematical formulas for things like electromagnetism, gravity, and calculus to check your work.

### Why this beats prompting it yourself
Standard AI prompts often suggest "close enough" checks that fail when numbers get very small or very large. This skill uses scientific error math that works across all scales. It also knows how to test for "drift" where a simulation slowly breaks over time, which a normal chat would miss.

### Use cases
- Proving a satellite simulation keeps its orbit perfectly over 100,000 steps.
- Checking that a magnetic field simulation doesn't "leak" energy.
- Verifying that doubling a time step changes the error exactly by the predicted amount.
- Making sure a physics engine handles zero gravity or tiny particles without crashing.

### Known limitations
This skill works specifically with Vitest and TypeScript. It is meant for checking math and logic, not for testing how things look on a screen or visual animations.

## Technical details

This skill implements a 7-pillar verification workflow for TypeScript scientific simulations. It focuses on Vitest-based testing of numerical integrators (like Boris Pusher/RK4), symplectic stability, and vector calculus identities ($\nabla\cdot\mathbf{B} = 0$). It generates code using relative error (relErr) instead of toBeCloseTo to handle SI unit scaling. It includes logic for calculating $O(h^p)$ convergence rates and provides templates for long-horizon conservation testing and independent quadrature cross-checks.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Physics Simulator Vitest Verification skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### Will this help me prove my physics engine is actually accurate?

This skill helps you verify that your scientific software follows real physical laws like gravity or magnetism. It moves beyond simple visual checks to prove that the underlying math stays accurate over thousands of steps without losing energy or drifting.

### What software do I need to have ready to use this?

You will need your simulation code written in TypeScript and the Vitest testing tool. The skill uses these to run automated checks against scientific formulas and unit standards.

### What kind of results will I see after using this?

The skill produces automated test suites that check for things like energy conservation, vector calculus rules, and numerical error scaling. You get clear reports showing if your math fails at extreme scales or during long simulations.

### Can I use this to test my game's graphics and animations?

This skill is designed to test the mathematical logic and scientific calculations of a simulator. It does not check how things look on a screen or verify visual animations and user interface elements.

### How do I tell my AI agent to start checking my physics math?

Ask your agent to design a Vitest suite for a specific physics law you are building. You can describe the simulation, such as a satellite orbit or magnetic field, and tell the agent to check for conservation laws and numerical stability.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
