mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-05 05:05:08 +02:00
feat: auto-setup on first use via AskUserQuestion
SKILL.md now instructs Claude to check if the binary exists before any browse command. If missing, asks user permission to run setup (bun install + build). One-time ~10s setup, then never again. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,7 @@ description: |
|
||||
allowed-tools:
|
||||
- Bash
|
||||
- Read
|
||||
- mcp__conductor__AskUserQuestion
|
||||
---
|
||||
|
||||
# Browse v2: Persistent Browser for Claude Code
|
||||
@@ -17,9 +18,27 @@ allowed-tools:
|
||||
Persistent headless Chromium daemon. First call auto-starts the server (~3s).
|
||||
Every subsequent call: ~100-200ms. Auto-shuts down after 30 min idle.
|
||||
|
||||
## SETUP (run this check BEFORE any browse command)
|
||||
|
||||
Before using any browse command, check if the binary exists:
|
||||
|
||||
```bash
|
||||
test -x ~/.claude/skills/gstack-browse/dist/browse && echo "READY" || echo "NEEDS_SETUP"
|
||||
```
|
||||
|
||||
If `NEEDS_SETUP`:
|
||||
1. Use `mcp__conductor__AskUserQuestion` to ask: "gstack-browse needs a one-time setup (bun install + compile CLI). This takes ~10 seconds. OK to proceed?"
|
||||
2. If approved, run:
|
||||
```bash
|
||||
cd ~/.claude/skills/gstack-browse && bun install && bun run build
|
||||
```
|
||||
3. If `bun` is not installed, tell the user to install it: `curl -fsSL https://bun.sh/install | bash`
|
||||
|
||||
Once setup is done, it never needs to run again (the compiled binary persists).
|
||||
|
||||
## IMPORTANT
|
||||
|
||||
- Use `~/.claude/skills/gstack-browse/dist/browse` (compiled binary) or `bun run ~/.claude/skills/gstack-browse/src/cli.ts` via Bash.
|
||||
- Use `~/.claude/skills/gstack-browse/dist/browse` (compiled binary) via Bash.
|
||||
- NEVER use `mcp__claude-in-chrome__*` tools. They are slow and unreliable.
|
||||
- The browser persists between calls — cookies, tabs, and state carry over.
|
||||
- The server auto-starts on first command. No setup needed.
|
||||
@@ -184,30 +203,6 @@ browse restart Kill + restart server
|
||||
| Mobile layout check | `responsive /tmp/prefix` |
|
||||
| Multi-step flow | `echo '[...]' \| browse chain` |
|
||||
|
||||
## Multi-step Workflow Example
|
||||
|
||||
```bash
|
||||
B=~/.claude/skills/gstack-browse/dist/browse
|
||||
|
||||
# Login flow
|
||||
$B goto https://example.com/login
|
||||
$B fill "#email" "user@test.com"
|
||||
$B fill "#password" "pass123"
|
||||
$B click "button[type=submit]"
|
||||
$B wait ".dashboard"
|
||||
$B screenshot /tmp/dashboard.png
|
||||
|
||||
# Or as a chain (single call):
|
||||
echo '[
|
||||
["goto", "https://example.com/login"],
|
||||
["fill", "#email", "user@test.com"],
|
||||
["fill", "#password", "pass123"],
|
||||
["click", "button[type=submit]"],
|
||||
["wait", ".dashboard"],
|
||||
["screenshot", "/tmp/dashboard.png"]
|
||||
]' | $B chain
|
||||
```
|
||||
|
||||
## Architecture
|
||||
|
||||
- Persistent Chromium daemon on localhost (port 9400-9410)
|
||||
|
||||
Reference in New Issue
Block a user