Skip to main content

Builder.io Patterns for Commandr + DiffViewer

Builder.io’s Agent-Native and Skills repos help our workflow in two concrete ways:
  1. Shared action vocabulary — humans and agents should invoke the same validated actions, whether the trigger is a UI click, tool call, CLI command, MCP call, or runner adapter.
  2. Inspectable visual artifacts — plans and recaps should become durable review packages, not chat walls.
They do not replace Commandr or its .agents/ bus. Commandr remains L3 source of truth. DiffViewer remains L5 projection and action UI. Builder.io patterns shape the seams between them.

Layer Mapping


Commandr Contract

Commandr should expose action-like verbs, but every bus mutation must still map to SPEC v0.3 or a future conformance-backed SPEC change. Rule: approval_requested, artifact_created, .agents/approvals/*.pending, .denied, and runner workspace paths stay outside SPEC until DiffViewer has a real consumer and Commandr adds conformance checks.

DiffViewer Contract

DiffViewer should implement the Builder.io pattern as a local action dispatcher:
Human clicks and agent proposals enter the same dispatcher. The dispatcher validates input, classifies risk, checks approval policy, then calls the right handler. Agent text never jumps directly to side effects. DiffViewer-owned artifacts should live outside .agents/, for example:
These artifacts are regenerated projections. Losing them should not corrupt task lifecycle.

Visual Plan Package

Builder.io /visual-plan maps to a pre-implementation package rendered by DiffViewer. Inputs: Output: .diffviewer/artifacts/<task>/plan.md. Required sections: Commandr relationship: the plan is not the task packet. The packet remains the work contract; the plan is a rendered aid and can be referenced from task_progress as a neutral note.

Visual Recap / Review Package

Builder.io /visual-recap maps directly to DiffViewer’s end-of-task review package. Inputs: Output: .diffviewer/artifacts/<task>/review-package.json plus a rendered Markdown/MDX view. Minimal JSON shape:
DiffViewer can render this as cards: overview, file map, risk, verification, screenshots, logs, approvals, council, residual risks.

Workflow

This preserves the thin waist: Commandr records lifecycle; DiffViewer records UI/action/audit projections; runners own private execution state.

Implementation Slices

Slice 1: No-SPEC-Change Review Package

Build in DiffViewer only. Acceptance criteria:

Slice 2: Action Registry

Add a local dispatcher in DiffViewer. Acceptance criteria:

Slice 3: Builder-Style Skills

Package workflows as reusable skills consumed by OpenCode/Claude/Pi/omp. Candidate skills: Skill rule: a skill may call Commandr commands or write DiffViewer-local artifacts. It must not invent bus files or parse runner-private state as authority.

Slice 4: Future SPEC Artifact References

Only after Slice 1 proves real UI value, consider a Commandr SPEC v0.4 artifact event. Candidate event shape:
This needs SPEC text, conformance checks, and a migration decision. Until then, artifact references stay local or as human-readable task_progress notes.

Non-Goals

  • Do not replace .agents/ with Agent-Native SQL state.
  • Do not add .agents/approvals/*.pending or denial files.
  • Do not emit non-SPEC events from Commandr.
  • Do not store runner transcripts or LSP caches on the bus.
  • Do not make DiffViewer authoritative for lifecycle.
  • Do not adopt Builder.io templates wholesale before the local action/artifact seam works.