@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,704 @@
1
+ ---
2
+ name: review
3
+ description: |
4
+ Pre-landing PR review. Analyzes diff against the base branch for SQL safety, LLM trust
5
+ boundary violations, conditional side effects, and other structural issues. Use when
6
+ asked to "review this PR", "code review", "pre-landing review", or "check my diff".
7
+ Proactively suggest when the user is about to merge or land code changes.
8
+ ---
9
+ <!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->
10
+ <!-- Regenerate: bun run gen:skill-docs -->
11
+
12
+ ## Preamble (run first)
13
+
14
+ ```bash
15
+ _UPD=$(~/.codex/skills/gstack/bin/gstack-update-check 2>/dev/null || .agents/skills/gstack/bin/gstack-update-check 2>/dev/null || true)
16
+ [ -n "$_UPD" ] && echo "$_UPD" || true
17
+ mkdir -p ~/.gstack/sessions
18
+ touch ~/.gstack/sessions/"$PPID"
19
+ _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ')
20
+ find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true
21
+ _CONTRIB=$(~/.codex/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true)
22
+ _PROACTIVE=$(~/.codex/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true")
23
+ _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
24
+ echo "BRANCH: $_BRANCH"
25
+ echo "PROACTIVE: $_PROACTIVE"
26
+ source <(~/.codex/skills/gstack/bin/gstack-repo-mode 2>/dev/null) || true
27
+ REPO_MODE=${REPO_MODE:-unknown}
28
+ echo "REPO_MODE: $REPO_MODE"
29
+ _LAKE_SEEN=$([ -f ~/.gstack/.completeness-intro-seen ] && echo "yes" || echo "no")
30
+ echo "LAKE_INTRO: $_LAKE_SEEN"
31
+ _TEL=$(~/.codex/skills/gstack/bin/gstack-config get telemetry 2>/dev/null || true)
32
+ _TEL_PROMPTED=$([ -f ~/.gstack/.telemetry-prompted ] && echo "yes" || echo "no")
33
+ _TEL_START=$(date +%s)
34
+ _SESSION_ID="$$-$(date +%s)"
35
+ echo "TELEMETRY: ${_TEL:-off}"
36
+ echo "TEL_PROMPTED: $_TEL_PROMPTED"
37
+ mkdir -p ~/.gstack/analytics
38
+ echo '{"skill":"review","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
39
+ 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
40
+ ```
41
+
42
+ If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills — only invoke
43
+ them when the user explicitly asks. The user opted out of proactive suggestions.
44
+
45
+ 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.
46
+
47
+ If `LAKE_INTRO` is `no`: Before continuing, introduce the Completeness Principle.
48
+ Tell the user: "gstack follows the **Boil the Lake** principle — always do the complete
49
+ thing when AI makes the marginal cost near-zero. Read more: https://garryslist.org/posts/boil-the-ocean"
50
+ Then offer to open the essay in their default browser:
51
+
52
+ ```bash
53
+ open https://garryslist.org/posts/boil-the-ocean
54
+ touch ~/.gstack/.completeness-intro-seen
55
+ ```
56
+
57
+ Only run `open` if the user says yes. Always run `touch` to mark as seen. This only happens once.
58
+
59
+ If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled,
60
+ ask the user about telemetry. Use AskUserQuestion:
61
+
62
+ > Help gstack get better! Community mode shares usage data (which skills you use, how long
63
+ > they take, crash info) with a stable device ID so we can track trends and fix bugs faster.
64
+ > No code, file paths, or repo names are ever sent.
65
+ > Change anytime with `gstack-config set telemetry off`.
66
+
67
+ Options:
68
+ - A) Help gstack get better! (recommended)
69
+ - B) No thanks
70
+
71
+ If A: run `~/.codex/skills/gstack/bin/gstack-config set telemetry community`
72
+
73
+ If B: ask a follow-up AskUserQuestion:
74
+
75
+ > How about anonymous mode? We just learn that *someone* used gstack — no unique ID,
76
+ > no way to connect sessions. Just a counter that helps us know if anyone's out there.
77
+
78
+ Options:
79
+ - A) Sure, anonymous is fine
80
+ - B) No thanks, fully off
81
+
82
+ If B→A: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous`
83
+ If B→B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off`
84
+
85
+ Always run:
86
+ ```bash
87
+ touch ~/.gstack/.telemetry-prompted
88
+ ```
89
+
90
+ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely.
91
+
92
+ ## AskUserQuestion Format
93
+
94
+ **ALWAYS follow this structure for every AskUserQuestion call:**
95
+ 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)
96
+ 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.
97
+ 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.
98
+ 4. **Options:** Lettered options: `A) ... B) ... C) ...` — when an option involves effort, show both scales: `(human: ~X / CC: ~Y)`
99
+
100
+ 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.
101
+
102
+ Per-skill instructions may add additional formatting rules on top of this baseline.
103
+
104
+ ## Completeness Principle — Boil the Lake
105
+
106
+ AI-assisted coding makes the marginal cost of completeness near-zero. When you present options:
107
+
108
+ - 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.
109
+ - **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.
110
+ - **When estimating effort**, always show both scales: human team time and CC+gstack time. The compression ratio varies by task type — use this reference:
111
+
112
+ | Task type | Human team | CC+gstack | Compression |
113
+ |-----------|-----------|-----------|-------------|
114
+ | Boilerplate / scaffolding | 2 days | 15 min | ~100x |
115
+ | Test writing | 1 day | 15 min | ~50x |
116
+ | Feature implementation | 1 week | 30 min | ~30x |
117
+ | Bug fix + regression test | 4 hours | 15 min | ~20x |
118
+ | Architecture / design | 2 days | 4 hours | ~5x |
119
+ | Research / exploration | 1 day | 3 hours | ~3x |
120
+
121
+ - 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.
122
+
123
+ **Anti-patterns — DON'T do this:**
124
+ - BAD: "Choose B — it covers 90% of the value with less code." (If A is only 70 lines more, choose A.)
125
+ - BAD: "We can skip edge case handling to save time." (Edge case handling costs minutes with CC.)
126
+ - BAD: "Let's defer test coverage to a follow-up PR." (Tests are the cheapest lake to boil.)
127
+ - BAD: Quoting only human-team effort: "This would take 2 weeks." (Say: "2 weeks human / ~1 hour CC.")
128
+
129
+ ## Repo Ownership Mode — See Something, Say Something
130
+
131
+ `REPO_MODE` from the preamble tells you who owns issues in this repo:
132
+
133
+ - **`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.
134
+ - **`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.
135
+ - **`unknown`** — Treat as collaborative (safer default — ask before fixing).
136
+
137
+ **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.
138
+
139
+ Never let a noticed issue silently pass. The whole point is proactive communication.
140
+
141
+ ## Search Before Building
142
+
143
+ 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.
144
+
145
+ **Three layers of knowledge:**
146
+ - **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.
147
+ - **Layer 2** (new and popular — search for these). But scrutinize: humans are subject to mania. Search results are inputs to your thinking, not answers.
148
+ - **Layer 3** (first principles — prize these above all). Original observations derived from reasoning about the specific problem. The most valuable of all.
149
+
150
+ **Eureka moment:** When first-principles reasoning reveals conventional wisdom is wrong, name it:
151
+ "EUREKA: Everyone does X because [assumption]. But [evidence] shows this is wrong. Y is better because [reasoning]."
152
+
153
+ Log eureka moments:
154
+ ```bash
155
+ 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
156
+ ```
157
+ Replace SKILL_NAME and ONE_LINE_SUMMARY. Runs inline — don't stop the workflow.
158
+
159
+ **WebSearch fallback:** If WebSearch is unavailable, skip the search step and note: "Search unavailable — proceeding with in-distribution knowledge only."
160
+
161
+ ## Contributor Mode
162
+
163
+ If `_CONTRIB` is `true`: you are in **contributor mode**. You're a gstack user who also helps make it better.
164
+
165
+ **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!
166
+
167
+ **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.
168
+
169
+ **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.
170
+
171
+ **To file:** write `~/.gstack/contributor-logs/{slug}.md` with **all sections below** (do not truncate — include every section through the Date/Version footer):
172
+
173
+ ```
174
+ # {Title}
175
+
176
+ Hey gstack team — ran into this while using /{skill-name}:
177
+
178
+ **What I was trying to do:** {what the user/agent was attempting}
179
+ **What happened instead:** {what actually happened}
180
+ **My rating:** {0-10} — {one sentence on why it wasn't a 10}
181
+
182
+ ## Steps to reproduce
183
+ 1. {step}
184
+
185
+ ## Raw output
186
+ ```
187
+ {paste the actual error or unexpected output here}
188
+ ```
189
+
190
+ ## What would make this a 10
191
+ {one sentence: what gstack should have done differently}
192
+
193
+ **Date:** {YYYY-MM-DD} | **Version:** {gstack version} | **Skill:** /{skill}
194
+ ```
195
+
196
+ 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}"
197
+
198
+ ## Completion Status Protocol
199
+
200
+ When completing a skill workflow, report status using one of:
201
+ - **DONE** — All steps completed successfully. Evidence provided for each claim.
202
+ - **DONE_WITH_CONCERNS** — Completed, but with issues the user should know about. List each concern.
203
+ - **BLOCKED** — Cannot proceed. State what is blocking and what was tried.
204
+ - **NEEDS_CONTEXT** — Missing information required to continue. State exactly what you need.
205
+
206
+ ### Escalation
207
+
208
+ It is always OK to stop and say "this is too hard for me" or "I'm not confident in this result."
209
+
210
+ Bad work is worse than no work. You will not be penalized for escalating.
211
+ - If you have attempted a task 3 times without success, STOP and escalate.
212
+ - If you are uncertain about a security-sensitive change, STOP and escalate.
213
+ - If the scope of work exceeds what you can verify, STOP and escalate.
214
+
215
+ Escalation format:
216
+ ```
217
+ STATUS: BLOCKED | NEEDS_CONTEXT
218
+ REASON: [1-2 sentences]
219
+ ATTEMPTED: [what you tried]
220
+ RECOMMENDATION: [what the user should do next]
221
+ ```
222
+
223
+ ## Telemetry (run last)
224
+
225
+ After the skill workflow completes (success, error, or abort), log the telemetry event.
226
+ Determine the skill name from the `name:` field in this file's YAML frontmatter.
227
+ Determine the outcome from the workflow result (success if completed normally, error
228
+ if it failed, abort if the user interrupted).
229
+
230
+ **PLAN MODE EXCEPTION — ALWAYS RUN:** This command writes telemetry to
231
+ `~/.gstack/analytics/` (user config directory, not project files). The skill
232
+ preamble already writes to the same directory — this is the same pattern.
233
+ Skipping this command loses session duration and outcome data.
234
+
235
+ Run this bash:
236
+
237
+ ```bash
238
+ _TEL_END=$(date +%s)
239
+ _TEL_DUR=$(( _TEL_END - _TEL_START ))
240
+ rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true
241
+ ~/.codex/skills/gstack/bin/gstack-telemetry-log \
242
+ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \
243
+ --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null &
244
+ ```
245
+
246
+ Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with
247
+ success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used.
248
+ If you cannot determine the outcome, use "unknown". This runs in the background and
249
+ never blocks the user.
250
+
251
+ ## Step 0: Detect base branch
252
+
253
+ Determine which branch this PR targets. Use the result as "the base branch" in all subsequent steps.
254
+
255
+ 1. Check if a PR already exists for this branch:
256
+ `gh pr view --json baseRefName -q .baseRefName`
257
+ If this succeeds, use the printed branch name as the base branch.
258
+
259
+ 2. If no PR exists (command fails), detect the repo's default branch:
260
+ `gh repo view --json defaultBranchRef -q .defaultBranchRef.name`
261
+
262
+ 3. If both commands fail, fall back to `main`.
263
+
264
+ Print the detected base branch name. In every subsequent `git diff`, `git log`,
265
+ `git fetch`, `git merge`, and `gh pr create` command, substitute the detected
266
+ branch name wherever the instructions say "the base branch."
267
+
268
+ ---
269
+
270
+ # Pre-Landing PR Review
271
+
272
+ You are running the `/review` workflow. Analyze the current branch's diff against the base branch for structural issues that tests don't catch.
273
+
274
+ ---
275
+
276
+ ## Step 1: Check branch
277
+
278
+ 1. Run `git branch --show-current` to get the current branch.
279
+ 2. If on the base branch, output: **"Nothing to review — you're on the base branch or have no changes against it."** and stop.
280
+ 3. Run `git fetch origin <base> --quiet && git diff origin/<base> --stat` to check if there's a diff. If no diff, output the same message and stop.
281
+
282
+ ---
283
+
284
+ ## Step 1.5: Scope Drift Detection
285
+
286
+ Before reviewing code quality, check: **did they build what was requested — nothing more, nothing less?**
287
+
288
+ 1. Read `TODOS.md` (if it exists). Read PR description (`gh pr view --json body --jq .body 2>/dev/null || true`).
289
+ Read commit messages (`git log origin/<base>..HEAD --oneline`).
290
+ **If no PR exists:** rely on commit messages and TODOS.md for stated intent — this is the common case since /review runs before /ship creates the PR.
291
+ 2. Identify the **stated intent** — what was this branch supposed to accomplish?
292
+ 3. Run `git diff origin/<base> --stat` and compare the files changed against the stated intent.
293
+ 4. Evaluate with skepticism:
294
+
295
+ **SCOPE CREEP detection:**
296
+ - Files changed that are unrelated to the stated intent
297
+ - New features or refactors not mentioned in the plan
298
+ - "While I was in there..." changes that expand blast radius
299
+
300
+ **MISSING REQUIREMENTS detection:**
301
+ - Requirements from TODOS.md/PR description not addressed in the diff
302
+ - Test coverage gaps for stated requirements
303
+ - Partial implementations (started but not finished)
304
+
305
+ 5. Output (before the main review begins):
306
+ ```
307
+ Scope Check: [CLEAN / DRIFT DETECTED / REQUIREMENTS MISSING]
308
+ Intent: <1-line summary of what was requested>
309
+ Delivered: <1-line summary of what the diff actually does>
310
+ [If drift: list each out-of-scope change]
311
+ [If missing: list each unaddressed requirement]
312
+ ```
313
+
314
+ 6. This is **INFORMATIONAL** — does not block the review. Proceed to Step 2.
315
+
316
+ ---
317
+
318
+ ## Step 2: Read the checklist
319
+
320
+ Read `.agents/skills/gstack/review/checklist.md`.
321
+
322
+ **If the file cannot be read, STOP and report the error.** Do not proceed without the checklist.
323
+
324
+ ---
325
+
326
+ ## Step 2.5: Check for Greptile review comments
327
+
328
+ Read `.agents/skills/gstack/review/greptile-triage.md` and follow the fetch, filter, classify, and **escalation detection** steps.
329
+
330
+ **If no PR exists, `gh` fails, API returns an error, or there are zero Greptile comments:** Skip this step silently. Greptile integration is additive — the review works without it.
331
+
332
+ **If Greptile comments are found:** Store the classifications (VALID & ACTIONABLE, VALID BUT ALREADY FIXED, FALSE POSITIVE, SUPPRESSED) — you will need them in Step 5.
333
+
334
+ ---
335
+
336
+ ## Step 3: Get the diff
337
+
338
+ Fetch the latest base branch to avoid false positives from stale local state:
339
+
340
+ ```bash
341
+ git fetch origin <base> --quiet
342
+ ```
343
+
344
+ Run `git diff origin/<base>` to get the full diff. This includes both committed and uncommitted changes against the latest base branch.
345
+
346
+ ---
347
+
348
+ ## Step 4: Two-pass review
349
+
350
+ Apply the checklist against the diff in two passes:
351
+
352
+ 1. **Pass 1 (CRITICAL):** SQL & Data Safety, Race Conditions & Concurrency, LLM Output Trust Boundary, Enum & Value Completeness
353
+ 2. **Pass 2 (INFORMATIONAL):** Conditional Side Effects, Magic Numbers & String Coupling, Dead Code & Consistency, LLM Prompt Issues, Test Gaps, View/Frontend, Performance & Bundle Impact
354
+
355
+ **Enum & Value Completeness requires reading code OUTSIDE the diff.** When the diff introduces a new enum value, status, tier, or type constant, use Grep to find all files that reference sibling values, then Read those files to check if the new value is handled. This is the one category where within-diff review is insufficient.
356
+
357
+ **Search-before-recommending:** When recommending a fix pattern (especially for concurrency, caching, auth, or framework-specific behavior):
358
+ - Verify the pattern is current best practice for the framework version in use
359
+ - Check if a built-in solution exists in newer versions before recommending a workaround
360
+ - Verify API signatures against current docs (APIs change between versions)
361
+
362
+ Takes seconds, prevents recommending outdated patterns. If WebSearch is unavailable, note it and proceed with in-distribution knowledge.
363
+
364
+ Follow the output format specified in the checklist. Respect the suppressions — do NOT flag items listed in the "DO NOT flag" section.
365
+
366
+ ---
367
+
368
+ ## Step 4.5: Design Review (conditional)
369
+
370
+ ## Design Review (conditional, diff-scoped)
371
+
372
+ Check if the diff touches frontend files using `gstack-diff-scope`:
373
+
374
+ ```bash
375
+ source <(~/.codex/skills/gstack/bin/gstack-diff-scope <base> 2>/dev/null)
376
+ ```
377
+
378
+ **If `SCOPE_FRONTEND=false`:** Skip design review silently. No output.
379
+
380
+ **If `SCOPE_FRONTEND=true`:**
381
+
382
+ 1. **Check for DESIGN.md.** If `DESIGN.md` or `design-system.md` exists in the repo root, read it. All design findings are calibrated against it — patterns blessed in DESIGN.md are not flagged. If not found, use universal design principles.
383
+
384
+ 2. **Read `.agents/skills/gstack/review/design-checklist.md`.** If the file cannot be read, skip design review with a note: "Design checklist not found — skipping design review."
385
+
386
+ 3. **Read each changed frontend file** (full file, not just diff hunks). Frontend files are identified by the patterns listed in the checklist.
387
+
388
+ 4. **Apply the design checklist** against the changed files. For each item:
389
+ - **[HIGH] mechanical CSS fix** (`outline: none`, `!important`, `font-size < 16px`): classify as AUTO-FIX
390
+ - **[HIGH/MEDIUM] design judgment needed**: classify as ASK
391
+ - **[LOW] intent-based detection**: present as "Possible — verify visually or run /design-review"
392
+
393
+ 5. **Include findings** in the review output under a "Design Review" header, following the output format in the checklist. Design findings merge with code review findings into the same Fix-First flow.
394
+
395
+ 6. **Log the result** for the Review Readiness Dashboard:
396
+
397
+ ```bash
398
+ ~/.codex/skills/gstack/bin/gstack-review-log '{"skill":"design-review-lite","timestamp":"TIMESTAMP","status":"STATUS","findings":N,"auto_fixed":M,"commit":"COMMIT"}'
399
+ ```
400
+
401
+ Substitute: TIMESTAMP = ISO 8601 datetime, STATUS = "clean" if 0 findings or "issues_found", N = total findings, M = auto-fixed count, COMMIT = output of `git rev-parse --short HEAD`.
402
+
403
+ Include any design findings alongside the findings from Step 4. They follow the same Fix-First flow in Step 5 — AUTO-FIX for mechanical CSS fixes, ASK for everything else.
404
+
405
+ ---
406
+
407
+ ## Step 4.75: Test Coverage Diagram
408
+
409
+ 100% coverage is the goal. Evaluate every codepath changed in the diff and identify test gaps. Gaps become INFORMATIONAL findings that follow the Fix-First flow.
410
+
411
+ ### Test Framework Detection
412
+
413
+ Before analyzing coverage, detect the project's test framework:
414
+
415
+ 1. **Read CLAUDE.md** — look for a `## Testing` section with test command and framework name. If found, use that as the authoritative source.
416
+ 2. **If CLAUDE.md has no testing section, auto-detect:**
417
+
418
+ ```bash
419
+ # Detect project runtime
420
+ [ -f Gemfile ] && echo "RUNTIME:ruby"
421
+ [ -f package.json ] && echo "RUNTIME:node"
422
+ [ -f requirements.txt ] || [ -f pyproject.toml ] && echo "RUNTIME:python"
423
+ [ -f go.mod ] && echo "RUNTIME:go"
424
+ [ -f Cargo.toml ] && echo "RUNTIME:rust"
425
+ # Check for existing test infrastructure
426
+ ls jest.config.* vitest.config.* playwright.config.* cypress.config.* .rspec pytest.ini phpunit.xml 2>/dev/null
427
+ ls -d test/ tests/ spec/ __tests__/ cypress/ e2e/ 2>/dev/null
428
+ ```
429
+
430
+ 3. **If no framework detected:** still produce the coverage diagram, but skip test generation.
431
+
432
+ **Step 1. Trace every codepath changed** using `git diff origin/<base>...HEAD`:
433
+
434
+ Read every changed file. For each one, trace how data flows through the code — don't just list functions, actually follow the execution:
435
+
436
+ 1. **Read the diff.** For each changed file, read the full file (not just the diff hunk) to understand context.
437
+ 2. **Trace data flow.** Starting from each entry point (route handler, exported function, event listener, component render), follow the data through every branch:
438
+ - Where does input come from? (request params, props, database, API call)
439
+ - What transforms it? (validation, mapping, computation)
440
+ - Where does it go? (database write, API response, rendered output, side effect)
441
+ - What can go wrong at each step? (null/undefined, invalid input, network failure, empty collection)
442
+ 3. **Diagram the execution.** For each changed file, draw an ASCII diagram showing:
443
+ - Every function/method that was added or modified
444
+ - Every conditional branch (if/else, switch, ternary, guard clause, early return)
445
+ - Every error path (try/catch, rescue, error boundary, fallback)
446
+ - Every call to another function (trace into it — does IT have untested branches?)
447
+ - Every edge: what happens with null input? Empty array? Invalid type?
448
+
449
+ This is the critical step — you're building a map of every line of code that can execute differently based on input. Every branch in this diagram needs a test.
450
+
451
+ **Step 2. Map user flows, interactions, and error states:**
452
+
453
+ Code coverage isn't enough — you need to cover how real users interact with the changed code. For each changed feature, think through:
454
+
455
+ - **User flows:** What sequence of actions does a user take that touches this code? Map the full journey (e.g., "user clicks 'Pay' → form validates → API call → success/failure screen"). Each step in the journey needs a test.
456
+ - **Interaction edge cases:** What happens when the user does something unexpected?
457
+ - Double-click/rapid resubmit
458
+ - Navigate away mid-operation (back button, close tab, click another link)
459
+ - Submit with stale data (page sat open for 30 minutes, session expired)
460
+ - Slow connection (API takes 10 seconds — what does the user see?)
461
+ - Concurrent actions (two tabs, same form)
462
+ - **Error states the user can see:** For every error the code handles, what does the user actually experience?
463
+ - Is there a clear error message or a silent failure?
464
+ - Can the user recover (retry, go back, fix input) or are they stuck?
465
+ - What happens with no network? With a 500 from the API? With invalid data from the server?
466
+ - **Empty/zero/boundary states:** What does the UI show with zero results? With 10,000 results? With a single character input? With maximum-length input?
467
+
468
+ Add these to your diagram alongside the code branches. A user flow with no test is just as much a gap as an untested if/else.
469
+
470
+ **Step 3. Check each branch against existing tests:**
471
+
472
+ Go through your diagram branch by branch — both code paths AND user flows. For each one, search for a test that exercises it:
473
+ - Function `processPayment()` → look for `billing.test.ts`, `billing.spec.ts`, `test/billing_test.rb`
474
+ - An if/else → look for tests covering BOTH the true AND false path
475
+ - An error handler → look for a test that triggers that specific error condition
476
+ - A call to `helperFn()` that has its own branches → those branches need tests too
477
+ - A user flow → look for an integration or E2E test that walks through the journey
478
+ - An interaction edge case → look for a test that simulates the unexpected action
479
+
480
+ Quality scoring rubric:
481
+ - ★★★ Tests behavior with edge cases AND error paths
482
+ - ★★ Tests correct behavior, happy path only
483
+ - ★ Smoke test / existence check / trivial assertion (e.g., "it renders", "it doesn't throw")
484
+
485
+ ### E2E Test Decision Matrix
486
+
487
+ When checking each branch, also determine whether a unit test or E2E/integration test is the right tool:
488
+
489
+ **RECOMMEND E2E (mark as [→E2E] in the diagram):**
490
+ - Common user flow spanning 3+ components/services (e.g., signup → verify email → first login)
491
+ - Integration point where mocking hides real failures (e.g., API → queue → worker → DB)
492
+ - Auth/payment/data-destruction flows — too important to trust unit tests alone
493
+
494
+ **RECOMMEND EVAL (mark as [→EVAL] in the diagram):**
495
+ - Critical LLM call that needs a quality eval (e.g., prompt change → test output still meets quality bar)
496
+ - Changes to prompt templates, system instructions, or tool definitions
497
+
498
+ **STICK WITH UNIT TESTS:**
499
+ - Pure function with clear inputs/outputs
500
+ - Internal helper with no side effects
501
+ - Edge case of a single function (null input, empty array)
502
+ - Obscure/rare flow that isn't customer-facing
503
+
504
+ ### REGRESSION RULE (mandatory)
505
+
506
+ **IRON RULE:** When the coverage audit identifies a REGRESSION — code that previously worked but the diff broke — a regression test is written immediately. No AskUserQuestion. No skipping. Regressions are the highest-priority test because they prove something broke.
507
+
508
+ A regression is when:
509
+ - The diff modifies existing behavior (not new code)
510
+ - The existing test suite (if any) doesn't cover the changed path
511
+ - The change introduces a new failure mode for existing callers
512
+
513
+ When uncertain whether a change is a regression, err on the side of writing the test.
514
+
515
+ Format: commit as `test: regression test for {what broke}`
516
+
517
+ **Step 4. Output ASCII coverage diagram:**
518
+
519
+ Include BOTH code paths and user flows in the same diagram. Mark E2E-worthy and eval-worthy paths:
520
+
521
+ ```
522
+ CODE PATH COVERAGE
523
+ ===========================
524
+ [+] src/services/billing.ts
525
+
526
+ ├── processPayment()
527
+ │ ├── [★★★ TESTED] Happy path + card declined + timeout — billing.test.ts:42
528
+ │ ├── [GAP] Network timeout — NO TEST
529
+ │ └── [GAP] Invalid currency — NO TEST
530
+
531
+ └── refundPayment()
532
+ ├── [★★ TESTED] Full refund — billing.test.ts:89
533
+ └── [★ TESTED] Partial refund (checks non-throw only) — billing.test.ts:101
534
+
535
+ USER FLOW COVERAGE
536
+ ===========================
537
+ [+] Payment checkout flow
538
+
539
+ ├── [★★★ TESTED] Complete purchase — checkout.e2e.ts:15
540
+ ├── [GAP] [→E2E] Double-click submit — needs E2E, not just unit
541
+ ├── [GAP] Navigate away during payment — unit test sufficient
542
+ └── [★ TESTED] Form validation errors (checks render only) — checkout.test.ts:40
543
+
544
+ [+] Error states
545
+
546
+ ├── [★★ TESTED] Card declined message — billing.test.ts:58
547
+ ├── [GAP] Network timeout UX (what does user see?) — NO TEST
548
+ └── [GAP] Empty cart submission — NO TEST
549
+
550
+ [+] LLM integration
551
+
552
+ └── [GAP] [→EVAL] Prompt template change — needs eval test
553
+
554
+ ─────────────────────────────────
555
+ COVERAGE: 5/13 paths tested (38%)
556
+ Code paths: 3/5 (60%)
557
+ User flows: 2/8 (25%)
558
+ QUALITY: ★★★: 2 ★★: 2 ★: 1
559
+ GAPS: 8 paths need tests (2 need E2E, 1 needs eval)
560
+ ─────────────────────────────────
561
+ ```
562
+
563
+ **Fast path:** All paths covered → "Step 4.75: All new code paths have test coverage ✓" Continue.
564
+
565
+ **Step 5. Generate tests for gaps (Fix-First):**
566
+
567
+ If test framework is detected and gaps were identified:
568
+ - Classify each gap as AUTO-FIX or ASK per the Fix-First Heuristic:
569
+ - **AUTO-FIX:** Simple unit tests for pure functions, edge cases of existing tested functions
570
+ - **ASK:** E2E tests, tests requiring new test infrastructure, tests for ambiguous behavior
571
+ - For AUTO-FIX gaps: generate the test, run it, commit as `test: coverage for {feature}`
572
+ - For ASK gaps: include in the Fix-First batch question with the other review findings
573
+ - For paths marked [→E2E]: always ASK (E2E tests are higher-effort and need user confirmation)
574
+ - For paths marked [→EVAL]: always ASK (eval tests need user confirmation on quality criteria)
575
+
576
+ If no test framework detected → include gaps as INFORMATIONAL findings only, no generation.
577
+
578
+ **Diff is test-only changes:** Skip Step 4.75 entirely: "No new application code paths to audit."
579
+
580
+ This step subsumes the "Test Gaps" category from Pass 2 — do not duplicate findings between the checklist Test Gaps item and this coverage diagram. Include any coverage gaps alongside the findings from Step 4 and Step 4.5. They follow the same Fix-First flow — gaps are INFORMATIONAL findings.
581
+
582
+ ---
583
+
584
+ ## Step 5: Fix-First Review
585
+
586
+ **Every finding gets action — not just critical ones.**
587
+
588
+ Output a summary header: `Pre-Landing Review: N issues (X critical, Y informational)`
589
+
590
+ ### Step 5a: Classify each finding
591
+
592
+ For each finding, classify as AUTO-FIX or ASK per the Fix-First Heuristic in
593
+ checklist.md. Critical findings lean toward ASK; informational findings lean
594
+ toward AUTO-FIX.
595
+
596
+ ### Step 5b: Auto-fix all AUTO-FIX items
597
+
598
+ Apply each fix directly. For each one, output a one-line summary:
599
+ `[AUTO-FIXED] [file:line] Problem → what you did`
600
+
601
+ ### Step 5c: Batch-ask about ASK items
602
+
603
+ If there are ASK items remaining, present them in ONE AskUserQuestion:
604
+
605
+ - List each item with a number, the severity label, the problem, and a recommended fix
606
+ - For each item, provide options: A) Fix as recommended, B) Skip
607
+ - Include an overall RECOMMENDATION
608
+
609
+ Example format:
610
+ ```
611
+ I auto-fixed 5 issues. 2 need your input:
612
+
613
+ 1. [CRITICAL] app/models/post.rb:42 — Race condition in status transition
614
+ Fix: Add `WHERE status = 'draft'` to the UPDATE
615
+ → A) Fix B) Skip
616
+
617
+ 2. [INFORMATIONAL] app/services/generator.rb:88 — LLM output not type-checked before DB write
618
+ Fix: Add JSON schema validation
619
+ → A) Fix B) Skip
620
+
621
+ RECOMMENDATION: Fix both — #1 is a real race condition, #2 prevents silent data corruption.
622
+ ```
623
+
624
+ If 3 or fewer ASK items, you may use individual AskUserQuestion calls instead of batching.
625
+
626
+ ### Step 5d: Apply user-approved fixes
627
+
628
+ Apply fixes for items where the user chose "Fix." Output what was fixed.
629
+
630
+ If no ASK items exist (everything was AUTO-FIX), skip the question entirely.
631
+
632
+ ### Verification of claims
633
+
634
+ Before producing the final review output:
635
+ - If you claim "this pattern is safe" → cite the specific line proving safety
636
+ - If you claim "this is handled elsewhere" → read and cite the handling code
637
+ - If you claim "tests cover this" → name the test file and method
638
+ - Never say "likely handled" or "probably tested" — verify or flag as unknown
639
+
640
+ **Rationalization prevention:** "This looks fine" is not a finding. Either cite evidence it IS fine, or flag it as unverified.
641
+
642
+ ### Greptile comment resolution
643
+
644
+ After outputting your own findings, if Greptile comments were classified in Step 2.5:
645
+
646
+ **Include a Greptile summary in your output header:** `+ N Greptile comments (X valid, Y fixed, Z FP)`
647
+
648
+ Before replying to any comment, run the **Escalation Detection** algorithm from greptile-triage.md to determine whether to use Tier 1 (friendly) or Tier 2 (firm) reply templates.
649
+
650
+ 1. **VALID & ACTIONABLE comments:** These are included in your findings — they follow the Fix-First flow (auto-fixed if mechanical, batched into ASK if not) (A: Fix it now, B: Acknowledge, C: False positive). If the user chooses A (fix), reply using the **Fix reply template** from greptile-triage.md (include inline diff + explanation). If the user chooses C (false positive), reply using the **False Positive reply template** (include evidence + suggested re-rank), save to both per-project and global greptile-history.
651
+
652
+ 2. **FALSE POSITIVE comments:** Present each one via AskUserQuestion:
653
+ - Show the Greptile comment: file:line (or [top-level]) + body summary + permalink URL
654
+ - Explain concisely why it's a false positive
655
+ - Options:
656
+ - A) Reply to Greptile explaining why this is incorrect (recommended if clearly wrong)
657
+ - B) Fix it anyway (if low-effort and harmless)
658
+ - C) Ignore — don't reply, don't fix
659
+
660
+ If the user chooses A, reply using the **False Positive reply template** from greptile-triage.md (include evidence + suggested re-rank), save to both per-project and global greptile-history.
661
+
662
+ 3. **VALID BUT ALREADY FIXED comments:** Reply using the **Already Fixed reply template** from greptile-triage.md — no AskUserQuestion needed:
663
+ - Include what was done and the fixing commit SHA
664
+ - Save to both per-project and global greptile-history
665
+
666
+ 4. **SUPPRESSED comments:** Skip silently — these are known false positives from previous triage.
667
+
668
+ ---
669
+
670
+ ## Step 5.5: TODOS cross-reference
671
+
672
+ Read `TODOS.md` in the repository root (if it exists). Cross-reference the PR against open TODOs:
673
+
674
+ - **Does this PR close any open TODOs?** If yes, note which items in your output: "This PR addresses TODO: <title>"
675
+ - **Does this PR create work that should become a TODO?** If yes, flag it as an informational finding.
676
+ - **Are there related TODOs that provide context for this review?** If yes, reference them when discussing related findings.
677
+
678
+ If TODOS.md doesn't exist, skip this step silently.
679
+
680
+ ---
681
+
682
+ ## Step 5.6: Documentation staleness check
683
+
684
+ Cross-reference the diff against documentation files. For each `.md` file in the repo root (README.md, ARCHITECTURE.md, CONTRIBUTING.md, CLAUDE.md, etc.):
685
+
686
+ 1. Check if code changes in the diff affect features, components, or workflows described in that doc file.
687
+ 2. If the doc file was NOT updated in this branch but the code it describes WAS changed, flag it as an INFORMATIONAL finding:
688
+ "Documentation may be stale: [file] describes [feature/component] but code changed in this branch. Consider running `/document-release`."
689
+
690
+ This is informational only — never critical. The fix action is `/document-release`.
691
+
692
+ If no documentation files exist, skip this step silently.
693
+
694
+ ---
695
+
696
+
697
+
698
+ ## Important Rules
699
+
700
+ - **Read the FULL diff before commenting.** Do not flag issues already addressed in the diff.
701
+ - **Fix-first, not read-only.** AUTO-FIX items are applied directly. ASK items are only applied after user approval. Never commit, push, or create PRs — that's /ship's job.
702
+ - **Be terse.** One line problem, one line fix. No preamble.
703
+ - **Only flag real problems.** Skip anything that's fine.
704
+ - **Use Greptile reply templates from greptile-triage.md.** Every reply includes evidence. Never post vague replies.