@uicontract/skill 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/SKILL.md CHANGED
@@ -46,7 +46,12 @@ Use the `agentId` from the find result to target the element in the browser.
46
46
  **agent-browser:**
47
47
 
48
48
  ```bash
49
- agent-browser find testid "settings.billing.pause-subscription.button" click
49
+ # Scoped snapshot to find the element ref:
50
+ agent-browser snapshot -s '[data-agent-id="settings.billing.pause-subscription.button"]'
51
+ # Returns: - button "Pause subscription" [ref=e1]
52
+
53
+ # Interact using the ref:
54
+ agent-browser click @e1
50
55
  ```
51
56
 
52
57
  **CSS selector (any tool):**
@@ -200,10 +205,12 @@ npx uicontract find "pause subscription" --json
200
205
  agent-browser open http://localhost:3000/settings/billing
201
206
  ```
202
207
 
203
- **Step 3 -- Interact:**
208
+ **Step 3 -- Target and interact:**
204
209
 
205
210
  ```bash
206
- agent-browser find testid "settings.billing.pause-subscription.button" click
211
+ agent-browser snapshot -s '[data-agent-id="settings.billing.pause-subscription.button"]'
212
+ # Returns: - button "Pause subscription" [ref=e1]
213
+ agent-browser click @e1
207
214
  ```
208
215
 
209
216
  ## Key Rules
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uicontract/skill",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Agent skill files for UI Contracts - makes web app UIs machine-readable for AI coding agents",
5
5
  "license": "MIT",
6
6
  "author": "UIC Contributors",
@@ -6,17 +6,18 @@ UI Contracts annotates source code with `data-agent-id` attributes. This referen
6
6
 
7
7
  ### agent-browser
8
8
 
9
- No configuration needed. Use the `find testid` locator to target elements by their agent ID directly.
9
+ Use a scoped snapshot to locate the element ref, then interact using that ref.
10
10
 
11
11
  ```bash
12
12
  # Click an element
13
- agent-browser find testid "settings.billing.pause-subscription.button" click
13
+ agent-browser snapshot -s '[data-agent-id="settings.billing.pause-subscription.button"]'
14
+ # Returns: - button "Pause subscription" [ref=e1]
15
+ agent-browser click @e1
14
16
 
15
17
  # Fill a form field
16
- agent-browser find testid "login.login-form.email.input" fill "user@example.com"
17
-
18
- # Check visibility
19
- agent-browser find testid "settings.billing.pause-subscription.button" visible
18
+ agent-browser snapshot -s '[data-agent-id="login.login-form.email.input"]'
19
+ # Returns: - textbox "Email" [ref=e1]
20
+ agent-browser fill @e1 "user@example.com"
20
21
  ```
21
22
 
22
23
  ### Playwright MCP