Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 22 additions & 0 deletions .agents/skills/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Agent skill packs

This directory vendors several agent-skill packs so they are available to
Codex and Prime Agent (which discover skills under `.agents/skills/`). The same
packs are mirrored under [`.claude/skills/`](../../.claude/skills/) for Claude
Code and Cursor.

| Pack | Source | License |
| --- | --- | --- |
| `superpowers/` | [`obra/superpowers`](https://github.com/obra/superpowers) | MIT |
| `mattpocock/` | [`mattpocock/skills`](https://github.com/mattpocock/skills) | MIT |
| `gstack/` | [`garrytan/gstack`](https://github.com/garrytan/gstack) | MIT |
| `pstack/` | [`michael-denyer/pstack-claude`](https://github.com/michael-denyer/pstack-claude) (poteto's pstack port) | MIT |

- Full, browsable index with every skill and its trigger description:
[`docs/agent-skills.md`](../../docs/agent-skills.md).
- These are **slimmed** installs: only `SKILL.md` files and their Markdown
references are vendored; upstream build scripts, browser extensions, tests and
binaries are excluded to keep the repo lean.
- To refresh/update from upstream:
`./scripts/install-agent-skills.sh && node scripts/gen-skills-index.js`.
- Each pack directory retains its upstream `LICENSE` for attribution.
21 changes: 21 additions & 0 deletions .agents/skills/gstack/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Garry Tan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
626 changes: 626 additions & 0 deletions .agents/skills/gstack/_router/SKILL.md

Large diffs are not rendered by default.

1,905 changes: 1,905 additions & 0 deletions .agents/skills/gstack/autoplan/SKILL.md

Large diffs are not rendered by default.

684 changes: 684 additions & 0 deletions .agents/skills/gstack/benchmark-models/SKILL.md

Large diffs are not rendered by default.

809 changes: 809 additions & 0 deletions .agents/skills/gstack/benchmark/SKILL.md

Large diffs are not rendered by default.

102 changes: 102 additions & 0 deletions .agents/skills/gstack/browse/PLAN-snapshot-dropdown-interactive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Plan: Snapshot Dropdown/Autocomplete Interactive Element Detection

## Problem

`snapshot -i` misses dropdown/autocomplete items on modern web apps. These elements:
1. Are often `<div>`/`<li>` with click handlers but no semantic ARIA roles
2. Live inside dynamically-created portals/popovers (floating containers)
3. Don't appear in Playwright's accessibility tree (`ariaSnapshot()`)

The `-C` flag (cursor-interactive scan) was designed for this but:
- Requires separate flag β€” agents using `-i` don't get it automatically
- Skips elements that HAVE an ARIA role (even if the ARIA tree missed them)
- Doesn't prioritize popover/portal containers where dropdown items live

## Root Cause

Playwright's `ariaSnapshot()` builds from the browser's accessibility tree. Dynamically-rendered popovers (React portals, Radix Popover, etc.) may not be in the accessibility tree if:
- The component doesn't set ARIA roles
- The portal renders outside the scoped `body` locator's subtree timing
- The browser hasn't updated the accessibility tree yet after DOM mutation

## Changes

### 1. Auto-enable cursor-interactive scan with `-i` flag

**File:** `browse/src/snapshot.ts`

When `-i` (interactive) is passed, automatically include the cursor-interactive scan. This means agents always see clickable non-ARIA elements when they ask for interactive elements.

The `-C` flag remains as a standalone option for non-interactive snapshots.

```
if (opts.interactive) {
opts.cursorInteractive = true;
}
```

### 2. Add popover/portal priority scanning

**File:** `browse/src/snapshot.ts` (inside cursor-interactive evaluate block)

Before the general cursor:pointer scan, specifically scan for visible floating containers (popovers, dropdowns, menus) and include ALL their direct children as interactive:

Detection heuristics for floating containers:
- `position: fixed` or `position: absolute` with `z-index >= 10`
- Has `role="listbox"`, `role="menu"`, `role="dialog"`, `role="tooltip"`, `[data-radix-popper-content-wrapper]`, `[data-floating-ui-portal]`, etc.
- Appeared recently in the DOM (not in initial page load)
- Is visible (`offsetParent !== null` or `position: fixed`)

For each floating container, include child elements that:
- Have text content
- Are visible
- Have cursor:pointer OR onclick OR role="option" OR role="menuitem"
- Tag with reason `popover-child` for clarity

### 3. Remove the `hasRole` skip in cursor-interactive scan

**File:** `browse/src/snapshot.ts`

Currently: `if (hasRole) continue;` β€” skips any element with an ARIA role, assuming the ARIA tree already captured it.

Problem: if the ARIA tree MISSED the element (timing, portal, bad DOM structure), it falls through both systems.

Fix: Only skip if the element's role is in `INTERACTIVE_ROLES` AND it was actually captured in the main refMap. Otherwise include it.

Since we can't easily check the refMap from inside `page.evaluate()`, the simpler fix: remove the `hasRole` skip entirely for elements inside detected floating containers. For elements outside floating containers, keep the `hasRole` skip as-is (to avoid duplicates in normal page content).

### 4. Add dropdown test fixture and tests

**File:** `browse/test/fixtures/dropdown.html`

HTML page with:
- A combobox input that shows a dropdown on focus/type
- Dropdown items as `<div>` with click handlers (no ARIA roles)
- Dropdown items as `<li>` with `role="option"`
- A React-portal-style container (`position: fixed`, high z-index)

**File:** `browse/test/snapshot.test.ts`

New test cases:
- `snapshot -i` on dropdown page finds dropdown items via cursor scan
- `snapshot -i` on dropdown page includes popover-child elements
- `@c` refs from dropdown scan are clickable
- Elements inside floating containers with ARIA roles are captured even when ARIA tree misses them

## Rollout Risk

**Low.** The `-C` scan is additive β€” it only adds `@c` refs, never removes `@e` refs. The change to auto-enable it with `-i` increases output size but agents already handle mixed ref types.

**One concern:** The `-C` scan queries ALL elements (`document.querySelectorAll('*')`) which can be slow on heavy pages. For the popover-specific scan, we limit to elements inside detected floating containers, which is fast (small subtree).

## Testing

```bash
cd /data/gstack/browse && bun test snapshot
```

## Files Changed

1. `browse/src/snapshot.ts` β€” auto-enable -C with -i, popover scanning, remove hasRole skip in floating containers
2. `browse/test/fixtures/dropdown.html` β€” new test fixture
3. `browse/test/snapshot.test.ts` β€” new dropdown/popover test cases
Loading
Loading