DEV Community

Cute Panda
Cute Panda

Posted on

One Engine, Two Applications: Building SyncEngine with Kiro | Kiroween 2026

This article is being written as part of the Kiroween 2026 hackathon. It documents our journey of building SyncEngine, a reusable synchronization foundation, and using Kiro throughout the process.

๐Ÿš€ Introduction

Imagine building a collaborative whiteboard where multiple users can draw, move objects, and edit the same canvas simultaneously.

Now imagine building a multiplayer first-person shooter where players interact with the game world, fight opponents, and compete against each other in real time.

At first glance, these applications have very little in common. One is focused on collaboration and shared editing, while the other is centered around multiplayer gameplay.

However, they share an important underlying problem: how do you keep multiple users synchronized while ensuring that everyone works with a consistent view of the application state?

Every time developers build a collaborative application, they face similar questions:

  • How should changes made by one user reach everyone else?
  • What happens when multiple users update the same piece of data?
  • How do we validate actions before applying them?
  • How can we reconstruct the application state if something goes wrong?
  • How do we maintain a reliable history of changes?

These problems are often solved independently for every application, even though many of the underlying requirements are remarkably similar.

We wanted to explore whether we could solve this problem once and make the solution reusable.

That idea became SyncEngine.

๐Ÿ’ก The Idea Behind SyncEngine

SyncEngine is a reusable foundation for building collaborative, multi-user applications.

Instead of making every application implement its own synchronization pipeline, we wanted to separate the common synchronization infrastructure from application-specific functionality.

The basic idea is simple:

Applications should define what their state looks like, what actions users can perform, and what rules govern those actions. The engine should handle the common infrastructure required to process those actions and maintain consistent, recoverable state.

We designed SyncEngine around typed application contracts and a modular architecture.

This means applications can define their own behavior while reusing the same underlying synchronization mechanisms.

Some of the core capabilities include:

  • Typed application contracts: Define application-specific state and actions through structured interfaces.
  • Action validation: Validate incoming actions against application-defined rules before applying them.
  • Controlled state transitions: Ensure state changes happen through explicitly defined transitions.
  • Append-only, hash-chained logs: Maintain an ordered history of state-changing events with integrity verification.
  • Deterministic replay: Reconstruct application state by replaying recorded events.
  • Snapshots and checkpoints: Recover state without replaying the entire event history every time.
  • Conflict handling and middleware: Provide mechanisms to manage concurrent updates and extend the action-processing pipeline.
  • Modular architecture: Allow storage, transport, clocks, and other dependencies to be supplied through adapters.

We built the engine in TypeScript, keeping the core synchronization logic separate from application-specific behavior.

But we didn't want to prove its usefulness through a single demonstration.

We wanted to test it against two applications with very different requirements.

๐ŸŽจ Application 1: A Collaborative Whiteboard

Our first application was a real-time collaborative whiteboard.

The idea was to allow multiple users to join a shared workspace and interact with the same canvas.

Users can create and edit shapes, draw freely, add text and sticky notes, and connect different elements. Changes made by one user can be reflected in the shared workspace for other participants.

A whiteboard is an interesting use case for synchronization because users can continuously modify shared objects.

Consider two users editing the same whiteboard. One moves a sticky note while another modifies or moves the same object.

The application needs a structured way to process these interactions, validate changes, and maintain a consistent shared state.

This made the whiteboard a useful environment for testing SyncEngine's action processing, state transitions, and conflict-handling mechanisms.

The goal was to make collaboration feel natural while keeping the underlying state management structured and predictable.

AeroBoard

๐ŸŽฎ Application 2: A Multiplayer First-Person Battle Royale

Our second application was a multiplayer first-person battle royale game.

Players enter an island, explore the environment, fight opponents, and compete to achieve the highest number of kills.

This was a completely different challenge from the whiteboard.

Instead of editing shared objects, players interact with a continuously changing game environment. The application has to handle match-state changes such as player health, hits, kills, deaths, respawns, and leaderboard updates.

We used the same SyncEngine foundation for these important match-state updates.

However, we also had to recognize that not every game update belongs in a persistent event history.

Player movement, aiming, and other high-frequency presentation updates need a different communication path. We therefore handled these through a separate ephemeral channel, while important match-state changes went through SyncEngine.

This separation allowed us to use the engine where its structured state-management capabilities were most useful without forcing every high-frequency update through the same pipeline.

GenX0

๐Ÿ”— One Engine, Two Very Different Applications

Building both applications was an important part of validating our original idea.

The whiteboard and the game have different interaction patterns, different state requirements, and different performance considerations.

Yet both can rely on the same underlying foundation for important synchronization responsibilities.

That was the main idea we wanted to demonstrate with SyncEngine.

We weren't simply building two applications. We were building a reusable foundation that could support both.

๐Ÿ—๏ธ How We Designed and Built SyncEngine

We developed SyncEngine using TypeScript and a modular architecture.

One of our main architectural decisions was to separate application-specific behavior from the engine's core responsibilities.

An application defines its state, available actions, validation rules, and state transitions through typed contracts.

The engine provides the common infrastructure for processing those actions and maintaining the event history.

We also designed the system around injected dependencies rather than tightly coupling the core to specific implementations.

For example, storage and transport implementations can be supplied through adapters. This makes it easier to use the same engine in different application environments.

Another important part of the architecture was deterministic state reconstruction.

Rather than treating the current in-memory state as the only source of truth, we wanted to maintain a history of accepted state-changing events.

This led us to implement an append-only, hash-chained event log, deterministic replay, snapshots, and a verification pipeline.

These mechanisms work together to make state reconstruction more predictable and allow the integrity of the recorded history to be checked.

flowchart TD
  %% --- STYLES & THEMING ---
  classDef boundary fill:#1f2937,stroke:#4b5563,stroke-width:2px,color:#f9fafb,rx:8px,ry:8px;
  classDef core fill:#1e1b4b,stroke:#6366f1,stroke-width:2px,color:#e0e7ff,rx:8px,ry:8px;
  classDef port fill:#064e3b,stroke:#10b981,stroke-width:2px,color:#d1fae5,rx:6px,ry:6px;
  classDef ext fill:#312e81,stroke:#818cf8,stroke-width:2px,color:#e0e7ff,rx:6px,ry:6px;

  %% --- EXTERNAL / ENTRY LAYER ---
  subgraph Entry_Layer [" Entry & Transport "]
    Client([Client])
    Transport[Transport Layer]
  end
  class Client,Transport boundary;

  %% --- APPLICATION / CORE ROUTING ---
  subgraph App_Layer [" Application Layer "]
    Rooms[Rooms]
    Engine{{Engine Core}}
  end
  class Rooms,Engine core;

  %% --- INTERNAL LOGIC & PIPELINES ---
  subgraph Core_Services [" Core Logic & Processing "]
    Middleware[Middleware]
    Conflict[Conflict Resolution]
    Blame[Blame Tracking]
    Log[Event Log]
    Replay[Replay Engine]
    Verify[Verifier]
  end
  class Middleware,Conflict,Blame,Log,Replay,Verify core;

  %% --- PORTS & STORAGE LAYER ---
  subgraph Persistence [" Storage & Ports "]
    Store[(Store Ports)]
    Lease[RoomLease Port]
    Canonical[(Canonical Data)]
  end
  class Store,Lease,Canonical port;

  %% --- MODULES & EXTENSIONS ---
  subgraph Extensions [" Extensions "]
    Modules[/Modules & Tools\]
  end
  class Modules ext;

  %% --- CONNECTIONS & DATAFLOW ---
  Client --> Transport
  Transport --> Engine
  Rooms --> Lease

  Engine --> Middleware
  Engine --> Conflict
  Conflict --> Blame
  Engine --> Log
  Engine --> Rooms

  Log --> Canonical
  Log --> Store
  Replay --> Log
  Verify --> Replay

  Engine -. "Hooks" .-> Modules

  %% --- LINK STYLES ---
  linkStyle default stroke:#94a3b8,stroke-width:2px;

๐Ÿค– Building with Kiro: More Than Just Code Generation

Building SyncEngine alongside two complete applications was a fairly ambitious undertaking.

We were dealing with a large codebase, multiple application environments, architectural decisions, testing requirements, and deployment infrastructure.

We wanted to use AI-assisted development, but simply asking an AI assistant to generate code for every feature wasn't going to be enough.

We needed a workflow that could preserve architectural context, break complex tasks into manageable pieces, automate repetitive checks, and help us understand the code being produced.

This is where Kiro became an important part of our development process.

We used several parts of Kiro's ecosystem, including Specs, Steering, Hooks, MCP integrations, and custom Agent Skills.

Here's how each contributed to the project.

1. Spec-Driven Development

One of the first things we used Kiro for was structuring the project through specifications.

Instead of approaching large features with a single prompt, we broke them down into requirements, technical designs, and implementation tasks.

The syncengine-core spec alone contains 130 tasks, covering everything from monorepo scaffolding and JCS canonicalization to hash chaining, middleware, and the verification pipeline.

We also created dedicated specifications for the whiteboard and six game features.

Across the project, our specifications contain more than 5,500 lines of requirements, designs, and tasks, with 350+ completed tasks.

This gave us a much clearer development process.

We could understand what needed to be implemented, why it was needed, and how individual tasks contributed to the larger architecture.

Spec Driven Development

2. Bugfix Specifications

We also used Kiro Specs for debugging and code-quality improvements.

During a whiteboard code review, we identified 12 critical issues that needed to be addressed.

Instead of fixing them through disconnected prompts, we created a dedicated bugfix specification.

Each issue documented the existing behavior, expected behavior, and functionality that must not regress.

Kiro then helped us work through a structured set of 65 tasks.

Some of the issues were particularly interesting:

  • A privilege-escalation issue where users could obtain host privileges by choosing a username beginning with host.
  • A color-selection action that could permanently disconnect a client.

This approach turned code-review findings into a systematic repair process rather than a collection of isolated fixes.

3. Steering Documents

As the project grew, maintaining architectural consistency became increasingly important.

We created project-wide steering documents, including:

  • project-principles.md
  • commit-per-feature.md
  • AGENTS.MD

These documents provided Kiro with persistent development guidelines.

Some of the rules we established included:

  • The event log must remain the source of truth.
  • Core synchronization logic must remain deterministic.
  • Avoid unseeded randomness and wall-clock dependencies in deterministic code.
  • Follow ports-and-adapters boundaries.
  • Rejected actions must never be added to the event log.
  • Maintain the project's established coding and testing conventions.

This was especially useful because Kiro was working across multiple applications and packages.

Instead of repeatedly explaining our architectural decisions, we could rely on steering documents to provide that context.

Kiro Steering

4. Agent Hooks

We wanted some development safeguards to run automatically rather than depending entirely on manual checks.

For this, we implemented three Kiro hooks.

PreToolUse hook: Prevents secrets and local-only files from being staged.

PostFileSave hook: Checks modified files against our determinism rules.

PostFileSave hook: Automatically runs SyncEngine tests after relevant file saves.

These hooks helped bring important checks closer to the moment code changes happen.

They also reduced the need to remember repetitive development steps manually.

Kiro Hooks

5. Playwright MCP

This was one of the most useful integrations for testing our applications.

We connected Kiro to Playwright MCP, allowing it to interact with actual browser sessions.

It could:

  • Open the whiteboard and game in a browser.
  • Click buttons and interact with application elements.
  • Type text and hold keyboard keys.
  • Inspect browser console output.
  • Open multiple tabs to simulate different players.

This meant Kiro could do more than inspect source code.

It could interact with the applications through their actual browser interfaces and help us test real user flows.

For example, opening multiple whiteboard sessions allowed us to simulate multiple users interacting with a shared workspace.

Similarly, browser-based interactions helped us test multiplayer game flows.

This reduced repetitive manual testing and made it easier to identify issues that might not be obvious from code inspection alone.

6. Terraform MCP

We also wanted to extend our AI-assisted workflow beyond application development.

We used Terraform MCP to help write and refine infrastructure-as-code for our Azure deployment.

Our infrastructure includes:

  • Azure Static Web Apps for the client.
  • Azure Container Apps for the match server.
  • Log Analytics for infrastructure logs.
  • Supporting resources for Terraform state storage.

This allowed us to use Kiro's MCP integrations when working with deployment infrastructure, rather than limiting its role to application code.

MCP

7. Custom Agent Skills

We created five reusable custom Agent Skills to make our development workflow more structured.

Each skill was designed for a particular stage of engineering:

  • feature-design: Helps compare alternative approaches before implementation.
  • feature-slice: Breaks a selected design into smaller implementation steps.
  • slice-predict: Guides us through reasoning about an implementation before making changes.
  • slice-walkthrough: Helps explain and understand completed code.
  • slice-qna: Tests our understanding of the implementation through questions.

We didn't want AI-assisted development to become a process where code was generated and accepted without understanding it.

Kiro Skills

These skills helped us use Kiro not only to implement features but also to reason about architecture and learn the codebase.

8. Property-Based Testing with fast-check

For a synchronization engine, correctness is extremely important.

A system that reconstructs different states when replaying the same event history would undermine one of its most important guarantees.

We used fast-check for property-based testing, with Kiro helping us translate correctness requirements into test properties.

Instead of checking only a few manually selected inputs, property-based tests generate many different inputs and verify that important properties continue to hold.

We particularly focused on deterministic replay and consistent state reconstruction.

This helped us test fundamental engine guarantees across a broader range of cases.

Kiro Memory

Kiro Memories helped maintain important project context across development sessions. By retaining key architectural decisions, coding conventions, and implementation details, Kiro could continue working with better context instead of requiring us to explain the same things repeatedly. This helped maintain consistency and made our development workflow more efficient.

Kiro Memory

๐Ÿงฉ The Biggest Challenges We Faced

One of our biggest challenges was designing an abstraction that was genuinely reusable.

It is relatively easy to build something that works for one application. The difficulty comes when a second application has very different requirements.

The whiteboard and the multiplayer game made this particularly clear.

A whiteboard frequently modifies shared objects. A multiplayer game has a much higher frequency of updates, and not every update needs to become part of a permanent event history.

We had to carefully separate important state-changing actions from high-frequency presentation updates.

Another challenge was designing deterministic state reconstruction.

Maintaining an event log is not enough by itself. The system must also be able to replay the recorded actions predictably and reconstruct the expected state.

This required careful thought around event processing, snapshots, hash chaining, and verification.

Finally, integrating the engine into two applications helped expose architectural limitations early.

Some abstractions that seemed reasonable while building the first application needed to be reconsidered when we started using them in the second.

That experience was valuable because it forced us to think about the engine as an independent foundation rather than a collection of features built specifically for one application.

๐Ÿ“š What We Learned

This project taught us that building reusable infrastructure is often harder than building application-specific functionality.

An abstraction that works perfectly for one use case may become a limitation when another application starts using it.

We learned a lot about:

  • Real-time state synchronization.
  • Event-driven architecture.
  • Deterministic state reconstruction.
  • Event logging and integrity verification.
  • Modular software design.
  • Testing concurrent application behavior.
  • The trade-offs between persistent state changes and high-frequency updates.

We also learned that AI-assisted development works best when it is supported by clear architectural context, structured tasks, and automated verification.

Kiro helped us establish that workflow throughout the project.

Kiro Usage 1 Kiro Usage 2 Kiro Usage 3
Credit Usage

Rather than treating AI as a replacement for engineering decisions, we used it as part of the process of making, implementing, and validating those decisions.

๐Ÿ”ฎ What's Next?

We see SyncEngine as a starting point for building many kinds of collaborative applications.

Beyond whiteboards and multiplayer games, the same underlying ideas can be useful in:

  • Collaborative project management tools.
  • Real-time auction systems.
  • Shared workspaces and editing applications.
  • Multiplayer experiences.
  • Applications where multiple users need consistent shared state and recoverable event history.

Our goal is to continue improving the engine, refining its abstractions, and making it easier for developers to integrate into new applications.

We don't want developers to repeatedly solve the same synchronization problems every time they start a collaborative project.

We want them to focus on building the actual product.

โค๏ธ Final Thoughts

Kiroween 2026 gave us an opportunity to take an ambitious idea and turn it into a working ecosystem.

What started as an attempt to avoid rebuilding synchronization infrastructure became a much larger engineering journey involving architecture design, two different applications, deterministic replay, testing, browser automation, and cloud infrastructure.

Kiro played an important role throughout that journey.

Specs helped us plan. Steering maintained architectural consistency. Hooks automated safeguards. MCP integrations connected our development workflow to real applications and infrastructure. Custom skills helped us reason about and understand our implementations.

And through the whiteboard and multiplayer game, we got to test whether our original idea could work beyond a single use case.

One engine. Two applications. A foundation for many more.

That's SyncEngine.


๐Ÿ”—Explore the Project

Built with TypeScript and Kiro as part of the Kiroween 2026 hackathon.

Top comments (1)

Collapse
 
samiran634 profile image
Samiran Chakraborty •

Nice, bro... proper utilization of Kiro Ide