Skip to content

Commit 14356d3

Browse files
authored
Merge pull request #12 from fullstorydev/joel/inspect-updates
Update skills to use view-inspect for sightmap selector discovery
2 parents 78c5e68 + 3c4da62 commit 14356d3

3 files changed

Lines changed: 5 additions & 8 deletions

File tree

skills/live/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ API catalog for live browser tools (all prefixed `live-`) on the unified subtext
3333
| `live-view-select` | Switch to a different view |
3434
| `live-view-close` | Close a view |
3535
| `live-view-snapshot` | Component tree snapshot (no screenshot) |
36+
| `live-view-inspect` | Component tree with full CSS selectors — for sightmap authoring only, not general use |
3637
| `live-view-screenshot` | Visual screenshot of current view |
3738
| `live-view-resize` | Resize the viewport |
3839

@@ -95,6 +96,7 @@ After every `live-connect`, check `capture_status` and respond as follows:
9596

9697
- Always `live-view-snapshot` before interacting — you need element UIDs to click/fill.
9798
- `live-view-snapshot` is cheaper than `live-view-screenshot`. Prefer snapshots; use screenshots for visual evidence.
99+
- `live-view-inspect` is for **sightmap authoring only** — it returns verbose CSS selectors on every node. Do not use it as a general snapshot replacement. Use it once to discover selectors, write your `.sightmap/` YAML, then use `live-view-snapshot` for everything else.
98100
- Component names from sightmap appear in snapshots — use `[src: ...]` annotations to find source files.
99101
- Close connections when done to free server resources.
100102

skills/recipe-sightmap-setup/SKILL.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,8 @@ metadata:
1515
1. **Navigate to the page**: `live-view-navigate(url=...)` or `live-view-new(url=...)`
1616
2. **Take a baseline snapshot**: `live-view-snapshot()` to see the current a11y tree with generic roles
1717
3. **Identify key UI components** in the snapshot (navigation, forms, cards, modals, etc.)
18-
4. **Find good selectors** using `live-eval-script`:
19-
```js
20-
(el) => { return el.tagName + '.' + el.className + ' ' + el.id; }
21-
```
22-
Prefer `data-*` attributes when available — they're stable and semantically meaningful (e.g., `[data-component="ProductTile"]`, `[data-testid="checkout-button"]`). Check for them with:
23-
```js
24-
(el) => { return JSON.stringify(Object.fromEntries([...el.attributes].filter(a => a.name.startsWith('data-')).map(a => [a.name, a.value]))); }
25-
```
18+
4. **Find good selectors** using `live-view-inspect()` — this returns the full component tree with CSS selectors (tag, id, classes, `data-*` attributes, `aria-*`, `href`, etc.) on every node. Use it to identify stable targeting info, then switch back to `live-view-snapshot()` for normal interaction.
19+
Prefer `data-*` attributes when available — they're stable and semantically meaningful (e.g., `[data-component="ProductTile"]`, `[data-testid="checkout-button"]`).
2620
5. **Create `.sightmap/components.yaml`** with component definitions (see `subtext:sightmap` skill for schema)
2721
6. **Add memories** to key components — contextual notes that appear in a `[Guide]` section at the top of every snapshot. Focus on:
2822
- **Auth/access**: passwords, test accounts, login flows (e.g., `"Password is 'argus'"`)

skills/session/SKILL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ API catalog for the session replay tools (all prefixed `review-`). These tools l
1818
|------|-------------|
1919
| `review-open` | Open a session for analysis. Returns event summaries, metadata, timestamps. |
2020
| `review-view` | Capture UI state at a timestamp — component tree + screenshot |
21+
| `review-inspect` | Component tree with full CSS selectors — for sightmap authoring only, not general use |
2122
| `review-diff` | Compare UI state between two timestamps |
2223
| `review-close` | Close the session and free resources |
2324

0 commit comments

Comments
 (0)