Figma-like visual builder for React Native Reusables on UniWind. Chat-first editing, JSON-driven rendering, real RN code export.
This plan supersedes two older assumptions:
- DesignForge should feel like a deep Figma-style editor shell, not a simple form builder.
- The repo is no longer greenfield.
editor-core,editor-ui,catalog,mcp-server,desktop,vscode, andagent-cli designalready exist as scaffolds or partial implementations.
The target is:
- Figma-like interaction model: left rail, layers, infinite canvas, inspector, keyboard-first workflows, pan/zoom, multi-select, layout tools.
- Vibe chat as a first-class surface: prompt, preview, accept, reject, branch, retry.
json-renderas the long-term document/render contract.@next-dev/rn-uniwindas the actual runtime output library.apps/uniwind-expopluspnpm dlx @react-native-reusables/cli@latestas the official ingest path for new RNR components.
Important scope line:
- We are cloning the editor ergonomics of Figma, not the vector drawing engine of Figma.
- The document model remains component-native and layout-native, not freeform SVG/Bezier authoring.
DesignForge should let a developer do all of the following in one loop:
- Prompt a screen into existence in chat.
- Inspect and refine it visually in a Figma-like editor.
- Edit props, layout, hierarchy, and variants without leaving the canvas.
- Export or sync the result as real React Native code using
@next-dev/rn-uniwind.
The win is not "another canvas app". The win is:
- structured UI data instead of pixels
- real RNR components instead of fake primitives
- UniWind classes and design tokens instead of ad hoc inline styling
- AI that speaks patches, not screenshots
packages/editor-core
- Document model
- History
- Selection
- Clipboard
- Vitest coverage
packages/catalog
- Zod-based component definitions
- Editor metadata
- Registry scaffolding
packages/editor-ui
- Toolbar
- Component palette
- Layer tree
- Canvas shell
- Props panel
- DnD plumbing
- Mock AI service abstraction
packages/mcp-server
- MCP server bootstrapped
- CRUD-style design tools over stdio
apps/desktop
- Electron shell scaffold
apps/vscode
- VS Code custom editor scaffold
apps/agent-cli
designcommand exists withgenerate,export,list, andpreview
json-renderis planned but not yet integrated into the actual codepaths.packages/catalogcurrently knows about more components than@next-dev/rn-uniwindexports.@next-dev/rn-uniwindcurrently exports only a small subset of the components needed by the builder.editor-uihas AI service plumbing but does not yet expose a real chat dock and patch review UX.mcp-serveris still in-memory and not yet sessioned around real.dfgfiles.- Desktop and VS Code hosts are scaffolds, not end-to-end product surfaces yet.
This means the next phase is not "start from zero". It is "close parity gaps, then turn the scaffolds into a coherent product".
DesignForge should visually and behaviorally borrow from:
- Figma for the editor shell and interaction grammar
- Framer for polished canvas ergonomics
- Lovable / v0 for the chat-native generation loop
- Left rail: files, pages, assets, insert, layers
- Top toolbar: select, hand, frame preset, add component, undo/redo, zoom, platform preview
- Center: infinite canvas with artboards/frames and overlays
- Right inspector: design, layout, props, variants, export
- Right dock or bottom dock: persistent AI chat
- Bottom status bar: zoom, platform, branch/version, unsaved status
- Pan with spacebar or middle mouse
- Zoom to cursor
- Marquee multi-select
- Keyboard shortcuts for duplicate, group, ungroup, delete, nudge
- Resizable panels
- Frames/pages as first-class concepts
- Layer locking, hiding, collapse state
- Selection outlines and insertion indicators
- Command palette and slash insert
- Pen tool
- Bezier editing
- Vector boolean ops
- Bitmap editing
- Asset pipeline management
The result should feel like "Figma for structured React Native UI", not "Figma but worse".
The document source of truth should be a structured JSON tree that can power:
- canvas rendering
- prop editing
- AI patch generation
- export to RN code
- host interoperability
Use a .dfg file that wraps:
- a
json-rendercompatible spec - editor-only metadata
- host/session metadata
Example shape:
{
"version": 2,
"catalog": "rnr-uniwind-v1",
"targets": ["ios", "android", "web"],
"spec": {
"root": "frame-home",
"elements": {
"frame-home": {
"type": "Frame",
"props": {
"name": "Home",
"platform": "universal",
"className": "flex-1 bg-background p-4 gap-4"
},
"children": ["card-1"]
},
"card-1": {
"type": "Card",
"props": {
"className": null
},
"children": ["title-1", "body-1"]
}
},
"state": {}
},
"editor": {
"selectedIds": [],
"expandedLayers": ["frame-home"],
"viewport": {
"zoom": 1,
"x": 0,
"y": 0
}
}
}editor-coreowns mutations, validation, history, and selection.- Hosts and AI clients never mutate the document directly.
- Every mutation becomes a labeled operation or patch batch.
- Export strips editor metadata and emits real RN code.
json-render should become the contract between:
- the visual canvas
- the AI layer
- future code generation
- It gives us a stable spec format instead of custom one-off JSON.
- It makes renderer, schema, and codegen composable.
- It gives the AI a constrained vocabulary.
- It makes host portability easier because the document stays headless.
Short term:
- Keep current
editor-coredocument primitives. - Introduce an adapter layer that maps current spec shape to the
json-rendershape we want to standardize on.
Mid term:
- Integrate
@json-render/core - Integrate
@json-render/react - Integrate
@json-render/zustand - Integrate
@json-render/codegen
Long term:
- Remove redundant custom rendering code once
json-renderis the real runtime path.
This is the critical architectural rule:
packages/catalogmust only describe components that actually exist and export from@next-dev/rn-uniwind.
Right now that rule is violated. Fixing it is one of the first priorities.
Per the UniWind/RNR workflow in this repo:
- Run the RNR CLI from
apps/uniwind-expo, not frompackages/rn-uniwind. - Use
@react-native-reusables/cli@latest. - Copy or sync generated files into
packages/rn-uniwind. - Fix aliases from
@/to~/. - Export the components from
packages/rn-uniwind/src/index.ts. - Only then update
packages/catalog.
Commands:
cd apps/uniwind-expo
pnpm dlx @react-native-reusables/cli@latest add input label separator switch checkbox textarea tabs select popover tooltipIf needed:
pnpm dlx @react-native-reusables/cli@latest doctor
pnpm dlx @react-native-reusables/cli@latest add --overwrite input label separatorThese should exist before the AI/canvas loop is considered credible:
InputLabelSeparatorTextareaCheckboxSwitchSelectPopoverTabsAccordionAlertAlertDialogAvatarSkeletonTooltip
- No hand-waving types in
catalog. - No components in AI prompts that do not render on canvas.
- No components in export that do not exist in
@next-dev/rn-uniwind. - Registry, catalog, AI prompt context, and export imports must stay in lockstep.
The canvas should be an infinite workspace with frames, not a boxed preview card.
Needs:
- pan and zoom
- frame presets for phone/tablet/web
- center-on-selection
- multi-select overlays
- drop insertion markers
- snap lines later, not day one
- optional minimap later
The layers panel should feel close to Figma:
- page/frame tree
- collapse and expand
- drag to reorder or reparent
- show hidden/locked state
- inline rename
- selection sync with canvas
The right inspector should unify:
- component props
- layout controls
- spacing and alignment
- UniWind className editing
- variant selection
- frame settings
The inspector is where "component-native" beats pixel tooling:
- edit props directly
- surface RNR variants as structured controls
- let advanced users drop to className when necessary
There should be three insert paths:
- drag from components panel
- slash insert on canvas or layers
- prompt in chat
All three should land in the same document mutation pipeline.
Chat is not a side feature. It is a co-equal editing surface.
- Prompt against the whole screen or current selection.
- Generate structure, not screenshots.
- Preview changes before commit.
- Let the user accept all, accept some, or reject all.
- Preserve a visible conversation per file.
The chat panel should support:
- message thread
- suggested prompts
- mode switch:
Ask,Edit,Generate,Refactor - selection-aware prompting
- patch preview cards
- retry and branch
- apply/revert
- concise diff summaries
- "Turn this into a pricing screen with three tiers"
- "Make the selected card look more premium"
- "Add a settings section under the profile card"
- "Replace these buttons with tabs"
- "Convert this form to a mobile-first layout"
The AI should return structured JSON, not freeform prose.
Example envelope:
{
"summary": "Added a settings section below the profile card.",
"target": {
"scope": "selection",
"selectionIds": ["card-2"]
},
"operations": [
{
"type": "add",
"parentId": "frame-home",
"elementType": "Card",
"props": {
"className": "gap-3"
}
}
]
}Never silently apply AI edits in the final product.
The flow should be:
- prompt
- model returns operations
- editor creates preview branch
- user inspects highlighted changes
- user accepts or rejects
This is the main difference between a toy prompt box and a real vibe-chat workflow.
Keep the host adapter model. Extend it.
HostAdapter
- file system
- dialogs
- theme
- clipboard
- notifications
- preview window hooks
AIAdapter
- send prompt
- stream partial status
- return structured operation batches
- support cancel
DesignSession
- load/save
.dfg - autosave
- dirty tracking
- branch history
- chat thread persistence
Electron:
- local filesystem
- multi-window preview
- menu and shortcuts
- optional local MCP process
VS Code / Cursor / Windsurf:
- custom editor for
.dfg - webview host for editor UI
- extension-host bridge for files and commands
- reuse the same bundled
editor-ui
CLI:
- batch generation
- export
- validation
- preview
- scripted design transformations later
MCP:
- remote or local AI entry point
- component catalog introspection
- file-backed editing
- host-neutral automation surface
Owns:
- document schema helpers
- operations
- validation
- history
- selection
- clipboard
- import/export transforms
Next additions:
- frame/page concepts
- branchable preview state
- operation labels suitable for chat diffs
- stricter schema validation
Owns:
- component schemas
- editor metadata
- grouping and categorization
- AI prompt serialization
- runtime registry mapping
Next additions:
- generate catalog from actual exports where possible
- component capability metadata
- frame/screen primitives
- prop editors for variants and design tokens
Owns:
- full Figma-like shell
- canvas and overlays
- layers panel
- inspector
- chat panel
- keyboard shortcuts
- host-agnostic state wiring
Next additions:
- chat dock
- preview diff mode
- resizable panels
- frame presets
- command palette
- selection-scoped prompting
Owns:
- AI and automation tools
- file-backed document sessions
- catalog/context exposure
- deterministic edit endpoints
Next additions:
- real
.dfgopen/save - session IDs
- patch preview responses
- export endpoints
- validation errors that map cleanly to UI
Owns:
- polished local product shell
- native open/save dialogs
- preview windows
- packaging and updates
Owns:
.dfgcustom editor- IDE-native command surface
- integration with Cursor/Windsurf via VS Code compatibility
Owns:
- terminal-first workflows
- export and validation
- catalog listing
- scripted generation
Next additions:
- file validation
- migration command
- bridge to MCP-backed generation instead of heuristics
- Expand
@next-dev/rn-uniwindusing@react-native-reusables/cli@latest - Fix
catalogto match exported runtime components - Lock
.dfgversion 2 schema - Add validation that catches catalog/registry/export drift
- Keep
editor-coreas the single mutation authority
Exit criteria:
- every catalog component renders
- every catalog component exports
- every catalog component is AI-addressable
- Replace the current simple canvas layout with an infinite workspace
- Add frames/pages
- Add panel resizing
- Add better selection overlays
- Add marquee multi-select
- Add richer keyboard shortcuts
Exit criteria:
- the app feels like a serious editor even before AI is used
- Add real chat panel in
editor-ui - Implement patch preview and accept/reject
- Scope prompts to selection or entire document
- Replace mock service with host-backed
AIAdapter
Exit criteria:
- user can build and revise a screen mostly from chat without losing trust
- Introduce
@json-render/core - Introduce
@json-render/react - Route canvas rendering through the registry
- Introduce
@json-render/codegenfor cleaner export
Exit criteria:
- spec, canvas, AI, and export all speak one contract
- File-backed desktop editing
- VS Code custom editor wiring
- CLI integration with MCP-backed operations
.agents/mcp.jsonsync improvements
Exit criteria:
- same document can move across desktop, IDE, CLI, and MCP
- starter templates
- design tokens
- version snapshots
- better previews
- onboarding
- gallery of generated examples
If work starts now, do this in order:
- Expand
@next-dev/rn-uniwindcomponent coverage through the Expo app and RNR CLI. - Fix
packages/catalogso it matches real exports only. - Add a proper
AIChatPaneland chat state inpackages/editor-ui. - Add preview-branch support in
editor-corefor accept/reject flows. - Make
mcp-serveroperate on real.dfgfiles instead of only in-memory state. - Upgrade the canvas shell to frames plus infinite pan/zoom.
- Integrate
json-renderas the rendering contract. - Replace heuristic CLI/AI generation with the same structured operations used everywhere else.
This order matters. Chat on top of broken component parity will fail. A Figma-like shell without patch review will feel cosmetic. json-render should land after the document boundaries are stable enough to adopt it cleanly.
DesignForge is on track when all of the following are true:
- A prompt can generate a believable mobile screen in under a minute.
- The result renders with real
@next-dev/rn-uniwindcomponents. - The user can refine the result visually without leaving the editor.
- The user can inspect and accept AI changes as structured diffs.
- Exported code compiles without hand-editing for the supported component set.
- The same
.dfgfile opens in desktop, VS Code, CLI, and MCP flows.
- NativeWind-first workflows
- vector illustration tooling
- freeform absolute-position design systems
- design token management across multiple remote sources
- multiplayer collaboration
- marketplace/plugin ecosystem
V1 should be opinionated:
- UniWind only
- RNR only
- structured component composition only
That constraint is what makes the builder exportable and AI-friendly.