When many packages need to cooperate, do not create one giant store that everyone imports. Let packages meet through Bitfield state, data names, and action requests.
A command center has a file tree, file editor, AI chat, project preview, notifications, keyboard shortcuts, and a sidebar. Each package has its own job. The user still needs one coherent product.The goal is cooperation without fusion: packages share public Bitfield handles instead of turning into one tangled codebase.Traditional app shape
Bitfield shape
Cooperation map
State
Editor, AI context, and breadcrumbs read the same product fact.
Input
Preview UI reads a prepared view of project status and URL.
Request
A settings surface asks the notification package to change mode.
Private
Temporary UI details stay inside the package rendering them.
Larger chain
Start with a normal product flow:Shared names, separate packages
What this prevents
| Bad shape | Why it breaks | Better shape |
|---|---|---|
| One giant app store. | Every feature depends on every other feature’s private state shape. | Shared product facts in Bitfield. |
| One central service imports all packages. | Adding a package means editing the central service. | Packages expose inputs and targets. |
| Shell coordinates package-specific UI rules. | Layout becomes business logic. | Shell places; packages read/call. |
| Code gets patched wherever it is easiest. | The code compiles but boundaries collapse. | Choose state, input, target, private UI state, or package bytes. |
Complete translation example
| Product need | Traditional answer | Bitfield answer |
|---|---|---|
| Editor needs active file. | Import file tree store. | Read selected-file. |
| AI chat needs active file. | Import editor state. | Read selected-file. |
| Preview panel needs URL. | Import project preview service. | Read project-preview-surface. |
| Button refreshes preview. | Call preview implementation. | Request project-preview.refresh-status. |
| Keyboard changes selected agent. | Import selected-agent service. | Request selected-agent.update. |
| Dropdown opens. | Global app store. | Private UI state. |
Add a new package without retangling
Imagine you add a “recent activity” package.Traditional addition
Central-store shortcut
Read public facts instead
Multi-package review checklist
| Check | Good answer |
|---|---|
| Does adding the new package require editing existing package imports? | No. |
| Does the shell branch on package-specific UI rules? | No. It places descriptors and surfaces. |
| Does one package become the central product store? | No. Shared facts live in Bitfield. |
| Can keyboard, command palette, and buttons request the same work? | Yes. They send the same action request. |
| Can a non-React shell follow the same chain? | Yes. React is one adapter, not the architecture. |
Why this scales past the first screen
The first screen can survive traditional coupling. The tenth screen usually cannot. The problem is not that stores, services, or contexts are evil. The problem is that they make every feature depend on another feature’s private state shape.Bitfield keeps the product language outside any one package:| Product language | Public name |
|---|---|
| ”The file the user is working on” | selected-file |
| ”The project the workspace is showing” | current-project |
| ”The preview surface to render” | project-preview-surface |
| ”Change the selected agent” | selected-agent.update |
| ”Search help” | help.search |
Review check
When more than two packages are involved, do not solve it by creatingappStore, platformStore, globalState, or sharedService. First classify each relationship:Next
- Start with the overview: Build without tangled code
- Build a full example: Placeable surface product loop
- Review AI coding rules: Rules for AI agents