Skip to main content

This case study follows one realistic product flow end to end: a user selects a file, the editor reads it, the preview surface shows the current project, help content is available, keyboard shortcuts change the selected agent, and notifications update mode.

You are building a command center with a file tree, file editor, web preview, help panel, keyboard shortcuts, AI context, and notifications. The product needs to feel connected, but the packages must not import each other.This case study shows the exact traditional code pattern that causes tangles, then translates it into public Runtime Kit handles without importing package files, private stores, or implementation functions.

Source facts this case uses

This page is grounded in public-safe Runtime Kit shapes:Do not copy package private folders or local source paths from an example. The public lesson is the handle shape: input, prepared view, action request, package-owned bytes, and private UI state.

Traditional implementation

This is the kind of code the traditional app shape makes feel natural:
This code is not bad because it is long. It is bad because every package directly depends on every other package. The editor imports the file tree store. The preview caller imports the preview service. The help consumer imports the help folder. The keyboard path imports the selected-agent store. Notification changes happen by direct implementation call.

Bitfield translation

The same product flow becomes public names:

React adapter example

Request example

The adapter can be React, a native shell, a terminal shell, or a future SDK. The boundary stays the same: read named data, request named work, keep visual-only state private.

Public names

Data-flow map

01

The selected file becomes a public product fact.

02

Editor, AI context, and preview read named inputs.

03

Keyboard and settings send named action requests.

04

Hover, open menu, and draft text stay inside the surface.

File-by-file public files and names

Boundary mistakes

Review checklist

The finished flow should answer yes to all of these:

Next

Last modified on May 10, 2026