@runchr/gstack-antigravity 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of @runchr/gstack-antigravity might be problematic. Click here for more details.

Files changed (297) hide show
  1. package/.agents/rules/ETHOS.md +129 -0
  2. package/.agents/rules/global-gstack.md +117 -0
  3. package/.agents/rules/persona-gstack-autoplan.md +14 -0
  4. package/.agents/rules/persona-gstack-benchmark.md +14 -0
  5. package/.agents/rules/persona-gstack-browse.md +14 -0
  6. package/.agents/rules/persona-gstack-canary.md +14 -0
  7. package/.agents/rules/persona-gstack-careful.md +14 -0
  8. package/.agents/rules/persona-gstack-codex.md +14 -0
  9. package/.agents/rules/persona-gstack-cso.md +14 -0
  10. package/.agents/rules/persona-gstack-design-consultation.md +14 -0
  11. package/.agents/rules/persona-gstack-design-review.md +14 -0
  12. package/.agents/rules/persona-gstack-document-release.md +14 -0
  13. package/.agents/rules/persona-gstack-freeze.md +14 -0
  14. package/.agents/rules/persona-gstack-gstack-upgrade.md +14 -0
  15. package/.agents/rules/persona-gstack-guard.md +14 -0
  16. package/.agents/rules/persona-gstack-investigate.md +14 -0
  17. package/.agents/rules/persona-gstack-land-and-deploy.md +14 -0
  18. package/.agents/rules/persona-gstack-office-hours.md +14 -0
  19. package/.agents/rules/persona-gstack-plan-ceo-review.md +14 -0
  20. package/.agents/rules/persona-gstack-plan-design-review.md +14 -0
  21. package/.agents/rules/persona-gstack-plan-eng-review.md +14 -0
  22. package/.agents/rules/persona-gstack-qa-only.md +14 -0
  23. package/.agents/rules/persona-gstack-qa.md +14 -0
  24. package/.agents/rules/persona-gstack-retro.md +14 -0
  25. package/.agents/rules/persona-gstack-review.md +14 -0
  26. package/.agents/rules/persona-gstack-setup-browser-cookies.md +14 -0
  27. package/.agents/rules/persona-gstack-setup-deploy.md +14 -0
  28. package/.agents/rules/persona-gstack-ship.md +14 -0
  29. package/.agents/rules/persona-gstack-unfreeze.md +14 -0
  30. package/.agents/rules/persona-gstack.md +40 -0
  31. package/.agents/rules/recursive-identities.md +22 -0
  32. package/.agents/workflows/autoplan.md +30 -0
  33. package/.agents/workflows/benchmark.md +31 -0
  34. package/.agents/workflows/browse.md +26 -0
  35. package/.agents/workflows/canary.md +33 -0
  36. package/.agents/workflows/careful.md +22 -0
  37. package/.agents/workflows/codex.md +36 -0
  38. package/.agents/workflows/cso.md +29 -0
  39. package/.agents/workflows/design-consultation.md +28 -0
  40. package/.agents/workflows/design-review.md +28 -0
  41. package/.agents/workflows/document-release.md +32 -0
  42. package/.agents/workflows/freeze.md +17 -0
  43. package/.agents/workflows/gstack-upgrade.md +54 -0
  44. package/.agents/workflows/gstack.md +56 -0
  45. package/.agents/workflows/guard.md +18 -0
  46. package/.agents/workflows/investigate.md +37 -0
  47. package/.agents/workflows/land-and-deploy.md +35 -0
  48. package/.agents/workflows/office-hours.md +27 -0
  49. package/.agents/workflows/plan-ceo-review.md +34 -0
  50. package/.agents/workflows/plan-design-review.md +31 -0
  51. package/.agents/workflows/plan-eng-review.md +28 -0
  52. package/.agents/workflows/qa-only.md +28 -0
  53. package/.agents/workflows/qa.md +73 -0
  54. package/.agents/workflows/retro.md +34 -0
  55. package/.agents/workflows/review.md +30 -0
  56. package/.agents/workflows/setup-browser-cookies.md +15 -0
  57. package/.agents/workflows/setup-cookies.md +8 -0
  58. package/.agents/workflows/setup-deploy.md +21 -0
  59. package/.agents/workflows/ship.md +93 -0
  60. package/.agents/workflows/unfreeze.md +12 -0
  61. package/LICENSE +22 -0
  62. package/README.md +189 -0
  63. package/README_KO.md +191 -0
  64. package/bin/install.js +105 -0
  65. package/gstack-origin/.agents/skills/gstack/SKILL.md +651 -0
  66. package/gstack-origin/.agents/skills/gstack-autoplan/SKILL.md +678 -0
  67. package/gstack-origin/.agents/skills/gstack-benchmark/SKILL.md +482 -0
  68. package/gstack-origin/.agents/skills/gstack-browse/SKILL.md +511 -0
  69. package/gstack-origin/.agents/skills/gstack-canary/SKILL.md +486 -0
  70. package/gstack-origin/.agents/skills/gstack-careful/SKILL.md +50 -0
  71. package/gstack-origin/.agents/skills/gstack-cso/SKILL.md +607 -0
  72. package/gstack-origin/.agents/skills/gstack-design-consultation/SKILL.md +615 -0
  73. package/gstack-origin/.agents/skills/gstack-design-review/SKILL.md +988 -0
  74. package/gstack-origin/.agents/skills/gstack-document-release/SKILL.md +604 -0
  75. package/gstack-origin/.agents/skills/gstack-freeze/SKILL.md +67 -0
  76. package/gstack-origin/.agents/skills/gstack-guard/SKILL.md +62 -0
  77. package/gstack-origin/.agents/skills/gstack-investigate/SKILL.md +415 -0
  78. package/gstack-origin/.agents/skills/gstack-land-and-deploy/SKILL.md +873 -0
  79. package/gstack-origin/.agents/skills/gstack-office-hours/SKILL.md +986 -0
  80. package/gstack-origin/.agents/skills/gstack-plan-ceo-review/SKILL.md +1268 -0
  81. package/gstack-origin/.agents/skills/gstack-plan-design-review/SKILL.md +668 -0
  82. package/gstack-origin/.agents/skills/gstack-plan-eng-review/SKILL.md +826 -0
  83. package/gstack-origin/.agents/skills/gstack-qa/SKILL.md +1006 -0
  84. package/gstack-origin/.agents/skills/gstack-qa-only/SKILL.md +626 -0
  85. package/gstack-origin/.agents/skills/gstack-retro/SKILL.md +1065 -0
  86. package/gstack-origin/.agents/skills/gstack-review/SKILL.md +704 -0
  87. package/gstack-origin/.agents/skills/gstack-setup-browser-cookies/SKILL.md +325 -0
  88. package/gstack-origin/.agents/skills/gstack-setup-deploy/SKILL.md +450 -0
  89. package/gstack-origin/.agents/skills/gstack-ship/SKILL.md +1312 -0
  90. package/gstack-origin/.agents/skills/gstack-unfreeze/SKILL.md +36 -0
  91. package/gstack-origin/.agents/skills/gstack-upgrade/SKILL.md +220 -0
  92. package/gstack-origin/.env.example +5 -0
  93. package/gstack-origin/.github/workflows/skill-docs.yml +17 -0
  94. package/gstack-origin/AGENTS.md +49 -0
  95. package/gstack-origin/ARCHITECTURE.md +359 -0
  96. package/gstack-origin/BROWSER.md +271 -0
  97. package/gstack-origin/CHANGELOG.md +800 -0
  98. package/gstack-origin/CLAUDE.md +284 -0
  99. package/gstack-origin/CONTRIBUTING.md +370 -0
  100. package/gstack-origin/ETHOS.md +129 -0
  101. package/gstack-origin/LICENSE +21 -0
  102. package/gstack-origin/README.md +228 -0
  103. package/gstack-origin/SKILL.md +657 -0
  104. package/gstack-origin/SKILL.md.tmpl +281 -0
  105. package/gstack-origin/TODOS.md +564 -0
  106. package/gstack-origin/VERSION +1 -0
  107. package/gstack-origin/autoplan/SKILL.md +689 -0
  108. package/gstack-origin/autoplan/SKILL.md.tmpl +416 -0
  109. package/gstack-origin/benchmark/SKILL.md +489 -0
  110. package/gstack-origin/benchmark/SKILL.md.tmpl +233 -0
  111. package/gstack-origin/bin/dev-setup +68 -0
  112. package/gstack-origin/bin/dev-teardown +56 -0
  113. package/gstack-origin/bin/gstack-analytics +191 -0
  114. package/gstack-origin/bin/gstack-community-dashboard +113 -0
  115. package/gstack-origin/bin/gstack-config +38 -0
  116. package/gstack-origin/bin/gstack-diff-scope +71 -0
  117. package/gstack-origin/bin/gstack-global-discover.ts +591 -0
  118. package/gstack-origin/bin/gstack-repo-mode +93 -0
  119. package/gstack-origin/bin/gstack-review-log +9 -0
  120. package/gstack-origin/bin/gstack-review-read +12 -0
  121. package/gstack-origin/bin/gstack-slug +15 -0
  122. package/gstack-origin/bin/gstack-telemetry-log +158 -0
  123. package/gstack-origin/bin/gstack-telemetry-sync +127 -0
  124. package/gstack-origin/bin/gstack-update-check +196 -0
  125. package/gstack-origin/browse/SKILL.md +517 -0
  126. package/gstack-origin/browse/SKILL.md.tmpl +141 -0
  127. package/gstack-origin/browse/bin/find-browse +21 -0
  128. package/gstack-origin/browse/bin/remote-slug +14 -0
  129. package/gstack-origin/browse/scripts/build-node-server.sh +48 -0
  130. package/gstack-origin/browse/src/browser-manager.ts +634 -0
  131. package/gstack-origin/browse/src/buffers.ts +137 -0
  132. package/gstack-origin/browse/src/bun-polyfill.cjs +109 -0
  133. package/gstack-origin/browse/src/cli.ts +420 -0
  134. package/gstack-origin/browse/src/commands.ts +111 -0
  135. package/gstack-origin/browse/src/config.ts +150 -0
  136. package/gstack-origin/browse/src/cookie-import-browser.ts +417 -0
  137. package/gstack-origin/browse/src/cookie-picker-routes.ts +207 -0
  138. package/gstack-origin/browse/src/cookie-picker-ui.ts +541 -0
  139. package/gstack-origin/browse/src/find-browse.ts +61 -0
  140. package/gstack-origin/browse/src/meta-commands.ts +269 -0
  141. package/gstack-origin/browse/src/platform.ts +17 -0
  142. package/gstack-origin/browse/src/read-commands.ts +335 -0
  143. package/gstack-origin/browse/src/server.ts +369 -0
  144. package/gstack-origin/browse/src/snapshot.ts +398 -0
  145. package/gstack-origin/browse/src/url-validation.ts +91 -0
  146. package/gstack-origin/browse/src/write-commands.ts +352 -0
  147. package/gstack-origin/browse/test/bun-polyfill.test.ts +72 -0
  148. package/gstack-origin/browse/test/commands.test.ts +1836 -0
  149. package/gstack-origin/browse/test/config.test.ts +250 -0
  150. package/gstack-origin/browse/test/cookie-import-browser.test.ts +397 -0
  151. package/gstack-origin/browse/test/cookie-picker-routes.test.ts +205 -0
  152. package/gstack-origin/browse/test/find-browse.test.ts +50 -0
  153. package/gstack-origin/browse/test/fixtures/basic.html +33 -0
  154. package/gstack-origin/browse/test/fixtures/cursor-interactive.html +22 -0
  155. package/gstack-origin/browse/test/fixtures/dialog.html +15 -0
  156. package/gstack-origin/browse/test/fixtures/empty.html +2 -0
  157. package/gstack-origin/browse/test/fixtures/forms.html +55 -0
  158. package/gstack-origin/browse/test/fixtures/qa-eval-checkout.html +108 -0
  159. package/gstack-origin/browse/test/fixtures/qa-eval-spa.html +98 -0
  160. package/gstack-origin/browse/test/fixtures/qa-eval.html +51 -0
  161. package/gstack-origin/browse/test/fixtures/responsive.html +49 -0
  162. package/gstack-origin/browse/test/fixtures/snapshot.html +55 -0
  163. package/gstack-origin/browse/test/fixtures/spa.html +24 -0
  164. package/gstack-origin/browse/test/fixtures/states.html +17 -0
  165. package/gstack-origin/browse/test/fixtures/upload.html +25 -0
  166. package/gstack-origin/browse/test/gstack-config.test.ts +125 -0
  167. package/gstack-origin/browse/test/gstack-update-check.test.ts +467 -0
  168. package/gstack-origin/browse/test/handoff.test.ts +235 -0
  169. package/gstack-origin/browse/test/path-validation.test.ts +63 -0
  170. package/gstack-origin/browse/test/platform.test.ts +37 -0
  171. package/gstack-origin/browse/test/snapshot.test.ts +467 -0
  172. package/gstack-origin/browse/test/test-server.ts +57 -0
  173. package/gstack-origin/browse/test/url-validation.test.ts +72 -0
  174. package/gstack-origin/canary/SKILL.md +493 -0
  175. package/gstack-origin/canary/SKILL.md.tmpl +220 -0
  176. package/gstack-origin/careful/SKILL.md +59 -0
  177. package/gstack-origin/careful/SKILL.md.tmpl +57 -0
  178. package/gstack-origin/careful/bin/check-careful.sh +112 -0
  179. package/gstack-origin/codex/SKILL.md +677 -0
  180. package/gstack-origin/codex/SKILL.md.tmpl +356 -0
  181. package/gstack-origin/conductor.json +6 -0
  182. package/gstack-origin/cso/SKILL.md +615 -0
  183. package/gstack-origin/cso/SKILL.md.tmpl +376 -0
  184. package/gstack-origin/design-consultation/SKILL.md +625 -0
  185. package/gstack-origin/design-consultation/SKILL.md.tmpl +369 -0
  186. package/gstack-origin/design-review/SKILL.md +998 -0
  187. package/gstack-origin/design-review/SKILL.md.tmpl +262 -0
  188. package/gstack-origin/docs/images/github-2013.png +0 -0
  189. package/gstack-origin/docs/images/github-2026.png +0 -0
  190. package/gstack-origin/docs/skills.md +877 -0
  191. package/gstack-origin/document-release/SKILL.md +613 -0
  192. package/gstack-origin/document-release/SKILL.md.tmpl +357 -0
  193. package/gstack-origin/freeze/SKILL.md +82 -0
  194. package/gstack-origin/freeze/SKILL.md.tmpl +80 -0
  195. package/gstack-origin/freeze/bin/check-freeze.sh +68 -0
  196. package/gstack-origin/gstack-upgrade/SKILL.md +226 -0
  197. package/gstack-origin/gstack-upgrade/SKILL.md.tmpl +224 -0
  198. package/gstack-origin/guard/SKILL.md +82 -0
  199. package/gstack-origin/guard/SKILL.md.tmpl +80 -0
  200. package/gstack-origin/investigate/SKILL.md +435 -0
  201. package/gstack-origin/investigate/SKILL.md.tmpl +196 -0
  202. package/gstack-origin/land-and-deploy/SKILL.md +880 -0
  203. package/gstack-origin/land-and-deploy/SKILL.md.tmpl +575 -0
  204. package/gstack-origin/office-hours/SKILL.md +996 -0
  205. package/gstack-origin/office-hours/SKILL.md.tmpl +624 -0
  206. package/gstack-origin/package.json +55 -0
  207. package/gstack-origin/plan-ceo-review/SKILL.md +1277 -0
  208. package/gstack-origin/plan-ceo-review/SKILL.md.tmpl +838 -0
  209. package/gstack-origin/plan-design-review/SKILL.md +676 -0
  210. package/gstack-origin/plan-design-review/SKILL.md.tmpl +314 -0
  211. package/gstack-origin/plan-eng-review/SKILL.md +836 -0
  212. package/gstack-origin/plan-eng-review/SKILL.md.tmpl +279 -0
  213. package/gstack-origin/qa/SKILL.md +1016 -0
  214. package/gstack-origin/qa/SKILL.md.tmpl +316 -0
  215. package/gstack-origin/qa/references/issue-taxonomy.md +85 -0
  216. package/gstack-origin/qa/templates/qa-report-template.md +126 -0
  217. package/gstack-origin/qa-only/SKILL.md +633 -0
  218. package/gstack-origin/qa-only/SKILL.md.tmpl +101 -0
  219. package/gstack-origin/retro/SKILL.md +1072 -0
  220. package/gstack-origin/retro/SKILL.md.tmpl +833 -0
  221. package/gstack-origin/review/SKILL.md +849 -0
  222. package/gstack-origin/review/SKILL.md.tmpl +259 -0
  223. package/gstack-origin/review/TODOS-format.md +62 -0
  224. package/gstack-origin/review/checklist.md +190 -0
  225. package/gstack-origin/review/design-checklist.md +132 -0
  226. package/gstack-origin/review/greptile-triage.md +220 -0
  227. package/gstack-origin/scripts/analytics.ts +190 -0
  228. package/gstack-origin/scripts/dev-skill.ts +82 -0
  229. package/gstack-origin/scripts/eval-compare.ts +96 -0
  230. package/gstack-origin/scripts/eval-list.ts +116 -0
  231. package/gstack-origin/scripts/eval-select.ts +86 -0
  232. package/gstack-origin/scripts/eval-summary.ts +187 -0
  233. package/gstack-origin/scripts/eval-watch.ts +172 -0
  234. package/gstack-origin/scripts/gen-skill-docs.ts +2414 -0
  235. package/gstack-origin/scripts/skill-check.ts +167 -0
  236. package/gstack-origin/setup +269 -0
  237. package/gstack-origin/setup-browser-cookies/SKILL.md +330 -0
  238. package/gstack-origin/setup-browser-cookies/SKILL.md.tmpl +74 -0
  239. package/gstack-origin/setup-deploy/SKILL.md +459 -0
  240. package/gstack-origin/setup-deploy/SKILL.md.tmpl +220 -0
  241. package/gstack-origin/ship/SKILL.md +1457 -0
  242. package/gstack-origin/ship/SKILL.md.tmpl +528 -0
  243. package/gstack-origin/supabase/config.sh +10 -0
  244. package/gstack-origin/supabase/functions/community-pulse/index.ts +59 -0
  245. package/gstack-origin/supabase/functions/telemetry-ingest/index.ts +135 -0
  246. package/gstack-origin/supabase/functions/update-check/index.ts +37 -0
  247. package/gstack-origin/supabase/migrations/001_telemetry.sql +89 -0
  248. package/gstack-origin/test/analytics.test.ts +277 -0
  249. package/gstack-origin/test/codex-e2e.test.ts +197 -0
  250. package/gstack-origin/test/fixtures/coverage-audit-fixture.ts +76 -0
  251. package/gstack-origin/test/fixtures/eval-baselines.json +7 -0
  252. package/gstack-origin/test/fixtures/qa-eval-checkout-ground-truth.json +43 -0
  253. package/gstack-origin/test/fixtures/qa-eval-ground-truth.json +43 -0
  254. package/gstack-origin/test/fixtures/qa-eval-spa-ground-truth.json +43 -0
  255. package/gstack-origin/test/fixtures/review-eval-design-slop.css +86 -0
  256. package/gstack-origin/test/fixtures/review-eval-design-slop.html +41 -0
  257. package/gstack-origin/test/fixtures/review-eval-enum-diff.rb +30 -0
  258. package/gstack-origin/test/fixtures/review-eval-enum.rb +27 -0
  259. package/gstack-origin/test/fixtures/review-eval-vuln.rb +14 -0
  260. package/gstack-origin/test/gemini-e2e.test.ts +173 -0
  261. package/gstack-origin/test/gen-skill-docs.test.ts +1049 -0
  262. package/gstack-origin/test/global-discover.test.ts +187 -0
  263. package/gstack-origin/test/helpers/codex-session-runner.ts +282 -0
  264. package/gstack-origin/test/helpers/e2e-helpers.ts +239 -0
  265. package/gstack-origin/test/helpers/eval-store.test.ts +548 -0
  266. package/gstack-origin/test/helpers/eval-store.ts +689 -0
  267. package/gstack-origin/test/helpers/gemini-session-runner.test.ts +104 -0
  268. package/gstack-origin/test/helpers/gemini-session-runner.ts +201 -0
  269. package/gstack-origin/test/helpers/llm-judge.ts +130 -0
  270. package/gstack-origin/test/helpers/observability.test.ts +283 -0
  271. package/gstack-origin/test/helpers/session-runner.test.ts +96 -0
  272. package/gstack-origin/test/helpers/session-runner.ts +357 -0
  273. package/gstack-origin/test/helpers/skill-parser.ts +206 -0
  274. package/gstack-origin/test/helpers/touchfiles.ts +260 -0
  275. package/gstack-origin/test/hook-scripts.test.ts +373 -0
  276. package/gstack-origin/test/skill-e2e-browse.test.ts +293 -0
  277. package/gstack-origin/test/skill-e2e-deploy.test.ts +279 -0
  278. package/gstack-origin/test/skill-e2e-design.test.ts +614 -0
  279. package/gstack-origin/test/skill-e2e-plan.test.ts +538 -0
  280. package/gstack-origin/test/skill-e2e-qa-bugs.test.ts +194 -0
  281. package/gstack-origin/test/skill-e2e-qa-workflow.test.ts +412 -0
  282. package/gstack-origin/test/skill-e2e-review.test.ts +535 -0
  283. package/gstack-origin/test/skill-e2e-workflow.test.ts +586 -0
  284. package/gstack-origin/test/skill-e2e.test.ts +3325 -0
  285. package/gstack-origin/test/skill-llm-eval.test.ts +787 -0
  286. package/gstack-origin/test/skill-parser.test.ts +179 -0
  287. package/gstack-origin/test/skill-routing-e2e.test.ts +605 -0
  288. package/gstack-origin/test/skill-validation.test.ts +1520 -0
  289. package/gstack-origin/test/telemetry.test.ts +278 -0
  290. package/gstack-origin/test/touchfiles.test.ts +262 -0
  291. package/gstack-origin/unfreeze/SKILL.md +40 -0
  292. package/gstack-origin/unfreeze/SKILL.md.tmpl +38 -0
  293. package/package.json +38 -0
  294. package/scripts/install-antigravity-skill.ps1 +33 -0
  295. package/scripts/install-antigravity-skill.sh +41 -0
  296. package/scripts/sync-gstack-origin.ps1 +37 -0
  297. package/scripts/sync-gstack-origin.sh +35 -0
@@ -0,0 +1,517 @@
1
+ ---
2
+ name: browse
3
+ version: 1.1.0
4
+ description: |
5
+ Fast headless browser for QA testing and site dogfooding. Navigate any URL, interact with
6
+ elements, verify page state, diff before/after actions, take annotated screenshots, check
7
+ responsive layouts, test forms and uploads, handle dialogs, and assert element states.
8
+ ~100ms per command. Use when you need to test a feature, verify a deployment, dogfood a
9
+ user flow, or file a bug with evidence. Use when asked to "open in browser", "test the
10
+ site", "take a screenshot", or "dogfood this".
11
+ allowed-tools:
12
+ - Bash
13
+ - Read
14
+ - AskUserQuestion
15
+
16
+ ---
17
+ <!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->
18
+ <!-- Regenerate: bun run gen:skill-docs -->
19
+
20
+ ## Preamble (run first)
21
+
22
+ ```bash
23
+ _UPD=$(~/.claude/skills/gstack/bin/gstack-update-check 2>/dev/null || .claude/skills/gstack/bin/gstack-update-check 2>/dev/null || true)
24
+ [ -n "$_UPD" ] && echo "$_UPD" || true
25
+ mkdir -p ~/.gstack/sessions
26
+ touch ~/.gstack/sessions/"$PPID"
27
+ _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ')
28
+ find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true
29
+ _CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true)
30
+ _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true")
31
+ _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
32
+ echo "BRANCH: $_BRANCH"
33
+ echo "PROACTIVE: $_PROACTIVE"
34
+ source <(~/.claude/skills/gstack/bin/gstack-repo-mode 2>/dev/null) || true
35
+ REPO_MODE=${REPO_MODE:-unknown}
36
+ echo "REPO_MODE: $REPO_MODE"
37
+ _LAKE_SEEN=$([ -f ~/.gstack/.completeness-intro-seen ] && echo "yes" || echo "no")
38
+ echo "LAKE_INTRO: $_LAKE_SEEN"
39
+ _TEL=$(~/.claude/skills/gstack/bin/gstack-config get telemetry 2>/dev/null || true)
40
+ _TEL_PROMPTED=$([ -f ~/.gstack/.telemetry-prompted ] && echo "yes" || echo "no")
41
+ _TEL_START=$(date +%s)
42
+ _SESSION_ID="$$-$(date +%s)"
43
+ echo "TELEMETRY: ${_TEL:-off}"
44
+ echo "TEL_PROMPTED: $_TEL_PROMPTED"
45
+ mkdir -p ~/.gstack/analytics
46
+ echo '{"skill":"browse","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true
47
+ for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done
48
+ ```
49
+
50
+ If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills — only invoke
51
+ them when the user explicitly asks. The user opted out of proactive suggestions.
52
+
53
+ If output shows `UPGRADE_AVAILABLE <old> <new>`: read `~/.claude/skills/gstack/gstack-upgrade/SKILL.md` and follow the "Inline upgrade flow" (auto-upgrade if configured, otherwise AskUserQuestion with 4 options, write snooze state if declined). If `JUST_UPGRADED <from> <to>`: tell user "Running gstack v{to} (just updated!)" and continue.
54
+
55
+ If `LAKE_INTRO` is `no`: Before continuing, introduce the Completeness Principle.
56
+ Tell the user: "gstack follows the **Boil the Lake** principle — always do the complete
57
+ thing when AI makes the marginal cost near-zero. Read more: https://garryslist.org/posts/boil-the-ocean"
58
+ Then offer to open the essay in their default browser:
59
+
60
+ ```bash
61
+ open https://garryslist.org/posts/boil-the-ocean
62
+ touch ~/.gstack/.completeness-intro-seen
63
+ ```
64
+
65
+ Only run `open` if the user says yes. Always run `touch` to mark as seen. This only happens once.
66
+
67
+ If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled,
68
+ ask the user about telemetry. Use AskUserQuestion:
69
+
70
+ > Help gstack get better! Community mode shares usage data (which skills you use, how long
71
+ > they take, crash info) with a stable device ID so we can track trends and fix bugs faster.
72
+ > No code, file paths, or repo names are ever sent.
73
+ > Change anytime with `gstack-config set telemetry off`.
74
+
75
+ Options:
76
+ - A) Help gstack get better! (recommended)
77
+ - B) No thanks
78
+
79
+ If A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry community`
80
+
81
+ If B: ask a follow-up AskUserQuestion:
82
+
83
+ > How about anonymous mode? We just learn that *someone* used gstack — no unique ID,
84
+ > no way to connect sessions. Just a counter that helps us know if anyone's out there.
85
+
86
+ Options:
87
+ - A) Sure, anonymous is fine
88
+ - B) No thanks, fully off
89
+
90
+ If B→A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous`
91
+ If B→B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off`
92
+
93
+ Always run:
94
+ ```bash
95
+ touch ~/.gstack/.telemetry-prompted
96
+ ```
97
+
98
+ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely.
99
+
100
+ ## AskUserQuestion Format
101
+
102
+ **ALWAYS follow this structure for every AskUserQuestion call:**
103
+ 1. **Re-ground:** State the project, the current branch (use the `_BRANCH` value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences)
104
+ 2. **Simplify:** Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called.
105
+ 3. **Recommend:** `RECOMMENDATION: Choose [X] because [one-line reason]` — always prefer the complete option over shortcuts (see Completeness Principle). Include `Completeness: X/10` for each option. Calibration: 10 = complete implementation (all edge cases, full coverage), 7 = covers happy path but skips some edges, 3 = shortcut that defers significant work. If both options are 8+, pick the higher; if one is ≤5, flag it.
106
+ 4. **Options:** Lettered options: `A) ... B) ... C) ...` — when an option involves effort, show both scales: `(human: ~X / CC: ~Y)`
107
+
108
+ Assume the user hasn't looked at this window in 20 minutes and doesn't have the code open. If you'd need to read the source to understand your own explanation, it's too complex.
109
+
110
+ Per-skill instructions may add additional formatting rules on top of this baseline.
111
+
112
+ ## Completeness Principle — Boil the Lake
113
+
114
+ AI-assisted coding makes the marginal cost of completeness near-zero. When you present options:
115
+
116
+ - If Option A is the complete implementation (full parity, all edge cases, 100% coverage) and Option B is a shortcut that saves modest effort — **always recommend A**. The delta between 80 lines and 150 lines is meaningless with CC+gstack. "Good enough" is the wrong instinct when "complete" costs minutes more.
117
+ - **Lake vs. ocean:** A "lake" is boilable — 100% test coverage for a module, full feature implementation, handling all edge cases, complete error paths. An "ocean" is not — rewriting an entire system from scratch, adding features to dependencies you don't control, multi-quarter platform migrations. Recommend boiling lakes. Flag oceans as out of scope.
118
+ - **When estimating effort**, always show both scales: human team time and CC+gstack time. The compression ratio varies by task type — use this reference:
119
+
120
+ | Task type | Human team | CC+gstack | Compression |
121
+ |-----------|-----------|-----------|-------------|
122
+ | Boilerplate / scaffolding | 2 days | 15 min | ~100x |
123
+ | Test writing | 1 day | 15 min | ~50x |
124
+ | Feature implementation | 1 week | 30 min | ~30x |
125
+ | Bug fix + regression test | 4 hours | 15 min | ~20x |
126
+ | Architecture / design | 2 days | 4 hours | ~5x |
127
+ | Research / exploration | 1 day | 3 hours | ~3x |
128
+
129
+ - This principle applies to test coverage, error handling, documentation, edge cases, and feature completeness. Don't skip the last 10% to "save time" — with AI, that 10% costs seconds.
130
+
131
+ **Anti-patterns — DON'T do this:**
132
+ - BAD: "Choose B — it covers 90% of the value with less code." (If A is only 70 lines more, choose A.)
133
+ - BAD: "We can skip edge case handling to save time." (Edge case handling costs minutes with CC.)
134
+ - BAD: "Let's defer test coverage to a follow-up PR." (Tests are the cheapest lake to boil.)
135
+ - BAD: Quoting only human-team effort: "This would take 2 weeks." (Say: "2 weeks human / ~1 hour CC.")
136
+
137
+ ## Repo Ownership Mode — See Something, Say Something
138
+
139
+ `REPO_MODE` from the preamble tells you who owns issues in this repo:
140
+
141
+ - **`solo`** — One person does 80%+ of the work. They own everything. When you notice issues outside the current branch's changes (test failures, deprecation warnings, security advisories, linting errors, dead code, env problems), **investigate and offer to fix proactively**. The solo dev is the only person who will fix it. Default to action.
142
+ - **`collaborative`** — Multiple active contributors. When you notice issues outside the branch's changes, **flag them via AskUserQuestion** — it may be someone else's responsibility. Default to asking, not fixing.
143
+ - **`unknown`** — Treat as collaborative (safer default — ask before fixing).
144
+
145
+ **See Something, Say Something:** Whenever you notice something that looks wrong during ANY workflow step — not just test failures — flag it briefly. One sentence: what you noticed and its impact. In solo mode, follow up with "Want me to fix it?" In collaborative mode, just flag it and move on.
146
+
147
+ Never let a noticed issue silently pass. The whole point is proactive communication.
148
+
149
+ ## Search Before Building
150
+
151
+ Before building infrastructure, unfamiliar patterns, or anything the runtime might have a built-in — **search first.** Read `~/.claude/skills/gstack/ETHOS.md` for the full philosophy.
152
+
153
+ **Three layers of knowledge:**
154
+ - **Layer 1** (tried and true — in distribution). Don't reinvent the wheel. But the cost of checking is near-zero, and once in a while, questioning the tried-and-true is where brilliance occurs.
155
+ - **Layer 2** (new and popular — search for these). But scrutinize: humans are subject to mania. Search results are inputs to your thinking, not answers.
156
+ - **Layer 3** (first principles — prize these above all). Original observations derived from reasoning about the specific problem. The most valuable of all.
157
+
158
+ **Eureka moment:** When first-principles reasoning reveals conventional wisdom is wrong, name it:
159
+ "EUREKA: Everyone does X because [assumption]. But [evidence] shows this is wrong. Y is better because [reasoning]."
160
+
161
+ Log eureka moments:
162
+ ```bash
163
+ jq -n --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$(git branch --show-current 2>/dev/null)" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> ~/.gstack/analytics/eureka.jsonl 2>/dev/null || true
164
+ ```
165
+ Replace SKILL_NAME and ONE_LINE_SUMMARY. Runs inline — don't stop the workflow.
166
+
167
+ **WebSearch fallback:** If WebSearch is unavailable, skip the search step and note: "Search unavailable — proceeding with in-distribution knowledge only."
168
+
169
+ ## Contributor Mode
170
+
171
+ If `_CONTRIB` is `true`: you are in **contributor mode**. You're a gstack user who also helps make it better.
172
+
173
+ **At the end of each major workflow step** (not after every single command), reflect on the gstack tooling you used. Rate your experience 0 to 10. If it wasn't a 10, think about why. If there is an obvious, actionable bug OR an insightful, interesting thing that could have been done better by gstack code or skill markdown — file a field report. Maybe our contributor will help make us better!
174
+
175
+ **Calibration — this is the bar:** For example, `$B js "await fetch(...)"` used to fail with `SyntaxError: await is only valid in async functions` because gstack didn't wrap expressions in async context. Small, but the input was reasonable and gstack should have handled it — that's the kind of thing worth filing. Things less consequential than this, ignore.
176
+
177
+ **NOT worth filing:** user's app bugs, network errors to user's URL, auth failures on user's site, user's own JS logic bugs.
178
+
179
+ **To file:** write `~/.gstack/contributor-logs/{slug}.md` with **all sections below** (do not truncate — include every section through the Date/Version footer):
180
+
181
+ ```
182
+ # {Title}
183
+
184
+ Hey gstack team — ran into this while using /{skill-name}:
185
+
186
+ **What I was trying to do:** {what the user/agent was attempting}
187
+ **What happened instead:** {what actually happened}
188
+ **My rating:** {0-10} — {one sentence on why it wasn't a 10}
189
+
190
+ ## Steps to reproduce
191
+ 1. {step}
192
+
193
+ ## Raw output
194
+ ```
195
+ {paste the actual error or unexpected output here}
196
+ ```
197
+
198
+ ## What would make this a 10
199
+ {one sentence: what gstack should have done differently}
200
+
201
+ **Date:** {YYYY-MM-DD} | **Version:** {gstack version} | **Skill:** /{skill}
202
+ ```
203
+
204
+ Slug: lowercase, hyphens, max 60 chars (e.g. `browse-js-no-await`). Skip if file already exists. Max 3 reports per session. File inline and continue — don't stop the workflow. Tell user: "Filed gstack field report: {title}"
205
+
206
+ ## Completion Status Protocol
207
+
208
+ When completing a skill workflow, report status using one of:
209
+ - **DONE** — All steps completed successfully. Evidence provided for each claim.
210
+ - **DONE_WITH_CONCERNS** — Completed, but with issues the user should know about. List each concern.
211
+ - **BLOCKED** — Cannot proceed. State what is blocking and what was tried.
212
+ - **NEEDS_CONTEXT** — Missing information required to continue. State exactly what you need.
213
+
214
+ ### Escalation
215
+
216
+ It is always OK to stop and say "this is too hard for me" or "I'm not confident in this result."
217
+
218
+ Bad work is worse than no work. You will not be penalized for escalating.
219
+ - If you have attempted a task 3 times without success, STOP and escalate.
220
+ - If you are uncertain about a security-sensitive change, STOP and escalate.
221
+ - If the scope of work exceeds what you can verify, STOP and escalate.
222
+
223
+ Escalation format:
224
+ ```
225
+ STATUS: BLOCKED | NEEDS_CONTEXT
226
+ REASON: [1-2 sentences]
227
+ ATTEMPTED: [what you tried]
228
+ RECOMMENDATION: [what the user should do next]
229
+ ```
230
+
231
+ ## Telemetry (run last)
232
+
233
+ After the skill workflow completes (success, error, or abort), log the telemetry event.
234
+ Determine the skill name from the `name:` field in this file's YAML frontmatter.
235
+ Determine the outcome from the workflow result (success if completed normally, error
236
+ if it failed, abort if the user interrupted).
237
+
238
+ **PLAN MODE EXCEPTION — ALWAYS RUN:** This command writes telemetry to
239
+ `~/.gstack/analytics/` (user config directory, not project files). The skill
240
+ preamble already writes to the same directory — this is the same pattern.
241
+ Skipping this command loses session duration and outcome data.
242
+
243
+ Run this bash:
244
+
245
+ ```bash
246
+ _TEL_END=$(date +%s)
247
+ _TEL_DUR=$(( _TEL_END - _TEL_START ))
248
+ rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true
249
+ ~/.claude/skills/gstack/bin/gstack-telemetry-log \
250
+ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \
251
+ --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null &
252
+ ```
253
+
254
+ Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with
255
+ success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used.
256
+ If you cannot determine the outcome, use "unknown". This runs in the background and
257
+ never blocks the user.
258
+
259
+ # browse: QA Testing & Dogfooding
260
+
261
+ Persistent headless Chromium. First call auto-starts (~3s), then ~100ms per command.
262
+ State persists between calls (cookies, tabs, login sessions).
263
+
264
+ ## SETUP (run this check BEFORE any browse command)
265
+
266
+ ```bash
267
+ _ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
268
+ B=""
269
+ [ -n "$_ROOT" ] && [ -x "$_ROOT/.claude/skills/gstack/browse/dist/browse" ] && B="$_ROOT/.claude/skills/gstack/browse/dist/browse"
270
+ [ -z "$B" ] && B=~/.claude/skills/gstack/browse/dist/browse
271
+ if [ -x "$B" ]; then
272
+ echo "READY: $B"
273
+ else
274
+ echo "NEEDS_SETUP"
275
+ fi
276
+ ```
277
+
278
+ If `NEEDS_SETUP`:
279
+ 1. Tell the user: "gstack browse needs a one-time build (~10 seconds). OK to proceed?" Then STOP and wait.
280
+ 2. Run: `cd <SKILL_DIR> && ./setup`
281
+ 3. If `bun` is not installed: `curl -fsSL https://bun.sh/install | bash`
282
+
283
+ ## Core QA Patterns
284
+
285
+ ### 1. Verify a page loads correctly
286
+ ```bash
287
+ $B goto https://yourapp.com
288
+ $B text # content loads?
289
+ $B console # JS errors?
290
+ $B network # failed requests?
291
+ $B is visible ".main-content" # key elements present?
292
+ ```
293
+
294
+ ### 2. Test a user flow
295
+ ```bash
296
+ $B goto https://app.com/login
297
+ $B snapshot -i # see all interactive elements
298
+ $B fill @e3 "user@test.com"
299
+ $B fill @e4 "password"
300
+ $B click @e5 # submit
301
+ $B snapshot -D # diff: what changed after submit?
302
+ $B is visible ".dashboard" # success state present?
303
+ ```
304
+
305
+ ### 3. Verify an action worked
306
+ ```bash
307
+ $B snapshot # baseline
308
+ $B click @e3 # do something
309
+ $B snapshot -D # unified diff shows exactly what changed
310
+ ```
311
+
312
+ ### 4. Visual evidence for bug reports
313
+ ```bash
314
+ $B snapshot -i -a -o /tmp/annotated.png # labeled screenshot
315
+ $B screenshot /tmp/bug.png # plain screenshot
316
+ $B console # error log
317
+ ```
318
+
319
+ ### 5. Find all clickable elements (including non-ARIA)
320
+ ```bash
321
+ $B snapshot -C # finds divs with cursor:pointer, onclick, tabindex
322
+ $B click @c1 # interact with them
323
+ ```
324
+
325
+ ### 6. Assert element states
326
+ ```bash
327
+ $B is visible ".modal"
328
+ $B is enabled "#submit-btn"
329
+ $B is disabled "#submit-btn"
330
+ $B is checked "#agree-checkbox"
331
+ $B is editable "#name-field"
332
+ $B is focused "#search-input"
333
+ $B js "document.body.textContent.includes('Success')"
334
+ ```
335
+
336
+ ### 7. Test responsive layouts
337
+ ```bash
338
+ $B responsive /tmp/layout # mobile + tablet + desktop screenshots
339
+ $B viewport 375x812 # or set specific viewport
340
+ $B screenshot /tmp/mobile.png
341
+ ```
342
+
343
+ ### 8. Test file uploads
344
+ ```bash
345
+ $B upload "#file-input" /path/to/file.pdf
346
+ $B is visible ".upload-success"
347
+ ```
348
+
349
+ ### 9. Test dialogs
350
+ ```bash
351
+ $B dialog-accept "yes" # set up handler
352
+ $B click "#delete-button" # trigger dialog
353
+ $B dialog # see what appeared
354
+ $B snapshot -D # verify deletion happened
355
+ ```
356
+
357
+ ### 10. Compare environments
358
+ ```bash
359
+ $B diff https://staging.app.com https://prod.app.com
360
+ ```
361
+
362
+ ### 11. Show screenshots to the user
363
+ After `$B screenshot`, `$B snapshot -a -o`, or `$B responsive`, always use the Read tool on the output PNG(s) so the user can see them. Without this, screenshots are invisible.
364
+
365
+ ## User Handoff
366
+
367
+ When you hit something you can't handle in headless mode (CAPTCHA, complex auth, multi-factor
368
+ login), hand off to the user:
369
+
370
+ ```bash
371
+ # 1. Open a visible Chrome at the current page
372
+ $B handoff "Stuck on CAPTCHA at login page"
373
+
374
+ # 2. Tell the user what happened (via AskUserQuestion)
375
+ # "I've opened Chrome at the login page. Please solve the CAPTCHA
376
+ # and let me know when you're done."
377
+
378
+ # 3. When user says "done", re-snapshot and continue
379
+ $B resume
380
+ ```
381
+
382
+ **When to use handoff:**
383
+ - CAPTCHAs or bot detection
384
+ - Multi-factor authentication (SMS, authenticator app)
385
+ - OAuth flows that require user interaction
386
+ - Complex interactions the AI can't handle after 3 attempts
387
+
388
+ The browser preserves all state (cookies, localStorage, tabs) across the handoff.
389
+ After `resume`, you get a fresh snapshot of wherever the user left off.
390
+
391
+ ## Snapshot Flags
392
+
393
+ The snapshot is your primary tool for understanding and interacting with pages.
394
+
395
+ ```
396
+ -i --interactive Interactive elements only (buttons, links, inputs) with @e refs
397
+ -c --compact Compact (no empty structural nodes)
398
+ -d <N> --depth Limit tree depth (0 = root only, default: unlimited)
399
+ -s <sel> --selector Scope to CSS selector
400
+ -D --diff Unified diff against previous snapshot (first call stores baseline)
401
+ -a --annotate Annotated screenshot with red overlay boxes and ref labels
402
+ -o <path> --output Output path for annotated screenshot (default: <temp>/browse-annotated.png)
403
+ -C --cursor-interactive Cursor-interactive elements (@c refs — divs with pointer, onclick)
404
+ ```
405
+
406
+ All flags can be combined freely. `-o` only applies when `-a` is also used.
407
+ Example: `$B snapshot -i -a -C -o /tmp/annotated.png`
408
+
409
+ **Ref numbering:** @e refs are assigned sequentially (@e1, @e2, ...) in tree order.
410
+ @c refs from `-C` are numbered separately (@c1, @c2, ...).
411
+
412
+ After snapshot, use @refs as selectors in any command:
413
+ ```bash
414
+ $B click @e3 $B fill @e4 "value" $B hover @e1
415
+ $B html @e2 $B css @e5 "color" $B attrs @e6
416
+ $B click @c1 # cursor-interactive ref (from -C)
417
+ ```
418
+
419
+ **Output format:** indented accessibility tree with @ref IDs, one element per line.
420
+ ```
421
+ @e1 [heading] "Welcome" [level=1]
422
+ @e2 [textbox] "Email"
423
+ @e3 [button] "Submit"
424
+ ```
425
+
426
+ Refs are invalidated on navigation — run `snapshot` again after `goto`.
427
+
428
+ ## Full Command List
429
+
430
+ ### Navigation
431
+ | Command | Description |
432
+ |---------|-------------|
433
+ | `back` | History back |
434
+ | `forward` | History forward |
435
+ | `goto <url>` | Navigate to URL |
436
+ | `reload` | Reload page |
437
+ | `url` | Print current URL |
438
+
439
+ ### Reading
440
+ | Command | Description |
441
+ |---------|-------------|
442
+ | `accessibility` | Full ARIA tree |
443
+ | `forms` | Form fields as JSON |
444
+ | `html [selector]` | innerHTML of selector (throws if not found), or full page HTML if no selector given |
445
+ | `links` | All links as "text → href" |
446
+ | `text` | Cleaned page text |
447
+
448
+ ### Interaction
449
+ | Command | Description |
450
+ |---------|-------------|
451
+ | `click <sel>` | Click element |
452
+ | `cookie <name>=<value>` | Set cookie on current page domain |
453
+ | `cookie-import <json>` | Import cookies from JSON file |
454
+ | `cookie-import-browser [browser] [--domain d]` | Import cookies from Comet, Chrome, Arc, Brave, or Edge (opens picker, or use --domain for direct import) |
455
+ | `dialog-accept [text]` | Auto-accept next alert/confirm/prompt. Optional text is sent as the prompt response |
456
+ | `dialog-dismiss` | Auto-dismiss next dialog |
457
+ | `fill <sel> <val>` | Fill input |
458
+ | `header <name>:<value>` | Set custom request header (colon-separated, sensitive values auto-redacted) |
459
+ | `hover <sel>` | Hover element |
460
+ | `press <key>` | Press key — Enter, Tab, Escape, ArrowUp/Down/Left/Right, Backspace, Delete, Home, End, PageUp, PageDown, or modifiers like Shift+Enter |
461
+ | `scroll [sel]` | Scroll element into view, or scroll to page bottom if no selector |
462
+ | `select <sel> <val>` | Select dropdown option by value, label, or visible text |
463
+ | `type <text>` | Type into focused element |
464
+ | `upload <sel> <file> [file2...]` | Upload file(s) |
465
+ | `useragent <string>` | Set user agent |
466
+ | `viewport <WxH>` | Set viewport size |
467
+ | `wait <sel|--networkidle|--load>` | Wait for element, network idle, or page load (timeout: 15s) |
468
+
469
+ ### Inspection
470
+ | Command | Description |
471
+ |---------|-------------|
472
+ | `attrs <sel|@ref>` | Element attributes as JSON |
473
+ | `console [--clear|--errors]` | Console messages (--errors filters to error/warning) |
474
+ | `cookies` | All cookies as JSON |
475
+ | `css <sel> <prop>` | Computed CSS value |
476
+ | `dialog [--clear]` | Dialog messages |
477
+ | `eval <file>` | Run JavaScript from file and return result as string (path must be under /tmp or cwd) |
478
+ | `is <prop> <sel>` | State check (visible/hidden/enabled/disabled/checked/editable/focused) |
479
+ | `js <expr>` | Run JavaScript expression and return result as string |
480
+ | `network [--clear]` | Network requests |
481
+ | `perf` | Page load timings |
482
+ | `storage [set k v]` | Read all localStorage + sessionStorage as JSON, or set <key> <value> to write localStorage |
483
+
484
+ ### Visual
485
+ | Command | Description |
486
+ |---------|-------------|
487
+ | `diff <url1> <url2>` | Text diff between pages |
488
+ | `pdf [path]` | Save as PDF |
489
+ | `responsive [prefix]` | Screenshots at mobile (375x812), tablet (768x1024), desktop (1280x720). Saves as {prefix}-mobile.png etc. |
490
+ | `screenshot [--viewport] [--clip x,y,w,h] [selector|@ref] [path]` | Save screenshot (supports element crop via CSS/@ref, --clip region, --viewport) |
491
+
492
+ ### Snapshot
493
+ | Command | Description |
494
+ |---------|-------------|
495
+ | `snapshot [flags]` | Accessibility tree with @e refs for element selection. Flags: -i interactive only, -c compact, -d N depth limit, -s sel scope, -D diff vs previous, -a annotated screenshot, -o path output, -C cursor-interactive @c refs |
496
+
497
+ ### Meta
498
+ | Command | Description |
499
+ |---------|-------------|
500
+ | `chain` | Run commands from JSON stdin. Format: [["cmd","arg1",...],...] |
501
+
502
+ ### Tabs
503
+ | Command | Description |
504
+ |---------|-------------|
505
+ | `closetab [id]` | Close tab |
506
+ | `newtab [url]` | Open new tab |
507
+ | `tab <id>` | Switch to tab |
508
+ | `tabs` | List open tabs |
509
+
510
+ ### Server
511
+ | Command | Description |
512
+ |---------|-------------|
513
+ | `handoff [message]` | Open visible Chrome at current page for user takeover |
514
+ | `restart` | Restart server |
515
+ | `resume` | Re-snapshot after user takeover, return control to AI |
516
+ | `status` | Health check |
517
+ | `stop` | Shutdown server |
@@ -0,0 +1,141 @@
1
+ ---
2
+ name: browse
3
+ version: 1.1.0
4
+ description: |
5
+ Fast headless browser for QA testing and site dogfooding. Navigate any URL, interact with
6
+ elements, verify page state, diff before/after actions, take annotated screenshots, check
7
+ responsive layouts, test forms and uploads, handle dialogs, and assert element states.
8
+ ~100ms per command. Use when you need to test a feature, verify a deployment, dogfood a
9
+ user flow, or file a bug with evidence. Use when asked to "open in browser", "test the
10
+ site", "take a screenshot", or "dogfood this".
11
+ allowed-tools:
12
+ - Bash
13
+ - Read
14
+ - AskUserQuestion
15
+
16
+ ---
17
+
18
+ {{PREAMBLE}}
19
+
20
+ # browse: QA Testing & Dogfooding
21
+
22
+ Persistent headless Chromium. First call auto-starts (~3s), then ~100ms per command.
23
+ State persists between calls (cookies, tabs, login sessions).
24
+
25
+ {{BROWSE_SETUP}}
26
+
27
+ ## Core QA Patterns
28
+
29
+ ### 1. Verify a page loads correctly
30
+ ```bash
31
+ $B goto https://yourapp.com
32
+ $B text # content loads?
33
+ $B console # JS errors?
34
+ $B network # failed requests?
35
+ $B is visible ".main-content" # key elements present?
36
+ ```
37
+
38
+ ### 2. Test a user flow
39
+ ```bash
40
+ $B goto https://app.com/login
41
+ $B snapshot -i # see all interactive elements
42
+ $B fill @e3 "user@test.com"
43
+ $B fill @e4 "password"
44
+ $B click @e5 # submit
45
+ $B snapshot -D # diff: what changed after submit?
46
+ $B is visible ".dashboard" # success state present?
47
+ ```
48
+
49
+ ### 3. Verify an action worked
50
+ ```bash
51
+ $B snapshot # baseline
52
+ $B click @e3 # do something
53
+ $B snapshot -D # unified diff shows exactly what changed
54
+ ```
55
+
56
+ ### 4. Visual evidence for bug reports
57
+ ```bash
58
+ $B snapshot -i -a -o /tmp/annotated.png # labeled screenshot
59
+ $B screenshot /tmp/bug.png # plain screenshot
60
+ $B console # error log
61
+ ```
62
+
63
+ ### 5. Find all clickable elements (including non-ARIA)
64
+ ```bash
65
+ $B snapshot -C # finds divs with cursor:pointer, onclick, tabindex
66
+ $B click @c1 # interact with them
67
+ ```
68
+
69
+ ### 6. Assert element states
70
+ ```bash
71
+ $B is visible ".modal"
72
+ $B is enabled "#submit-btn"
73
+ $B is disabled "#submit-btn"
74
+ $B is checked "#agree-checkbox"
75
+ $B is editable "#name-field"
76
+ $B is focused "#search-input"
77
+ $B js "document.body.textContent.includes('Success')"
78
+ ```
79
+
80
+ ### 7. Test responsive layouts
81
+ ```bash
82
+ $B responsive /tmp/layout # mobile + tablet + desktop screenshots
83
+ $B viewport 375x812 # or set specific viewport
84
+ $B screenshot /tmp/mobile.png
85
+ ```
86
+
87
+ ### 8. Test file uploads
88
+ ```bash
89
+ $B upload "#file-input" /path/to/file.pdf
90
+ $B is visible ".upload-success"
91
+ ```
92
+
93
+ ### 9. Test dialogs
94
+ ```bash
95
+ $B dialog-accept "yes" # set up handler
96
+ $B click "#delete-button" # trigger dialog
97
+ $B dialog # see what appeared
98
+ $B snapshot -D # verify deletion happened
99
+ ```
100
+
101
+ ### 10. Compare environments
102
+ ```bash
103
+ $B diff https://staging.app.com https://prod.app.com
104
+ ```
105
+
106
+ ### 11. Show screenshots to the user
107
+ After `$B screenshot`, `$B snapshot -a -o`, or `$B responsive`, always use the Read tool on the output PNG(s) so the user can see them. Without this, screenshots are invisible.
108
+
109
+ ## User Handoff
110
+
111
+ When you hit something you can't handle in headless mode (CAPTCHA, complex auth, multi-factor
112
+ login), hand off to the user:
113
+
114
+ ```bash
115
+ # 1. Open a visible Chrome at the current page
116
+ $B handoff "Stuck on CAPTCHA at login page"
117
+
118
+ # 2. Tell the user what happened (via AskUserQuestion)
119
+ # "I've opened Chrome at the login page. Please solve the CAPTCHA
120
+ # and let me know when you're done."
121
+
122
+ # 3. When user says "done", re-snapshot and continue
123
+ $B resume
124
+ ```
125
+
126
+ **When to use handoff:**
127
+ - CAPTCHAs or bot detection
128
+ - Multi-factor authentication (SMS, authenticator app)
129
+ - OAuth flows that require user interaction
130
+ - Complex interactions the AI can't handle after 3 attempts
131
+
132
+ The browser preserves all state (cookies, localStorage, tabs) across the handoff.
133
+ After `resume`, you get a fresh snapshot of wherever the user left off.
134
+
135
+ ## Snapshot Flags
136
+
137
+ {{SNAPSHOT_FLAGS}}
138
+
139
+ ## Full Command List
140
+
141
+ {{COMMAND_REFERENCE}}
@@ -0,0 +1,21 @@
1
+ #!/bin/bash
2
+ # Shim: delegates to compiled find-browse binary, falls back to basic discovery.
3
+ # The compiled binary handles git root detection for workspace-local installs.
4
+ DIR="$(cd "$(dirname "$0")/.." && pwd)/dist"
5
+ if test -x "$DIR/find-browse"; then
6
+ exec "$DIR/find-browse" "$@"
7
+ fi
8
+ # Fallback: basic discovery with priority chain
9
+ ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
10
+ for MARKER in .codex .agents .claude; do
11
+ if [ -n "$ROOT" ] && test -x "$ROOT/$MARKER/skills/gstack/browse/dist/browse"; then
12
+ echo "$ROOT/$MARKER/skills/gstack/browse/dist/browse"
13
+ exit 0
14
+ fi
15
+ if test -x "$HOME/$MARKER/skills/gstack/browse/dist/browse"; then
16
+ echo "$HOME/$MARKER/skills/gstack/browse/dist/browse"
17
+ exit 0
18
+ fi
19
+ done
20
+ echo "ERROR: browse binary not found. Run: cd <skill-dir> && ./setup" >&2
21
+ exit 1