From f7d68c253e27a57139feb7bfd6dd886807c045bb Mon Sep 17 00:00:00 2001 From: Sina Date: Sat, 5 Sep 2026 16:40:16 -0400 Subject: [PATCH] docs: Aside first, gstack browser fallback README, BROWSER.md, docs/, CONTRIBUTING, CLAUDE.md, ARCHITECTURE, AGENTS.md, TODOS and the root router describe the one product story: Aside is the browser gstack drives first; the bundled headless browser is the automatic fallback (Linux, Windows, app closed) where cookie import, GStack Browser, pair-agent and browser-skills still apply. Co-Authored-By: Claude Fable 5.1 --- AGENTS.md | 32 ++-- ARCHITECTURE.md | 64 +++++++- BROWSER.md | 238 ++++++++++++++++++++++++++++- CLAUDE.md | 61 ++++++-- CONTRIBUTING.md | 40 +++-- README.md | 35 +++-- SKILL.md.tmpl | 13 +- TODOS.md | 93 ++++++++++- docs/BROWSER_INTERNALS.md | 2 + docs/OPENCLAW.md | 2 +- docs/PROJECT_STRUCTURE.md | 20 ++- docs/REMOTE_BROWSER_ACCESS.md | 2 + docs/TESTING_INTERNALS.md | 26 ++++ docs/domain-skills.md | 2 + docs/howto-diagrams-and-formats.md | 13 +- docs/skills.md | 116 +++++++------- 16 files changed, 631 insertions(+), 128 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 7d802490e..a70b232ed 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -36,8 +36,8 @@ Invoke them by name (e.g., `/office-hours`). | `/devex-review` | Live developer experience audit (TTHW measured against the real flow). | | `/qa` | Open a real browser, find bugs, fix them, re-verify. | | `/qa-only` | Same methodology as /qa but report only — no code changes. | -| `/scrape` | Pull data from a web page. First call prototypes; codified call runs in ~200ms. | -| `/skillify` | Codify the most recent successful `/scrape` flow into a permanent browser-skill. | +| `/scrape` | Pull data from a web page in your Aside browser, with your real logged-in state. Read-only. On the fallback browser a codified browser-skill answers a repeat intent in ~200ms. | +| `/skillify` | Codify the most recent successful `/scrape` flow into a permanent browser-skill (fallback browser only). | ### Release + deploy @@ -45,7 +45,7 @@ Invoke them by name (e.g., `/office-hours`). |-------|-------------| | `/ship` | Run tests, review, push, open PR. Workspace-aware version queue. | | `/land-and-deploy` | Merge the PR, wait for CI and deploy, verify production health. | -| `/canary` | Post-deploy monitoring loop using the browse daemon. | +| `/canary` | Post-deploy monitoring loop in your Aside browser (or gstack's own when Aside is absent). | | `/landing-report` | Read-only dashboard for the workspace-aware ship queue. | | `/document-release` | Update all docs to match what you just shipped. | | `/document-generate` | Generate Diataxis docs (tutorial / how-to / reference / explanation) from code. | @@ -69,12 +69,18 @@ Invoke them by name (e.g., `/office-hours`). ### Browser + agent integration +Every browser skill drives the Aside AI browser first (macOS 15+, aside.com) — +the user's real browser with their real sessions, through `aside repl` scripts; +gstack never installs it. When Aside is not installed or not running (Linux, +Windows, a closed Aside app) the same skills fall back automatically to gstack's +own headless Chromium (`$B`), which is where the three skills under `/browse` apply. + | Skill | What it does | |-------|-------------| -| `/browse` | Headless browser — real Chromium, real clicks, ~100ms/command. | -| `/open-gstack-browser` | Launch the visible GStack Browser with sidebar + stealth. | -| `/setup-browser-cookies` | Import cookies from your real browser for authenticated testing. | -| `/pair-agent` | Pair a remote AI agent (OpenClaw, Codex, etc.) with your browser. | +| `/browse` | Drive a browser: open a page, read it, click through a flow, screenshots, console errors. Aside first; gstack's own Chromium (~100ms/command) as the fallback. Every other browser skill stands on it. | +| `/open-gstack-browser` | Launch the visible GStack Browser with sidebar + stealth — the headed face of the fallback engine. | +| `/setup-browser-cookies` | Import cookies from your real browser into the fallback engine for authenticated testing. Unnecessary on Aside. | +| `/pair-agent` | Pair a remote AI agent (OpenClaw, Codex, etc.) with gstack's own browser over a scoped tunnel. | ### iOS QA — drive real iPhones over USB or Tailscale (v1.43.0.0+) @@ -104,8 +110,8 @@ End-to-end walkthrough: [docs/howto-ios-testing-with-gstack.md](docs/howto-ios-t | `/freeze` | Lock edits to one directory. Hard block, not just a warning. | | `/guard` | Activate both careful + freeze at once. | | `/unfreeze` | Remove directory edit restrictions. | -| `/make-pdf` | Turn any markdown file into a publication-quality PDF. | -| `/diagram` | English in, diagram out: mermaid source + editable .excalidraw + SVG/PNG, offline. | +| `/make-pdf` | Turn any markdown file into a publication-quality PDF. Renders through Aside, or gstack's own browser when Aside is absent. | +| `/diagram` | English in, diagram out: mermaid source + editable .excalidraw + SVG/PNG, offline. Renders through Aside, or gstack's own browser when Aside is absent. | ## Build commands @@ -126,12 +132,16 @@ bun run skill:check # health dashboard for all skills MSYS today; native PowerShell support is a future expansion. The `bin/gstack-paths` helper resolves state roots through `CLAUDE_PLUGIN_DATA` / `GSTACK_HOME` so plugin installs work on every platform. +- **Browser and renderer**: the browser skills, `/make-pdf`, and `/diagram` drive + the Aside browser first, which is macOS 15+ only. On Linux and Windows (or a + Mac with Aside closed) the readiness check says so once and the same skills use + gstack's own bundled browser, built by `./setup`. ## Key conventions - SKILL.md files are **generated** from `.tmpl` templates. Edit the template, not the output. - Run `bun run gen:skill-docs --host codex` to regenerate Codex-specific output. -- The browse binary provides headless browser access. Use `$B ` in skills. +- Browser steps in skills are `aside repl` scripts per `scripts/resolvers/aside.ts` (Aside first), each with a `$B` equivalent for the fallback engine — `$B ` is the browse binary and is a legitimate tool when the Aside probe does not print `READY`. Local HTML renders through `bin/gstack-render.ts`, which picks the same way. - Safety skills (careful, freeze, guard) use inline advisory prose — always confirm before destructive operations. - State paths resolve via `bin/gstack-paths` (sourced via `eval "$(...)"`). Honors `GSTACK_HOME`, `CLAUDE_PLUGIN_DATA`, `CLAUDE_PLANS_DIR`. -- The `claude` CLI binary resolves via `browse/src/claude-bin.ts` (`Bun.which()` + `GSTACK_CLAUDE_BIN` override). Set `GSTACK_CLAUDE_BIN=wsl` plus `GSTACK_CLAUDE_BIN_ARGS='["claude"]'` to run Claude through WSL on Windows. +- The `claude` CLI binary resolves via `browse/src/claude-bin.ts` (shared copy: `lib/claude-bin.ts`; `Bun.which()` + `GSTACK_CLAUDE_BIN` override). Set `GSTACK_CLAUDE_BIN=wsl` plus `GSTACK_CLAUDE_BIN_ARGS='["claude"]'` to run Claude through WSL on Windows. diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 374dd8774..1688ba016 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -4,9 +4,29 @@ This document explains **why** gstack is built the way it is. For setup and comm ## The core idea -gstack gives Claude Code a persistent browser and a set of opinionated workflow skills. The browser is the hard part — everything else is Markdown. +gstack gives Claude Code a set of opinionated workflow skills and a browser to see with. The browser it reaches for first is the user's own [Aside](https://aside.com) AI browser (macOS 15+): real cookies, real logged-in accounts, the tabs they already have open. When Aside is not installed or not running — Linux, Windows, a closed Aside app — gstack falls back, automatically, to the browser it ships itself: a persistent headless Chromium daemon behind a compiled CLI (`$B`). Same skills, same evidence lines, two engines. -The key insight: an AI agent interacting with a browser needs **sub-second latency** and **persistent state**. If every command cold-starts a browser, you're waiting 3-5 seconds per tool call. If the browser dies between commands, you lose cookies, tabs, and login sessions. So gstack runs a long-lived Chromium daemon that the CLI talks to over localhost HTTP. +The key insight, learned the expensive way: an AI agent wants to be in *your* browser, not in a browser that imitates you. Every feature of the daemon — cookie import so it could be logged in as you, headed mode so you could watch, a CAPTCHA handoff, a tunnel so other agents could join, a sidebar so it could talk back — existed to close the gap to the browser you already had open. Aside is that browser with an agent-grade CLI, so on a Mac with Aside open the skills use it directly: + +``` +Claude Code Aside (the user's browser, macOS 15+) +───────── ───── + bash: aside repl '