13 Commits

Author SHA1 Message Date
Max Bridgland 1132c5c90f Add retrodiffusion as a skill (#25)
* Add retrodiffusion

* Detect animation GIF output by magic bytes; add /retrodiffusion to README

The previous animate-mode extension check looked for "gif" in the style
name, but documented animation styles (walk-cycle, idle, attack) never
contain that substring, so GIF responses were always saved as .png and
wouldn't load. Sniff the base64 prefix instead.

Also drop unused `extname` import and add a `/retrodiffusion` row to the
README slash-commands table to match the new user-invocable skill.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: rshtirmer <rshtirmer@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 14:52:13 -04:00
rshtirmer b4c92dd749 fix(intercept-hook): strip trailing punctuation, anchor grep patterns
- Strip trailing .,;:!) from captured key values so mid-sentence
  pastes like "MESHY_API_KEY=abc123." save correctly
- Anchor all .env grep checks with ^KEY=. to avoid matching comments
  or empty assignments

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 20:02:46 -04:00
rshtirmer 8bc2a0c024 fix(intercept-hook): address CodeRabbit review feedback
- Skip placeholder values (your-key-here, <key>, etc.) so example
  text from skill prompts is never saved as a real secret
- Auto-append .env to the target project's .gitignore when saving keys
- Make additionalContext provider-agnostic (remove hardcoded meshy ref)
- Use `set -a; . .env; set +a` instead of `source .env` so vars are
  exported to child processes (node, npx)
- Fix grep/cut command in game-deploy to anchor match and preserve
  keys containing = characters

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 19:54:25 -04:00
rshtirmer 66e591a2a4 feat(security): intercept API keys pasted in chat via UserPromptSubmit hook
API keys pasted in chat previously ended up in Claude's context window.
This adds a UserPromptSubmit hook that detects key patterns, saves them
to .env, and blocks the message so keys never reach the model.

- Add scripts/intercept-api-key.mjs (zero deps, explicit + bare key detection)
- Add hooks.UserPromptSubmit config to settings.json
- Add .env to .gitignore
- Update 6 skill prompts to use KEY=value paste format with .env check-first

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 17:38:44 -04:00
rshtirmer c8cec81b1c feat(worldlabs): add World Labs skill and generation script
Adds skill for generating 3D Gaussian Splat environments via World Labs API,
plus worldlabs-generate.mjs helper script. Updates .gitignore to exclude
.herenow/ deployment artifacts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 14:09:21 -04:00
rshtirmer 707206cc9f feat: add GLB optimization pipeline for web-ready 3D assets
Meshy AI generates raw GLBs (1-25MB) with uncompressed textures and high
polycounts. New optimize-glb.mjs script automatically reduces file sizes
by 80-95% via texture resize, WebP conversion, and meshopt compression.

- Add scripts/optimize-glb.mjs (standalone, zero-dep, uses npx gltf-transform)
- Auto-optimize after every GLB download in meshy-generate.mjs and find-3d-asset.mjs
- Add MeshoptDecoder to AssetLoader.js template for runtime decompression
- Lower default polycount from 30,000 to 10,000 for game-ready topology
- Add --no-optimize flag to skip optimization when needed

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-27 15:16:26 -05:00
rshtirmer df0ac3701c fix: auto-download animations, atomic rig pipeline, early API key prompt
Fixes 5 issues found during Rock Em Sock Em Robots build:

1. meshy-generate.mjs: rig mode now auto-downloads walking + running
   animation GLBs as {slug}-walk.glb and {slug}-run.glb instead of
   just printing URLs that expire in 3 days

2. make-game: Meshy API key prompt moved to Step 0 (before scaffolding)
   instead of Step 1.5 (after scaffolding is done)

3. make-game: 3D character pipeline is now ONE atomic step
   (generate → read meta → rig → auto-download anims) instead of
   separate steps requiring manual meta.json parsing between them

4. make-game: integration subagent instructions now mandate orientation
   and scale verification — characters must face each other, fit inside
   their environment, and be positioned close enough to interact

5. meshyai: rig section documents the 3-file output (rigged GLB +
   walk GLB + run GLB) and says "NEVER leave humanoids as static"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-26 17:44:22 -05:00
rshtirmer 2857bae1b5 feat(meshyai): add Meshy AI skill for 3D model generation, rigging, and animation
New skill and CLI script for generating custom 3D models via Meshy AI API:
- text-to-3d: generate models from text prompts (preview → refine pipeline)
- image-to-3d: generate models from reference images (URL, local file, base64)
- auto-rig: add skeleton to humanoid models for animation
- animate: apply animations to rigged models
- status: check any task's progress

Script handles full lifecycle: submit → poll → download GLB → write meta.json.
Zero npm dependencies, same output format as find-3d-asset.mjs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-26 14:33:44 -05:00
rshtirmer bc0ca6e08b feat: 3D asset pipeline — animated characters, model search, OrbitControls template
Add the 3D parallel to the 2D pixel art pipeline:

- scripts/find-3d-asset.mjs: search & download GLBs from Sketchfab, Poly Haven, Poly.pizza
- skills/game-3d-assets: full skill with AssetLoader (SkeletonUtils.clone), OrbitControls
  camera, fadeToAction animation crossfade, camera-relative WASD, per-model facingOffset
- skills/add-3d-assets: user-invocable /add-3d-assets command
- 3d-character-library/: 4 animated GLBs (Soldier, Xbot, Robot, Fox) with manifest.json
- templates/threejs-3d: updated with animated character controller, OrbitControls,
  AssetLoader, third-person camera follow pattern
- examples/3d-asset-test: working demo with character cycling (C key), preloading,
  world props (barrels, crates), animated enemies
- make-game pipeline: Step 1.5 now works for 3D — character selection from library,
  world object search via find-3d-asset.mjs, full subagent instructions

Key learnings baked into skill:
- SkeletonUtils.clone() is mandatory for skeletal models (regular .clone breaks → T-pose)
- Model facing varies: facingOffset per character (Soldier -Z needs +PI, Robot +Z needs 0)
- OrbitControls + target-follow is the proven third-person pattern (from official three.js example)
- Preload all GLBs with Promise.all on startup for instant character cycling

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-25 15:12:47 -05:00
rshtirmer 150fda32e7 Add face detection character pipeline and trump-mog example
Introduces the Node.js character build pipeline using face-api.js for
face detection and @imgly/background-removal-node for ML background
removal. Includes the trump-mog example game demonstrating South Park
photo-composite characters with Trump and Biden.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 14:52:09 -05:00
rshtirmer d70bdb02a8 refactor(qa): replace inline verification with QA subagent, fix bugs, reduce noise
- Replace 5-phase inline Verification Protocol (~11 tool calls + 2 images per step)
  with a QA subagent that returns text-only summary (1 Task call per step)
- Add game-specific actions generation to Step 1 subagent (replaces hardcoded space-bar)
- Fix renderSpriteSheet() bug: pass canvas directly instead of .source[0]
- Filter 0<|n|<1 proportional values from magic number validator
- Add data: favicon to suppress 404 false positives in verify-runtime

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 14:08:55 -05:00
rshtirmer a4e0bdeec4 feat(scripts): add architecture validation and multi-restart testing
Add validate-architecture.mjs that statically checks game source files for
required patterns (render_game_to_text, GameState.reset, SAFE_ZONE, button
pattern, EventBus events) with magic number warnings. Separate Phaser and
Three.js variants with appropriate checks for each framework.

Add --restart-cycles N and --restart-key flags to iterate-client.js for
automated multi-restart testing. Polls for game_over state, presses restart,
then verifies score reset and mode transition across N cycles.

Both scripts copied to phaser-2d and threejs-3d templates with npm validate
script added to each package.json.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-23 13:10:10 -05:00
rshtirmer c262955248 feat: bake Playwright scripts into templates, wire iterate-client into pipeline
The iterate-client.js and verify-runtime.mjs scripts were defined outside
templates and never used in the make-game pipeline. This moves them into
both templates as the single source of truth, fixes the `playwright` →
`@playwright/test` import mismatch, adds robust Playwright prerequisite
checking, and inserts Phase 2.5 (iterate check) into the verification
protocol so every pipeline step gets screenshots + game state feedback.

Also adds render_game_to_text(), advanceTime(), and iterate client docs
to templates, game-qa skill, and CLAUDE.md.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 14:43:46 -05:00