skills/physics-rendering-expert/SKILL.md
Real-time rope/cable physics using Position-Based Dynamics (PBD), Verlet integration, and constraint solvers. Expert in quaternion math, Gauss-Seidel/Jacobi solvers, and tangling detection. Activate on 'rope simulation', 'PBD', 'Position-Based Dynamics', 'Verlet', 'constraint solver', 'quaternion', 'cable dynamics', 'cloth simulation', 'leash physics'. NOT for fluid dynamics (SPH/MPM), fracture simulation (FEM), offline cinematic physics, molecular dynamics, or general game physics engines (use Unity/Unreal built-ins).
npx skillsauth add curiositech/windags-skills physics-rendering-expertInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Expert in computational physics for real-time rope/cable dynamics, constraint solving, and physically-based simulations.
Choosing constraint solver approach:
Input: System type & performance requirements
├─ Sequential structure (rope/chain)?
│ ├─ If single rope/chain → Gauss-Seidel (5-10 iterations)
│ └─ If multiple independent ropes → Parallel Gauss-Seidel per rope
└─ Large parallel system (cloth/1000+ particles)?
├─ If GPU available → Jacobi solver (compute shader)
└─ If CPU only → Chunked Gauss-Seidel with spatial partitioning
Tangle detection decision tree:
For each rope segment pair:
├─ If rope-rope proximity < 0.1 * rope_radius AND relative velocity > 2.0
│ ├─ Calculate segment-segment distance
│ ├─ If distance < threshold → Create TangleConstraint
│ └─ Else → Continue monitoring
└─ If no proximity violation → Skip expensive distance calculation
Performance optimization decision:
Frame budget exceeded?
├─ If solver taking >50% budget
│ ├─ Reduce iterations (5 → 3)
│ ├─ Use spatial hashing for collision detection
│ └─ Consider LOD (fewer particles at distance)
└─ If rendering taking >50% budget → Delegate to metal-shader-expert
Symptoms: Rope oscillates wildly, simulation explodes at high spring constants
Detection: If particle velocity magnitude > 10x expected, you've hit this
Fix: Replace spring forces with PBD distance constraints: p.predicted = lerp(p1.predicted, p2.predicted, weight)
Symptoms: Sudden orientation flips, rotation "jumps" at 90° angles
Detection: If rotation contains Euler angles (pitch/yaw/roll) representation
Fix: Convert to quaternions: q = normalize(vec4(sin(θ/2)*axis, cos(θ/2)))
Symptoms: Performance bottleneck with minimal visual improvement after iteration 10 Detection: If solver iterations > 15 or frame time > 16ms on target hardware Fix: Cap iterations at 5-10; if more constraint satisfaction needed, use XPBD with compliance parameters
Symptoms: Frame rate hitches, garbage collection spikes during simulation
Detection: If new/malloc calls inside update loop or growing collections
Fix: Pre-allocate particle buffers, use object pools for constraints, fixed-size spatial grids
Symptoms: Ropes stick together without actual contact, false tangle detection Detection: If TangleConstraints created when visual gap exists between ropes Fix: Implement proper segment-segment distance with parametric line equations, not bounding box overlap
Scenario: Three-dog leash system with tangle detection (60 particles total)
Setup decisions:
Solver iteration walkthrough:
Frame start: Dogs pulling in different directions
Iteration 1: Distance constraints partially satisfied, 15% error remaining
Iteration 3: Error down to 3%, visual quality acceptable
Iteration 5: Error < 1%, diminishing returns beyond this point
Tangle detection triggers:
Performance result: 0.7ms total (0.4ms solver + 0.3ms tangle detection)
Scenario: 30m dynamic climbing rope with 150 particles, climber fall simulation
Critical decisions:
Load case walkthrough:
t=0: Rope hanging freely, minimal constraints active
t=0.5s: Climber begins fall, tension propagates upward
t=1.2s: Peak load reached, rope stretches 8% (realistic for dynamic rope)
t=2.0s: Oscillations damped, stable configuration
Expert vs novice differences:
Do NOT use this skill for:
Delegate these scenarios:
data-ai
license: Apache-2.0 NOT for unrelated tasks outside this domain.
development
Use when designing caching strategies (cache-aside, write-through, write-behind), implementing distributed locks, building rate limiters, leaderboards, real-time streams (XADD/consumer groups), pub/sub, or tuning eviction policies. Triggers: thundering-herd on cache miss, dogpile on key expiry, Redlock vs SET-NX-PX choice, sliding-window rate limiter, hot-key on a single cluster slot, big-key blowup, MULTI/EXEC across slots, KEYS in production. NOT for Redis Cluster operations/admin (different domain), embedded KV (SQLite, leveldb), in-process LRU caches, or Memcached.
tools
Drawing the `'use client'` boundary correctly in React Server Components apps (Next.js App Router, RSC frameworks) — leaf-pushing, slot composition, serialization rules, and environment poisoning prevention. Grounded in react.dev and Next.js 16 docs.
development
Use when designing rate limiting for an API, choosing between token bucket / sliding window / leaky bucket / fixed window, implementing it in Redis, deciding edge (Cloudflare/Upstash) vs origin enforcement, sizing per-user vs per-IP vs per-endpoint quotas, returning the right 429 response with Retry-After, or fixing the boundary-burst bug in fixed-window limiters. Triggers: 429 too many requests, INCR + EXPIRE, ZADD + ZREMRANGEBYSCORE + ZCARD, X-RateLimit-Remaining header, Cloudflare WAF rate limiting rules, Upstash @upstash/ratelimit, leaky bucket shaping vs policing, distributed rate limiter consistency. NOT for DDoS mitigation specifically (different scale), CAPTCHA / bot management, full WAF design, or per-user quota billing.