physics-patterns

physics-patterns is a skill for Claude Code from HermeticOrmus/LibreGameDev-Claude-Code. It costs 54 tokens per session (2,138 once invoked), scanned A, original, MIT.

A set of game-physics guidelines for configuring collision layers and masks, which control what game objects can detect or collide with.

In plain words
What is it for?
Use it to define layers for terrain, players, enemies, projectiles, pickups, triggers, and vehicles, then assign which objects each type interacts with.
Why use it?
It replaces unexplained numeric settings with named layers and a clear assignment table, making collision behavior easier to understand and maintain.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the physics-simulation plugin — 1 skill, 1 command, 1 agent shipped together

Good fit Use it to define layers for terrain, players, enemies, projectiles, pickups, triggers, and vehicles, then assign which objects each type interacts with.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hermeticormus/libregamedev-claude-code/physics-patterns
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add HermeticOrmus/LibreGameDev-Claude-Code --skill physics-patterns
Clone the repo
git clone --depth 1 https://github.com/HermeticOrmus/LibreGameDev-Claude-Code

Made for: Claude Code.

Or install physics-simulation, the plugin that ships this one along with the rest of its 1 skill, 1 command, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for physics-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/hermeticormus/libregamedev-claude-code/physics-patterns/github.svg)](https://agentmods.dev/skills/hermeticormus/libregamedev-claude-code/physics-patterns)
Your own site
<a href="https://agentmods.dev/skills/hermeticormus/libregamedev-claude-code/physics-patterns"><img src="https://agentmods.dev/badge/skills/hermeticormus/libregamedev-claude-code/physics-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for physics-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/hermeticormus/libregamedev-claude-code/physics-patterns"><img src="https://agentmods.dev/badge/skills/hermeticormus/libregamedev-claude-code/physics-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,138 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00054 $0.02138
Opus 5.5 $0.00022 $0.00855
Sonnet 5.5 $0.00011 $0.00428
Haiku 4.5 $0.00005 $0.00214

Measured 2mo ago against content hash 1b7239d85f45, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

physics-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/physics-simulation/skills/physics-patterns/SKILL.md · 217 lines

How it starts

The opening of the file, as written. The whole thing — 217 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Physics Patterns

Collision Layer Configuration

# Define collision layers as constants - never magic numbers
class_name PhysicsLayers
# Layer values: collision_layer and collision_mask use bitmasks
const WORLD: int        = 1 << 0  # Layer 1: Static geometry (terrain, walls)
const PLAYER: int       = 1 << 1  # Layer 2: Player character
const ENEMY: int        = 1 << 2  # Layer 3: Enemy characters
const PROJECTILE: int   = 1 << 3  # Layer 4: Bullets, arrows, spells
const PICKUP: int       = 1 << 4  # Layer 5: Collectible items
const TRIGGER: int      = 1 << 5  # Layer 6: Area3D triggers (checkpoints)
const VEHICLE: int      = 1 << 6  # Layer 7: Driveable objects

# Layer assignment table:
# Body Type          | collision_layer    | collision_mask
# Player             | PLAYER             | WORLD | ENEMY | PICKUP | TRIGGER
# Enemy              | ENEMY              | WORLD | PLAYER | PROJECTILE
# Projectile         | PROJECTILE         | WORLD | ENEMY (not PLAYER if friendly fire off)
# Pickup (Area3D)    | PICKUP             | PLAYER (only player can collect)
# Terrain (Static)   | WORLD              | 0 (statics don't need to detect anything)

# Usage:
# player_body.collision_layer = PhysicsLayers.PLAYER
# player_body.collision_mask = PhysicsLayers.WORLD | PhysicsLayers.ENEMY | PhysicsLayers.PICKUP
class_name PlatformerCharacter extends CharacterBody3D
const SPEED: float = 6.0
const JUMP_VELOCITY: float = 6.0
const GRAVITY: float = 20.0
const FALL_GRAVITY_MULTIPLIER: float = 2.0  # Fast fall on descent
const MAX_FALL_SPEED: float = -30.0

@export var floor_snap_length: float = 0.3  # Prevents bouncing on slopes

func _ready() -> void:
    # Floor snap prevents character bouncing when descending slopes
    motion_mode = CharacterBody3D.MOTION_MODE_GROUNDED
    floor_snap_length = 0.3
    floor_stop_on_slope = true
    floor_max_angle = deg_to_rad(46)  # Max walkable slope

func _physics_process(delta: float) -> void:
    _apply_gravity(delta)
    _handle_movement()
    move_and_slide()
    # move_and_slide() updates velocity for you after collisions

func _apply_gravity(delta: float) -> void:
    if is_on_floor():
        # Keep small downward velocity for slope snapping
        velocity.y = -0.1
    else:
        var grav := GRAVITY * delta
        if velocity.y < 0:
            grav *= FALL_GRAVITY_MULTIPLIER  # Faster fall = better game feel
        velocity.y = maxf(velocity.y - grav, MAX_FALL_SPEED)

func _handle_movement() -> void:
    var input := Input.get_axis(&"move_left", &"move_right")
    velocity.x = input * SPEED

func jump() -> void:
    if is_on_floor():
        velocity.y = JUMP_VELOCITY

Read the full file on GitHub · 217 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago Changed · +5 lines · +54 tokens per session 1b7239d85f45
  2. 3mo ago First seen · 212 lines · 0 tokens per session scan A b1cefc67114a

Subscribe to this mod's changes

physics-patterns is a skill published in the GitHub repository HermeticOrmus/LibreGameDev-Claude-Code (5 stars, last pushed 2mo ago), licensed MIT. It adds 54 tokens to every session and 2,138 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

physics-patterns compared with skills from other repositories

physics-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
physics-patternsHermeticOrmus/LibreGameDev-Claude-CodeSkill52mo agoMITA54Claude Code
unity-cliAlex-Rachel/TEngineSkill2.4k12d agoMITA68Codex
luban-devAlex-Rachel/TEngineSkill2.4k12d agoMITA63Codex
html-to-uguiAlex-Rachel/TEngineSkill2.4k12d agoMITA75Codex
tengine-devAlex-Rachel/TEngineSkill2.4k12d agoMITA71Codex
godot-masterbgrenat/godot-game-dev-studioSkill3121d agoLGPL-3.0A170Claude Code, Codex
godot-2d-animationbgrenat/godot-game-dev-studioSkill3121d agoLGPL-3.0A109Claude Code, Codex