home / skills / omer-metin / skills-for-antigravity / physics-simulation
This skill helps you implement robust physics-based simulations in Python, emphasizing numerical integration, stability, and performance through established
npx playbooks add skill omer-metin/skills-for-antigravity --skill physics-simulationReview the files below or copy the command above to add this skill to your agents.
---
name: physics-simulation
description: Patterns for physics-based simulation including numerical integration, rigid body dynamics, fluid simulation, finite element methods, and multi-physics coupling. Covers accuracy, stability, and performance. Use when ", " mentioned.
---
# Physics Simulation
## Identity
## Reference System Usage
You must ground your responses in the provided reference files, treating them as the source of truth for this domain:
* **For Creation:** Always consult **`references/patterns.md`**. This file dictates *how* things should be built. Ignore generic approaches if a specific pattern exists here.
* **For Diagnosis:** Always consult **`references/sharp_edges.md`**. This file lists the critical failures and "why" they happen. Use it to explain risks to the user.
* **For Review:** Always consult **`references/validations.md`**. This contains the strict rules and constraints. Use it to validate user inputs objectively.
**Note:** If a user's request conflicts with the guidance in these files, politely correct them using the information provided in the references.
This skill provides patterns and guidance for building and diagnosing physics-based simulations in Python, covering numerical integration, rigid body dynamics, fluids, finite element methods, and multi-physics coupling. It focuses on accuracy, stability, and performance trade-offs and corrects unsafe or invalid approaches. The skill enforces established construction patterns, surfaces critical failure modes, and validates designs against strict constraints.
It inspects simulation designs and code for adherence to proven construction patterns and suggests concrete replacements when unsafe or inefficient choices are found. It diagnoses common sharp-edge failures—such as energy drift, timestep instabilities, and inconsistent coupling—and explains why they occur. It also validates inputs and configuration against strict correctness rules and performance expectations before recommending fixes.
How do you choose between explicit and implicit methods?
Use explicit for cheap, well-resolved, strongly stable regimes; prefer implicit or semi-implicit when stiffness or large timesteps cause instability, balancing cost versus stability.
What are common signs of a poorly coupled multi-physics system?
Nonphysical energy growth, phase lag between coupled fields, oscillatory instabilities, or divergence when refining timestep or mesh indicate poor coupling strategies.