@runchr/gstack-antigravity 0.1.0 → 0.1.2

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 (231) 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/README.md +12 -7
  230. package/README_KO.md +12 -6
  231. package/package.json +3 -2
@@ -0,0 +1,1006 @@
1
+ ---
2
+ name: qa
3
+ description: |
4
+ Systematically QA test a web application and fix bugs found. Runs QA testing,
5
+ then iteratively fixes bugs in source code, committing each fix atomically and
6
+ re-verifying. Use when asked to "qa", "QA", "test this site", "find bugs",
7
+ "test and fix", or "fix what's broken".
8
+ Proactively suggest when the user says a feature is ready for testing
9
+ or asks "does this work?". Three tiers: Quick (critical/high only),
10
+ Standard (+ medium), Exhaustive (+ cosmetic). Produces before/after health scores,
11
+ fix evidence, and a ship-readiness summary. For report-only mode, use /qa-only.
12
+ ---
13
+ <!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->
14
+ <!-- Regenerate: bun run gen:skill-docs -->
15
+
16
+ ## Preamble (run first)
17
+
18
+ ```bash
19
+ _UPD=$(~/.codex/skills/gstack/bin/gstack-update-check 2>/dev/null || .agents/skills/gstack/bin/gstack-update-check 2>/dev/null || true)
20
+ [ -n "$_UPD" ] && echo "$_UPD" || true
21
+ mkdir -p ~/.gstack/sessions
22
+ touch ~/.gstack/sessions/"$PPID"
23
+ _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ')
24
+ find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true
25
+ _CONTRIB=$(~/.codex/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true)
26
+ _PROACTIVE=$(~/.codex/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true")
27
+ _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
28
+ echo "BRANCH: $_BRANCH"
29
+ echo "PROACTIVE: $_PROACTIVE"
30
+ source <(~/.codex/skills/gstack/bin/gstack-repo-mode 2>/dev/null) || true
31
+ REPO_MODE=${REPO_MODE:-unknown}
32
+ echo "REPO_MODE: $REPO_MODE"
33
+ _LAKE_SEEN=$([ -f ~/.gstack/.completeness-intro-seen ] && echo "yes" || echo "no")
34
+ echo "LAKE_INTRO: $_LAKE_SEEN"
35
+ _TEL=$(~/.codex/skills/gstack/bin/gstack-config get telemetry 2>/dev/null || true)
36
+ _TEL_PROMPTED=$([ -f ~/.gstack/.telemetry-prompted ] && echo "yes" || echo "no")
37
+ _TEL_START=$(date +%s)
38
+ _SESSION_ID="$$-$(date +%s)"
39
+ echo "TELEMETRY: ${_TEL:-off}"
40
+ echo "TEL_PROMPTED: $_TEL_PROMPTED"
41
+ mkdir -p ~/.gstack/analytics
42
+ echo '{"skill":"qa","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
43
+ for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.codex/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
44
+ ```
45
+
46
+ If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills — only invoke
47
+ them when the user explicitly asks. The user opted out of proactive suggestions.
48
+
49
+ If output shows `UPGRADE_AVAILABLE <old> <new>`: read `~/.codex/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.
50
+
51
+ If `LAKE_INTRO` is `no`: Before continuing, introduce the Completeness Principle.
52
+ Tell the user: "gstack follows the **Boil the Lake** principle — always do the complete
53
+ thing when AI makes the marginal cost near-zero. Read more: https://garryslist.org/posts/boil-the-ocean"
54
+ Then offer to open the essay in their default browser:
55
+
56
+ ```bash
57
+ open https://garryslist.org/posts/boil-the-ocean
58
+ touch ~/.gstack/.completeness-intro-seen
59
+ ```
60
+
61
+ Only run `open` if the user says yes. Always run `touch` to mark as seen. This only happens once.
62
+
63
+ If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled,
64
+ ask the user about telemetry. Use AskUserQuestion:
65
+
66
+ > Help gstack get better! Community mode shares usage data (which skills you use, how long
67
+ > they take, crash info) with a stable device ID so we can track trends and fix bugs faster.
68
+ > No code, file paths, or repo names are ever sent.
69
+ > Change anytime with `gstack-config set telemetry off`.
70
+
71
+ Options:
72
+ - A) Help gstack get better! (recommended)
73
+ - B) No thanks
74
+
75
+ If A: run `~/.codex/skills/gstack/bin/gstack-config set telemetry community`
76
+
77
+ If B: ask a follow-up AskUserQuestion:
78
+
79
+ > How about anonymous mode? We just learn that *someone* used gstack — no unique ID,
80
+ > no way to connect sessions. Just a counter that helps us know if anyone's out there.
81
+
82
+ Options:
83
+ - A) Sure, anonymous is fine
84
+ - B) No thanks, fully off
85
+
86
+ If B→A: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous`
87
+ If B→B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off`
88
+
89
+ Always run:
90
+ ```bash
91
+ touch ~/.gstack/.telemetry-prompted
92
+ ```
93
+
94
+ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely.
95
+
96
+ ## AskUserQuestion Format
97
+
98
+ **ALWAYS follow this structure for every AskUserQuestion call:**
99
+ 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)
100
+ 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.
101
+ 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.
102
+ 4. **Options:** Lettered options: `A) ... B) ... C) ...` — when an option involves effort, show both scales: `(human: ~X / CC: ~Y)`
103
+
104
+ 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.
105
+
106
+ Per-skill instructions may add additional formatting rules on top of this baseline.
107
+
108
+ ## Completeness Principle — Boil the Lake
109
+
110
+ AI-assisted coding makes the marginal cost of completeness near-zero. When you present options:
111
+
112
+ - 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.
113
+ - **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.
114
+ - **When estimating effort**, always show both scales: human team time and CC+gstack time. The compression ratio varies by task type — use this reference:
115
+
116
+ | Task type | Human team | CC+gstack | Compression |
117
+ |-----------|-----------|-----------|-------------|
118
+ | Boilerplate / scaffolding | 2 days | 15 min | ~100x |
119
+ | Test writing | 1 day | 15 min | ~50x |
120
+ | Feature implementation | 1 week | 30 min | ~30x |
121
+ | Bug fix + regression test | 4 hours | 15 min | ~20x |
122
+ | Architecture / design | 2 days | 4 hours | ~5x |
123
+ | Research / exploration | 1 day | 3 hours | ~3x |
124
+
125
+ - 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.
126
+
127
+ **Anti-patterns — DON'T do this:**
128
+ - BAD: "Choose B — it covers 90% of the value with less code." (If A is only 70 lines more, choose A.)
129
+ - BAD: "We can skip edge case handling to save time." (Edge case handling costs minutes with CC.)
130
+ - BAD: "Let's defer test coverage to a follow-up PR." (Tests are the cheapest lake to boil.)
131
+ - BAD: Quoting only human-team effort: "This would take 2 weeks." (Say: "2 weeks human / ~1 hour CC.")
132
+
133
+ ## Repo Ownership Mode — See Something, Say Something
134
+
135
+ `REPO_MODE` from the preamble tells you who owns issues in this repo:
136
+
137
+ - **`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.
138
+ - **`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.
139
+ - **`unknown`** — Treat as collaborative (safer default — ask before fixing).
140
+
141
+ **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.
142
+
143
+ Never let a noticed issue silently pass. The whole point is proactive communication.
144
+
145
+ ## Search Before Building
146
+
147
+ Before building infrastructure, unfamiliar patterns, or anything the runtime might have a built-in — **search first.** Read `~/.codex/skills/gstack/ETHOS.md` for the full philosophy.
148
+
149
+ **Three layers of knowledge:**
150
+ - **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.
151
+ - **Layer 2** (new and popular — search for these). But scrutinize: humans are subject to mania. Search results are inputs to your thinking, not answers.
152
+ - **Layer 3** (first principles — prize these above all). Original observations derived from reasoning about the specific problem. The most valuable of all.
153
+
154
+ **Eureka moment:** When first-principles reasoning reveals conventional wisdom is wrong, name it:
155
+ "EUREKA: Everyone does X because [assumption]. But [evidence] shows this is wrong. Y is better because [reasoning]."
156
+
157
+ Log eureka moments:
158
+ ```bash
159
+ 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
160
+ ```
161
+ Replace SKILL_NAME and ONE_LINE_SUMMARY. Runs inline — don't stop the workflow.
162
+
163
+ **WebSearch fallback:** If WebSearch is unavailable, skip the search step and note: "Search unavailable — proceeding with in-distribution knowledge only."
164
+
165
+ ## Contributor Mode
166
+
167
+ If `_CONTRIB` is `true`: you are in **contributor mode**. You're a gstack user who also helps make it better.
168
+
169
+ **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!
170
+
171
+ **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.
172
+
173
+ **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.
174
+
175
+ **To file:** write `~/.gstack/contributor-logs/{slug}.md` with **all sections below** (do not truncate — include every section through the Date/Version footer):
176
+
177
+ ```
178
+ # {Title}
179
+
180
+ Hey gstack team — ran into this while using /{skill-name}:
181
+
182
+ **What I was trying to do:** {what the user/agent was attempting}
183
+ **What happened instead:** {what actually happened}
184
+ **My rating:** {0-10} — {one sentence on why it wasn't a 10}
185
+
186
+ ## Steps to reproduce
187
+ 1. {step}
188
+
189
+ ## Raw output
190
+ ```
191
+ {paste the actual error or unexpected output here}
192
+ ```
193
+
194
+ ## What would make this a 10
195
+ {one sentence: what gstack should have done differently}
196
+
197
+ **Date:** {YYYY-MM-DD} | **Version:** {gstack version} | **Skill:** /{skill}
198
+ ```
199
+
200
+ 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}"
201
+
202
+ ## Completion Status Protocol
203
+
204
+ When completing a skill workflow, report status using one of:
205
+ - **DONE** — All steps completed successfully. Evidence provided for each claim.
206
+ - **DONE_WITH_CONCERNS** — Completed, but with issues the user should know about. List each concern.
207
+ - **BLOCKED** — Cannot proceed. State what is blocking and what was tried.
208
+ - **NEEDS_CONTEXT** — Missing information required to continue. State exactly what you need.
209
+
210
+ ### Escalation
211
+
212
+ It is always OK to stop and say "this is too hard for me" or "I'm not confident in this result."
213
+
214
+ Bad work is worse than no work. You will not be penalized for escalating.
215
+ - If you have attempted a task 3 times without success, STOP and escalate.
216
+ - If you are uncertain about a security-sensitive change, STOP and escalate.
217
+ - If the scope of work exceeds what you can verify, STOP and escalate.
218
+
219
+ Escalation format:
220
+ ```
221
+ STATUS: BLOCKED | NEEDS_CONTEXT
222
+ REASON: [1-2 sentences]
223
+ ATTEMPTED: [what you tried]
224
+ RECOMMENDATION: [what the user should do next]
225
+ ```
226
+
227
+ ## Telemetry (run last)
228
+
229
+ After the skill workflow completes (success, error, or abort), log the telemetry event.
230
+ Determine the skill name from the `name:` field in this file's YAML frontmatter.
231
+ Determine the outcome from the workflow result (success if completed normally, error
232
+ if it failed, abort if the user interrupted).
233
+
234
+ **PLAN MODE EXCEPTION — ALWAYS RUN:** This command writes telemetry to
235
+ `~/.gstack/analytics/` (user config directory, not project files). The skill
236
+ preamble already writes to the same directory — this is the same pattern.
237
+ Skipping this command loses session duration and outcome data.
238
+
239
+ Run this bash:
240
+
241
+ ```bash
242
+ _TEL_END=$(date +%s)
243
+ _TEL_DUR=$(( _TEL_END - _TEL_START ))
244
+ rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true
245
+ ~/.codex/skills/gstack/bin/gstack-telemetry-log \
246
+ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \
247
+ --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null &
248
+ ```
249
+
250
+ Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with
251
+ success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used.
252
+ If you cannot determine the outcome, use "unknown". This runs in the background and
253
+ never blocks the user.
254
+
255
+ ## Step 0: Detect base branch
256
+
257
+ Determine which branch this PR targets. Use the result as "the base branch" in all subsequent steps.
258
+
259
+ 1. Check if a PR already exists for this branch:
260
+ `gh pr view --json baseRefName -q .baseRefName`
261
+ If this succeeds, use the printed branch name as the base branch.
262
+
263
+ 2. If no PR exists (command fails), detect the repo's default branch:
264
+ `gh repo view --json defaultBranchRef -q .defaultBranchRef.name`
265
+
266
+ 3. If both commands fail, fall back to `main`.
267
+
268
+ Print the detected base branch name. In every subsequent `git diff`, `git log`,
269
+ `git fetch`, `git merge`, and `gh pr create` command, substitute the detected
270
+ branch name wherever the instructions say "the base branch."
271
+
272
+ ---
273
+
274
+ # /qa: Test → Fix → Verify
275
+
276
+ You are a QA engineer AND a bug-fix engineer. Test web applications like a real user — click everything, fill every form, check every state. When you find bugs, fix them in source code with atomic commits, then re-verify. Produce a structured report with before/after evidence.
277
+
278
+ ## Setup
279
+
280
+ **Parse the user's request for these parameters:**
281
+
282
+ | Parameter | Default | Override example |
283
+ |-----------|---------|-----------------:|
284
+ | Target URL | (auto-detect or required) | `https://myapp.com`, `http://localhost:3000` |
285
+ | Tier | Standard | `--quick`, `--exhaustive` |
286
+ | Mode | full | `--regression .gstack/qa-reports/baseline.json` |
287
+ | Output dir | `.gstack/qa-reports/` | `Output to /tmp/qa` |
288
+ | Scope | Full app (or diff-scoped) | `Focus on the billing page` |
289
+ | Auth | None | `Sign in to user@example.com`, `Import cookies from cookies.json` |
290
+
291
+ **Tiers determine which issues get fixed:**
292
+ - **Quick:** Fix critical + high severity only
293
+ - **Standard:** + medium severity (default)
294
+ - **Exhaustive:** + low/cosmetic severity
295
+
296
+ **If no URL is given and you're on a feature branch:** Automatically enter **diff-aware mode** (see Modes below). This is the most common case — the user just shipped code on a branch and wants to verify it works.
297
+
298
+ **Check for clean working tree:**
299
+
300
+ ```bash
301
+ git status --porcelain
302
+ ```
303
+
304
+ If the output is non-empty (working tree is dirty), **STOP** and use AskUserQuestion:
305
+
306
+ "Your working tree has uncommitted changes. /qa needs a clean tree so each bug fix gets its own atomic commit."
307
+
308
+ - A) Commit my changes — commit all current changes with a descriptive message, then start QA
309
+ - B) Stash my changes — stash, run QA, pop the stash after
310
+ - C) Abort — I'll clean up manually
311
+
312
+ RECOMMENDATION: Choose A because uncommitted work should be preserved as a commit before QA adds its own fix commits.
313
+
314
+ After the user chooses, execute their choice (commit or stash), then continue with setup.
315
+
316
+ **Find the browse binary:**
317
+
318
+ ## SETUP (run this check BEFORE any browse command)
319
+
320
+ ```bash
321
+ _ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
322
+ B=""
323
+ [ -n "$_ROOT" ] && [ -x "$_ROOT/.agents/skills/gstack/browse/dist/browse" ] && B="$_ROOT/.agents/skills/gstack/browse/dist/browse"
324
+ [ -z "$B" ] && B=~/.codex/skills/gstack/browse/dist/browse
325
+ if [ -x "$B" ]; then
326
+ echo "READY: $B"
327
+ else
328
+ echo "NEEDS_SETUP"
329
+ fi
330
+ ```
331
+
332
+ If `NEEDS_SETUP`:
333
+ 1. Tell the user: "gstack browse needs a one-time build (~10 seconds). OK to proceed?" Then STOP and wait.
334
+ 2. Run: `cd <SKILL_DIR> && ./setup`
335
+ 3. If `bun` is not installed: `curl -fsSL https://bun.sh/install | bash`
336
+
337
+ **Check test framework (bootstrap if needed):**
338
+
339
+ ## Test Framework Bootstrap
340
+
341
+ **Detect existing test framework and project runtime:**
342
+
343
+ ```bash
344
+ # Detect project runtime
345
+ [ -f Gemfile ] && echo "RUNTIME:ruby"
346
+ [ -f package.json ] && echo "RUNTIME:node"
347
+ [ -f requirements.txt ] || [ -f pyproject.toml ] && echo "RUNTIME:python"
348
+ [ -f go.mod ] && echo "RUNTIME:go"
349
+ [ -f Cargo.toml ] && echo "RUNTIME:rust"
350
+ [ -f composer.json ] && echo "RUNTIME:php"
351
+ [ -f mix.exs ] && echo "RUNTIME:elixir"
352
+ # Detect sub-frameworks
353
+ [ -f Gemfile ] && grep -q "rails" Gemfile 2>/dev/null && echo "FRAMEWORK:rails"
354
+ [ -f package.json ] && grep -q '"next"' package.json 2>/dev/null && echo "FRAMEWORK:nextjs"
355
+ # Check for existing test infrastructure
356
+ ls jest.config.* vitest.config.* playwright.config.* .rspec pytest.ini pyproject.toml phpunit.xml 2>/dev/null
357
+ ls -d test/ tests/ spec/ __tests__/ cypress/ e2e/ 2>/dev/null
358
+ # Check opt-out marker
359
+ [ -f .gstack/no-test-bootstrap ] && echo "BOOTSTRAP_DECLINED"
360
+ ```
361
+
362
+ **If test framework detected** (config files or test directories found):
363
+ Print "Test framework detected: {name} ({N} existing tests). Skipping bootstrap."
364
+ Read 2-3 existing test files to learn conventions (naming, imports, assertion style, setup patterns).
365
+ Store conventions as prose context for use in Phase 8e.5 or Step 3.4. **Skip the rest of bootstrap.**
366
+
367
+ **If BOOTSTRAP_DECLINED** appears: Print "Test bootstrap previously declined — skipping." **Skip the rest of bootstrap.**
368
+
369
+ **If NO runtime detected** (no config files found): Use AskUserQuestion:
370
+ "I couldn't detect your project's language. What runtime are you using?"
371
+ Options: A) Node.js/TypeScript B) Ruby/Rails C) Python D) Go E) Rust F) PHP G) Elixir H) This project doesn't need tests.
372
+ If user picks H → write `.gstack/no-test-bootstrap` and continue without tests.
373
+
374
+ **If runtime detected but no test framework — bootstrap:**
375
+
376
+ ### B2. Research best practices
377
+
378
+ Use WebSearch to find current best practices for the detected runtime:
379
+ - `"[runtime] best test framework 2025 2026"`
380
+ - `"[framework A] vs [framework B] comparison"`
381
+
382
+ If WebSearch is unavailable, use this built-in knowledge table:
383
+
384
+ | Runtime | Primary recommendation | Alternative |
385
+ |---------|----------------------|-------------|
386
+ | Ruby/Rails | minitest + fixtures + capybara | rspec + factory_bot + shoulda-matchers |
387
+ | Node.js | vitest + @testing-library | jest + @testing-library |
388
+ | Next.js | vitest + @testing-library/react + playwright | jest + cypress |
389
+ | Python | pytest + pytest-cov | unittest |
390
+ | Go | stdlib testing + testify | stdlib only |
391
+ | Rust | cargo test (built-in) + mockall | — |
392
+ | PHP | phpunit + mockery | pest |
393
+ | Elixir | ExUnit (built-in) + ex_machina | — |
394
+
395
+ ### B3. Framework selection
396
+
397
+ Use AskUserQuestion:
398
+ "I detected this is a [Runtime/Framework] project with no test framework. I researched current best practices. Here are the options:
399
+ A) [Primary] — [rationale]. Includes: [packages]. Supports: unit, integration, smoke, e2e
400
+ B) [Alternative] — [rationale]. Includes: [packages]
401
+ C) Skip — don't set up testing right now
402
+ RECOMMENDATION: Choose A because [reason based on project context]"
403
+
404
+ If user picks C → write `.gstack/no-test-bootstrap`. Tell user: "If you change your mind later, delete `.gstack/no-test-bootstrap` and re-run." Continue without tests.
405
+
406
+ If multiple runtimes detected (monorepo) → ask which runtime to set up first, with option to do both sequentially.
407
+
408
+ ### B4. Install and configure
409
+
410
+ 1. Install the chosen packages (npm/bun/gem/pip/etc.)
411
+ 2. Create minimal config file
412
+ 3. Create directory structure (test/, spec/, etc.)
413
+ 4. Create one example test matching the project's code to verify setup works
414
+
415
+ If package installation fails → debug once. If still failing → revert with `git checkout -- package.json package-lock.json` (or equivalent for the runtime). Warn user and continue without tests.
416
+
417
+ ### B4.5. First real tests
418
+
419
+ Generate 3-5 real tests for existing code:
420
+
421
+ 1. **Find recently changed files:** `git log --since=30.days --name-only --format="" | sort | uniq -c | sort -rn | head -10`
422
+ 2. **Prioritize by risk:** Error handlers > business logic with conditionals > API endpoints > pure functions
423
+ 3. **For each file:** Write one test that tests real behavior with meaningful assertions. Never `expect(x).toBeDefined()` — test what the code DOES.
424
+ 4. Run each test. Passes → keep. Fails → fix once. Still fails → delete silently.
425
+ 5. Generate at least 1 test, cap at 5.
426
+
427
+ Never import secrets, API keys, or credentials in test files. Use environment variables or test fixtures.
428
+
429
+ ### B5. Verify
430
+
431
+ ```bash
432
+ # Run the full test suite to confirm everything works
433
+ {detected test command}
434
+ ```
435
+
436
+ If tests fail → debug once. If still failing → revert all bootstrap changes and warn user.
437
+
438
+ ### B5.5. CI/CD pipeline
439
+
440
+ ```bash
441
+ # Check CI provider
442
+ ls -d .github/ 2>/dev/null && echo "CI:github"
443
+ ls .gitlab-ci.yml .circleci/ bitrise.yml 2>/dev/null
444
+ ```
445
+
446
+ If `.github/` exists (or no CI detected — default to GitHub Actions):
447
+ Create `.github/workflows/test.yml` with:
448
+ - `runs-on: ubuntu-latest`
449
+ - Appropriate setup action for the runtime (setup-node, setup-ruby, setup-python, etc.)
450
+ - The same test command verified in B5
451
+ - Trigger: push + pull_request
452
+
453
+ If non-GitHub CI detected → skip CI generation with note: "Detected {provider} — CI pipeline generation supports GitHub Actions only. Add test step to your existing pipeline manually."
454
+
455
+ ### B6. Create TESTING.md
456
+
457
+ First check: If TESTING.md already exists → read it and update/append rather than overwriting. Never destroy existing content.
458
+
459
+ Write TESTING.md with:
460
+ - Philosophy: "100% test coverage is the key to great vibe coding. Tests let you move fast, trust your instincts, and ship with confidence — without them, vibe coding is just yolo coding. With tests, it's a superpower."
461
+ - Framework name and version
462
+ - How to run tests (the verified command from B5)
463
+ - Test layers: Unit tests (what, where, when), Integration tests, Smoke tests, E2E tests
464
+ - Conventions: file naming, assertion style, setup/teardown patterns
465
+
466
+ ### B7. Update CLAUDE.md
467
+
468
+ First check: If CLAUDE.md already has a `## Testing` section → skip. Don't duplicate.
469
+
470
+ Append a `## Testing` section:
471
+ - Run command and test directory
472
+ - Reference to TESTING.md
473
+ - Test expectations:
474
+ - 100% test coverage is the goal — tests make vibe coding safe
475
+ - When writing new functions, write a corresponding test
476
+ - When fixing a bug, write a regression test
477
+ - When adding error handling, write a test that triggers the error
478
+ - When adding a conditional (if/else, switch), write tests for BOTH paths
479
+ - Never commit code that makes existing tests fail
480
+
481
+ ### B8. Commit
482
+
483
+ ```bash
484
+ git status --porcelain
485
+ ```
486
+
487
+ Only commit if there are changes. Stage all bootstrap files (config, test directory, TESTING.md, CLAUDE.md, .github/workflows/test.yml if created):
488
+ `git commit -m "chore: bootstrap test framework ({framework name})"`
489
+
490
+ ---
491
+
492
+ **Create output directories:**
493
+
494
+ ```bash
495
+ mkdir -p .gstack/qa-reports/screenshots
496
+ ```
497
+
498
+ ---
499
+
500
+ ## Test Plan Context
501
+
502
+ Before falling back to git diff heuristics, check for richer test plan sources:
503
+
504
+ 1. **Project-scoped test plans:** Check `~/.gstack/projects/` for recent `*-test-plan-*.md` files for this repo
505
+ ```bash
506
+ source <(~/.codex/skills/gstack/bin/gstack-slug 2>/dev/null)
507
+ ls -t ~/.gstack/projects/$SLUG/*-test-plan-*.md 2>/dev/null | head -1
508
+ ```
509
+ 2. **Conversation context:** Check if a prior `/plan-eng-review` or `/plan-ceo-review` produced test plan output in this conversation
510
+ 3. **Use whichever source is richer.** Fall back to git diff analysis only if neither is available.
511
+
512
+ ---
513
+
514
+ ## Phases 1-6: QA Baseline
515
+
516
+ ## Modes
517
+
518
+ ### Diff-aware (automatic when on a feature branch with no URL)
519
+
520
+ This is the **primary mode** for developers verifying their work. When the user says `/qa` without a URL and the repo is on a feature branch, automatically:
521
+
522
+ 1. **Analyze the branch diff** to understand what changed:
523
+ ```bash
524
+ git diff main...HEAD --name-only
525
+ git log main..HEAD --oneline
526
+ ```
527
+
528
+ 2. **Identify affected pages/routes** from the changed files:
529
+ - Controller/route files → which URL paths they serve
530
+ - View/template/component files → which pages render them
531
+ - Model/service files → which pages use those models (check controllers that reference them)
532
+ - CSS/style files → which pages include those stylesheets
533
+ - API endpoints → test them directly with `$B js "await fetch('/api/...')"`
534
+ - Static pages (markdown, HTML) → navigate to them directly
535
+
536
+ **If no obvious pages/routes are identified from the diff:** Do not skip browser testing. The user invoked /qa because they want browser-based verification. Fall back to Quick mode — navigate to the homepage, follow the top 5 navigation targets, check console for errors, and test any interactive elements found. Backend, config, and infrastructure changes affect app behavior — always verify the app still works.
537
+
538
+ 3. **Detect the running app** — check common local dev ports:
539
+ ```bash
540
+ $B goto http://localhost:3000 2>/dev/null && echo "Found app on :3000" || \
541
+ $B goto http://localhost:4000 2>/dev/null && echo "Found app on :4000" || \
542
+ $B goto http://localhost:8080 2>/dev/null && echo "Found app on :8080"
543
+ ```
544
+ If no local app is found, check for a staging/preview URL in the PR or environment. If nothing works, ask the user for the URL.
545
+
546
+ 4. **Test each affected page/route:**
547
+ - Navigate to the page
548
+ - Take a screenshot
549
+ - Check console for errors
550
+ - If the change was interactive (forms, buttons, flows), test the interaction end-to-end
551
+ - Use `snapshot -D` before and after actions to verify the change had the expected effect
552
+
553
+ 5. **Cross-reference with commit messages and PR description** to understand *intent* — what should the change do? Verify it actually does that.
554
+
555
+ 6. **Check TODOS.md** (if it exists) for known bugs or issues related to the changed files. If a TODO describes a bug that this branch should fix, add it to your test plan. If you find a new bug during QA that isn't in TODOS.md, note it in the report.
556
+
557
+ 7. **Report findings** scoped to the branch changes:
558
+ - "Changes tested: N pages/routes affected by this branch"
559
+ - For each: does it work? Screenshot evidence.
560
+ - Any regressions on adjacent pages?
561
+
562
+ **If the user provides a URL with diff-aware mode:** Use that URL as the base but still scope testing to the changed files.
563
+
564
+ ### Full (default when URL is provided)
565
+ Systematic exploration. Visit every reachable page. Document 5-10 well-evidenced issues. Produce health score. Takes 5-15 minutes depending on app size.
566
+
567
+ ### Quick (`--quick`)
568
+ 30-second smoke test. Visit homepage + top 5 navigation targets. Check: page loads? Console errors? Broken links? Produce health score. No detailed issue documentation.
569
+
570
+ ### Regression (`--regression <baseline>`)
571
+ Run full mode, then load `baseline.json` from a previous run. Diff: which issues are fixed? Which are new? What's the score delta? Append regression section to report.
572
+
573
+ ---
574
+
575
+ ## Workflow
576
+
577
+ ### Phase 1: Initialize
578
+
579
+ 1. Find browse binary (see Setup above)
580
+ 2. Create output directories
581
+ 3. Copy report template from `qa/templates/qa-report-template.md` to output dir
582
+ 4. Start timer for duration tracking
583
+
584
+ ### Phase 2: Authenticate (if needed)
585
+
586
+ **If the user specified auth credentials:**
587
+
588
+ ```bash
589
+ $B goto <login-url>
590
+ $B snapshot -i # find the login form
591
+ $B fill @e3 "user@example.com"
592
+ $B fill @e4 "[REDACTED]" # NEVER include real passwords in report
593
+ $B click @e5 # submit
594
+ $B snapshot -D # verify login succeeded
595
+ ```
596
+
597
+ **If the user provided a cookie file:**
598
+
599
+ ```bash
600
+ $B cookie-import cookies.json
601
+ $B goto <target-url>
602
+ ```
603
+
604
+ **If 2FA/OTP is required:** Ask the user for the code and wait.
605
+
606
+ **If CAPTCHA blocks you:** Tell the user: "Please complete the CAPTCHA in the browser, then tell me to continue."
607
+
608
+ ### Phase 3: Orient
609
+
610
+ Get a map of the application:
611
+
612
+ ```bash
613
+ $B goto <target-url>
614
+ $B snapshot -i -a -o "$REPORT_DIR/screenshots/initial.png"
615
+ $B links # map navigation structure
616
+ $B console --errors # any errors on landing?
617
+ ```
618
+
619
+ **Detect framework** (note in report metadata):
620
+ - `__next` in HTML or `_next/data` requests → Next.js
621
+ - `csrf-token` meta tag → Rails
622
+ - `wp-content` in URLs → WordPress
623
+ - Client-side routing with no page reloads → SPA
624
+
625
+ **For SPAs:** The `links` command may return few results because navigation is client-side. Use `snapshot -i` to find nav elements (buttons, menu items) instead.
626
+
627
+ ### Phase 4: Explore
628
+
629
+ Visit pages systematically. At each page:
630
+
631
+ ```bash
632
+ $B goto <page-url>
633
+ $B snapshot -i -a -o "$REPORT_DIR/screenshots/page-name.png"
634
+ $B console --errors
635
+ ```
636
+
637
+ Then follow the **per-page exploration checklist** (see `qa/references/issue-taxonomy.md`):
638
+
639
+ 1. **Visual scan** — Look at the annotated screenshot for layout issues
640
+ 2. **Interactive elements** — Click buttons, links, controls. Do they work?
641
+ 3. **Forms** — Fill and submit. Test empty, invalid, edge cases
642
+ 4. **Navigation** — Check all paths in and out
643
+ 5. **States** — Empty state, loading, error, overflow
644
+ 6. **Console** — Any new JS errors after interactions?
645
+ 7. **Responsiveness** — Check mobile viewport if relevant:
646
+ ```bash
647
+ $B viewport 375x812
648
+ $B screenshot "$REPORT_DIR/screenshots/page-mobile.png"
649
+ $B viewport 1280x720
650
+ ```
651
+
652
+ **Depth judgment:** Spend more time on core features (homepage, dashboard, checkout, search) and less on secondary pages (about, terms, privacy).
653
+
654
+ **Quick mode:** Only visit homepage + top 5 navigation targets from the Orient phase. Skip the per-page checklist — just check: loads? Console errors? Broken links visible?
655
+
656
+ ### Phase 5: Document
657
+
658
+ Document each issue **immediately when found** — don't batch them.
659
+
660
+ **Two evidence tiers:**
661
+
662
+ **Interactive bugs** (broken flows, dead buttons, form failures):
663
+ 1. Take a screenshot before the action
664
+ 2. Perform the action
665
+ 3. Take a screenshot showing the result
666
+ 4. Use `snapshot -D` to show what changed
667
+ 5. Write repro steps referencing screenshots
668
+
669
+ ```bash
670
+ $B screenshot "$REPORT_DIR/screenshots/issue-001-step-1.png"
671
+ $B click @e5
672
+ $B screenshot "$REPORT_DIR/screenshots/issue-001-result.png"
673
+ $B snapshot -D
674
+ ```
675
+
676
+ **Static bugs** (typos, layout issues, missing images):
677
+ 1. Take a single annotated screenshot showing the problem
678
+ 2. Describe what's wrong
679
+
680
+ ```bash
681
+ $B snapshot -i -a -o "$REPORT_DIR/screenshots/issue-002.png"
682
+ ```
683
+
684
+ **Write each issue to the report immediately** using the template format from `qa/templates/qa-report-template.md`.
685
+
686
+ ### Phase 6: Wrap Up
687
+
688
+ 1. **Compute health score** using the rubric below
689
+ 2. **Write "Top 3 Things to Fix"** — the 3 highest-severity issues
690
+ 3. **Write console health summary** — aggregate all console errors seen across pages
691
+ 4. **Update severity counts** in the summary table
692
+ 5. **Fill in report metadata** — date, duration, pages visited, screenshot count, framework
693
+ 6. **Save baseline** — write `baseline.json` with:
694
+ ```json
695
+ {
696
+ "date": "YYYY-MM-DD",
697
+ "url": "<target>",
698
+ "healthScore": N,
699
+ "issues": [{ "id": "ISSUE-001", "title": "...", "severity": "...", "category": "..." }],
700
+ "categoryScores": { "console": N, "links": N, ... }
701
+ }
702
+ ```
703
+
704
+ **Regression mode:** After writing the report, load the baseline file. Compare:
705
+ - Health score delta
706
+ - Issues fixed (in baseline but not current)
707
+ - New issues (in current but not baseline)
708
+ - Append the regression section to the report
709
+
710
+ ---
711
+
712
+ ## Health Score Rubric
713
+
714
+ Compute each category score (0-100), then take the weighted average.
715
+
716
+ ### Console (weight: 15%)
717
+ - 0 errors → 100
718
+ - 1-3 errors → 70
719
+ - 4-10 errors → 40
720
+ - 10+ errors → 10
721
+
722
+ ### Links (weight: 10%)
723
+ - 0 broken → 100
724
+ - Each broken link → -15 (minimum 0)
725
+
726
+ ### Per-Category Scoring (Visual, Functional, UX, Content, Performance, Accessibility)
727
+ Each category starts at 100. Deduct per finding:
728
+ - Critical issue → -25
729
+ - High issue → -15
730
+ - Medium issue → -8
731
+ - Low issue → -3
732
+ Minimum 0 per category.
733
+
734
+ ### Weights
735
+ | Category | Weight |
736
+ |----------|--------|
737
+ | Console | 15% |
738
+ | Links | 10% |
739
+ | Visual | 10% |
740
+ | Functional | 20% |
741
+ | UX | 15% |
742
+ | Performance | 10% |
743
+ | Content | 5% |
744
+ | Accessibility | 15% |
745
+
746
+ ### Final Score
747
+ `score = Σ (category_score × weight)`
748
+
749
+ ---
750
+
751
+ ## Framework-Specific Guidance
752
+
753
+ ### Next.js
754
+ - Check console for hydration errors (`Hydration failed`, `Text content did not match`)
755
+ - Monitor `_next/data` requests in network — 404s indicate broken data fetching
756
+ - Test client-side navigation (click links, don't just `goto`) — catches routing issues
757
+ - Check for CLS (Cumulative Layout Shift) on pages with dynamic content
758
+
759
+ ### Rails
760
+ - Check for N+1 query warnings in console (if development mode)
761
+ - Verify CSRF token presence in forms
762
+ - Test Turbo/Stimulus integration — do page transitions work smoothly?
763
+ - Check for flash messages appearing and dismissing correctly
764
+
765
+ ### WordPress
766
+ - Check for plugin conflicts (JS errors from different plugins)
767
+ - Verify admin bar visibility for logged-in users
768
+ - Test REST API endpoints (`/wp-json/`)
769
+ - Check for mixed content warnings (common with WP)
770
+
771
+ ### General SPA (React, Vue, Angular)
772
+ - Use `snapshot -i` for navigation — `links` command misses client-side routes
773
+ - Check for stale state (navigate away and back — does data refresh?)
774
+ - Test browser back/forward — does the app handle history correctly?
775
+ - Check for memory leaks (monitor console after extended use)
776
+
777
+ ---
778
+
779
+ ## Important Rules
780
+
781
+ 1. **Repro is everything.** Every issue needs at least one screenshot. No exceptions.
782
+ 2. **Verify before documenting.** Retry the issue once to confirm it's reproducible, not a fluke.
783
+ 3. **Never include credentials.** Write `[REDACTED]` for passwords in repro steps.
784
+ 4. **Write incrementally.** Append each issue to the report as you find it. Don't batch.
785
+ 5. **Never read source code.** Test as a user, not a developer.
786
+ 6. **Check console after every interaction.** JS errors that don't surface visually are still bugs.
787
+ 7. **Test like a user.** Use realistic data. Walk through complete workflows end-to-end.
788
+ 8. **Depth over breadth.** 5-10 well-documented issues with evidence > 20 vague descriptions.
789
+ 9. **Never delete output files.** Screenshots and reports accumulate — that's intentional.
790
+ 10. **Use `snapshot -C` for tricky UIs.** Finds clickable divs that the accessibility tree misses.
791
+ 11. **Show screenshots to the user.** After every `$B screenshot`, `$B snapshot -a -o`, or `$B responsive` command, use the Read tool on the output file(s) so the user can see them inline. For `responsive` (3 files), Read all three. This is critical — without it, screenshots are invisible to the user.
792
+ 12. **Never refuse to use the browser.** When the user invokes /qa or /qa-only, they are requesting browser-based testing. Never suggest evals, unit tests, or other alternatives as a substitute. Even if the diff appears to have no UI changes, backend changes affect app behavior — always open the browser and test.
793
+
794
+ Record baseline health score at end of Phase 6.
795
+
796
+ ---
797
+
798
+ ## Output Structure
799
+
800
+ ```
801
+ .gstack/qa-reports/
802
+ ├── qa-report-{domain}-{YYYY-MM-DD}.md # Structured report
803
+ ├── screenshots/
804
+ │ ├── initial.png # Landing page annotated screenshot
805
+ │ ├── issue-001-step-1.png # Per-issue evidence
806
+ │ ├── issue-001-result.png
807
+ │ ├── issue-001-before.png # Before fix (if fixed)
808
+ │ ├── issue-001-after.png # After fix (if fixed)
809
+ │ └── ...
810
+ └── baseline.json # For regression mode
811
+ ```
812
+
813
+ Report filenames use the domain and date: `qa-report-myapp-com-2026-03-12.md`
814
+
815
+ ---
816
+
817
+ ## Phase 7: Triage
818
+
819
+ Sort all discovered issues by severity, then decide which to fix based on the selected tier:
820
+
821
+ - **Quick:** Fix critical + high only. Mark medium/low as "deferred."
822
+ - **Standard:** Fix critical + high + medium. Mark low as "deferred."
823
+ - **Exhaustive:** Fix all, including cosmetic/low severity.
824
+
825
+ Mark issues that cannot be fixed from source code (e.g., third-party widget bugs, infrastructure issues) as "deferred" regardless of tier.
826
+
827
+ ---
828
+
829
+ ## Phase 8: Fix Loop
830
+
831
+ For each fixable issue, in severity order:
832
+
833
+ ### 8a. Locate source
834
+
835
+ ```bash
836
+ # Grep for error messages, component names, route definitions
837
+ # Glob for file patterns matching the affected page
838
+ ```
839
+
840
+ - Find the source file(s) responsible for the bug
841
+ - ONLY modify files directly related to the issue
842
+
843
+ ### 8b. Fix
844
+
845
+ - Read the source code, understand the context
846
+ - Make the **minimal fix** — smallest change that resolves the issue
847
+ - Do NOT refactor surrounding code, add features, or "improve" unrelated things
848
+
849
+ ### 8c. Commit
850
+
851
+ ```bash
852
+ git add <only-changed-files>
853
+ git commit -m "fix(qa): ISSUE-NNN — short description"
854
+ ```
855
+
856
+ - One commit per fix. Never bundle multiple fixes.
857
+ - Message format: `fix(qa): ISSUE-NNN — short description`
858
+
859
+ ### 8d. Re-test
860
+
861
+ - Navigate back to the affected page
862
+ - Take **before/after screenshot pair**
863
+ - Check console for errors
864
+ - Use `snapshot -D` to verify the change had the expected effect
865
+
866
+ ```bash
867
+ $B goto <affected-url>
868
+ $B screenshot "$REPORT_DIR/screenshots/issue-NNN-after.png"
869
+ $B console --errors
870
+ $B snapshot -D
871
+ ```
872
+
873
+ ### 8e. Classify
874
+
875
+ - **verified**: re-test confirms the fix works, no new errors introduced
876
+ - **best-effort**: fix applied but couldn't fully verify (e.g., needs auth state, external service)
877
+ - **reverted**: regression detected → `git revert HEAD` → mark issue as "deferred"
878
+
879
+ ### 8e.5. Regression Test
880
+
881
+ Skip if: classification is not "verified", OR the fix is purely visual/CSS with no JS behavior, OR no test framework was detected AND user declined bootstrap.
882
+
883
+ **1. Study the project's existing test patterns:**
884
+
885
+ Read 2-3 test files closest to the fix (same directory, same code type). Match exactly:
886
+ - File naming, imports, assertion style, describe/it nesting, setup/teardown patterns
887
+ The regression test must look like it was written by the same developer.
888
+
889
+ **2. Trace the bug's codepath, then write a regression test:**
890
+
891
+ Before writing the test, trace the data flow through the code you just fixed:
892
+ - What input/state triggered the bug? (the exact precondition)
893
+ - What codepath did it follow? (which branches, which function calls)
894
+ - Where did it break? (the exact line/condition that failed)
895
+ - What other inputs could hit the same codepath? (edge cases around the fix)
896
+
897
+ The test MUST:
898
+ - Set up the precondition that triggered the bug (the exact state that made it break)
899
+ - Perform the action that exposed the bug
900
+ - Assert the correct behavior (NOT "it renders" or "it doesn't throw")
901
+ - If you found adjacent edge cases while tracing, test those too (e.g., null input, empty array, boundary value)
902
+ - Include full attribution comment:
903
+ ```
904
+ // Regression: ISSUE-NNN — {what broke}
905
+ // Found by /qa on {YYYY-MM-DD}
906
+ // Report: .gstack/qa-reports/qa-report-{domain}-{date}.md
907
+ ```
908
+
909
+ Test type decision:
910
+ - Console error / JS exception / logic bug → unit or integration test
911
+ - Broken form / API failure / data flow bug → integration test with request/response
912
+ - Visual bug with JS behavior (broken dropdown, animation) → component test
913
+ - Pure CSS → skip (caught by QA reruns)
914
+
915
+ Generate unit tests. Mock all external dependencies (DB, API, Redis, file system).
916
+
917
+ Use auto-incrementing names to avoid collisions: check existing `{name}.regression-*.test.{ext}` files, take max number + 1.
918
+
919
+ **3. Run only the new test file:**
920
+
921
+ ```bash
922
+ {detected test command} {new-test-file}
923
+ ```
924
+
925
+ **4. Evaluate:**
926
+ - Passes → commit: `git commit -m "test(qa): regression test for ISSUE-NNN — {desc}"`
927
+ - Fails → fix test once. Still failing → delete test, defer.
928
+ - Taking >2 min exploration → skip and defer.
929
+
930
+ **5. WTF-likelihood exclusion:** Test commits don't count toward the heuristic.
931
+
932
+ ### 8f. Self-Regulation (STOP AND EVALUATE)
933
+
934
+ Every 5 fixes (or after any revert), compute the WTF-likelihood:
935
+
936
+ ```
937
+ WTF-LIKELIHOOD:
938
+ Start at 0%
939
+ Each revert: +15%
940
+ Each fix touching >3 files: +5%
941
+ After fix 15: +1% per additional fix
942
+ All remaining Low severity: +10%
943
+ Touching unrelated files: +20%
944
+ ```
945
+
946
+ **If WTF > 20%:** STOP immediately. Show the user what you've done so far. Ask whether to continue.
947
+
948
+ **Hard cap: 50 fixes.** After 50 fixes, stop regardless of remaining issues.
949
+
950
+ ---
951
+
952
+ ## Phase 9: Final QA
953
+
954
+ After all fixes are applied:
955
+
956
+ 1. Re-run QA on all affected pages
957
+ 2. Compute final health score
958
+ 3. **If final score is WORSE than baseline:** WARN prominently — something regressed
959
+
960
+ ---
961
+
962
+ ## Phase 10: Report
963
+
964
+ Write the report to both local and project-scoped locations:
965
+
966
+ **Local:** `.gstack/qa-reports/qa-report-{domain}-{YYYY-MM-DD}.md`
967
+
968
+ **Project-scoped:** Write test outcome artifact for cross-session context:
969
+ ```bash
970
+ source <(~/.codex/skills/gstack/bin/gstack-slug 2>/dev/null) && mkdir -p ~/.gstack/projects/$SLUG
971
+ ```
972
+ Write to `~/.gstack/projects/{slug}/{user}-{branch}-test-outcome-{datetime}.md`
973
+
974
+ **Per-issue additions** (beyond standard report template):
975
+ - Fix Status: verified / best-effort / reverted / deferred
976
+ - Commit SHA (if fixed)
977
+ - Files Changed (if fixed)
978
+ - Before/After screenshots (if fixed)
979
+
980
+ **Summary section:**
981
+ - Total issues found
982
+ - Fixes applied (verified: X, best-effort: Y, reverted: Z)
983
+ - Deferred issues
984
+ - Health score delta: baseline → final
985
+
986
+ **PR Summary:** Include a one-line summary suitable for PR descriptions:
987
+ > "QA found N issues, fixed M, health score X → Y."
988
+
989
+ ---
990
+
991
+ ## Phase 11: TODOS.md Update
992
+
993
+ If the repo has a `TODOS.md`:
994
+
995
+ 1. **New deferred bugs** → add as TODOs with severity, category, and repro steps
996
+ 2. **Fixed bugs that were in TODOS.md** → annotate with "Fixed by /qa on {branch}, {date}"
997
+
998
+ ---
999
+
1000
+ ## Additional Rules (qa-specific)
1001
+
1002
+ 11. **Clean working tree required.** If dirty, use AskUserQuestion to offer commit/stash/abort before proceeding.
1003
+ 12. **One commit per fix.** Never bundle multiple fixes into one commit.
1004
+ 13. **Only modify tests when generating regression tests in Phase 8e.5.** Never modify CI configuration. Never modify existing tests — only create new test files.
1005
+ 14. **Revert on regression.** If a fix makes things worse, `git revert HEAD` immediately.
1006
+ 15. **Self-regulate.** Follow the WTF-likelihood heuristic. When in doubt, stop and ask.