Skip to content

Commit 3faec34

Browse files
committed
chore: update README.md with workflow diagrams
1 parent 6acb7d4 commit 3faec34

3 files changed

Lines changed: 13 additions & 6 deletions

File tree

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@ Domscribe bridges both directions: click a DOM element to tell your agent what t
3030
Your agent is editing `Button.tsx` line 12. It calls `domscribe.query.bySource` and instantly gets back the live DOM snapshot, current props, component state, and rendered attributes — without any human interaction. The agent can verify what an element looks like _before_ changing it and confirm the result _after_.
3131

3232

33-
```jsonc
34-
// Agent asks: "What's rendering at Button.tsx line 12?"
35-
// → domscribe.query.bySource({ file: "src/components/Button.tsx", line: 12 })
33+
<p align="center">
34+
<img src="./docs/code-to-ui.png" alt="Code → UI: Let the agent see the browser" />
35+
</p>
3636

37+
Here's an example response that the agent might get back:
38+
39+
```json
3740
{
3841
"sourceLocation": {
3942
"file": "src/components/Button.tsx",
@@ -59,9 +62,13 @@ Your agent is editing `Button.tsx` line 12. It calls `domscribe.query.bySource`
5962

6063
A developer clicks an element in the browser overlay, types "make this button use the primary color," and submits. Domscribe captures the element's source location, runtime context, and user intent as an annotation. The agent claims it, navigates to the exact file and line, and implements the change.
6164

62-
```jsonc
63-
// → domscribe.annotation.process (claims next queued annotation)
65+
<p align="center">
66+
<img src="./docs/ui-to-code.png" alt="UI → Code: Point and tell" />
67+
</p>
6468

69+
The annotation is stored as a JSON file in your repository in the `.domscribe/annotations` directory. Here's an example:
70+
71+
```json
6572
{
6673
"found": true,
6774
"annotationId": "ann_A1B2C3D4_1710500000",
@@ -87,7 +94,7 @@ A developer clicks an element in the browser overlay, types "make this button us
8794
}
8895
```
8996

90-
The agent edits the code, calls `domscribe.annotation.respond` with a description of what it did, and the overlay shows the result in real time via WebSocket.
97+
Once the agent is done with the edits, it calls `domscribe.annotation.respond` with a description of what it did. The overlay shows the result in real time via WebSocket.
9198

9299
---
93100

docs/code-to-ui.png

87.3 KB
Loading

docs/ui-to-code.png

86.4 KB
Loading

0 commit comments

Comments
 (0)