@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,1072 @@
1
+ ---
2
+ name: retro
3
+ version: 2.0.0
4
+ description: |
5
+ Weekly engineering retrospective. Analyzes commit history, work patterns,
6
+ and code quality metrics with persistent history and trend tracking.
7
+ Team-aware: breaks down per-person contributions with praise and growth areas.
8
+ Use when asked to "weekly retro", "what did we ship", or "engineering retrospective".
9
+ Proactively suggest at the end of a work week or sprint.
10
+ allowed-tools:
11
+ - Bash
12
+ - Read
13
+ - Write
14
+ - Glob
15
+ - AskUserQuestion
16
+ ---
17
+ <!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->
18
+ <!-- Regenerate: bun run gen:skill-docs -->
19
+
20
+ ## Preamble (run first)
21
+
22
+ ```bash
23
+ _UPD=$(~/.claude/skills/gstack/bin/gstack-update-check 2>/dev/null || .claude/skills/gstack/bin/gstack-update-check 2>/dev/null || true)
24
+ [ -n "$_UPD" ] && echo "$_UPD" || true
25
+ mkdir -p ~/.gstack/sessions
26
+ touch ~/.gstack/sessions/"$PPID"
27
+ _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ')
28
+ find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true
29
+ _CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true)
30
+ _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true")
31
+ _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
32
+ echo "BRANCH: $_BRANCH"
33
+ echo "PROACTIVE: $_PROACTIVE"
34
+ source <(~/.claude/skills/gstack/bin/gstack-repo-mode 2>/dev/null) || true
35
+ REPO_MODE=${REPO_MODE:-unknown}
36
+ echo "REPO_MODE: $REPO_MODE"
37
+ _LAKE_SEEN=$([ -f ~/.gstack/.completeness-intro-seen ] && echo "yes" || echo "no")
38
+ echo "LAKE_INTRO: $_LAKE_SEEN"
39
+ _TEL=$(~/.claude/skills/gstack/bin/gstack-config get telemetry 2>/dev/null || true)
40
+ _TEL_PROMPTED=$([ -f ~/.gstack/.telemetry-prompted ] && echo "yes" || echo "no")
41
+ _TEL_START=$(date +%s)
42
+ _SESSION_ID="$$-$(date +%s)"
43
+ echo "TELEMETRY: ${_TEL:-off}"
44
+ echo "TEL_PROMPTED: $_TEL_PROMPTED"
45
+ mkdir -p ~/.gstack/analytics
46
+ echo '{"skill":"retro","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true
47
+ for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done
48
+ ```
49
+
50
+ If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills — only invoke
51
+ them when the user explicitly asks. The user opted out of proactive suggestions.
52
+
53
+ If output shows `UPGRADE_AVAILABLE <old> <new>`: read `~/.claude/skills/gstack/gstack-upgrade/SKILL.md` and follow the "Inline upgrade flow" (auto-upgrade if configured, otherwise AskUserQuestion with 4 options, write snooze state if declined). If `JUST_UPGRADED <from> <to>`: tell user "Running gstack v{to} (just updated!)" and continue.
54
+
55
+ If `LAKE_INTRO` is `no`: Before continuing, introduce the Completeness Principle.
56
+ Tell the user: "gstack follows the **Boil the Lake** principle — always do the complete
57
+ thing when AI makes the marginal cost near-zero. Read more: https://garryslist.org/posts/boil-the-ocean"
58
+ Then offer to open the essay in their default browser:
59
+
60
+ ```bash
61
+ open https://garryslist.org/posts/boil-the-ocean
62
+ touch ~/.gstack/.completeness-intro-seen
63
+ ```
64
+
65
+ Only run `open` if the user says yes. Always run `touch` to mark as seen. This only happens once.
66
+
67
+ If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled,
68
+ ask the user about telemetry. Use AskUserQuestion:
69
+
70
+ > Help gstack get better! Community mode shares usage data (which skills you use, how long
71
+ > they take, crash info) with a stable device ID so we can track trends and fix bugs faster.
72
+ > No code, file paths, or repo names are ever sent.
73
+ > Change anytime with `gstack-config set telemetry off`.
74
+
75
+ Options:
76
+ - A) Help gstack get better! (recommended)
77
+ - B) No thanks
78
+
79
+ If A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry community`
80
+
81
+ If B: ask a follow-up AskUserQuestion:
82
+
83
+ > How about anonymous mode? We just learn that *someone* used gstack — no unique ID,
84
+ > no way to connect sessions. Just a counter that helps us know if anyone's out there.
85
+
86
+ Options:
87
+ - A) Sure, anonymous is fine
88
+ - B) No thanks, fully off
89
+
90
+ If B→A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous`
91
+ If B→B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off`
92
+
93
+ Always run:
94
+ ```bash
95
+ touch ~/.gstack/.telemetry-prompted
96
+ ```
97
+
98
+ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely.
99
+
100
+ ## AskUserQuestion Format
101
+
102
+ **ALWAYS follow this structure for every AskUserQuestion call:**
103
+ 1. **Re-ground:** State the project, the current branch (use the `_BRANCH` value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences)
104
+ 2. **Simplify:** Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called.
105
+ 3. **Recommend:** `RECOMMENDATION: Choose [X] because [one-line reason]` — always prefer the complete option over shortcuts (see Completeness Principle). Include `Completeness: X/10` for each option. Calibration: 10 = complete implementation (all edge cases, full coverage), 7 = covers happy path but skips some edges, 3 = shortcut that defers significant work. If both options are 8+, pick the higher; if one is ≤5, flag it.
106
+ 4. **Options:** Lettered options: `A) ... B) ... C) ...` — when an option involves effort, show both scales: `(human: ~X / CC: ~Y)`
107
+
108
+ Assume the user hasn't looked at this window in 20 minutes and doesn't have the code open. If you'd need to read the source to understand your own explanation, it's too complex.
109
+
110
+ Per-skill instructions may add additional formatting rules on top of this baseline.
111
+
112
+ ## Completeness Principle — Boil the Lake
113
+
114
+ AI-assisted coding makes the marginal cost of completeness near-zero. When you present options:
115
+
116
+ - If Option A is the complete implementation (full parity, all edge cases, 100% coverage) and Option B is a shortcut that saves modest effort — **always recommend A**. The delta between 80 lines and 150 lines is meaningless with CC+gstack. "Good enough" is the wrong instinct when "complete" costs minutes more.
117
+ - **Lake vs. ocean:** A "lake" is boilable — 100% test coverage for a module, full feature implementation, handling all edge cases, complete error paths. An "ocean" is not — rewriting an entire system from scratch, adding features to dependencies you don't control, multi-quarter platform migrations. Recommend boiling lakes. Flag oceans as out of scope.
118
+ - **When estimating effort**, always show both scales: human team time and CC+gstack time. The compression ratio varies by task type — use this reference:
119
+
120
+ | Task type | Human team | CC+gstack | Compression |
121
+ |-----------|-----------|-----------|-------------|
122
+ | Boilerplate / scaffolding | 2 days | 15 min | ~100x |
123
+ | Test writing | 1 day | 15 min | ~50x |
124
+ | Feature implementation | 1 week | 30 min | ~30x |
125
+ | Bug fix + regression test | 4 hours | 15 min | ~20x |
126
+ | Architecture / design | 2 days | 4 hours | ~5x |
127
+ | Research / exploration | 1 day | 3 hours | ~3x |
128
+
129
+ - This principle applies to test coverage, error handling, documentation, edge cases, and feature completeness. Don't skip the last 10% to "save time" — with AI, that 10% costs seconds.
130
+
131
+ **Anti-patterns — DON'T do this:**
132
+ - BAD: "Choose B — it covers 90% of the value with less code." (If A is only 70 lines more, choose A.)
133
+ - BAD: "We can skip edge case handling to save time." (Edge case handling costs minutes with CC.)
134
+ - BAD: "Let's defer test coverage to a follow-up PR." (Tests are the cheapest lake to boil.)
135
+ - BAD: Quoting only human-team effort: "This would take 2 weeks." (Say: "2 weeks human / ~1 hour CC.")
136
+
137
+ ## Repo Ownership Mode — See Something, Say Something
138
+
139
+ `REPO_MODE` from the preamble tells you who owns issues in this repo:
140
+
141
+ - **`solo`** — One person does 80%+ of the work. They own everything. When you notice issues outside the current branch's changes (test failures, deprecation warnings, security advisories, linting errors, dead code, env problems), **investigate and offer to fix proactively**. The solo dev is the only person who will fix it. Default to action.
142
+ - **`collaborative`** — Multiple active contributors. When you notice issues outside the branch's changes, **flag them via AskUserQuestion** — it may be someone else's responsibility. Default to asking, not fixing.
143
+ - **`unknown`** — Treat as collaborative (safer default — ask before fixing).
144
+
145
+ **See Something, Say Something:** Whenever you notice something that looks wrong during ANY workflow step — not just test failures — flag it briefly. One sentence: what you noticed and its impact. In solo mode, follow up with "Want me to fix it?" In collaborative mode, just flag it and move on.
146
+
147
+ Never let a noticed issue silently pass. The whole point is proactive communication.
148
+
149
+ ## Search Before Building
150
+
151
+ Before building infrastructure, unfamiliar patterns, or anything the runtime might have a built-in — **search first.** Read `~/.claude/skills/gstack/ETHOS.md` for the full philosophy.
152
+
153
+ **Three layers of knowledge:**
154
+ - **Layer 1** (tried and true — in distribution). Don't reinvent the wheel. But the cost of checking is near-zero, and once in a while, questioning the tried-and-true is where brilliance occurs.
155
+ - **Layer 2** (new and popular — search for these). But scrutinize: humans are subject to mania. Search results are inputs to your thinking, not answers.
156
+ - **Layer 3** (first principles — prize these above all). Original observations derived from reasoning about the specific problem. The most valuable of all.
157
+
158
+ **Eureka moment:** When first-principles reasoning reveals conventional wisdom is wrong, name it:
159
+ "EUREKA: Everyone does X because [assumption]. But [evidence] shows this is wrong. Y is better because [reasoning]."
160
+
161
+ Log eureka moments:
162
+ ```bash
163
+ jq -n --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$(git branch --show-current 2>/dev/null)" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> ~/.gstack/analytics/eureka.jsonl 2>/dev/null || true
164
+ ```
165
+ Replace SKILL_NAME and ONE_LINE_SUMMARY. Runs inline — don't stop the workflow.
166
+
167
+ **WebSearch fallback:** If WebSearch is unavailable, skip the search step and note: "Search unavailable — proceeding with in-distribution knowledge only."
168
+
169
+ ## Contributor Mode
170
+
171
+ If `_CONTRIB` is `true`: you are in **contributor mode**. You're a gstack user who also helps make it better.
172
+
173
+ **At the end of each major workflow step** (not after every single command), reflect on the gstack tooling you used. Rate your experience 0 to 10. If it wasn't a 10, think about why. If there is an obvious, actionable bug OR an insightful, interesting thing that could have been done better by gstack code or skill markdown — file a field report. Maybe our contributor will help make us better!
174
+
175
+ **Calibration — this is the bar:** For example, `$B js "await fetch(...)"` used to fail with `SyntaxError: await is only valid in async functions` because gstack didn't wrap expressions in async context. Small, but the input was reasonable and gstack should have handled it — that's the kind of thing worth filing. Things less consequential than this, ignore.
176
+
177
+ **NOT worth filing:** user's app bugs, network errors to user's URL, auth failures on user's site, user's own JS logic bugs.
178
+
179
+ **To file:** write `~/.gstack/contributor-logs/{slug}.md` with **all sections below** (do not truncate — include every section through the Date/Version footer):
180
+
181
+ ```
182
+ # {Title}
183
+
184
+ Hey gstack team — ran into this while using /{skill-name}:
185
+
186
+ **What I was trying to do:** {what the user/agent was attempting}
187
+ **What happened instead:** {what actually happened}
188
+ **My rating:** {0-10} — {one sentence on why it wasn't a 10}
189
+
190
+ ## Steps to reproduce
191
+ 1. {step}
192
+
193
+ ## Raw output
194
+ ```
195
+ {paste the actual error or unexpected output here}
196
+ ```
197
+
198
+ ## What would make this a 10
199
+ {one sentence: what gstack should have done differently}
200
+
201
+ **Date:** {YYYY-MM-DD} | **Version:** {gstack version} | **Skill:** /{skill}
202
+ ```
203
+
204
+ Slug: lowercase, hyphens, max 60 chars (e.g. `browse-js-no-await`). Skip if file already exists. Max 3 reports per session. File inline and continue — don't stop the workflow. Tell user: "Filed gstack field report: {title}"
205
+
206
+ ## Completion Status Protocol
207
+
208
+ When completing a skill workflow, report status using one of:
209
+ - **DONE** — All steps completed successfully. Evidence provided for each claim.
210
+ - **DONE_WITH_CONCERNS** — Completed, but with issues the user should know about. List each concern.
211
+ - **BLOCKED** — Cannot proceed. State what is blocking and what was tried.
212
+ - **NEEDS_CONTEXT** — Missing information required to continue. State exactly what you need.
213
+
214
+ ### Escalation
215
+
216
+ It is always OK to stop and say "this is too hard for me" or "I'm not confident in this result."
217
+
218
+ Bad work is worse than no work. You will not be penalized for escalating.
219
+ - If you have attempted a task 3 times without success, STOP and escalate.
220
+ - If you are uncertain about a security-sensitive change, STOP and escalate.
221
+ - If the scope of work exceeds what you can verify, STOP and escalate.
222
+
223
+ Escalation format:
224
+ ```
225
+ STATUS: BLOCKED | NEEDS_CONTEXT
226
+ REASON: [1-2 sentences]
227
+ ATTEMPTED: [what you tried]
228
+ RECOMMENDATION: [what the user should do next]
229
+ ```
230
+
231
+ ## Telemetry (run last)
232
+
233
+ After the skill workflow completes (success, error, or abort), log the telemetry event.
234
+ Determine the skill name from the `name:` field in this file's YAML frontmatter.
235
+ Determine the outcome from the workflow result (success if completed normally, error
236
+ if it failed, abort if the user interrupted).
237
+
238
+ **PLAN MODE EXCEPTION — ALWAYS RUN:** This command writes telemetry to
239
+ `~/.gstack/analytics/` (user config directory, not project files). The skill
240
+ preamble already writes to the same directory — this is the same pattern.
241
+ Skipping this command loses session duration and outcome data.
242
+
243
+ Run this bash:
244
+
245
+ ```bash
246
+ _TEL_END=$(date +%s)
247
+ _TEL_DUR=$(( _TEL_END - _TEL_START ))
248
+ rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true
249
+ ~/.claude/skills/gstack/bin/gstack-telemetry-log \
250
+ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \
251
+ --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null &
252
+ ```
253
+
254
+ Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with
255
+ success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used.
256
+ If you cannot determine the outcome, use "unknown". This runs in the background and
257
+ never blocks the user.
258
+
259
+ ## Detect default branch
260
+
261
+ Before gathering data, detect the repo's default branch name:
262
+ `gh repo view --json defaultBranchRef -q .defaultBranchRef.name`
263
+
264
+ If this fails, fall back to `main`. Use the detected name wherever the instructions
265
+ say `origin/<default>` below.
266
+
267
+ ---
268
+
269
+ # /retro — Weekly Engineering Retrospective
270
+
271
+ Generates a comprehensive engineering retrospective analyzing commit history, work patterns, and code quality metrics. Team-aware: identifies the user running the command, then analyzes every contributor with per-person praise and growth opportunities. Designed for a senior IC/CTO-level builder using Claude Code as a force multiplier.
272
+
273
+ ## User-invocable
274
+ When the user types `/retro`, run this skill.
275
+
276
+ ## Arguments
277
+ - `/retro` — default: last 7 days
278
+ - `/retro 24h` — last 24 hours
279
+ - `/retro 14d` — last 14 days
280
+ - `/retro 30d` — last 30 days
281
+ - `/retro compare` — compare current window vs prior same-length window
282
+ - `/retro compare 14d` — compare with explicit window
283
+ - `/retro global` — cross-project retro across all AI coding tools (7d default)
284
+ - `/retro global 14d` — cross-project retro with explicit window
285
+
286
+ ## Instructions
287
+
288
+ Parse the argument to determine the time window. Default to 7 days if no argument given. All times should be reported in the user's **local timezone** (use the system default — do NOT set `TZ`).
289
+
290
+ **Midnight-aligned windows:** For day (`d`) and week (`w`) units, compute an absolute start date at local midnight, not a relative string. For example, if today is 2026-03-18 and the window is 7 days: the start date is 2026-03-11. Use `--since="2026-03-11T00:00:00"` for git log queries — the explicit `T00:00:00` suffix ensures git starts from midnight. Without it, git uses the current wall-clock time (e.g., `--since="2026-03-11"` at 11pm means 11pm, not midnight). For week units, multiply by 7 to get days (e.g., `2w` = 14 days back). For hour (`h`) units, use `--since="N hours ago"` since midnight alignment does not apply to sub-day windows.
291
+
292
+ **Argument validation:** If the argument doesn't match a number followed by `d`, `h`, or `w`, the word `compare` (optionally followed by a window), or the word `global` (optionally followed by a window), show this usage and stop:
293
+ ```
294
+ Usage: /retro [window | compare | global]
295
+ /retro — last 7 days (default)
296
+ /retro 24h — last 24 hours
297
+ /retro 14d — last 14 days
298
+ /retro 30d — last 30 days
299
+ /retro compare — compare this period vs prior period
300
+ /retro compare 14d — compare with explicit window
301
+ /retro global — cross-project retro across all AI tools (7d default)
302
+ /retro global 14d — cross-project retro with explicit window
303
+ ```
304
+
305
+ **If the first argument is `global`:** Skip the normal repo-scoped retro (Steps 1-14). Instead, follow the **Global Retrospective** flow at the end of this document. The optional second argument is the time window (default 7d). This mode does NOT require being inside a git repo.
306
+
307
+ ### Step 1: Gather Raw Data
308
+
309
+ First, fetch origin and identify the current user:
310
+ ```bash
311
+ git fetch origin <default> --quiet
312
+ # Identify who is running the retro
313
+ git config user.name
314
+ git config user.email
315
+ ```
316
+
317
+ The name returned by `git config user.name` is **"you"** — the person reading this retro. All other authors are teammates. Use this to orient the narrative: "your" commits vs teammate contributions.
318
+
319
+ Run ALL of these git commands in parallel (they are independent):
320
+
321
+ ```bash
322
+ # 1. All commits in window with timestamps, subject, hash, AUTHOR, files changed, insertions, deletions
323
+ git log origin/<default> --since="<window>" --format="%H|%aN|%ae|%ai|%s" --shortstat
324
+
325
+ # 2. Per-commit test vs total LOC breakdown with author
326
+ # Each commit block starts with COMMIT:<hash>|<author>, followed by numstat lines.
327
+ # Separate test files (matching test/|spec/|__tests__/) from production files.
328
+ git log origin/<default> --since="<window>" --format="COMMIT:%H|%aN" --numstat
329
+
330
+ # 3. Commit timestamps for session detection and hourly distribution (with author)
331
+ git log origin/<default> --since="<window>" --format="%at|%aN|%ai|%s" | sort -n
332
+
333
+ # 4. Files most frequently changed (hotspot analysis)
334
+ git log origin/<default> --since="<window>" --format="" --name-only | grep -v '^$' | sort | uniq -c | sort -rn
335
+
336
+ # 5. PR numbers from commit messages (extract #NNN patterns)
337
+ git log origin/<default> --since="<window>" --format="%s" | grep -oE '#[0-9]+' | sed 's/^#//' | sort -n | uniq | sed 's/^/#/'
338
+
339
+ # 6. Per-author file hotspots (who touches what)
340
+ git log origin/<default> --since="<window>" --format="AUTHOR:%aN" --name-only
341
+
342
+ # 7. Per-author commit counts (quick summary)
343
+ git shortlog origin/<default> --since="<window>" -sn --no-merges
344
+
345
+ # 8. Greptile triage history (if available)
346
+ cat ~/.gstack/greptile-history.md 2>/dev/null || true
347
+
348
+ # 9. TODOS.md backlog (if available)
349
+ cat TODOS.md 2>/dev/null || true
350
+
351
+ # 10. Test file count
352
+ find . -name '*.test.*' -o -name '*.spec.*' -o -name '*_test.*' -o -name '*_spec.*' 2>/dev/null | grep -v node_modules | wc -l
353
+
354
+ # 11. Regression test commits in window
355
+ git log origin/<default> --since="<window>" --oneline --grep="test(qa):" --grep="test(design):" --grep="test: coverage"
356
+
357
+ # 12. gstack skill usage telemetry (if available)
358
+ cat ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true
359
+
360
+ # 12. Test files changed in window
361
+ git log origin/<default> --since="<window>" --format="" --name-only | grep -E '\.(test|spec)\.' | sort -u | wc -l
362
+ ```
363
+
364
+ ### Step 2: Compute Metrics
365
+
366
+ Calculate and present these metrics in a summary table:
367
+
368
+ | Metric | Value |
369
+ |--------|-------|
370
+ | Commits to main | N |
371
+ | Contributors | N |
372
+ | PRs merged | N |
373
+ | Total insertions | N |
374
+ | Total deletions | N |
375
+ | Net LOC added | N |
376
+ | Test LOC (insertions) | N |
377
+ | Test LOC ratio | N% |
378
+ | Version range | vX.Y.Z.W → vX.Y.Z.W |
379
+ | Active days | N |
380
+ | Detected sessions | N |
381
+ | Avg LOC/session-hour | N |
382
+ | Greptile signal | N% (Y catches, Z FPs) |
383
+ | Test Health | N total tests · M added this period · K regression tests |
384
+
385
+ Then show a **per-author leaderboard** immediately below:
386
+
387
+ ```
388
+ Contributor Commits +/- Top area
389
+ You (garry) 32 +2400/-300 browse/
390
+ alice 12 +800/-150 app/services/
391
+ bob 3 +120/-40 tests/
392
+ ```
393
+
394
+ Sort by commits descending. The current user (from `git config user.name`) always appears first, labeled "You (name)".
395
+
396
+ **Greptile signal (if history exists):** Read `~/.gstack/greptile-history.md` (fetched in Step 1, command 8). Filter entries within the retro time window by date. Count entries by type: `fix`, `fp`, `already-fixed`. Compute signal ratio: `(fix + already-fixed) / (fix + already-fixed + fp)`. If no entries exist in the window or the file doesn't exist, skip the Greptile metric row. Skip unparseable lines silently.
397
+
398
+ **Backlog Health (if TODOS.md exists):** Read `TODOS.md` (fetched in Step 1, command 9). Compute:
399
+ - Total open TODOs (exclude items in `## Completed` section)
400
+ - P0/P1 count (critical/urgent items)
401
+ - P2 count (important items)
402
+ - Items completed this period (items in Completed section with dates within the retro window)
403
+ - Items added this period (cross-reference git log for commits that modified TODOS.md within the window)
404
+
405
+ Include in the metrics table:
406
+ ```
407
+ | Backlog Health | N open (X P0/P1, Y P2) · Z completed this period |
408
+ ```
409
+
410
+ If TODOS.md doesn't exist, skip the Backlog Health row.
411
+
412
+ **Skill Usage (if analytics exist):** Read `~/.gstack/analytics/skill-usage.jsonl` if it exists. Filter entries within the retro time window by `ts` field. Separate skill activations (no `event` field) from hook fires (`event: "hook_fire"`). Aggregate by skill name. Present as:
413
+
414
+ ```
415
+ | Skill Usage | /ship(12) /qa(8) /review(5) · 3 safety hook fires |
416
+ ```
417
+
418
+ If the JSONL file doesn't exist or has no entries in the window, skip the Skill Usage row.
419
+
420
+ **Eureka Moments (if logged):** Read `~/.gstack/analytics/eureka.jsonl` if it exists. Filter entries within the retro time window by `ts` field. For each eureka moment, show the skill that flagged it, the branch, and a one-line summary of the insight. Present as:
421
+
422
+ ```
423
+ | Eureka Moments | 2 this period |
424
+ ```
425
+
426
+ If moments exist, list them:
427
+ ```
428
+ EUREKA /office-hours (branch: garrytan/auth-rethink): "Session tokens don't need server storage — browser crypto API makes client-side JWT validation viable"
429
+ EUREKA /plan-eng-review (branch: garrytan/cache-layer): "Redis isn't needed here — Bun's built-in LRU cache handles this workload"
430
+ ```
431
+
432
+ If the JSONL file doesn't exist or has no entries in the window, skip the Eureka Moments row.
433
+
434
+ ### Step 3: Commit Time Distribution
435
+
436
+ Show hourly histogram in local time using bar chart:
437
+
438
+ ```
439
+ Hour Commits ████████████████
440
+ 00: 4 ████
441
+ 07: 5 █████
442
+ ...
443
+ ```
444
+
445
+ Identify and call out:
446
+ - Peak hours
447
+ - Dead zones
448
+ - Whether pattern is bimodal (morning/evening) or continuous
449
+ - Late-night coding clusters (after 10pm)
450
+
451
+ ### Step 4: Work Session Detection
452
+
453
+ Detect sessions using **45-minute gap** threshold between consecutive commits. For each session report:
454
+ - Start/end time (Pacific)
455
+ - Number of commits
456
+ - Duration in minutes
457
+
458
+ Classify sessions:
459
+ - **Deep sessions** (50+ min)
460
+ - **Medium sessions** (20-50 min)
461
+ - **Micro sessions** (<20 min, typically single-commit fire-and-forget)
462
+
463
+ Calculate:
464
+ - Total active coding time (sum of session durations)
465
+ - Average session length
466
+ - LOC per hour of active time
467
+
468
+ ### Step 5: Commit Type Breakdown
469
+
470
+ Categorize by conventional commit prefix (feat/fix/refactor/test/chore/docs). Show as percentage bar:
471
+
472
+ ```
473
+ feat: 20 (40%) ████████████████████
474
+ fix: 27 (54%) ███████████████████████████
475
+ refactor: 2 ( 4%) ██
476
+ ```
477
+
478
+ Flag if fix ratio exceeds 50% — this signals a "ship fast, fix fast" pattern that may indicate review gaps.
479
+
480
+ ### Step 6: Hotspot Analysis
481
+
482
+ Show top 10 most-changed files. Flag:
483
+ - Files changed 5+ times (churn hotspots)
484
+ - Test files vs production files in the hotspot list
485
+ - VERSION/CHANGELOG frequency (version discipline indicator)
486
+
487
+ ### Step 7: PR Size Distribution
488
+
489
+ From commit diffs, estimate PR sizes and bucket them:
490
+ - **Small** (<100 LOC)
491
+ - **Medium** (100-500 LOC)
492
+ - **Large** (500-1500 LOC)
493
+ - **XL** (1500+ LOC)
494
+
495
+ ### Step 8: Focus Score + Ship of the Week
496
+
497
+ **Focus score:** Calculate the percentage of commits touching the single most-changed top-level directory (e.g., `app/services/`, `app/views/`). Higher score = deeper focused work. Lower score = scattered context-switching. Report as: "Focus score: 62% (app/services/)"
498
+
499
+ **Ship of the week:** Auto-identify the single highest-LOC PR in the window. Highlight it:
500
+ - PR number and title
501
+ - LOC changed
502
+ - Why it matters (infer from commit messages and files touched)
503
+
504
+ ### Step 9: Team Member Analysis
505
+
506
+ For each contributor (including the current user), compute:
507
+
508
+ 1. **Commits and LOC** — total commits, insertions, deletions, net LOC
509
+ 2. **Areas of focus** — which directories/files they touched most (top 3)
510
+ 3. **Commit type mix** — their personal feat/fix/refactor/test breakdown
511
+ 4. **Session patterns** — when they code (their peak hours), session count
512
+ 5. **Test discipline** — their personal test LOC ratio
513
+ 6. **Biggest ship** — their single highest-impact commit or PR in the window
514
+
515
+ **For the current user ("You"):** This section gets the deepest treatment. Include all the detail from the solo retro — session analysis, time patterns, focus score. Frame it in first person: "Your peak hours...", "Your biggest ship..."
516
+
517
+ **For each teammate:** Write 2-3 sentences covering what they worked on and their pattern. Then:
518
+
519
+ - **Praise** (1-2 specific things): Anchor in actual commits. Not "great work" — say exactly what was good. Examples: "Shipped the entire auth middleware rewrite in 3 focused sessions with 45% test coverage", "Every PR under 200 LOC — disciplined decomposition."
520
+ - **Opportunity for growth** (1 specific thing): Frame as a leveling-up suggestion, not criticism. Anchor in actual data. Examples: "Test ratio was 12% this week — adding test coverage to the payment module before it gets more complex would pay off", "5 fix commits on the same file suggest the original PR could have used a review pass."
521
+
522
+ **If only one contributor (solo repo):** Skip the team breakdown and proceed as before — the retro is personal.
523
+
524
+ **If there are Co-Authored-By trailers:** Parse `Co-Authored-By:` lines in commit messages. Credit those authors for the commit alongside the primary author. Note AI co-authors (e.g., `noreply@anthropic.com`) but do not include them as team members — instead, track "AI-assisted commits" as a separate metric.
525
+
526
+ ### Step 10: Week-over-Week Trends (if window >= 14d)
527
+
528
+ If the time window is 14 days or more, split into weekly buckets and show trends:
529
+ - Commits per week (total and per-author)
530
+ - LOC per week
531
+ - Test ratio per week
532
+ - Fix ratio per week
533
+ - Session count per week
534
+
535
+ ### Step 11: Streak Tracking
536
+
537
+ Count consecutive days with at least 1 commit to origin/<default>, going back from today. Track both team streak and personal streak:
538
+
539
+ ```bash
540
+ # Team streak: all unique commit dates (local time) — no hard cutoff
541
+ git log origin/<default> --format="%ad" --date=format:"%Y-%m-%d" | sort -u
542
+
543
+ # Personal streak: only the current user's commits
544
+ git log origin/<default> --author="<user_name>" --format="%ad" --date=format:"%Y-%m-%d" | sort -u
545
+ ```
546
+
547
+ Count backward from today — how many consecutive days have at least one commit? This queries the full history so streaks of any length are reported accurately. Display both:
548
+ - "Team shipping streak: 47 consecutive days"
549
+ - "Your shipping streak: 32 consecutive days"
550
+
551
+ ### Step 12: Load History & Compare
552
+
553
+ Before saving the new snapshot, check for prior retro history:
554
+
555
+ ```bash
556
+ ls -t .context/retros/*.json 2>/dev/null
557
+ ```
558
+
559
+ **If prior retros exist:** Load the most recent one using the Read tool. Calculate deltas for key metrics and include a **Trends vs Last Retro** section:
560
+ ```
561
+ Last Now Delta
562
+ Test ratio: 22% → 41% ↑19pp
563
+ Sessions: 10 → 14 ↑4
564
+ LOC/hour: 200 → 350 ↑75%
565
+ Fix ratio: 54% → 30% ↓24pp (improving)
566
+ Commits: 32 → 47 ↑47%
567
+ Deep sessions: 3 → 5 ↑2
568
+ ```
569
+
570
+ **If no prior retros exist:** Skip the comparison section and append: "First retro recorded — run again next week to see trends."
571
+
572
+ ### Step 13: Save Retro History
573
+
574
+ After computing all metrics (including streak) and loading any prior history for comparison, save a JSON snapshot:
575
+
576
+ ```bash
577
+ mkdir -p .context/retros
578
+ ```
579
+
580
+ Determine the next sequence number for today (substitute the actual date for `$(date +%Y-%m-%d)`):
581
+ ```bash
582
+ # Count existing retros for today to get next sequence number
583
+ today=$(date +%Y-%m-%d)
584
+ existing=$(ls .context/retros/${today}-*.json 2>/dev/null | wc -l | tr -d ' ')
585
+ next=$((existing + 1))
586
+ # Save as .context/retros/${today}-${next}.json
587
+ ```
588
+
589
+ Use the Write tool to save the JSON file with this schema:
590
+ ```json
591
+ {
592
+ "date": "2026-03-08",
593
+ "window": "7d",
594
+ "metrics": {
595
+ "commits": 47,
596
+ "contributors": 3,
597
+ "prs_merged": 12,
598
+ "insertions": 3200,
599
+ "deletions": 800,
600
+ "net_loc": 2400,
601
+ "test_loc": 1300,
602
+ "test_ratio": 0.41,
603
+ "active_days": 6,
604
+ "sessions": 14,
605
+ "deep_sessions": 5,
606
+ "avg_session_minutes": 42,
607
+ "loc_per_session_hour": 350,
608
+ "feat_pct": 0.40,
609
+ "fix_pct": 0.30,
610
+ "peak_hour": 22,
611
+ "ai_assisted_commits": 32
612
+ },
613
+ "authors": {
614
+ "Garry Tan": { "commits": 32, "insertions": 2400, "deletions": 300, "test_ratio": 0.41, "top_area": "browse/" },
615
+ "Alice": { "commits": 12, "insertions": 800, "deletions": 150, "test_ratio": 0.35, "top_area": "app/services/" }
616
+ },
617
+ "version_range": ["1.16.0.0", "1.16.1.0"],
618
+ "streak_days": 47,
619
+ "tweetable": "Week of Mar 1: 47 commits (3 contributors), 3.2k LOC, 38% tests, 12 PRs, peak: 10pm",
620
+ "greptile": {
621
+ "fixes": 3,
622
+ "fps": 1,
623
+ "already_fixed": 2,
624
+ "signal_pct": 83
625
+ }
626
+ }
627
+ ```
628
+
629
+ **Note:** Only include the `greptile` field if `~/.gstack/greptile-history.md` exists and has entries within the time window. Only include the `backlog` field if `TODOS.md` exists. Only include the `test_health` field if test files were found (command 10 returns > 0). If any has no data, omit the field entirely.
630
+
631
+ Include test health data in the JSON when test files exist:
632
+ ```json
633
+ "test_health": {
634
+ "total_test_files": 47,
635
+ "tests_added_this_period": 5,
636
+ "regression_test_commits": 3,
637
+ "test_files_changed": 8
638
+ }
639
+ ```
640
+
641
+ Include backlog data in the JSON when TODOS.md exists:
642
+ ```json
643
+ "backlog": {
644
+ "total_open": 28,
645
+ "p0_p1": 2,
646
+ "p2": 8,
647
+ "completed_this_period": 3,
648
+ "added_this_period": 1
649
+ }
650
+ ```
651
+
652
+ ### Step 14: Write the Narrative
653
+
654
+ Structure the output as:
655
+
656
+ ---
657
+
658
+ **Tweetable summary** (first line, before everything else):
659
+ ```
660
+ Week of Mar 1: 47 commits (3 contributors), 3.2k LOC, 38% tests, 12 PRs, peak: 10pm | Streak: 47d
661
+ ```
662
+
663
+ ## Engineering Retro: [date range]
664
+
665
+ ### Summary Table
666
+ (from Step 2)
667
+
668
+ ### Trends vs Last Retro
669
+ (from Step 11, loaded before save — skip if first retro)
670
+
671
+ ### Time & Session Patterns
672
+ (from Steps 3-4)
673
+
674
+ Narrative interpreting what the team-wide patterns mean:
675
+ - When the most productive hours are and what drives them
676
+ - Whether sessions are getting longer or shorter over time
677
+ - Estimated hours per day of active coding (team aggregate)
678
+ - Notable patterns: do team members code at the same time or in shifts?
679
+
680
+ ### Shipping Velocity
681
+ (from Steps 5-7)
682
+
683
+ Narrative covering:
684
+ - Commit type mix and what it reveals
685
+ - PR size distribution and what it reveals about shipping cadence
686
+ - Fix-chain detection (sequences of fix commits on the same subsystem)
687
+ - Version bump discipline
688
+
689
+ ### Code Quality Signals
690
+ - Test LOC ratio trend
691
+ - Hotspot analysis (are the same files churning?)
692
+ - Greptile signal ratio and trend (if history exists): "Greptile: X% signal (Y valid catches, Z false positives)"
693
+
694
+ ### Test Health
695
+ - Total test files: N (from command 10)
696
+ - Tests added this period: M (from command 12 — test files changed)
697
+ - Regression test commits: list `test(qa):` and `test(design):` and `test: coverage` commits from command 11
698
+ - If prior retro exists and has `test_health`: show delta "Test count: {last} → {now} (+{delta})"
699
+ - If test ratio < 20%: flag as growth area — "100% test coverage is the goal. Tests make vibe coding safe."
700
+
701
+ ### Focus & Highlights
702
+ (from Step 8)
703
+ - Focus score with interpretation
704
+ - Ship of the week callout
705
+
706
+ ### Your Week (personal deep-dive)
707
+ (from Step 9, for the current user only)
708
+
709
+ This is the section the user cares most about. Include:
710
+ - Their personal commit count, LOC, test ratio
711
+ - Their session patterns and peak hours
712
+ - Their focus areas
713
+ - Their biggest ship
714
+ - **What you did well** (2-3 specific things anchored in commits)
715
+ - **Where to level up** (1-2 specific, actionable suggestions)
716
+
717
+ ### Team Breakdown
718
+ (from Step 9, for each teammate — skip if solo repo)
719
+
720
+ For each teammate (sorted by commits descending), write a section:
721
+
722
+ #### [Name]
723
+ - **What they shipped**: 2-3 sentences on their contributions, areas of focus, and commit patterns
724
+ - **Praise**: 1-2 specific things they did well, anchored in actual commits. Be genuine — what would you actually say in a 1:1? Examples:
725
+ - "Cleaned up the entire auth module in 3 small, reviewable PRs — textbook decomposition"
726
+ - "Added integration tests for every new endpoint, not just happy paths"
727
+ - "Fixed the N+1 query that was causing 2s load times on the dashboard"
728
+ - **Opportunity for growth**: 1 specific, constructive suggestion. Frame as investment, not criticism. Examples:
729
+ - "Test coverage on the payment module is at 8% — worth investing in before the next feature lands on top of it"
730
+ - "Most commits land in a single burst — spacing work across the day could reduce context-switching fatigue"
731
+ - "All commits land between 1-4am — sustainable pace matters for code quality long-term"
732
+
733
+ **AI collaboration note:** If many commits have `Co-Authored-By` AI trailers (e.g., Claude, Copilot), note the AI-assisted commit percentage as a team metric. Frame it neutrally — "N% of commits were AI-assisted" — without judgment.
734
+
735
+ ### Top 3 Team Wins
736
+ Identify the 3 highest-impact things shipped in the window across the whole team. For each:
737
+ - What it was
738
+ - Who shipped it
739
+ - Why it matters (product/architecture impact)
740
+
741
+ ### 3 Things to Improve
742
+ Specific, actionable, anchored in actual commits. Mix personal and team-level suggestions. Phrase as "to get even better, the team could..."
743
+
744
+ ### 3 Habits for Next Week
745
+ Small, practical, realistic. Each must be something that takes <5 minutes to adopt. At least one should be team-oriented (e.g., "review each other's PRs same-day").
746
+
747
+ ### Week-over-Week Trends
748
+ (if applicable, from Step 10)
749
+
750
+ ---
751
+
752
+ ## Global Retrospective Mode
753
+
754
+ When the user runs `/retro global` (or `/retro global 14d`), follow this flow instead of the repo-scoped Steps 1-14. This mode works from any directory — it does NOT require being inside a git repo.
755
+
756
+ ### Global Step 1: Compute time window
757
+
758
+ Same midnight-aligned logic as the regular retro. Default 7d. The second argument after `global` is the window (e.g., `14d`, `30d`, `24h`).
759
+
760
+ ### Global Step 2: Run discovery
761
+
762
+ Locate and run the discovery script using this fallback chain:
763
+
764
+ ```bash
765
+ DISCOVER_BIN=""
766
+ [ -x ~/.claude/skills/gstack/bin/gstack-global-discover ] && DISCOVER_BIN=~/.claude/skills/gstack/bin/gstack-global-discover
767
+ [ -z "$DISCOVER_BIN" ] && [ -x .claude/skills/gstack/bin/gstack-global-discover ] && DISCOVER_BIN=.claude/skills/gstack/bin/gstack-global-discover
768
+ [ -z "$DISCOVER_BIN" ] && which gstack-global-discover >/dev/null 2>&1 && DISCOVER_BIN=$(which gstack-global-discover)
769
+ [ -z "$DISCOVER_BIN" ] && [ -f bin/gstack-global-discover.ts ] && DISCOVER_BIN="bun run bin/gstack-global-discover.ts"
770
+ echo "DISCOVER_BIN: $DISCOVER_BIN"
771
+ ```
772
+
773
+ If no binary is found, tell the user: "Discovery script not found. Run `bun run build` in the gstack directory to compile it." and stop.
774
+
775
+ Run the discovery:
776
+ ```bash
777
+ $DISCOVER_BIN --since "<window>" --format json 2>/tmp/gstack-discover-stderr
778
+ ```
779
+
780
+ Read the stderr output from `/tmp/gstack-discover-stderr` for diagnostic info. Parse the JSON output from stdout.
781
+
782
+ If `total_sessions` is 0, say: "No AI coding sessions found in the last <window>. Try a longer window: `/retro global 30d`" and stop.
783
+
784
+ ### Global Step 3: Run git log on each discovered repo
785
+
786
+ For each repo in the discovery JSON's `repos` array, find the first valid path in `paths[]` (directory exists with `.git/`). If no valid path exists, skip the repo and note it.
787
+
788
+ **For local-only repos** (where `remote` starts with `local:`): skip `git fetch` and use the local default branch. Use `git log HEAD` instead of `git log origin/$DEFAULT`.
789
+
790
+ **For repos with remotes:**
791
+
792
+ ```bash
793
+ git -C <path> fetch origin --quiet 2>/dev/null
794
+ ```
795
+
796
+ Detect the default branch for each repo: first try `git symbolic-ref refs/remotes/origin/HEAD`, then check common branch names (`main`, `master`), then fall back to `git rev-parse --abbrev-ref HEAD`. Use the detected branch as `<default>` in the commands below.
797
+
798
+ ```bash
799
+ # Commits with stats
800
+ git -C <path> log origin/$DEFAULT --since="<start_date>T00:00:00" --format="%H|%aN|%ai|%s" --shortstat
801
+
802
+ # Commit timestamps for session detection, streak, and context switching
803
+ git -C <path> log origin/$DEFAULT --since="<start_date>T00:00:00" --format="%at|%aN|%ai|%s" | sort -n
804
+
805
+ # Per-author commit counts
806
+ git -C <path> shortlog origin/$DEFAULT --since="<start_date>T00:00:00" -sn --no-merges
807
+
808
+ # PR numbers from commit messages
809
+ git -C <path> log origin/$DEFAULT --since="<start_date>T00:00:00" --format="%s" | grep -oE '#[0-9]+' | sort -n | uniq
810
+ ```
811
+
812
+ For repos that fail (deleted paths, network errors): skip and note "N repos could not be reached."
813
+
814
+ ### Global Step 4: Compute global shipping streak
815
+
816
+ For each repo, get commit dates (capped at 365 days):
817
+
818
+ ```bash
819
+ git -C <path> log origin/$DEFAULT --since="365 days ago" --format="%ad" --date=format:"%Y-%m-%d" | sort -u
820
+ ```
821
+
822
+ Union all dates across all repos. Count backward from today — how many consecutive days have at least one commit to ANY repo? If the streak hits 365 days, display as "365+ days".
823
+
824
+ ### Global Step 5: Compute context switching metric
825
+
826
+ From the commit timestamps gathered in Step 3, group by date. For each date, count how many distinct repos had commits that day. Report:
827
+ - Average repos/day
828
+ - Maximum repos/day
829
+ - Which days were focused (1 repo) vs. fragmented (3+ repos)
830
+
831
+ ### Global Step 6: Per-tool productivity patterns
832
+
833
+ From the discovery JSON, analyze tool usage patterns:
834
+ - Which AI tool is used for which repos (exclusive vs. shared)
835
+ - Session count per tool
836
+ - Behavioral patterns (e.g., "Codex used exclusively for myapp, Claude Code for everything else")
837
+
838
+ ### Global Step 7: Aggregate and generate narrative
839
+
840
+ Structure the output with the **shareable personal card first**, then the full
841
+ team/project breakdown below. The personal card is designed to be screenshot-friendly
842
+ — everything someone would want to share on X/Twitter in one clean block.
843
+
844
+ ---
845
+
846
+ **Tweetable summary** (first line, before everything else):
847
+ ```
848
+ Week of Mar 14: 5 projects, 138 commits, 250k LOC across 5 repos | 48 AI sessions | Streak: 52d 🔥
849
+ ```
850
+
851
+ ## 🚀 Your Week: [user name] — [date range]
852
+
853
+ This section is the **shareable personal card**. It contains ONLY the current user's
854
+ stats — no team data, no project breakdowns. Designed to screenshot and post.
855
+
856
+ Use the user identity from `git config user.name` to filter all per-repo git data.
857
+ Aggregate across all repos to compute personal totals.
858
+
859
+ Render as a single visually clean block. Left border only — no right border (LLMs
860
+ can't align right borders reliably). Pad repo names to the longest name so columns
861
+ align cleanly. Never truncate project names.
862
+
863
+ ```
864
+ ╔═══════════════════════════════════════════════════════════════
865
+ ║ [USER NAME] — Week of [date]
866
+ ╠═══════════════════════════════════════════════════════════════
867
+
868
+ ║ [N] commits across [M] projects
869
+ ║ +[X]k LOC added · [Y]k LOC deleted · [Z]k net
870
+ ║ [N] AI coding sessions (CC: X, Codex: Y, Gemini: Z)
871
+ ║ [N]-day shipping streak 🔥
872
+
873
+ ║ PROJECTS
874
+ ║ ─────────────────────────────────────────────────────────
875
+ ║ [repo_name_full] [N] commits +[X]k LOC [solo/team]
876
+ ║ [repo_name_full] [N] commits +[X]k LOC [solo/team]
877
+ ║ [repo_name_full] [N] commits +[X]k LOC [solo/team]
878
+
879
+ ║ SHIP OF THE WEEK
880
+ ║ [PR title] — [LOC] lines across [N] files
881
+
882
+ ║ TOP WORK
883
+ ║ • [1-line description of biggest theme]
884
+ ║ • [1-line description of second theme]
885
+ ║ • [1-line description of third theme]
886
+
887
+ ║ Powered by gstack · github.com/garrytan/gstack
888
+ ╚═══════════════════════════════════════════════════════════════
889
+ ```
890
+
891
+ **Rules for the personal card:**
892
+ - Only show repos where the user has commits. Skip repos with 0 commits.
893
+ - Sort repos by user's commit count descending.
894
+ - **Never truncate repo names.** Use the full repo name (e.g., `analyze_transcripts`
895
+ not `analyze_trans`). Pad the name column to the longest repo name so all columns
896
+ align. If names are long, widen the box — the box width adapts to content.
897
+ - For LOC, use "k" formatting for thousands (e.g., "+64.0k" not "+64010").
898
+ - Role: "solo" if user is the only contributor, "team" if others contributed.
899
+ - Ship of the Week: the user's single highest-LOC PR across ALL repos.
900
+ - Top Work: 3 bullet points summarizing the user's major themes, inferred from
901
+ commit messages. Not individual commits — synthesize into themes.
902
+ E.g., "Built /retro global — cross-project retrospective with AI session discovery"
903
+ not "feat: gstack-global-discover" + "feat: /retro global template".
904
+ - The card must be self-contained. Someone seeing ONLY this block should understand
905
+ the user's week without any surrounding context.
906
+ - Do NOT include team members, project totals, or context switching data here.
907
+
908
+ **Personal streak:** Use the user's own commits across all repos (filtered by
909
+ `--author`) to compute a personal streak, separate from the team streak.
910
+
911
+ ---
912
+
913
+ ## Global Engineering Retro: [date range]
914
+
915
+ Everything below is the full analysis — team data, project breakdowns, patterns.
916
+ This is the "deep dive" that follows the shareable card.
917
+
918
+ ### All Projects Overview
919
+ | Metric | Value |
920
+ |--------|-------|
921
+ | Projects active | N |
922
+ | Total commits (all repos, all contributors) | N |
923
+ | Total LOC | +N / -N |
924
+ | AI coding sessions | N (CC: X, Codex: Y, Gemini: Z) |
925
+ | Active days | N |
926
+ | Global shipping streak (any contributor, any repo) | N consecutive days |
927
+ | Context switches/day | N avg (max: M) |
928
+
929
+ ### Per-Project Breakdown
930
+ For each repo (sorted by commits descending):
931
+ - Repo name (with % of total commits)
932
+ - Commits, LOC, PRs merged, top contributor
933
+ - Key work (inferred from commit messages)
934
+ - AI sessions by tool
935
+
936
+ **Your Contributions** (sub-section within each project):
937
+ For each project, add a "Your contributions" block showing the current user's
938
+ personal stats within that repo. Use the user identity from `git config user.name`
939
+ to filter. Include:
940
+ - Your commits / total commits (with %)
941
+ - Your LOC (+insertions / -deletions)
942
+ - Your key work (inferred from YOUR commit messages only)
943
+ - Your commit type mix (feat/fix/refactor/chore/docs breakdown)
944
+ - Your biggest ship in this repo (highest-LOC commit or PR)
945
+
946
+ If the user is the only contributor, say "Solo project — all commits are yours."
947
+ If the user has 0 commits in a repo (team project they didn't touch this period),
948
+ say "No commits this period — [N] AI sessions only." and skip the breakdown.
949
+
950
+ Format:
951
+ ```
952
+ **Your contributions:** 47/244 commits (19%), +4.2k/-0.3k LOC
953
+ Key work: Writer Chat, email blocking, security hardening
954
+ Biggest ship: PR #605 — Writer Chat eats the admin bar (2,457 ins, 46 files)
955
+ Mix: feat(3) fix(2) chore(1)
956
+ ```
957
+
958
+ ### Cross-Project Patterns
959
+ - Time allocation across projects (% breakdown, use YOUR commits not total)
960
+ - Peak productivity hours aggregated across all repos
961
+ - Focused vs. fragmented days
962
+ - Context switching trends
963
+
964
+ ### Tool Usage Analysis
965
+ Per-tool breakdown with behavioral patterns:
966
+ - Claude Code: N sessions across M repos — patterns observed
967
+ - Codex: N sessions across M repos — patterns observed
968
+ - Gemini: N sessions across M repos — patterns observed
969
+
970
+ ### Ship of the Week (Global)
971
+ Highest-impact PR across ALL projects. Identify by LOC and commit messages.
972
+
973
+ ### 3 Cross-Project Insights
974
+ What the global view reveals that no single-repo retro could show.
975
+
976
+ ### 3 Habits for Next Week
977
+ Considering the full cross-project picture.
978
+
979
+ ---
980
+
981
+ ### Global Step 8: Load history & compare
982
+
983
+ ```bash
984
+ ls -t ~/.gstack/retros/global-*.json 2>/dev/null | head -5
985
+ ```
986
+
987
+ **Only compare against a prior retro with the same `window` value** (e.g., 7d vs 7d). If the most recent prior retro has a different window, skip comparison and note: "Prior global retro used a different window — skipping comparison."
988
+
989
+ If a matching prior retro exists, load it with the Read tool. Show a **Trends vs Last Global Retro** table with deltas for key metrics: total commits, LOC, sessions, streak, context switches/day.
990
+
991
+ If no prior global retros exist, append: "First global retro recorded — run again next week to see trends."
992
+
993
+ ### Global Step 9: Save snapshot
994
+
995
+ ```bash
996
+ mkdir -p ~/.gstack/retros
997
+ ```
998
+
999
+ Determine the next sequence number for today:
1000
+ ```bash
1001
+ today=$(date +%Y-%m-%d)
1002
+ existing=$(ls ~/.gstack/retros/global-${today}-*.json 2>/dev/null | wc -l | tr -d ' ')
1003
+ next=$((existing + 1))
1004
+ ```
1005
+
1006
+ Use the Write tool to save JSON to `~/.gstack/retros/global-${today}-${next}.json`:
1007
+
1008
+ ```json
1009
+ {
1010
+ "type": "global",
1011
+ "date": "2026-03-21",
1012
+ "window": "7d",
1013
+ "projects": [
1014
+ {
1015
+ "name": "gstack",
1016
+ "remote": "https://github.com/garrytan/gstack",
1017
+ "commits": 47,
1018
+ "insertions": 3200,
1019
+ "deletions": 800,
1020
+ "sessions": { "claude_code": 15, "codex": 3, "gemini": 0 }
1021
+ }
1022
+ ],
1023
+ "totals": {
1024
+ "commits": 182,
1025
+ "insertions": 15300,
1026
+ "deletions": 4200,
1027
+ "projects": 5,
1028
+ "active_days": 6,
1029
+ "sessions": { "claude_code": 48, "codex": 8, "gemini": 3 },
1030
+ "global_streak_days": 52,
1031
+ "avg_context_switches_per_day": 2.1
1032
+ },
1033
+ "tweetable": "Week of Mar 14: 5 projects, 182 commits, 15.3k LOC | CC: 48, Codex: 8, Gemini: 3 | Focus: gstack (58%) | Streak: 52d"
1034
+ }
1035
+ ```
1036
+
1037
+ ---
1038
+
1039
+ ## Compare Mode
1040
+
1041
+ When the user runs `/retro compare` (or `/retro compare 14d`):
1042
+
1043
+ 1. Compute metrics for the current window (default 7d) using the midnight-aligned start date (same logic as the main retro — e.g., if today is 2026-03-18 and window is 7d, use `--since="2026-03-11T00:00:00"`)
1044
+ 2. Compute metrics for the immediately prior same-length window using both `--since` and `--until` with midnight-aligned dates to avoid overlap (e.g., for a 7d window starting 2026-03-11: prior window is `--since="2026-03-04T00:00:00" --until="2026-03-11T00:00:00"`)
1045
+ 3. Show a side-by-side comparison table with deltas and arrows
1046
+ 4. Write a brief narrative highlighting the biggest improvements and regressions
1047
+ 5. Save only the current-window snapshot to `.context/retros/` (same as a normal retro run); do **not** persist the prior-window metrics.
1048
+
1049
+ ## Tone
1050
+
1051
+ - Encouraging but candid, no coddling
1052
+ - Specific and concrete — always anchor in actual commits/code
1053
+ - Skip generic praise ("great job!") — say exactly what was good and why
1054
+ - Frame improvements as leveling up, not criticism
1055
+ - **Praise should feel like something you'd actually say in a 1:1** — specific, earned, genuine
1056
+ - **Growth suggestions should feel like investment advice** — "this is worth your time because..." not "you failed at..."
1057
+ - Never compare teammates against each other negatively. Each person's section stands on its own.
1058
+ - Keep total output around 3000-4500 words (slightly longer to accommodate team sections)
1059
+ - Use markdown tables and code blocks for data, prose for narrative
1060
+ - Output directly to the conversation — do NOT write to filesystem (except the `.context/retros/` JSON snapshot)
1061
+
1062
+ ## Important Rules
1063
+
1064
+ - ALL narrative output goes directly to the user in the conversation. The ONLY file written is the `.context/retros/` JSON snapshot.
1065
+ - Use `origin/<default>` for all git queries (not local main which may be stale)
1066
+ - Display all timestamps in the user's local timezone (do not override `TZ`)
1067
+ - If the window has zero commits, say so and suggest a different window
1068
+ - Round LOC/hour to nearest 50
1069
+ - Treat merge commits as PR boundaries
1070
+ - Do not read CLAUDE.md or other docs — this skill is self-contained
1071
+ - On first run (no prior retros), skip comparison sections gracefully
1072
+ - **Global mode:** Does NOT require being inside a git repo. Saves snapshots to `~/.gstack/retros/` (not `.context/retros/`). Gracefully skip AI tools that aren't installed. Only compare against prior global retros with the same window value. If streak hits 365d cap, display as "365+ days".