Math Foundation

Use when the user asks about game math, quaternions, SIMD vector math, transform hierarchies, frustum culling, collision primitives, interpolation or floating point precision in large worlds. Produces the engine math layer with numerically stable code. Not for physics solver design (use physics-engine).

45 stars 6 forksResearch & Science

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add j4flmao/agent-skills --skill math-foundation
Manual install
git clone --depth 1 https://github.com/j4flmao/agent-skills.git /tmp/agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/agent-skills/skills/game/game-engine/math-foundation ~/.claude/skills/math-foundation

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Math Foundation — Deep Engineering Guide

## Purpose
Every frame pushes millions of floats through vectors, matrices, quaternions, and collision tests. Math is the substrate: correct under 16.6 ms, deterministic for netcode, and SIMD-friendly or it dies. This skill covers the core math library every engine needs.

## Agent Protocol

### Trigger
"game math", "quaternion", "SIMD math", "transform hierarchy", "frustum culling", "collision primitives", "interpolation", "floating point precision".

### Input Context
- Language and SIMD targets (SSE/AVX, NEON)
- Coordinate conventions (handedness, row/column-major)
- Precision issue or feature needed

### Output Artifact
Math code with conventions stated explicitly. No file unless requested.

### Response Format
```
Conventions: {handedness, matrix layout, angle units}
Code: {snippet}
Edge cases: {normalisation, epsilon, degeneracy}
```

## 1. The Canonical Type Set

| Type | Represents | Memory |
|------|-----------|--------|
| `float2/3/4` | position, uv, color, dir | 8/12/16 B |
| `quat` | orientation | 16 B |
| `mat3/mat4` | transforms, projections | 36/64 B |
| `aabb`, `sphere`, `plane`, `frustum` | volume queries | 24/16/16/96 B (6 planes) |
| `ray` | intersection tests | 32 B |
| `transform` (pos, rot, scale) | rigid + scale | 48 B (hot tier) |

Rules:
- **Value types**, `struct` (not class), no vtables — SIMD can then reinterpret.
- **NaN/Inf guards**: default init to 0; assert on non-finite inputs in hot paths.
Read the full skill on GitHub

Details

Skill name
math-foundation
Path
skills/game/game-engine/math-foundation/SKILL.md
License
MIT
Repo updated
17 November 2026

FAQ

What does the Math Foundation skill do?

Use when the user asks about game math, quaternions, SIMD vector math, transform hierarchies, frustum culling, collision primitives, interpolation or floating point precision in large worlds. Produces the engine math layer with numerically stable code. Not for physics solver design (use physics-engine).

How do I install the Math Foundation skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add j4flmao/agent-skills --skill math-foundation. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Math Foundation popular?

It lives in j4flmao/agent-skills, which has 45 GitHub stars and 6 forks.

Related skills

Agent Observability

45

j4flmao/agent-skills

Use when the user asks about agent observability, tracing agent reasoning, debugging an agent loop, OpenTelemetry GenAI spans for LLM calls, LLM cost tracking per agent, agent audit logs or hallucination/eval monitoring in production. Produces instrumentation config, trace schema, dashboards, alerts and cost attribution. Not for generic service tracing without LLMs (use devops-opentelemetry).

DevOps & Cloud

AI Agent Architectures

45

j4flmao/agent-skills

Use when the user asks to build an AI agent, design an agent that calls tools and keeps memory, write an agent system prompt or pick an agent framework (Claude Agent SDK, OpenAI Agents SDK, LangGraph). Produces an architecture brief covering loop, tools, memory, guardrails and evals, routing depth to child skills. Not for workflow patterns (use ai-agentic-workflows).

AI, LLMs & Agents

AI Agent Core Loop

45

j4flmao/agent-skills

Use when the user asks about the agent loop, ReAct vs plan-and-solve, re-planning, Reflexion, an agent stuck in a loop, max iterations or termination conditions. Produces a loop spec or patch with state, success predicate, caps and no-progress detection. Not for overall agent design (use ai-agent-architectures) or tool schemas (use tool-calling-principles).

AI, LLMs & Agents

Physics Engine

45

j4flmao/agent-skills

Use when the user asks about a physics engine, collision detection, broad phase, narrow phase, GJK, EPA, constraint solvers, rigid bodies, CCD, character controllers or Jolt/PhysX internals. Produces rigid-body physics design and solver code. Not for engine-specific physics settings (use unity, unreal or godot).

Research & Science

Design UX Research

45

j4flmao/agent-skills

Use when the user asks about UX research, usability testing, user interviews, research plans, personas, journey maps, card sorting or synthesizing findings. Produces method selection, interview guides, test plans and synthesis frameworks. Not for A/B test design (use product-ab-testing) or product analytics (use product-analytics).

Research & Science

Unreal

45

j4flmao/agent-skills

Use when the user asks about Unreal Engine 5, UE5 C++, Blueprints, UObject and Actor lifecycle, Gameplay Ability System, Nanite, Lumen, Chaos physics or Unreal replication. Produces Unreal project architecture and C++/Blueprint guidance. Not for Unity (use unity) or custom engine rendering (use render-graph).

Research & Science

Browse the most popular Claude skills, all research & science skills, or write your own with the skills generator.