Reference implementation for the Phoenix Architecture. Work in progress. aicoding.leaflet.pub/
ai coding crazy
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 61 lines 1.8 kB view raw view rendered
1# ⚔️ Pixel Wars 2 3A real-time multiplayer territory capture game — 4 teams paint cells on a shared 20×20 grid. The team with the most cells when the timer hits zero wins. 4 5**Zero dependencies.** Single Node.js process. Raw WebSocket. Inline HTML/Canvas UI. 6 7Built and governed by [Phoenix VCS](../../README.md). 8 9## Play 10 11```bash 12npm start 13# → http://localhost:3000 14 15# Open 2+ browser tabs and start painting! 16``` 17 18## How It Works 19 201. Connect → you're assigned to the smallest team (auto-balancing) 212. Click/tap cells to paint them your team's color 223. You can **steal** territory by painting over other teams' cells 234. 500ms cooldown between paints — speed matters, but so does strategy 245. 2-minute rounds → winner announced → new round starts automatically 25 26## Teams 27 28| Team | Color | 29|------|-------| 30| 🔴 Red | `#ff4757` | 31| 🔵 Blue | `#3742fa` | 32| 🟢 Green | `#2ed573` | 33| 🟡 Yellow | `#ffa502` | 34 35## Architecture 36 37``` 38spec/server.md ─┐ 39spec/game.md ─┼─→ Phoenix Bootstrap ─→ 9 IUs ─→ Generated Code 40spec/ui.md ─┘ │ 41 ├─→ 55 canonical nodes (3 DEF, 19 CTX, 31 REQ, 2 CON) 42 ├─→ 164 typed edges 43 └─→ 100% extraction coverage 44``` 45 46The hand-written `server.mts` (275 lines) implements the full game using only Node.js built-ins — `node:http`, `node:crypto`, and raw WebSocket frame encoding. 47 48## Phoenix Commands 49 50```bash 51# See the trust dashboard 52phoenix status 53 54# Visualize the full provenance pipeline 55phoenix inspect 56 57# See what happens when you change a spec 58echo "- Players must be able to change teams mid-round" >> spec/game.md 59phoenix ingest spec/game.md 60phoenix status # ← shows the diff, classification, and cascade 61```