How I used Kiro specs, steering, and hooks to build a two-player browser mystery about getting to know a stranger.
I wrote this as part of the #KiroweenHackathon26.
The first thing you learn about the person who will help you escape is a number on a hospital file. The second is that they have the piece of evidence you need. Their face comes much later.
That’s Last Wave, a 3D browser mystery I built solo. I wanted to see what two strangers might learn about each other when they had to ask each other for help.
Table of Contents
- What I Built
- The Story
- Demo
- Code
- How I Used Kiro
- What I Learned
What I Built
Last Wave is a third-person social mystery for two players. After the first episode, the game automatically pairs two people and gives them separate versions of the same investigation. Each player can explore their own wing, read evidence, and solve local puzzles. To descend, they have to send each other clues over the ward phones.
I wanted the opening line between strangers to come from the game. “I found your load chart” gives both people something specific to talk about. From there, you might ask how your partner worked out a clue, laugh at a wrong guess, or check that they’re ready to head downstairs. You get a feel for how the other person thinks while you’re still in separate wings.
That idea shaped matchmaking too. You can play Episode One on your own. When you choose Continue to Episode 2, the game starts looking for another player and pairs you automatically. I wanted the game itself to introduce you to someone.
I used WebRTC to let both players talk live through the ward phones once they each enable voice. The same receiver supports typed messages and a dedicated evidence button. When you press Pass load chart, the full clue goes into your partner’s Casebook, where they can read it again after hanging up. A player who keeps their mic off can still talk through text, pass evidence, and finish the story.
The Story
Episode 01 — The day the ocean disappeared
The game opens in a forest at night. The camera falls beneath a wooden bridge into a dungeon, where a sign turns to reveal the sign-in board. The story proper then begins in daylight at the Tideline café. There’s a TV report playing. Your friend is waiting. You grab your bag and phone and head toward the seafront.
At the beach, you can talk with your friend, stop for a drink, or look out over the water. When you’ve done all three, the ocean pulls back and the birds scatter. The warning turns into an evacuation you have to play. Follow the boardwalk inland, climb toward higher ground, and try to keep up with your friend. The crowd separates you before the screen goes black.
Episode One begins the evacuation when the water retreats. The arrows show the route the player will run.
Episode 02 — A voice through the static
You wake on Floor 5, wearing a wristband marked 017 or 018. A stranger wakes in the opposite wing. The corridors have the same failing lights and sealed mortuary doors. The files tell different halves of the story.
On each floor you recover part of the hospital’s record and find something the other patient needs. First it’s a load chart, then a transfer authorization. The first exchange makes the security circuit usable. The second gives each player a way to authorize their own stairs. By the time you make it to Floor 1, you’ve talked and worked together for four floors without seeing each other.
At the bottom you finally meet. Two contacts control the last door. Players have to hold them together for six uninterrupted seconds. I wanted the final interaction to resolve something the whole hospital had been building toward. For the first time, you can see the person on the other end of the line.
Demo
The gameplay video follows the story from the coast to the hospital and shows how I used Kiro to build the co-op investigation.
Sign in, play through the blackout, and choose Continue to Episode 2. For a coordinated playtest, have a second player enter the lobby at the same time from a separate browser session. The lobby pairs you automatically. Play Last Wave
Follow the first clue across both screens.
- Two screens, two patients. Patient 017 and patient 018 wake in opposite wings. Each has a different file to open.
- One clue changes the other player’s game. At the corridor phones, press Pass load chart on one screen. On the other, the chart arrives from the unknown patient and becomes evidence in the Casebook. Repeat from the other receiver so both players can work on their circuits.
- The payoff. On the ground floor, watch the shared meter fill when both players hold their contacts. Once the hold completes, the door releases.
A captured two-client clue exchange. The microphone is off and both players can still send evidence.
I played the deployed version of Last Wave online with another player. We connected to the same ward, and my partner received the clues I sent through the ward phone.
The local two-client walkthrough covered the full descent, both exchanges on each floor, and the shared exit. It also checked that a returning player kept their role and clues. In a separate WebRTC test, synthetic microphones let me verify audio in both directions and check that hanging up released the microphone. Testing physical microphones across different networks and checking the production relay are still open. Gameplay verification
Code
The project is open source. The browser uses PlayCanvas and TypeScript for the 3D world and controls. Colyseus owns the live room, positions, and puzzle progress. Supabase handles sign-in and player-owned checkpoints. WebRTC carries optional voice, with signaling scoped through the ward server. Browse the source
Player 017 browser ───┐ ├── Colyseus ward ── authoritative puzzle and floor state Player 018 browser ───┘ Ward phones ───────────── WebRTC audio with consent └───── Colyseus text and evidence exchange Player accounts ───────── Supabase Auth and account-owned checkpoints 1. The phone makes cooperation an explicit game action
The file in your wing holds your partner’s fuse ratings. The server checks that both patients are at active phones on the same floor. It also checks that the sender has recovered the relevant file or recording. Only then does it mark the recipient’s evidence as received.
phonePeer(id: string, now: number): string | null { const self = this.patients.get(id); if (!self?.phone || !this.usePhone(id, true, now)) return null; for (const [otherId, p] of this.patients) if (otherId !== id && p.floor === self.floor && p.phone && this.usePhone(otherId, true, now)) return otherId; return null; } sharePhoneEvidence(id: string, kind: PhoneEvidenceKind, now: number) { const p = this.patients.get(id), otherId = this.phonePeer(id, now); if (!p || !otherId || (kind === 'load-chart' ? !p.file : !p.recording)) return null; const other = this.patients.get(otherId)!; if (kind === 'load-chart') other.chartReceived = true; else other.releaseReceived = true; return { from: p.role, text: floorPhoneClue(p.role, p.floor, kind, this.floorCount), kind }; } usePhone also checks proximity and whether a wall blocks access to the handset. The fuse panel reads chartReceived before accepting a code. That ties progression to something the other player actually did. Voice and typed text can carry the conversation, while the evidence action records the in-game handoff. Phone exchange and progression in HospitalRun.ts
2. One hospital floor lives in the scene at a time
The server advances your floor after you authorize the stairs. That change arrives in a snapshot. The client stages the next PlayCanvas floor in a disabled entity, builds its rooms and fixtures, then swaps it into the scene. Your player and network session persist across the change.
const next = new Entity(`hospital-floor-${hospitalFloorNumber(p.floor, view.floorCount)}`); next.enabled = false; root.addChild(next); let built; try { built = createPairedHospitalWard(next, app, hospitalAssets, role, compact, p.floor, view.floorCount); } catch (error) { next.destroy(); throw error; } world.destroy(); world = next; activeFloor = p.floor; clues = allFloorEvidence[activeFloor]; ({ gates, exit, lamps, updateDisplays } = built); world.enabled = true; Staging keeps the previous floor intact if construction throws, and replacing the world releases the previous floor’s scene entities. The same layout machinery supports five floors with different room dressing and evidence locations. The player’s Casebook can still contain records from earlier floors. Floor transition in PairedHospitalScene.ts
The South Ward uses signs, light, and an area map to make the investigation navigable in the dark.
3. The server decides when both players are holding the exit
Each patient has a separate contact. The room checks that both are in the final area, active, and close to their own contact. The server timer resets if either person breaks the hold. The browser renders the progress the room reports.
const holding = together && pair.every((p) => p.armed && p.active && now - p.lastSeen < 1000 && this.near(p, 'machine')); if (!this.unlocked) { this.surge = holding ? Math.min(6, this.surge + Math.min(dt, 0.2)) : 0; this.unlocked = this.surge >= 6; } Testing that reset matters to the story. The last door should open at the moment both players make the commitment. Surge logic in HospitalRun.ts
How I Used Kiro
I built most of Episode One scene by scene. When I moved into Episode Two, a change to the phone could affect puzzle state, browser permissions, network recovery, and the stairs. Kiro’s spec workflow gave me a place to describe those relationships before modifying any of those systems.
For the ward phone, I started with what the player should experience. When one player passes a chart, the other player should receive it as evidence and be able to use it at their fuse panel. That gave me a requirement I could follow into the room server and verify from the other player’s side. Ward phone walkthrough from spec to test
Specs made the design testable
The hospital co-op spec has three working files.
| File | What I used it for |
|---|---|
requirements.md | Describe the player experience in acceptance criteria. That covers automatic pairing, separate wings, evidence exchange, and the final shared hold. |
design.md | Decide what belongs to the browser, what belongs to the room server, and where the two have to agree. |
tasks.md | Turn the requirements into changes I could verify and keep records of the checks next to the work. |
One criterion covers what happens when voice fails and when a player leaves the phone.
IF microphone permission or negotiation fails, THEN THE SYSTEM SHALL keep text available. WHEN the phone closes or focus is lost, THE SYSTEM SHALL end media and signaling.
This gave me three observable things to check during a playtest. Text stays usable when permission is denied, evidence arrives when both players are at their receivers, and hangup releases the mic. I could test each independently of whether two people had already solved the rest of the floor. Hospital requirements and verification
I also wanted the test suite to protect what makes the game cooperative. In the test below, the first attempt fails while only one patient is on the phone. It succeeds once the partner picks up, and the evidence goes to the other patient.
at(a, 'phone'); run.usePhone('a', true, 10000); assert.equal(run.sharePhoneEvidence('a', 'load-chart', 10000), null); at(b, 'phone'); run.usePhone('b', true, 10000); a.active = false; b.active = false; assert.ok(run.sharePhoneEvidence('a', 'load-chart', 10000)); assert.equal(b.chartReceived, true); assert.equal(a.chartReceived, false); The test pauses normal movement input while both receivers are open. That’s an important distinction. A player can stop walking to use the phone and still be present for the exchange. Two-player evidence test
Steering kept the project’s decisions in the repository
The product steering records that strangers are matched automatically, start on Floor 5, and first see each other on Floor 1. The technical steering covers PlayCanvas, server authority, checkpoint ownership, and asset licensing. I could return to the hospital after a break and see why the room still owns puzzle progress, even though each browser also has a Casebook and an account save. Kiro steering files
Hooks made the end of a task concrete
I configured SessionStart to print the current scope and open tasks, PreTaskExec to load task context, and PostTaskExec to run the project checks. Here’s the verification hook.
{ "name": "Verify Last Wave spec task", "description": "Runs typecheck, repository ESLint and the Node test suite after a spec task completes.", "trigger": "PostTaskExec", "timeout": 600, "action": { "type": "command", "command": "node scripts/kiro-workflow.mjs verify" } } The same command runs from a terminal and writes a report. The repository also has a file-save hook for per-file lint and targeted hooks for ward, networking, server, and SQL changes. I could link a task to its result and see which checks had run. The submission review recorded a passing typecheck, ESLint run, and all 189 release tests. I recorded the browser walkthrough and hosted playtest separately. Kiro hooks and commands · Recorded release checks
A bugfix spec helped me debug the live room
During hosted testing, the matchmaking request returned HTTP 200, then the WebSocket upgrade returned 401. Those are two different steps in getting into a playable room. Correcting the deployed origin let two clients using the game’s origin get into the same hosted ward with distinct roles.
I used the bugfix spec to capture the recovery behavior as well. A temporary connection failure should keep the reservation available for retry. While the socket is down, the station prompt should disappear. Once a fresh snapshot arrives from the same ward, E should work again. I checked that last path by closing the actual socket in a local browser run, reconnecting, and opening the wristband clue. Hosted ward recovery bugfix and checks
What I Learned
My favorite part of Kiro is specs because they changed what I write down first. For a multiplayer feature I now start with what each player should see, what action changes their partner’s game, and what should survive an interruption. I can ask the same questions after a refactor and still have a way to tell whether the experience works.
The moment that sold me on Last Wave came when a real partner received the clue I’d just sent. We both went back to our own side of the ward. We each had a puzzle we could finally work on and a reason to come back to the phone. That was the interaction I’d wanted to build from the start.
If you try it, see how much you learn about your partner before you meet them. Play Last Wave · Explore the source and Kiro specs





