docs: tutorial foundation — architecture, browse engine, snapshots, commands#177
Open
johnxie wants to merge 1 commit intogarrytan:mainfrom
Open
docs: tutorial foundation — architecture, browse engine, snapshots, commands#177johnxie wants to merge 1 commit intogarrytan:mainfrom
johnxie wants to merge 1 commit intogarrytan:mainfrom
Conversation
…s, commands Add comprehensive onboarding documentation covering gstack's core infrastructure. Five files forming a self-contained tutorial that takes readers from "what is gstack?" to understanding every browse command. - index.md: Tutorial entry point with Mermaid architecture flowchart - 01_architecture.md: Three-layer design, virtual team, project structure - 02_browse_engine.md: Client-server model, lifecycle, security, buffers - 03_snapshot_and_refs.md: Accessibility tree, @ref system, staleness - 04_command_system.md: All 52 commands (read/write/meta), error handling All technical claims verified against source code (commands.ts, snapshot.ts, server.ts, browser-manager.ts, buffers.ts).
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the first half of a comprehensive tutorial for gstack — five interconnected chapters that take a newcomer from "what is this?" to understanding every browse command. Each chapter builds on the previous, uses real code examples from the codebase, and includes Mermaid diagrams for visual learners.
This PR covers the infrastructure layer — what gstack is, how the browser works, how snapshots see pages, and the full command vocabulary. A follow-up PR will cover the workflow layer (skills, templates, planning, shipping, QA, tests).
Motivation
What's included
docs/index.mddocs/01_architecture.mddocs/02_browse_engine.mddocs/03_snapshot_and_refs.mddocs/04_command_system.mdTotal: ~1,270 lines across 5 files, ~46KB
Architecture diagram (from index.md)
flowchart TD subgraph Planning["Planning Phase"] CEO["/plan-ceo-review\n(CEO/Founder)"] ENG["/plan-eng-review\n(Eng Manager)"] DESIGN_PLAN["/plan-design-review\n(Senior Designer)"] end subgraph Implementation["Implementation Phase"] BROWSE["/browse\n(Headless Browser)"] QA["/qa & /qa-only\n(QA Lead)"] DESIGN_FIX["/design-review\n(Designer Who Codes)"] end subgraph Shipping["Shipping Phase"] REVIEW["/review\n(Staff Engineer)"] SHIP["/ship\n(Release Engineer)"] DOCS["/document-release\n(Technical Writer)"] end CEO --> ENG --> DESIGN_PLAN DESIGN_PLAN --> BROWSE BROWSE --> QA QA --> DESIGN_FIX DESIGN_FIX --> REVIEW REVIEW --> SHIP SHIP --> DOCSBrowse engine deep dive (from chapter 2)
sequenceDiagram participant Skill as Skill ($B goto ...) participant CLI as CLI (cli.ts) participant State as .gstack/browse.json participant Server as HTTP Server (server.ts) participant Browser as Playwright + Chromium Skill->>CLI: $B goto https://example.com CLI->>State: Read pid, port, token CLI->>Server: POST /command {cmd: "goto", args: [...]} Server->>Browser: page.goto("https://example.com") Browser-->>Server: Page loaded Server-->>CLI: {output: "Navigated to https://example.com"} CLI-->>Skill: Navigated to https://example.comSnapshot pipeline (from chapter 3)
flowchart LR PAGE["Web Page\n(HTML + DOM)"] A11Y["Accessibility Tree\n(Playwright)"] PARSE["Parse & Assign\n@e1, @e2, ..."] OUTPUT["YAML-like\nSnapshot Text"] REFS["Ref Map\n@e1 → Locator\n@e2 → Locator"] PAGE --> A11Y --> PARSE PARSE --> OUTPUT PARSE --> REFSCommand system coverage (from chapter 4)
Verification methodology
Every technical claim was verified against source code:
browse/src/commands.tsbrowse/src/snapshot.tsSNAPSHOT_FLAGSbrowse/src/buffers.tsHIGH_WATER_MARKbrowse/src/server.tsbrowse/src/server.tsBROWSE_IDLE_TIMEOUTbrowse/src/browser-manager.tsbrowse/src/write-commands.ts*/SKILL.md.tmplDesign decisions
Relationship to existing docs
No existing files are modified. The new docs complement
skills.md(which documents skill usage) with deep technical content about how gstack works under the hood.Follow-up
A second PR (
docs/tutorial-workflows) will add chapters 5-10 covering:Test plan
$Bcommands referenced matchcommands.tsregistrySNAPSHOT_FLAGSarray