Guide

Writing code together

Let your agent work in the example you can see

You can ask an agent to change a calculator or repair a program while you watch the same source, results, and diagrams. WebMCP lets a browser page expose named tools to an agent. Here those tools use the page’s editor and compiler, so their results appear in your example.

The examples are written in Bosatsu. You do not need to know it before trying an example. The source, authoring guide, and package references give you and your agent a starting point.

1. Connect the tab

First time here? The QuickStart for Cursor, Codex, Claude Code, and OpenCode walks through connection, a calculator change, generated Why feedback, and saving a local runnable copy.

Open the example as a normal browser page. In a host that supports native WebMCP site tools, enable this page’s tools using that host’s controls. Keep the tab open. Ask the agent to call yichus_examples_list; it should name the examples on this page. Native host setup.

Connect an ordinary browser through the local relay

Build the relay from a checkout with Node 20+ and pnpm. The repository package is not published to npm:

git clone https://github.com/snoble/yichus
cd yichus
pnpm install
pnpm run yichus-mcp:build

Add the following stdio server to your MCP client, using your checkout’s absolute path. Your client starts the process.

{
  "mcpServers": {
    "yichus-browser": {
      "command": "node",
      "args": ["/absolute/path/to/yichus/packages/yichus-mcp/dist/cli.js"]
    }
  }
}

Open the example with ?webmcp=1 in its URL. Through the relay, use webmcp_list_sources, use webmcp_list_tools, and match each tool’s sources to this tab to discover its public name and schema. Invoke page tools with webmcp_call_tool and its arguments field. If the tab is missing, check that the relay is running and the flag is present. For a local website build, pass --base-url http://localhost:8092 to the relay, matching the origin you opened.

The page and relay run on the same computer. Opening a page on a phone does not connect it to a relay on your laptop.

2. Give the agent a concrete change

Start with yichus_development_guide on a development page. Its tool description introduces the engine boundary and the inspect → edit → compare → check workflow; the result supplies the full guidance and reference links. The example guide and the browser workbench’s api_guide also include this guidance.

Engines use existing libraries for execution and integrations; Bosatsu supplies typed calculations, handlers, policies, and effects. Before adding code, have the agent inspect similar implementations and shared definitions. After editing, compare the same structure and check the relevant properties. This can expose a refactor worth making or an interface that makes the feature easier. The argument for this division of work explains both its opportunity and its limits.

Open Work with your agent inside an example’s source drawer for a prompt containing its id. For the event-budget tutorial, you can use:

Call yichus_example_guide, then read exampleId "event_budget".
Add a $50 booking fee to the cost calculation.
Use the source revision you read when updating and running it.
Check the preview: the starting balance should be $150.
Open Why beside the balance and check that it includes the fee.
Tell me what you changed and tested.

Your agent must use the example tools on the tab containing the tutorial. They share its current source buffers. Edits stay in that page; copy or save the files before leaving.

3. Check the feedback together

ToolWhat you and the agent get
yichus_development_guideThe engine/application boundary, guidance on preserving and improving structure, evidence scopes, and links to the argument, Forum exercise, and check selector. Available across development pages.
yichus_example_guideThe editing workflow, language conventions, scope, and reference links.
yichus_examples_listThis page’s example ids and whether each can be edited or checked.
yichus_example_readThe open source drawer, all files, execution setup, revision, and status.
yichus_example_updateEdits in the visible source editor. A stale revision is rejected if the user has changed it.
yichus_example_runCompilation and execution, or the example’s diagram/access check. If running is true, poll yichus_example_feedback until it is false; check the revision and error before using the result. Errors also appear on the page.
yichus_example_feedbackCurrent result, selected diagram definition, compiler error, and rendered calculator text and controls when its preview is ready.
yichus_example_previewChanges to the actual preview controls, including opening Why. The returned feedback describes the resulting page.
yichus_example_exportChunks of compiled HTML and the current source files, pinned to a revision and compilation id. The local relay’s yichus_save_calculator assembles them into a new local directory and returns file paths. The HTML starts from configured defaults and loads supporting assets from the returned site URL; it is not an offline bundle.

Preview feedback contains rendered text, control values, page width, chart count, and runtime errors. It is not a screenshot and does not judge whether a diagram looks good. A compilation error hides the previous preview. After a source edit, the agent must compile again before presenting results.

For dependency diagrams, diagramView gives the current view, focused definition, and rendered text. It is absent when the source drawer is closed. Use yichus_page_feedback to find visible buttons and disclosures, then yichus_page_action to expand a package, reveal other checked types, follow a definition, or return to the full map. Shared-type groups show their names directly. Numerical details are under All measurements; the tool result retains the complete artifact. Read feedback again after navigating. These groups describe checked types and dependencies; they do not prove behavior or a permission policy.

Use lenses to inspect a change

Choose the question first: dependencies, recurring patterns, effects, or an access property. The lens overview links each question to its tool. Read the current source, run that tool, make the edit, and repeat the same analysis. Use the changed names and relationships to explain what moved; use relevant executions or verification checks to assess behavior.

For repository work, use the project’s declared source set when one is available, and keep that set and revision fixed when comparing results. A component check and a whole-program check have different scope; protocol checks may also need an observation package. Icetakes provides named live input sets and a helper that prepares MCP sources. Historical benchmark replay uses its archived inputs.

For an authored text view, call api_organize with lens: "stack" or lens: "conventions" and a view JSON string. Start from the generated page so names and required facts come from the program. Check viewRefused even when ok is true: a refused view leaves the generated text available. Captions are authored commentary, not proved facts. Download and validate the stock view example →

Ask the agent to test a normal case and a relevant boundary case, report the actual inputs and outputs, and explain remaining assumptions. A successful compile establishes that the source is accepted. A run shows what happened for those inputs. Neither establishes that a calculator’s model fits the real world.

On the API workbench, open a verified app with yichus_app_open, read yichus_app_views, then use yichus_app_act to select a view, fill its controls and submit visibly. Start with the view’s example arguments and replace the values. Read yichus_app_feedback for the selected view, displayed identity, current inputs, pending state and rendered result or error. Standalone generated apps expose the same tools with their app name as a prefix. A later edit or action supersedes pending display feedback; it does not undo an already dispatched server mutation.

yichus_app_call makes a headless request. It leaves the visible form, selected user and rendered result unchanged. Use it for independent API requests; use yichus_app_act when the user should see the interaction. Feedback excludes bearer tokens.

yichus_page_feedback reads the surrounding page’s visible text, source editors, status messages, and accessible embedded views. Embedded feedback includes rendered text and controls, with explicit limits on nesting, frame count, text and controls; inaccessible or truncated contents are labeled. On the standalone editor, Explorer, API workbench, and spec demo, use it to check the page after a tool call or an accepted suggestion. It also returns a short development orientation, the guide tool’s name, and a link to these instructions.

On those standalone pages, yichus_page_edit replaces an editable text area only if its full current text matches expectedSource. Use the editor id and source from feedback. yichus_page_action activates a visible button or disclosure by its listed id. The button may start asynchronous work: read feedback again for its status and diagnostics. Use the dedicated example tools for source drawers and their sandboxed previews.

Read static traces without mistaking them for a run

The local daemon now navigates the same canonical binding dependencies as the trace dossier across all loaded inputs. It does not execute the program. Its valueOrigin distinguishes static literals, unevaluated bindings, producer-declared recordings, and imported values of unspecified origin. A computed binding has no execution value to show. Snippets come from the saved compile snapshot; a missing snapshot is an explicit error. Trace workflow and limits →

Other editing surfaces

Source and results pass to the connected agent through your browser host or local relay. Compilation happens in your browser; Yichus does not send source to a hosted compiler.

Make a calculator → · Repair a program →

Where this fits

What this is about: How the pieces fit