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:
tools
Building resilient distributed systems with circuit breakers, retries with full-jitter exponential backoff, retry budgets (per-request 3-attempt + per-client 10% ratio per Google SRE), deadline propagation, and the cascading-failure math (4 layers × 3 retries = 64x amplification). Grounded in Resilience4j, Microsoft Cloud Patterns, AWS Architecture Blog (Marc Brooker), and Google SRE Book.
testing
Designing HTTP cache headers that work correctly across browsers, CDNs, and shared proxies — `Cache-Control` directives per RFC 9111, `stale-while-revalidate` and `stale-if-error` per RFC 5861, the Vary header for varying responses, and surrogate keys for tag-based purging. Grounded in IETF RFCs and Cloudflare/Fastly docs.
development
Use when designing or fixing a Content Security Policy on a real site, choosing between nonce-based and hash-based CSP, adding strict-dynamic, debugging "Refused to execute inline script" errors, deploying CSP in report-only mode first, configuring report-to / report-uri, or auditing an existing policy for unsafe-inline / unsafe-eval / wildcards. Triggers: "CSP blocks legitimate inline script", strict-dynamic, nonce-{RANDOM}, sha256-{HASH}, object-src none, base-uri none, frame-ancestors, Trusted Types, X-Content-Security-Policy obsolete, report-only vs enforced. NOT for general HTTP security headers (HSTS, COOP/COEP), Trusted Types deep dive, CORS configuration, or building a WAF.
tools
Choosing and operating an HTTP API versioning strategy that doesn't break clients — Stripe's date-based pinned versions, the Deprecation/Sunset header pair (RFC 9745 + RFC 8594), URI vs header vs media-type approaches, and the version-transformer pattern. Grounded in Stripe's published architecture and IETF RFCs.