@runchr/gstack-antigravity 0.1.1 → 0.1.3

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 (229) hide show
  1. package/.agents/skills/gstack/.agents/skills/gstack/SKILL.md +651 -0
  2. package/.agents/skills/gstack/.agents/skills/gstack-autoplan/SKILL.md +678 -0
  3. package/.agents/skills/gstack/.agents/skills/gstack-benchmark/SKILL.md +482 -0
  4. package/.agents/skills/gstack/.agents/skills/gstack-browse/SKILL.md +511 -0
  5. package/.agents/skills/gstack/.agents/skills/gstack-canary/SKILL.md +486 -0
  6. package/.agents/skills/gstack/.agents/skills/gstack-careful/SKILL.md +50 -0
  7. package/.agents/skills/gstack/.agents/skills/gstack-cso/SKILL.md +607 -0
  8. package/.agents/skills/gstack/.agents/skills/gstack-design-consultation/SKILL.md +615 -0
  9. package/.agents/skills/gstack/.agents/skills/gstack-design-review/SKILL.md +988 -0
  10. package/.agents/skills/gstack/.agents/skills/gstack-document-release/SKILL.md +604 -0
  11. package/.agents/skills/gstack/.agents/skills/gstack-freeze/SKILL.md +67 -0
  12. package/.agents/skills/gstack/.agents/skills/gstack-guard/SKILL.md +62 -0
  13. package/.agents/skills/gstack/.agents/skills/gstack-investigate/SKILL.md +415 -0
  14. package/.agents/skills/gstack/.agents/skills/gstack-land-and-deploy/SKILL.md +873 -0
  15. package/.agents/skills/gstack/.agents/skills/gstack-office-hours/SKILL.md +986 -0
  16. package/.agents/skills/gstack/.agents/skills/gstack-plan-ceo-review/SKILL.md +1268 -0
  17. package/.agents/skills/gstack/.agents/skills/gstack-plan-design-review/SKILL.md +668 -0
  18. package/.agents/skills/gstack/.agents/skills/gstack-plan-eng-review/SKILL.md +826 -0
  19. package/.agents/skills/gstack/.agents/skills/gstack-qa/SKILL.md +1006 -0
  20. package/.agents/skills/gstack/.agents/skills/gstack-qa-only/SKILL.md +626 -0
  21. package/.agents/skills/gstack/.agents/skills/gstack-retro/SKILL.md +1065 -0
  22. package/.agents/skills/gstack/.agents/skills/gstack-review/SKILL.md +704 -0
  23. package/.agents/skills/gstack/.agents/skills/gstack-setup-browser-cookies/SKILL.md +325 -0
  24. package/.agents/skills/gstack/.agents/skills/gstack-setup-deploy/SKILL.md +450 -0
  25. package/.agents/skills/gstack/.agents/skills/gstack-ship/SKILL.md +1312 -0
  26. package/.agents/skills/gstack/.agents/skills/gstack-unfreeze/SKILL.md +36 -0
  27. package/.agents/skills/gstack/.agents/skills/gstack-upgrade/SKILL.md +220 -0
  28. package/.agents/skills/gstack/.env.example +5 -0
  29. package/.agents/skills/gstack/.github/workflows/skill-docs.yml +17 -0
  30. package/.agents/skills/gstack/AGENTS.md +49 -0
  31. package/.agents/skills/gstack/ARCHITECTURE.md +359 -0
  32. package/.agents/skills/gstack/BROWSER.md +271 -0
  33. package/.agents/skills/gstack/CHANGELOG.md +800 -0
  34. package/.agents/skills/gstack/CLAUDE.md +284 -0
  35. package/.agents/skills/gstack/CONTRIBUTING.md +370 -0
  36. package/.agents/skills/gstack/ETHOS.md +129 -0
  37. package/.agents/skills/gstack/LICENSE +21 -0
  38. package/.agents/skills/gstack/README.md +228 -0
  39. package/.agents/skills/gstack/SKILL.md +657 -0
  40. package/.agents/skills/gstack/SKILL.md.tmpl +281 -0
  41. package/.agents/skills/gstack/TODOS.md +564 -0
  42. package/.agents/skills/gstack/VERSION +1 -0
  43. package/.agents/skills/gstack/autoplan/SKILL.md +689 -0
  44. package/.agents/skills/gstack/autoplan/SKILL.md.tmpl +416 -0
  45. package/.agents/skills/gstack/benchmark/SKILL.md +489 -0
  46. package/.agents/skills/gstack/benchmark/SKILL.md.tmpl +233 -0
  47. package/.agents/skills/gstack/bin/dev-setup +68 -0
  48. package/.agents/skills/gstack/bin/dev-teardown +56 -0
  49. package/.agents/skills/gstack/bin/gstack-analytics +191 -0
  50. package/.agents/skills/gstack/bin/gstack-community-dashboard +113 -0
  51. package/.agents/skills/gstack/bin/gstack-config +38 -0
  52. package/.agents/skills/gstack/bin/gstack-diff-scope +71 -0
  53. package/.agents/skills/gstack/bin/gstack-global-discover.ts +591 -0
  54. package/.agents/skills/gstack/bin/gstack-repo-mode +93 -0
  55. package/.agents/skills/gstack/bin/gstack-review-log +9 -0
  56. package/.agents/skills/gstack/bin/gstack-review-read +12 -0
  57. package/.agents/skills/gstack/bin/gstack-slug +15 -0
  58. package/.agents/skills/gstack/bin/gstack-telemetry-log +158 -0
  59. package/.agents/skills/gstack/bin/gstack-telemetry-sync +127 -0
  60. package/.agents/skills/gstack/bin/gstack-update-check +196 -0
  61. package/.agents/skills/gstack/browse/SKILL.md +517 -0
  62. package/.agents/skills/gstack/browse/SKILL.md.tmpl +141 -0
  63. package/.agents/skills/gstack/browse/bin/find-browse +21 -0
  64. package/.agents/skills/gstack/browse/bin/remote-slug +14 -0
  65. package/.agents/skills/gstack/browse/scripts/build-node-server.sh +48 -0
  66. package/.agents/skills/gstack/browse/src/browser-manager.ts +634 -0
  67. package/.agents/skills/gstack/browse/src/buffers.ts +137 -0
  68. package/.agents/skills/gstack/browse/src/bun-polyfill.cjs +109 -0
  69. package/.agents/skills/gstack/browse/src/cli.ts +420 -0
  70. package/.agents/skills/gstack/browse/src/commands.ts +111 -0
  71. package/.agents/skills/gstack/browse/src/config.ts +150 -0
  72. package/.agents/skills/gstack/browse/src/cookie-import-browser.ts +417 -0
  73. package/.agents/skills/gstack/browse/src/cookie-picker-routes.ts +207 -0
  74. package/.agents/skills/gstack/browse/src/cookie-picker-ui.ts +541 -0
  75. package/.agents/skills/gstack/browse/src/find-browse.ts +61 -0
  76. package/.agents/skills/gstack/browse/src/meta-commands.ts +269 -0
  77. package/.agents/skills/gstack/browse/src/platform.ts +17 -0
  78. package/.agents/skills/gstack/browse/src/read-commands.ts +335 -0
  79. package/.agents/skills/gstack/browse/src/server.ts +369 -0
  80. package/.agents/skills/gstack/browse/src/snapshot.ts +398 -0
  81. package/.agents/skills/gstack/browse/src/url-validation.ts +91 -0
  82. package/.agents/skills/gstack/browse/src/write-commands.ts +352 -0
  83. package/.agents/skills/gstack/browse/test/bun-polyfill.test.ts +72 -0
  84. package/.agents/skills/gstack/browse/test/commands.test.ts +1836 -0
  85. package/.agents/skills/gstack/browse/test/config.test.ts +250 -0
  86. package/.agents/skills/gstack/browse/test/cookie-import-browser.test.ts +397 -0
  87. package/.agents/skills/gstack/browse/test/cookie-picker-routes.test.ts +205 -0
  88. package/.agents/skills/gstack/browse/test/find-browse.test.ts +50 -0
  89. package/.agents/skills/gstack/browse/test/fixtures/basic.html +33 -0
  90. package/.agents/skills/gstack/browse/test/fixtures/cursor-interactive.html +22 -0
  91. package/.agents/skills/gstack/browse/test/fixtures/dialog.html +15 -0
  92. package/.agents/skills/gstack/browse/test/fixtures/empty.html +2 -0
  93. package/.agents/skills/gstack/browse/test/fixtures/forms.html +55 -0
  94. package/.agents/skills/gstack/browse/test/fixtures/qa-eval-checkout.html +108 -0
  95. package/.agents/skills/gstack/browse/test/fixtures/qa-eval-spa.html +98 -0
  96. package/.agents/skills/gstack/browse/test/fixtures/qa-eval.html +51 -0
  97. package/.agents/skills/gstack/browse/test/fixtures/responsive.html +49 -0
  98. package/.agents/skills/gstack/browse/test/fixtures/snapshot.html +55 -0
  99. package/.agents/skills/gstack/browse/test/fixtures/spa.html +24 -0
  100. package/.agents/skills/gstack/browse/test/fixtures/states.html +17 -0
  101. package/.agents/skills/gstack/browse/test/fixtures/upload.html +25 -0
  102. package/.agents/skills/gstack/browse/test/gstack-config.test.ts +125 -0
  103. package/.agents/skills/gstack/browse/test/gstack-update-check.test.ts +467 -0
  104. package/.agents/skills/gstack/browse/test/handoff.test.ts +235 -0
  105. package/.agents/skills/gstack/browse/test/path-validation.test.ts +63 -0
  106. package/.agents/skills/gstack/browse/test/platform.test.ts +37 -0
  107. package/.agents/skills/gstack/browse/test/snapshot.test.ts +467 -0
  108. package/.agents/skills/gstack/browse/test/test-server.ts +57 -0
  109. package/.agents/skills/gstack/browse/test/url-validation.test.ts +72 -0
  110. package/.agents/skills/gstack/canary/SKILL.md +493 -0
  111. package/.agents/skills/gstack/canary/SKILL.md.tmpl +220 -0
  112. package/.agents/skills/gstack/careful/SKILL.md +59 -0
  113. package/.agents/skills/gstack/careful/SKILL.md.tmpl +57 -0
  114. package/.agents/skills/gstack/careful/bin/check-careful.sh +112 -0
  115. package/.agents/skills/gstack/codex/SKILL.md +677 -0
  116. package/.agents/skills/gstack/codex/SKILL.md.tmpl +356 -0
  117. package/.agents/skills/gstack/conductor.json +6 -0
  118. package/.agents/skills/gstack/cso/SKILL.md +615 -0
  119. package/.agents/skills/gstack/cso/SKILL.md.tmpl +376 -0
  120. package/.agents/skills/gstack/design-consultation/SKILL.md +625 -0
  121. package/.agents/skills/gstack/design-consultation/SKILL.md.tmpl +369 -0
  122. package/.agents/skills/gstack/design-review/SKILL.md +998 -0
  123. package/.agents/skills/gstack/design-review/SKILL.md.tmpl +262 -0
  124. package/.agents/skills/gstack/docs/images/github-2013.png +0 -0
  125. package/.agents/skills/gstack/docs/images/github-2026.png +0 -0
  126. package/.agents/skills/gstack/docs/skills.md +877 -0
  127. package/.agents/skills/gstack/document-release/SKILL.md +613 -0
  128. package/.agents/skills/gstack/document-release/SKILL.md.tmpl +357 -0
  129. package/.agents/skills/gstack/freeze/SKILL.md +82 -0
  130. package/.agents/skills/gstack/freeze/SKILL.md.tmpl +80 -0
  131. package/.agents/skills/gstack/freeze/bin/check-freeze.sh +68 -0
  132. package/.agents/skills/gstack/gstack-upgrade/SKILL.md +226 -0
  133. package/.agents/skills/gstack/gstack-upgrade/SKILL.md.tmpl +224 -0
  134. package/.agents/skills/gstack/guard/SKILL.md +82 -0
  135. package/.agents/skills/gstack/guard/SKILL.md.tmpl +80 -0
  136. package/.agents/skills/gstack/investigate/SKILL.md +435 -0
  137. package/.agents/skills/gstack/investigate/SKILL.md.tmpl +196 -0
  138. package/.agents/skills/gstack/land-and-deploy/SKILL.md +880 -0
  139. package/.agents/skills/gstack/land-and-deploy/SKILL.md.tmpl +575 -0
  140. package/.agents/skills/gstack/office-hours/SKILL.md +996 -0
  141. package/.agents/skills/gstack/office-hours/SKILL.md.tmpl +624 -0
  142. package/.agents/skills/gstack/package.json +55 -0
  143. package/.agents/skills/gstack/plan-ceo-review/SKILL.md +1277 -0
  144. package/.agents/skills/gstack/plan-ceo-review/SKILL.md.tmpl +838 -0
  145. package/.agents/skills/gstack/plan-design-review/SKILL.md +676 -0
  146. package/.agents/skills/gstack/plan-design-review/SKILL.md.tmpl +314 -0
  147. package/.agents/skills/gstack/plan-eng-review/SKILL.md +836 -0
  148. package/.agents/skills/gstack/plan-eng-review/SKILL.md.tmpl +279 -0
  149. package/.agents/skills/gstack/qa/SKILL.md +1016 -0
  150. package/.agents/skills/gstack/qa/SKILL.md.tmpl +316 -0
  151. package/.agents/skills/gstack/qa/references/issue-taxonomy.md +85 -0
  152. package/.agents/skills/gstack/qa/templates/qa-report-template.md +126 -0
  153. package/.agents/skills/gstack/qa-only/SKILL.md +633 -0
  154. package/.agents/skills/gstack/qa-only/SKILL.md.tmpl +101 -0
  155. package/.agents/skills/gstack/retro/SKILL.md +1072 -0
  156. package/.agents/skills/gstack/retro/SKILL.md.tmpl +833 -0
  157. package/.agents/skills/gstack/review/SKILL.md +849 -0
  158. package/.agents/skills/gstack/review/SKILL.md.tmpl +259 -0
  159. package/.agents/skills/gstack/review/TODOS-format.md +62 -0
  160. package/.agents/skills/gstack/review/checklist.md +190 -0
  161. package/.agents/skills/gstack/review/design-checklist.md +132 -0
  162. package/.agents/skills/gstack/review/greptile-triage.md +220 -0
  163. package/.agents/skills/gstack/scripts/analytics.ts +190 -0
  164. package/.agents/skills/gstack/scripts/dev-skill.ts +82 -0
  165. package/.agents/skills/gstack/scripts/eval-compare.ts +96 -0
  166. package/.agents/skills/gstack/scripts/eval-list.ts +116 -0
  167. package/.agents/skills/gstack/scripts/eval-select.ts +86 -0
  168. package/.agents/skills/gstack/scripts/eval-summary.ts +187 -0
  169. package/.agents/skills/gstack/scripts/eval-watch.ts +172 -0
  170. package/.agents/skills/gstack/scripts/gen-skill-docs.ts +2414 -0
  171. package/.agents/skills/gstack/scripts/skill-check.ts +167 -0
  172. package/.agents/skills/gstack/setup +269 -0
  173. package/.agents/skills/gstack/setup-browser-cookies/SKILL.md +330 -0
  174. package/.agents/skills/gstack/setup-browser-cookies/SKILL.md.tmpl +74 -0
  175. package/.agents/skills/gstack/setup-deploy/SKILL.md +459 -0
  176. package/.agents/skills/gstack/setup-deploy/SKILL.md.tmpl +220 -0
  177. package/.agents/skills/gstack/ship/SKILL.md +1457 -0
  178. package/.agents/skills/gstack/ship/SKILL.md.tmpl +528 -0
  179. package/.agents/skills/gstack/supabase/config.sh +10 -0
  180. package/.agents/skills/gstack/supabase/functions/community-pulse/index.ts +59 -0
  181. package/.agents/skills/gstack/supabase/functions/telemetry-ingest/index.ts +135 -0
  182. package/.agents/skills/gstack/supabase/functions/update-check/index.ts +37 -0
  183. package/.agents/skills/gstack/supabase/migrations/001_telemetry.sql +89 -0
  184. package/.agents/skills/gstack/test/analytics.test.ts +277 -0
  185. package/.agents/skills/gstack/test/codex-e2e.test.ts +197 -0
  186. package/.agents/skills/gstack/test/fixtures/coverage-audit-fixture.ts +76 -0
  187. package/.agents/skills/gstack/test/fixtures/eval-baselines.json +7 -0
  188. package/.agents/skills/gstack/test/fixtures/qa-eval-checkout-ground-truth.json +43 -0
  189. package/.agents/skills/gstack/test/fixtures/qa-eval-ground-truth.json +43 -0
  190. package/.agents/skills/gstack/test/fixtures/qa-eval-spa-ground-truth.json +43 -0
  191. package/.agents/skills/gstack/test/fixtures/review-eval-design-slop.css +86 -0
  192. package/.agents/skills/gstack/test/fixtures/review-eval-design-slop.html +41 -0
  193. package/.agents/skills/gstack/test/fixtures/review-eval-enum-diff.rb +30 -0
  194. package/.agents/skills/gstack/test/fixtures/review-eval-enum.rb +27 -0
  195. package/.agents/skills/gstack/test/fixtures/review-eval-vuln.rb +14 -0
  196. package/.agents/skills/gstack/test/gemini-e2e.test.ts +173 -0
  197. package/.agents/skills/gstack/test/gen-skill-docs.test.ts +1049 -0
  198. package/.agents/skills/gstack/test/global-discover.test.ts +187 -0
  199. package/.agents/skills/gstack/test/helpers/codex-session-runner.ts +282 -0
  200. package/.agents/skills/gstack/test/helpers/e2e-helpers.ts +239 -0
  201. package/.agents/skills/gstack/test/helpers/eval-store.test.ts +548 -0
  202. package/.agents/skills/gstack/test/helpers/eval-store.ts +689 -0
  203. package/.agents/skills/gstack/test/helpers/gemini-session-runner.test.ts +104 -0
  204. package/.agents/skills/gstack/test/helpers/gemini-session-runner.ts +201 -0
  205. package/.agents/skills/gstack/test/helpers/llm-judge.ts +130 -0
  206. package/.agents/skills/gstack/test/helpers/observability.test.ts +283 -0
  207. package/.agents/skills/gstack/test/helpers/session-runner.test.ts +96 -0
  208. package/.agents/skills/gstack/test/helpers/session-runner.ts +357 -0
  209. package/.agents/skills/gstack/test/helpers/skill-parser.ts +206 -0
  210. package/.agents/skills/gstack/test/helpers/touchfiles.ts +260 -0
  211. package/.agents/skills/gstack/test/hook-scripts.test.ts +373 -0
  212. package/.agents/skills/gstack/test/skill-e2e-browse.test.ts +293 -0
  213. package/.agents/skills/gstack/test/skill-e2e-deploy.test.ts +279 -0
  214. package/.agents/skills/gstack/test/skill-e2e-design.test.ts +614 -0
  215. package/.agents/skills/gstack/test/skill-e2e-plan.test.ts +538 -0
  216. package/.agents/skills/gstack/test/skill-e2e-qa-bugs.test.ts +194 -0
  217. package/.agents/skills/gstack/test/skill-e2e-qa-workflow.test.ts +412 -0
  218. package/.agents/skills/gstack/test/skill-e2e-review.test.ts +535 -0
  219. package/.agents/skills/gstack/test/skill-e2e-workflow.test.ts +586 -0
  220. package/.agents/skills/gstack/test/skill-e2e.test.ts +3325 -0
  221. package/.agents/skills/gstack/test/skill-llm-eval.test.ts +787 -0
  222. package/.agents/skills/gstack/test/skill-parser.test.ts +179 -0
  223. package/.agents/skills/gstack/test/skill-routing-e2e.test.ts +605 -0
  224. package/.agents/skills/gstack/test/skill-validation.test.ts +1520 -0
  225. package/.agents/skills/gstack/test/telemetry.test.ts +278 -0
  226. package/.agents/skills/gstack/test/touchfiles.test.ts +262 -0
  227. package/.agents/skills/gstack/unfreeze/SKILL.md +40 -0
  228. package/.agents/skills/gstack/unfreeze/SKILL.md.tmpl +38 -0
  229. package/package.json +2 -1
@@ -0,0 +1,657 @@
1
+ ---
2
+ name: gstack
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.
10
+
11
+ gstack also includes development workflow skills. When you notice the user is at
12
+ these stages, suggest the appropriate skill:
13
+ - Brainstorming a new idea → suggest /office-hours
14
+ - Reviewing a plan (strategy) → suggest /plan-ceo-review
15
+ - Reviewing a plan (architecture) → suggest /plan-eng-review
16
+ - Reviewing a plan (design) → suggest /plan-design-review
17
+ - Auto-reviewing a plan (all reviews at once) → suggest /autoplan
18
+ - Creating a design system → suggest /design-consultation
19
+ - Debugging errors → suggest /investigate
20
+ - Testing the app → suggest /qa
21
+ - Code review before merge → suggest /review
22
+ - Visual design audit → suggest /design-review
23
+ - Ready to deploy / create PR → suggest /ship
24
+ - Post-ship doc updates → suggest /document-release
25
+ - Weekly retrospective → suggest /retro
26
+ - Wanting a second opinion or adversarial code review → suggest /codex
27
+ - Working with production or live systems → suggest /careful
28
+ - Want to scope edits to one module/directory → suggest /freeze
29
+ - Maximum safety mode (destructive warnings + edit restrictions) → suggest /guard
30
+ - Removing edit restrictions → suggest /unfreeze
31
+ - Upgrading gstack to latest version → suggest /gstack-upgrade
32
+
33
+ If the user pushes back on skill suggestions ("stop suggesting things",
34
+ "I don't need suggestions", "too aggressive"):
35
+ 1. Stop suggesting for the rest of this session
36
+ 2. Run: gstack-config set proactive false
37
+ 3. Say: "Got it — I'll stop suggesting skills. Just tell me to be proactive
38
+ again if you change your mind."
39
+
40
+ If the user says "be proactive again" or "turn on suggestions":
41
+ 1. Run: gstack-config set proactive true
42
+ 2. Say: "Proactive suggestions are back on."
43
+ allowed-tools:
44
+ - Bash
45
+ - Read
46
+ - AskUserQuestion
47
+
48
+ ---
49
+ <!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->
50
+ <!-- Regenerate: bun run gen:skill-docs -->
51
+
52
+ ## Preamble (run first)
53
+
54
+ ```bash
55
+ _UPD=$(~/.claude/skills/gstack/bin/gstack-update-check 2>/dev/null || .claude/skills/gstack/bin/gstack-update-check 2>/dev/null || true)
56
+ [ -n "$_UPD" ] && echo "$_UPD" || true
57
+ mkdir -p ~/.gstack/sessions
58
+ touch ~/.gstack/sessions/"$PPID"
59
+ _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ')
60
+ find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true
61
+ _CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true)
62
+ _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true")
63
+ _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
64
+ echo "BRANCH: $_BRANCH"
65
+ echo "PROACTIVE: $_PROACTIVE"
66
+ source <(~/.claude/skills/gstack/bin/gstack-repo-mode 2>/dev/null) || true
67
+ REPO_MODE=${REPO_MODE:-unknown}
68
+ echo "REPO_MODE: $REPO_MODE"
69
+ _LAKE_SEEN=$([ -f ~/.gstack/.completeness-intro-seen ] && echo "yes" || echo "no")
70
+ echo "LAKE_INTRO: $_LAKE_SEEN"
71
+ _TEL=$(~/.claude/skills/gstack/bin/gstack-config get telemetry 2>/dev/null || true)
72
+ _TEL_PROMPTED=$([ -f ~/.gstack/.telemetry-prompted ] && echo "yes" || echo "no")
73
+ _TEL_START=$(date +%s)
74
+ _SESSION_ID="$$-$(date +%s)"
75
+ echo "TELEMETRY: ${_TEL:-off}"
76
+ echo "TEL_PROMPTED: $_TEL_PROMPTED"
77
+ mkdir -p ~/.gstack/analytics
78
+ echo '{"skill":"gstack","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
79
+ 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
80
+ ```
81
+
82
+ If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills — only invoke
83
+ them when the user explicitly asks. The user opted out of proactive suggestions.
84
+
85
+ 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.
86
+
87
+ If `LAKE_INTRO` is `no`: Before continuing, introduce the Completeness Principle.
88
+ Tell the user: "gstack follows the **Boil the Lake** principle — always do the complete
89
+ thing when AI makes the marginal cost near-zero. Read more: https://garryslist.org/posts/boil-the-ocean"
90
+ Then offer to open the essay in their default browser:
91
+
92
+ ```bash
93
+ open https://garryslist.org/posts/boil-the-ocean
94
+ touch ~/.gstack/.completeness-intro-seen
95
+ ```
96
+
97
+ Only run `open` if the user says yes. Always run `touch` to mark as seen. This only happens once.
98
+
99
+ If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled,
100
+ ask the user about telemetry. Use AskUserQuestion:
101
+
102
+ > Help gstack get better! Community mode shares usage data (which skills you use, how long
103
+ > they take, crash info) with a stable device ID so we can track trends and fix bugs faster.
104
+ > No code, file paths, or repo names are ever sent.
105
+ > Change anytime with `gstack-config set telemetry off`.
106
+
107
+ Options:
108
+ - A) Help gstack get better! (recommended)
109
+ - B) No thanks
110
+
111
+ If A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry community`
112
+
113
+ If B: ask a follow-up AskUserQuestion:
114
+
115
+ > How about anonymous mode? We just learn that *someone* used gstack — no unique ID,
116
+ > no way to connect sessions. Just a counter that helps us know if anyone's out there.
117
+
118
+ Options:
119
+ - A) Sure, anonymous is fine
120
+ - B) No thanks, fully off
121
+
122
+ If B→A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous`
123
+ If B→B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off`
124
+
125
+ Always run:
126
+ ```bash
127
+ touch ~/.gstack/.telemetry-prompted
128
+ ```
129
+
130
+ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely.
131
+
132
+ ## AskUserQuestion Format
133
+
134
+ **ALWAYS follow this structure for every AskUserQuestion call:**
135
+ 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)
136
+ 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.
137
+ 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.
138
+ 4. **Options:** Lettered options: `A) ... B) ... C) ...` — when an option involves effort, show both scales: `(human: ~X / CC: ~Y)`
139
+
140
+ 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.
141
+
142
+ Per-skill instructions may add additional formatting rules on top of this baseline.
143
+
144
+ ## Completeness Principle — Boil the Lake
145
+
146
+ AI-assisted coding makes the marginal cost of completeness near-zero. When you present options:
147
+
148
+ - 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.
149
+ - **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.
150
+ - **When estimating effort**, always show both scales: human team time and CC+gstack time. The compression ratio varies by task type — use this reference:
151
+
152
+ | Task type | Human team | CC+gstack | Compression |
153
+ |-----------|-----------|-----------|-------------|
154
+ | Boilerplate / scaffolding | 2 days | 15 min | ~100x |
155
+ | Test writing | 1 day | 15 min | ~50x |
156
+ | Feature implementation | 1 week | 30 min | ~30x |
157
+ | Bug fix + regression test | 4 hours | 15 min | ~20x |
158
+ | Architecture / design | 2 days | 4 hours | ~5x |
159
+ | Research / exploration | 1 day | 3 hours | ~3x |
160
+
161
+ - 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.
162
+
163
+ **Anti-patterns — DON'T do this:**
164
+ - BAD: "Choose B — it covers 90% of the value with less code." (If A is only 70 lines more, choose A.)
165
+ - BAD: "We can skip edge case handling to save time." (Edge case handling costs minutes with CC.)
166
+ - BAD: "Let's defer test coverage to a follow-up PR." (Tests are the cheapest lake to boil.)
167
+ - BAD: Quoting only human-team effort: "This would take 2 weeks." (Say: "2 weeks human / ~1 hour CC.")
168
+
169
+ ## Repo Ownership Mode — See Something, Say Something
170
+
171
+ `REPO_MODE` from the preamble tells you who owns issues in this repo:
172
+
173
+ - **`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.
174
+ - **`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.
175
+ - **`unknown`** — Treat as collaborative (safer default — ask before fixing).
176
+
177
+ **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.
178
+
179
+ Never let a noticed issue silently pass. The whole point is proactive communication.
180
+
181
+ ## Search Before Building
182
+
183
+ 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.
184
+
185
+ **Three layers of knowledge:**
186
+ - **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.
187
+ - **Layer 2** (new and popular — search for these). But scrutinize: humans are subject to mania. Search results are inputs to your thinking, not answers.
188
+ - **Layer 3** (first principles — prize these above all). Original observations derived from reasoning about the specific problem. The most valuable of all.
189
+
190
+ **Eureka moment:** When first-principles reasoning reveals conventional wisdom is wrong, name it:
191
+ "EUREKA: Everyone does X because [assumption]. But [evidence] shows this is wrong. Y is better because [reasoning]."
192
+
193
+ Log eureka moments:
194
+ ```bash
195
+ 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
196
+ ```
197
+ Replace SKILL_NAME and ONE_LINE_SUMMARY. Runs inline — don't stop the workflow.
198
+
199
+ **WebSearch fallback:** If WebSearch is unavailable, skip the search step and note: "Search unavailable — proceeding with in-distribution knowledge only."
200
+
201
+ ## Contributor Mode
202
+
203
+ If `_CONTRIB` is `true`: you are in **contributor mode**. You're a gstack user who also helps make it better.
204
+
205
+ **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!
206
+
207
+ **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.
208
+
209
+ **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.
210
+
211
+ **To file:** write `~/.gstack/contributor-logs/{slug}.md` with **all sections below** (do not truncate — include every section through the Date/Version footer):
212
+
213
+ ```
214
+ # {Title}
215
+
216
+ Hey gstack team — ran into this while using /{skill-name}:
217
+
218
+ **What I was trying to do:** {what the user/agent was attempting}
219
+ **What happened instead:** {what actually happened}
220
+ **My rating:** {0-10} — {one sentence on why it wasn't a 10}
221
+
222
+ ## Steps to reproduce
223
+ 1. {step}
224
+
225
+ ## Raw output
226
+ ```
227
+ {paste the actual error or unexpected output here}
228
+ ```
229
+
230
+ ## What would make this a 10
231
+ {one sentence: what gstack should have done differently}
232
+
233
+ **Date:** {YYYY-MM-DD} | **Version:** {gstack version} | **Skill:** /{skill}
234
+ ```
235
+
236
+ 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}"
237
+
238
+ ## Completion Status Protocol
239
+
240
+ When completing a skill workflow, report status using one of:
241
+ - **DONE** — All steps completed successfully. Evidence provided for each claim.
242
+ - **DONE_WITH_CONCERNS** — Completed, but with issues the user should know about. List each concern.
243
+ - **BLOCKED** — Cannot proceed. State what is blocking and what was tried.
244
+ - **NEEDS_CONTEXT** — Missing information required to continue. State exactly what you need.
245
+
246
+ ### Escalation
247
+
248
+ It is always OK to stop and say "this is too hard for me" or "I'm not confident in this result."
249
+
250
+ Bad work is worse than no work. You will not be penalized for escalating.
251
+ - If you have attempted a task 3 times without success, STOP and escalate.
252
+ - If you are uncertain about a security-sensitive change, STOP and escalate.
253
+ - If the scope of work exceeds what you can verify, STOP and escalate.
254
+
255
+ Escalation format:
256
+ ```
257
+ STATUS: BLOCKED | NEEDS_CONTEXT
258
+ REASON: [1-2 sentences]
259
+ ATTEMPTED: [what you tried]
260
+ RECOMMENDATION: [what the user should do next]
261
+ ```
262
+
263
+ ## Telemetry (run last)
264
+
265
+ After the skill workflow completes (success, error, or abort), log the telemetry event.
266
+ Determine the skill name from the `name:` field in this file's YAML frontmatter.
267
+ Determine the outcome from the workflow result (success if completed normally, error
268
+ if it failed, abort if the user interrupted).
269
+
270
+ **PLAN MODE EXCEPTION — ALWAYS RUN:** This command writes telemetry to
271
+ `~/.gstack/analytics/` (user config directory, not project files). The skill
272
+ preamble already writes to the same directory — this is the same pattern.
273
+ Skipping this command loses session duration and outcome data.
274
+
275
+ Run this bash:
276
+
277
+ ```bash
278
+ _TEL_END=$(date +%s)
279
+ _TEL_DUR=$(( _TEL_END - _TEL_START ))
280
+ rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true
281
+ ~/.claude/skills/gstack/bin/gstack-telemetry-log \
282
+ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \
283
+ --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null &
284
+ ```
285
+
286
+ Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with
287
+ success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used.
288
+ If you cannot determine the outcome, use "unknown". This runs in the background and
289
+ never blocks the user.
290
+
291
+ If `PROACTIVE` is `false`: do NOT proactively suggest other gstack skills during this session.
292
+ Only run skills the user explicitly invokes. This preference persists across sessions via
293
+ `gstack-config`.
294
+
295
+ # gstack browse: QA Testing & Dogfooding
296
+
297
+ Persistent headless Chromium. First call auto-starts (~3s), then ~100-200ms per command.
298
+ Auto-shuts down after 30 min idle. State persists between calls (cookies, tabs, sessions).
299
+
300
+ ## SETUP (run this check BEFORE any browse command)
301
+
302
+ ```bash
303
+ _ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
304
+ B=""
305
+ [ -n "$_ROOT" ] && [ -x "$_ROOT/.claude/skills/gstack/browse/dist/browse" ] && B="$_ROOT/.claude/skills/gstack/browse/dist/browse"
306
+ [ -z "$B" ] && B=~/.claude/skills/gstack/browse/dist/browse
307
+ if [ -x "$B" ]; then
308
+ echo "READY: $B"
309
+ else
310
+ echo "NEEDS_SETUP"
311
+ fi
312
+ ```
313
+
314
+ If `NEEDS_SETUP`:
315
+ 1. Tell the user: "gstack browse needs a one-time build (~10 seconds). OK to proceed?" Then STOP and wait.
316
+ 2. Run: `cd <SKILL_DIR> && ./setup`
317
+ 3. If `bun` is not installed: `curl -fsSL https://bun.sh/install | bash`
318
+
319
+ ## IMPORTANT
320
+
321
+ - Use the compiled binary via Bash: `$B <command>`
322
+ - NEVER use `mcp__claude-in-chrome__*` tools. They are slow and unreliable.
323
+ - Browser persists between calls — cookies, login sessions, and tabs carry over.
324
+ - Dialogs (alert/confirm/prompt) are auto-accepted by default — no browser lockup.
325
+ - **Show screenshots:** 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.
326
+
327
+ ## QA Workflows
328
+
329
+ ### Test a user flow (login, signup, checkout, etc.)
330
+
331
+ ```bash
332
+ # 1. Go to the page
333
+ $B goto https://app.example.com/login
334
+
335
+ # 2. See what's interactive
336
+ $B snapshot -i
337
+
338
+ # 3. Fill the form using refs
339
+ $B fill @e3 "test@example.com"
340
+ $B fill @e4 "password123"
341
+ $B click @e5
342
+
343
+ # 4. Verify it worked
344
+ $B snapshot -D # diff shows what changed after clicking
345
+ $B is visible ".dashboard" # assert the dashboard appeared
346
+ $B screenshot /tmp/after-login.png
347
+ ```
348
+
349
+ ### Verify a deployment / check prod
350
+
351
+ ```bash
352
+ $B goto https://yourapp.com
353
+ $B text # read the page — does it load?
354
+ $B console # any JS errors?
355
+ $B network # any failed requests?
356
+ $B js "document.title" # correct title?
357
+ $B is visible ".hero-section" # key elements present?
358
+ $B screenshot /tmp/prod-check.png
359
+ ```
360
+
361
+ ### Dogfood a feature end-to-end
362
+
363
+ ```bash
364
+ # Navigate to the feature
365
+ $B goto https://app.example.com/new-feature
366
+
367
+ # Take annotated screenshot — shows every interactive element with labels
368
+ $B snapshot -i -a -o /tmp/feature-annotated.png
369
+
370
+ # Find ALL clickable things (including divs with cursor:pointer)
371
+ $B snapshot -C
372
+
373
+ # Walk through the flow
374
+ $B snapshot -i # baseline
375
+ $B click @e3 # interact
376
+ $B snapshot -D # what changed? (unified diff)
377
+
378
+ # Check element states
379
+ $B is visible ".success-toast"
380
+ $B is enabled "#next-step-btn"
381
+ $B is checked "#agree-checkbox"
382
+
383
+ # Check console for errors after interactions
384
+ $B console
385
+ ```
386
+
387
+ ### Test responsive layouts
388
+
389
+ ```bash
390
+ # Quick: 3 screenshots at mobile/tablet/desktop
391
+ $B goto https://yourapp.com
392
+ $B responsive /tmp/layout
393
+
394
+ # Manual: specific viewport
395
+ $B viewport 375x812 # iPhone
396
+ $B screenshot /tmp/mobile.png
397
+ $B viewport 1440x900 # Desktop
398
+ $B screenshot /tmp/desktop.png
399
+
400
+ # Element screenshot (crop to specific element)
401
+ $B screenshot "#hero-banner" /tmp/hero.png
402
+ $B snapshot -i
403
+ $B screenshot @e3 /tmp/button.png
404
+
405
+ # Region crop
406
+ $B screenshot --clip 0,0,800,600 /tmp/above-fold.png
407
+
408
+ # Viewport only (no scroll)
409
+ $B screenshot --viewport /tmp/viewport.png
410
+ ```
411
+
412
+ ### Test file upload
413
+
414
+ ```bash
415
+ $B goto https://app.example.com/upload
416
+ $B snapshot -i
417
+ $B upload @e3 /path/to/test-file.pdf
418
+ $B is visible ".upload-success"
419
+ $B screenshot /tmp/upload-result.png
420
+ ```
421
+
422
+ ### Test forms with validation
423
+
424
+ ```bash
425
+ $B goto https://app.example.com/form
426
+ $B snapshot -i
427
+
428
+ # Submit empty — check validation errors appear
429
+ $B click @e10 # submit button
430
+ $B snapshot -D # diff shows error messages appeared
431
+ $B is visible ".error-message"
432
+
433
+ # Fill and resubmit
434
+ $B fill @e3 "valid input"
435
+ $B click @e10
436
+ $B snapshot -D # diff shows errors gone, success state
437
+ ```
438
+
439
+ ### Test dialogs (delete confirmations, prompts)
440
+
441
+ ```bash
442
+ # Set up dialog handling BEFORE triggering
443
+ $B dialog-accept # will auto-accept next alert/confirm
444
+ $B click "#delete-button" # triggers confirmation dialog
445
+ $B dialog # see what dialog appeared
446
+ $B snapshot -D # verify the item was deleted
447
+
448
+ # For prompts that need input
449
+ $B dialog-accept "my answer" # accept with text
450
+ $B click "#rename-button" # triggers prompt
451
+ ```
452
+
453
+ ### Test authenticated pages (import real browser cookies)
454
+
455
+ ```bash
456
+ # Import cookies from your real browser (opens interactive picker)
457
+ $B cookie-import-browser
458
+
459
+ # Or import a specific domain directly
460
+ $B cookie-import-browser comet --domain .github.com
461
+
462
+ # Now test authenticated pages
463
+ $B goto https://github.com/settings/profile
464
+ $B snapshot -i
465
+ $B screenshot /tmp/github-profile.png
466
+ ```
467
+
468
+ ### Compare two pages / environments
469
+
470
+ ```bash
471
+ $B diff https://staging.app.com https://prod.app.com
472
+ ```
473
+
474
+ ### Multi-step chain (efficient for long flows)
475
+
476
+ ```bash
477
+ echo '[
478
+ ["goto","https://app.example.com"],
479
+ ["snapshot","-i"],
480
+ ["fill","@e3","test@test.com"],
481
+ ["fill","@e4","password"],
482
+ ["click","@e5"],
483
+ ["snapshot","-D"],
484
+ ["screenshot","/tmp/result.png"]
485
+ ]' | $B chain
486
+ ```
487
+
488
+ ## Quick Assertion Patterns
489
+
490
+ ```bash
491
+ # Element exists and is visible
492
+ $B is visible ".modal"
493
+
494
+ # Button is enabled/disabled
495
+ $B is enabled "#submit-btn"
496
+ $B is disabled "#submit-btn"
497
+
498
+ # Checkbox state
499
+ $B is checked "#agree"
500
+
501
+ # Input is editable
502
+ $B is editable "#name-field"
503
+
504
+ # Element has focus
505
+ $B is focused "#search-input"
506
+
507
+ # Page contains text
508
+ $B js "document.body.textContent.includes('Success')"
509
+
510
+ # Element count
511
+ $B js "document.querySelectorAll('.list-item').length"
512
+
513
+ # Specific attribute value
514
+ $B attrs "#logo" # returns all attributes as JSON
515
+
516
+ # CSS property
517
+ $B css ".button" "background-color"
518
+ ```
519
+
520
+ ## Snapshot System
521
+
522
+ The snapshot is your primary tool for understanding and interacting with pages.
523
+
524
+ ```
525
+ -i --interactive Interactive elements only (buttons, links, inputs) with @e refs
526
+ -c --compact Compact (no empty structural nodes)
527
+ -d <N> --depth Limit tree depth (0 = root only, default: unlimited)
528
+ -s <sel> --selector Scope to CSS selector
529
+ -D --diff Unified diff against previous snapshot (first call stores baseline)
530
+ -a --annotate Annotated screenshot with red overlay boxes and ref labels
531
+ -o <path> --output Output path for annotated screenshot (default: <temp>/browse-annotated.png)
532
+ -C --cursor-interactive Cursor-interactive elements (@c refs — divs with pointer, onclick)
533
+ ```
534
+
535
+ All flags can be combined freely. `-o` only applies when `-a` is also used.
536
+ Example: `$B snapshot -i -a -C -o /tmp/annotated.png`
537
+
538
+ **Ref numbering:** @e refs are assigned sequentially (@e1, @e2, ...) in tree order.
539
+ @c refs from `-C` are numbered separately (@c1, @c2, ...).
540
+
541
+ After snapshot, use @refs as selectors in any command:
542
+ ```bash
543
+ $B click @e3 $B fill @e4 "value" $B hover @e1
544
+ $B html @e2 $B css @e5 "color" $B attrs @e6
545
+ $B click @c1 # cursor-interactive ref (from -C)
546
+ ```
547
+
548
+ **Output format:** indented accessibility tree with @ref IDs, one element per line.
549
+ ```
550
+ @e1 [heading] "Welcome" [level=1]
551
+ @e2 [textbox] "Email"
552
+ @e3 [button] "Submit"
553
+ ```
554
+
555
+ Refs are invalidated on navigation — run `snapshot` again after `goto`.
556
+
557
+ ## Command Reference
558
+
559
+ ### Navigation
560
+ | Command | Description |
561
+ |---------|-------------|
562
+ | `back` | History back |
563
+ | `forward` | History forward |
564
+ | `goto <url>` | Navigate to URL |
565
+ | `reload` | Reload page |
566
+ | `url` | Print current URL |
567
+
568
+ ### Reading
569
+ | Command | Description |
570
+ |---------|-------------|
571
+ | `accessibility` | Full ARIA tree |
572
+ | `forms` | Form fields as JSON |
573
+ | `html [selector]` | innerHTML of selector (throws if not found), or full page HTML if no selector given |
574
+ | `links` | All links as "text → href" |
575
+ | `text` | Cleaned page text |
576
+
577
+ ### Interaction
578
+ | Command | Description |
579
+ |---------|-------------|
580
+ | `click <sel>` | Click element |
581
+ | `cookie <name>=<value>` | Set cookie on current page domain |
582
+ | `cookie-import <json>` | Import cookies from JSON file |
583
+ | `cookie-import-browser [browser] [--domain d]` | Import cookies from Comet, Chrome, Arc, Brave, or Edge (opens picker, or use --domain for direct import) |
584
+ | `dialog-accept [text]` | Auto-accept next alert/confirm/prompt. Optional text is sent as the prompt response |
585
+ | `dialog-dismiss` | Auto-dismiss next dialog |
586
+ | `fill <sel> <val>` | Fill input |
587
+ | `header <name>:<value>` | Set custom request header (colon-separated, sensitive values auto-redacted) |
588
+ | `hover <sel>` | Hover element |
589
+ | `press <key>` | Press key — Enter, Tab, Escape, ArrowUp/Down/Left/Right, Backspace, Delete, Home, End, PageUp, PageDown, or modifiers like Shift+Enter |
590
+ | `scroll [sel]` | Scroll element into view, or scroll to page bottom if no selector |
591
+ | `select <sel> <val>` | Select dropdown option by value, label, or visible text |
592
+ | `type <text>` | Type into focused element |
593
+ | `upload <sel> <file> [file2...]` | Upload file(s) |
594
+ | `useragent <string>` | Set user agent |
595
+ | `viewport <WxH>` | Set viewport size |
596
+ | `wait <sel|--networkidle|--load>` | Wait for element, network idle, or page load (timeout: 15s) |
597
+
598
+ ### Inspection
599
+ | Command | Description |
600
+ |---------|-------------|
601
+ | `attrs <sel|@ref>` | Element attributes as JSON |
602
+ | `console [--clear|--errors]` | Console messages (--errors filters to error/warning) |
603
+ | `cookies` | All cookies as JSON |
604
+ | `css <sel> <prop>` | Computed CSS value |
605
+ | `dialog [--clear]` | Dialog messages |
606
+ | `eval <file>` | Run JavaScript from file and return result as string (path must be under /tmp or cwd) |
607
+ | `is <prop> <sel>` | State check (visible/hidden/enabled/disabled/checked/editable/focused) |
608
+ | `js <expr>` | Run JavaScript expression and return result as string |
609
+ | `network [--clear]` | Network requests |
610
+ | `perf` | Page load timings |
611
+ | `storage [set k v]` | Read all localStorage + sessionStorage as JSON, or set <key> <value> to write localStorage |
612
+
613
+ ### Visual
614
+ | Command | Description |
615
+ |---------|-------------|
616
+ | `diff <url1> <url2>` | Text diff between pages |
617
+ | `pdf [path]` | Save as PDF |
618
+ | `responsive [prefix]` | Screenshots at mobile (375x812), tablet (768x1024), desktop (1280x720). Saves as {prefix}-mobile.png etc. |
619
+ | `screenshot [--viewport] [--clip x,y,w,h] [selector|@ref] [path]` | Save screenshot (supports element crop via CSS/@ref, --clip region, --viewport) |
620
+
621
+ ### Snapshot
622
+ | Command | Description |
623
+ |---------|-------------|
624
+ | `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 |
625
+
626
+ ### Meta
627
+ | Command | Description |
628
+ |---------|-------------|
629
+ | `chain` | Run commands from JSON stdin. Format: [["cmd","arg1",...],...] |
630
+
631
+ ### Tabs
632
+ | Command | Description |
633
+ |---------|-------------|
634
+ | `closetab [id]` | Close tab |
635
+ | `newtab [url]` | Open new tab |
636
+ | `tab <id>` | Switch to tab |
637
+ | `tabs` | List open tabs |
638
+
639
+ ### Server
640
+ | Command | Description |
641
+ |---------|-------------|
642
+ | `handoff [message]` | Open visible Chrome at current page for user takeover |
643
+ | `restart` | Restart server |
644
+ | `resume` | Re-snapshot after user takeover, return control to AI |
645
+ | `status` | Health check |
646
+ | `stop` | Shutdown server |
647
+
648
+ ## Tips
649
+
650
+ 1. **Navigate once, query many times.** `goto` loads the page; then `text`, `js`, `screenshot` all hit the loaded page instantly.
651
+ 2. **Use `snapshot -i` first.** See all interactive elements, then click/fill by ref. No CSS selector guessing.
652
+ 3. **Use `snapshot -D` to verify.** Baseline → action → diff. See exactly what changed.
653
+ 4. **Use `is` for assertions.** `is visible .modal` is faster and more reliable than parsing page text.
654
+ 5. **Use `snapshot -a` for evidence.** Annotated screenshots are great for bug reports.
655
+ 6. **Use `snapshot -C` for tricky UIs.** Finds clickable divs that the accessibility tree misses.
656
+ 7. **Check `console` after actions.** Catch JS errors that don't surface visually.
657
+ 8. **Use `chain` for long flows.** Single command, no per-step CLI overhead.