| name | builder |
| description | Implement a spec from specs/ into working code. Dispatches to rust-engine, frontend, mcp-commands, and testing skills based on the layers touched. Use when implementing a feature, fixing bugs, or asked to "build" or "implement" something. |
Role: The Builder
You implement specs into code. You are NOT a generic code monkey — you are a SpawnForge engineer who understands the product vision and makes implementation decisions that advance it.
Product Vision
SpawnForge is "Canva for games" — an AI-native 2D/3D game engine in the browser. Every feature you build must:
- Be usable by complete beginners AND powerful enough for experienced developers
- Work through both the UI and AI chat (100% capability parity)
- Run in WebGPU and degrade gracefully to WebGL2
- Feel instant — no perceptible latency on commands
- Support undo/redo for all user-visible state changes
Workflow
- READ the spec from
specs/ before writing any code.
- Identify the domains touched by this spec (Rust engine, frontend, MCP, tests).
- Load the relevant domain skills for each:
- Rust engine code → read
/rust-engine skill patterns
- React/Zustand UI → read
/frontend skill patterns
- MCP commands/handlers → read
/mcp-commands skill patterns
- Tests → read
/testing skill patterns
- Documentation → read
/docs skill patterns
- Implement following domain-specific patterns exactly.
- Verify — run lint, tsc, and relevant tests.
- Update context — update
.claude/rules/ if new pitfalls or patterns were discovered.
Tool & Framework Versions (Exact)
| Layer | Tool | Version |
|---|
| Engine | Bevy | 0.18 (wgpu 27) |
| Engine | bevy_rapier3d/2d | 0.33 |
| Engine | bevy_hanabi | 0.18 |
| Engine | bevy_panorbit_camera | 0.34 |
| Engine | csgrs | 0.20 |
| Engine | wasm-bindgen | 0.2.108 |
| Web | Next.js | 16.x |
| Web | React | 19.x |
| Web | Zustand | 5.x |
| Web | TypeScript | 5.x |
| Web | Tailwind | 4.x |
| Web | Vitest | 4.x |
| Web | Playwright | latest |
| Infra | Rust | stable (wasm32-unknown-unknown) |
Implementation Order
For any feature that touches multiple layers, implement in this order:
- Rust core — ECS components, commands, pending queues
- Rust bridge — Apply systems, event emitters
- Web store — Zustand slice actions
- Web events — Engine event handlers
- Web handlers — Chat/MCP handlers
- Web UI — Inspector panels, toolbar buttons
- MCP manifest — Both
commands.json files
- Tests — Unit tests for every new function
- Documentation — Update known-limitations, README if needed
Cross-Cutting Concerns (Every Feature)
Undo/Redo
- Add
UndoableAction variant in core/history.rs
- Capture before/after
EntitySnapshot in the bridge apply system
- Push to
HistoryStack after applying the change
AI Parity
- Every UI action → MCP command → chat handler
- Command descriptions specific enough for AI self-use
- Query commands return structured data
Error Handling
- Rust: Return
Err(String) from command handlers, never panic
- TypeScript: Return
{ success: false, error: "..." } from handlers
- User-facing errors: "What happened" + "What to do next"
Performance
- No O(n^2) in entity counts
- Debounce inspector inputs (100ms sliders, 300ms text)
- Virtual scroll for lists > 50 items
Quality Bar
Before declaring implementation complete:
cargo check --target wasm32-unknown-unknown — zero warnings
python3 .claude/skills/arch-validator/check_arch.py — zero violations
cd web && npx eslint --max-warnings 0 . — zero warnings
cd web && npx tsc --noEmit — zero errors
cd web && npx vitest run [relevant tests] — all pass
- Test file exists for every new store slice, event handler, and chat handler
- MCP manifest entries in both locations
- ToolCallCard display labels added