@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,833 @@
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
+
18
+ {{PREAMBLE}}
19
+
20
+ ## Detect default branch
21
+
22
+ Before gathering data, detect the repo's default branch name:
23
+ `gh repo view --json defaultBranchRef -q .defaultBranchRef.name`
24
+
25
+ If this fails, fall back to `main`. Use the detected name wherever the instructions
26
+ say `origin/<default>` below.
27
+
28
+ ---
29
+
30
+ # /retro — Weekly Engineering Retrospective
31
+
32
+ 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.
33
+
34
+ ## User-invocable
35
+ When the user types `/retro`, run this skill.
36
+
37
+ ## Arguments
38
+ - `/retro` — default: last 7 days
39
+ - `/retro 24h` — last 24 hours
40
+ - `/retro 14d` — last 14 days
41
+ - `/retro 30d` — last 30 days
42
+ - `/retro compare` — compare current window vs prior same-length window
43
+ - `/retro compare 14d` — compare with explicit window
44
+ - `/retro global` — cross-project retro across all AI coding tools (7d default)
45
+ - `/retro global 14d` — cross-project retro with explicit window
46
+
47
+ ## Instructions
48
+
49
+ 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`).
50
+
51
+ **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.
52
+
53
+ **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:
54
+ ```
55
+ Usage: /retro [window | compare | global]
56
+ /retro — last 7 days (default)
57
+ /retro 24h — last 24 hours
58
+ /retro 14d — last 14 days
59
+ /retro 30d — last 30 days
60
+ /retro compare — compare this period vs prior period
61
+ /retro compare 14d — compare with explicit window
62
+ /retro global — cross-project retro across all AI tools (7d default)
63
+ /retro global 14d — cross-project retro with explicit window
64
+ ```
65
+
66
+ **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.
67
+
68
+ ### Step 1: Gather Raw Data
69
+
70
+ First, fetch origin and identify the current user:
71
+ ```bash
72
+ git fetch origin <default> --quiet
73
+ # Identify who is running the retro
74
+ git config user.name
75
+ git config user.email
76
+ ```
77
+
78
+ 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.
79
+
80
+ Run ALL of these git commands in parallel (they are independent):
81
+
82
+ ```bash
83
+ # 1. All commits in window with timestamps, subject, hash, AUTHOR, files changed, insertions, deletions
84
+ git log origin/<default> --since="<window>" --format="%H|%aN|%ae|%ai|%s" --shortstat
85
+
86
+ # 2. Per-commit test vs total LOC breakdown with author
87
+ # Each commit block starts with COMMIT:<hash>|<author>, followed by numstat lines.
88
+ # Separate test files (matching test/|spec/|__tests__/) from production files.
89
+ git log origin/<default> --since="<window>" --format="COMMIT:%H|%aN" --numstat
90
+
91
+ # 3. Commit timestamps for session detection and hourly distribution (with author)
92
+ git log origin/<default> --since="<window>" --format="%at|%aN|%ai|%s" | sort -n
93
+
94
+ # 4. Files most frequently changed (hotspot analysis)
95
+ git log origin/<default> --since="<window>" --format="" --name-only | grep -v '^$' | sort | uniq -c | sort -rn
96
+
97
+ # 5. PR numbers from commit messages (extract #NNN patterns)
98
+ git log origin/<default> --since="<window>" --format="%s" | grep -oE '#[0-9]+' | sed 's/^#//' | sort -n | uniq | sed 's/^/#/'
99
+
100
+ # 6. Per-author file hotspots (who touches what)
101
+ git log origin/<default> --since="<window>" --format="AUTHOR:%aN" --name-only
102
+
103
+ # 7. Per-author commit counts (quick summary)
104
+ git shortlog origin/<default> --since="<window>" -sn --no-merges
105
+
106
+ # 8. Greptile triage history (if available)
107
+ cat ~/.gstack/greptile-history.md 2>/dev/null || true
108
+
109
+ # 9. TODOS.md backlog (if available)
110
+ cat TODOS.md 2>/dev/null || true
111
+
112
+ # 10. Test file count
113
+ find . -name '*.test.*' -o -name '*.spec.*' -o -name '*_test.*' -o -name '*_spec.*' 2>/dev/null | grep -v node_modules | wc -l
114
+
115
+ # 11. Regression test commits in window
116
+ git log origin/<default> --since="<window>" --oneline --grep="test(qa):" --grep="test(design):" --grep="test: coverage"
117
+
118
+ # 12. gstack skill usage telemetry (if available)
119
+ cat ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true
120
+
121
+ # 12. Test files changed in window
122
+ git log origin/<default> --since="<window>" --format="" --name-only | grep -E '\.(test|spec)\.' | sort -u | wc -l
123
+ ```
124
+
125
+ ### Step 2: Compute Metrics
126
+
127
+ Calculate and present these metrics in a summary table:
128
+
129
+ | Metric | Value |
130
+ |--------|-------|
131
+ | Commits to main | N |
132
+ | Contributors | N |
133
+ | PRs merged | N |
134
+ | Total insertions | N |
135
+ | Total deletions | N |
136
+ | Net LOC added | N |
137
+ | Test LOC (insertions) | N |
138
+ | Test LOC ratio | N% |
139
+ | Version range | vX.Y.Z.W → vX.Y.Z.W |
140
+ | Active days | N |
141
+ | Detected sessions | N |
142
+ | Avg LOC/session-hour | N |
143
+ | Greptile signal | N% (Y catches, Z FPs) |
144
+ | Test Health | N total tests · M added this period · K regression tests |
145
+
146
+ Then show a **per-author leaderboard** immediately below:
147
+
148
+ ```
149
+ Contributor Commits +/- Top area
150
+ You (garry) 32 +2400/-300 browse/
151
+ alice 12 +800/-150 app/services/
152
+ bob 3 +120/-40 tests/
153
+ ```
154
+
155
+ Sort by commits descending. The current user (from `git config user.name`) always appears first, labeled "You (name)".
156
+
157
+ **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.
158
+
159
+ **Backlog Health (if TODOS.md exists):** Read `TODOS.md` (fetched in Step 1, command 9). Compute:
160
+ - Total open TODOs (exclude items in `## Completed` section)
161
+ - P0/P1 count (critical/urgent items)
162
+ - P2 count (important items)
163
+ - Items completed this period (items in Completed section with dates within the retro window)
164
+ - Items added this period (cross-reference git log for commits that modified TODOS.md within the window)
165
+
166
+ Include in the metrics table:
167
+ ```
168
+ | Backlog Health | N open (X P0/P1, Y P2) · Z completed this period |
169
+ ```
170
+
171
+ If TODOS.md doesn't exist, skip the Backlog Health row.
172
+
173
+ **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:
174
+
175
+ ```
176
+ | Skill Usage | /ship(12) /qa(8) /review(5) · 3 safety hook fires |
177
+ ```
178
+
179
+ If the JSONL file doesn't exist or has no entries in the window, skip the Skill Usage row.
180
+
181
+ **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:
182
+
183
+ ```
184
+ | Eureka Moments | 2 this period |
185
+ ```
186
+
187
+ If moments exist, list them:
188
+ ```
189
+ EUREKA /office-hours (branch: garrytan/auth-rethink): "Session tokens don't need server storage — browser crypto API makes client-side JWT validation viable"
190
+ EUREKA /plan-eng-review (branch: garrytan/cache-layer): "Redis isn't needed here — Bun's built-in LRU cache handles this workload"
191
+ ```
192
+
193
+ If the JSONL file doesn't exist or has no entries in the window, skip the Eureka Moments row.
194
+
195
+ ### Step 3: Commit Time Distribution
196
+
197
+ Show hourly histogram in local time using bar chart:
198
+
199
+ ```
200
+ Hour Commits ████████████████
201
+ 00: 4 ████
202
+ 07: 5 █████
203
+ ...
204
+ ```
205
+
206
+ Identify and call out:
207
+ - Peak hours
208
+ - Dead zones
209
+ - Whether pattern is bimodal (morning/evening) or continuous
210
+ - Late-night coding clusters (after 10pm)
211
+
212
+ ### Step 4: Work Session Detection
213
+
214
+ Detect sessions using **45-minute gap** threshold between consecutive commits. For each session report:
215
+ - Start/end time (Pacific)
216
+ - Number of commits
217
+ - Duration in minutes
218
+
219
+ Classify sessions:
220
+ - **Deep sessions** (50+ min)
221
+ - **Medium sessions** (20-50 min)
222
+ - **Micro sessions** (<20 min, typically single-commit fire-and-forget)
223
+
224
+ Calculate:
225
+ - Total active coding time (sum of session durations)
226
+ - Average session length
227
+ - LOC per hour of active time
228
+
229
+ ### Step 5: Commit Type Breakdown
230
+
231
+ Categorize by conventional commit prefix (feat/fix/refactor/test/chore/docs). Show as percentage bar:
232
+
233
+ ```
234
+ feat: 20 (40%) ████████████████████
235
+ fix: 27 (54%) ███████████████████████████
236
+ refactor: 2 ( 4%) ██
237
+ ```
238
+
239
+ Flag if fix ratio exceeds 50% — this signals a "ship fast, fix fast" pattern that may indicate review gaps.
240
+
241
+ ### Step 6: Hotspot Analysis
242
+
243
+ Show top 10 most-changed files. Flag:
244
+ - Files changed 5+ times (churn hotspots)
245
+ - Test files vs production files in the hotspot list
246
+ - VERSION/CHANGELOG frequency (version discipline indicator)
247
+
248
+ ### Step 7: PR Size Distribution
249
+
250
+ From commit diffs, estimate PR sizes and bucket them:
251
+ - **Small** (<100 LOC)
252
+ - **Medium** (100-500 LOC)
253
+ - **Large** (500-1500 LOC)
254
+ - **XL** (1500+ LOC)
255
+
256
+ ### Step 8: Focus Score + Ship of the Week
257
+
258
+ **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/)"
259
+
260
+ **Ship of the week:** Auto-identify the single highest-LOC PR in the window. Highlight it:
261
+ - PR number and title
262
+ - LOC changed
263
+ - Why it matters (infer from commit messages and files touched)
264
+
265
+ ### Step 9: Team Member Analysis
266
+
267
+ For each contributor (including the current user), compute:
268
+
269
+ 1. **Commits and LOC** — total commits, insertions, deletions, net LOC
270
+ 2. **Areas of focus** — which directories/files they touched most (top 3)
271
+ 3. **Commit type mix** — their personal feat/fix/refactor/test breakdown
272
+ 4. **Session patterns** — when they code (their peak hours), session count
273
+ 5. **Test discipline** — their personal test LOC ratio
274
+ 6. **Biggest ship** — their single highest-impact commit or PR in the window
275
+
276
+ **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..."
277
+
278
+ **For each teammate:** Write 2-3 sentences covering what they worked on and their pattern. Then:
279
+
280
+ - **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."
281
+ - **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."
282
+
283
+ **If only one contributor (solo repo):** Skip the team breakdown and proceed as before — the retro is personal.
284
+
285
+ **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.
286
+
287
+ ### Step 10: Week-over-Week Trends (if window >= 14d)
288
+
289
+ If the time window is 14 days or more, split into weekly buckets and show trends:
290
+ - Commits per week (total and per-author)
291
+ - LOC per week
292
+ - Test ratio per week
293
+ - Fix ratio per week
294
+ - Session count per week
295
+
296
+ ### Step 11: Streak Tracking
297
+
298
+ Count consecutive days with at least 1 commit to origin/<default>, going back from today. Track both team streak and personal streak:
299
+
300
+ ```bash
301
+ # Team streak: all unique commit dates (local time) — no hard cutoff
302
+ git log origin/<default> --format="%ad" --date=format:"%Y-%m-%d" | sort -u
303
+
304
+ # Personal streak: only the current user's commits
305
+ git log origin/<default> --author="<user_name>" --format="%ad" --date=format:"%Y-%m-%d" | sort -u
306
+ ```
307
+
308
+ 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:
309
+ - "Team shipping streak: 47 consecutive days"
310
+ - "Your shipping streak: 32 consecutive days"
311
+
312
+ ### Step 12: Load History & Compare
313
+
314
+ Before saving the new snapshot, check for prior retro history:
315
+
316
+ ```bash
317
+ ls -t .context/retros/*.json 2>/dev/null
318
+ ```
319
+
320
+ **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:
321
+ ```
322
+ Last Now Delta
323
+ Test ratio: 22% → 41% ↑19pp
324
+ Sessions: 10 → 14 ↑4
325
+ LOC/hour: 200 → 350 ↑75%
326
+ Fix ratio: 54% → 30% ↓24pp (improving)
327
+ Commits: 32 → 47 ↑47%
328
+ Deep sessions: 3 → 5 ↑2
329
+ ```
330
+
331
+ **If no prior retros exist:** Skip the comparison section and append: "First retro recorded — run again next week to see trends."
332
+
333
+ ### Step 13: Save Retro History
334
+
335
+ After computing all metrics (including streak) and loading any prior history for comparison, save a JSON snapshot:
336
+
337
+ ```bash
338
+ mkdir -p .context/retros
339
+ ```
340
+
341
+ Determine the next sequence number for today (substitute the actual date for `$(date +%Y-%m-%d)`):
342
+ ```bash
343
+ # Count existing retros for today to get next sequence number
344
+ today=$(date +%Y-%m-%d)
345
+ existing=$(ls .context/retros/${today}-*.json 2>/dev/null | wc -l | tr -d ' ')
346
+ next=$((existing + 1))
347
+ # Save as .context/retros/${today}-${next}.json
348
+ ```
349
+
350
+ Use the Write tool to save the JSON file with this schema:
351
+ ```json
352
+ {
353
+ "date": "2026-03-08",
354
+ "window": "7d",
355
+ "metrics": {
356
+ "commits": 47,
357
+ "contributors": 3,
358
+ "prs_merged": 12,
359
+ "insertions": 3200,
360
+ "deletions": 800,
361
+ "net_loc": 2400,
362
+ "test_loc": 1300,
363
+ "test_ratio": 0.41,
364
+ "active_days": 6,
365
+ "sessions": 14,
366
+ "deep_sessions": 5,
367
+ "avg_session_minutes": 42,
368
+ "loc_per_session_hour": 350,
369
+ "feat_pct": 0.40,
370
+ "fix_pct": 0.30,
371
+ "peak_hour": 22,
372
+ "ai_assisted_commits": 32
373
+ },
374
+ "authors": {
375
+ "Garry Tan": { "commits": 32, "insertions": 2400, "deletions": 300, "test_ratio": 0.41, "top_area": "browse/" },
376
+ "Alice": { "commits": 12, "insertions": 800, "deletions": 150, "test_ratio": 0.35, "top_area": "app/services/" }
377
+ },
378
+ "version_range": ["1.16.0.0", "1.16.1.0"],
379
+ "streak_days": 47,
380
+ "tweetable": "Week of Mar 1: 47 commits (3 contributors), 3.2k LOC, 38% tests, 12 PRs, peak: 10pm",
381
+ "greptile": {
382
+ "fixes": 3,
383
+ "fps": 1,
384
+ "already_fixed": 2,
385
+ "signal_pct": 83
386
+ }
387
+ }
388
+ ```
389
+
390
+ **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.
391
+
392
+ Include test health data in the JSON when test files exist:
393
+ ```json
394
+ "test_health": {
395
+ "total_test_files": 47,
396
+ "tests_added_this_period": 5,
397
+ "regression_test_commits": 3,
398
+ "test_files_changed": 8
399
+ }
400
+ ```
401
+
402
+ Include backlog data in the JSON when TODOS.md exists:
403
+ ```json
404
+ "backlog": {
405
+ "total_open": 28,
406
+ "p0_p1": 2,
407
+ "p2": 8,
408
+ "completed_this_period": 3,
409
+ "added_this_period": 1
410
+ }
411
+ ```
412
+
413
+ ### Step 14: Write the Narrative
414
+
415
+ Structure the output as:
416
+
417
+ ---
418
+
419
+ **Tweetable summary** (first line, before everything else):
420
+ ```
421
+ Week of Mar 1: 47 commits (3 contributors), 3.2k LOC, 38% tests, 12 PRs, peak: 10pm | Streak: 47d
422
+ ```
423
+
424
+ ## Engineering Retro: [date range]
425
+
426
+ ### Summary Table
427
+ (from Step 2)
428
+
429
+ ### Trends vs Last Retro
430
+ (from Step 11, loaded before save — skip if first retro)
431
+
432
+ ### Time & Session Patterns
433
+ (from Steps 3-4)
434
+
435
+ Narrative interpreting what the team-wide patterns mean:
436
+ - When the most productive hours are and what drives them
437
+ - Whether sessions are getting longer or shorter over time
438
+ - Estimated hours per day of active coding (team aggregate)
439
+ - Notable patterns: do team members code at the same time or in shifts?
440
+
441
+ ### Shipping Velocity
442
+ (from Steps 5-7)
443
+
444
+ Narrative covering:
445
+ - Commit type mix and what it reveals
446
+ - PR size distribution and what it reveals about shipping cadence
447
+ - Fix-chain detection (sequences of fix commits on the same subsystem)
448
+ - Version bump discipline
449
+
450
+ ### Code Quality Signals
451
+ - Test LOC ratio trend
452
+ - Hotspot analysis (are the same files churning?)
453
+ - Greptile signal ratio and trend (if history exists): "Greptile: X% signal (Y valid catches, Z false positives)"
454
+
455
+ ### Test Health
456
+ - Total test files: N (from command 10)
457
+ - Tests added this period: M (from command 12 — test files changed)
458
+ - Regression test commits: list `test(qa):` and `test(design):` and `test: coverage` commits from command 11
459
+ - If prior retro exists and has `test_health`: show delta "Test count: {last} → {now} (+{delta})"
460
+ - If test ratio < 20%: flag as growth area — "100% test coverage is the goal. Tests make vibe coding safe."
461
+
462
+ ### Focus & Highlights
463
+ (from Step 8)
464
+ - Focus score with interpretation
465
+ - Ship of the week callout
466
+
467
+ ### Your Week (personal deep-dive)
468
+ (from Step 9, for the current user only)
469
+
470
+ This is the section the user cares most about. Include:
471
+ - Their personal commit count, LOC, test ratio
472
+ - Their session patterns and peak hours
473
+ - Their focus areas
474
+ - Their biggest ship
475
+ - **What you did well** (2-3 specific things anchored in commits)
476
+ - **Where to level up** (1-2 specific, actionable suggestions)
477
+
478
+ ### Team Breakdown
479
+ (from Step 9, for each teammate — skip if solo repo)
480
+
481
+ For each teammate (sorted by commits descending), write a section:
482
+
483
+ #### [Name]
484
+ - **What they shipped**: 2-3 sentences on their contributions, areas of focus, and commit patterns
485
+ - **Praise**: 1-2 specific things they did well, anchored in actual commits. Be genuine — what would you actually say in a 1:1? Examples:
486
+ - "Cleaned up the entire auth module in 3 small, reviewable PRs — textbook decomposition"
487
+ - "Added integration tests for every new endpoint, not just happy paths"
488
+ - "Fixed the N+1 query that was causing 2s load times on the dashboard"
489
+ - **Opportunity for growth**: 1 specific, constructive suggestion. Frame as investment, not criticism. Examples:
490
+ - "Test coverage on the payment module is at 8% — worth investing in before the next feature lands on top of it"
491
+ - "Most commits land in a single burst — spacing work across the day could reduce context-switching fatigue"
492
+ - "All commits land between 1-4am — sustainable pace matters for code quality long-term"
493
+
494
+ **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.
495
+
496
+ ### Top 3 Team Wins
497
+ Identify the 3 highest-impact things shipped in the window across the whole team. For each:
498
+ - What it was
499
+ - Who shipped it
500
+ - Why it matters (product/architecture impact)
501
+
502
+ ### 3 Things to Improve
503
+ Specific, actionable, anchored in actual commits. Mix personal and team-level suggestions. Phrase as "to get even better, the team could..."
504
+
505
+ ### 3 Habits for Next Week
506
+ 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").
507
+
508
+ ### Week-over-Week Trends
509
+ (if applicable, from Step 10)
510
+
511
+ ---
512
+
513
+ ## Global Retrospective Mode
514
+
515
+ 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.
516
+
517
+ ### Global Step 1: Compute time window
518
+
519
+ Same midnight-aligned logic as the regular retro. Default 7d. The second argument after `global` is the window (e.g., `14d`, `30d`, `24h`).
520
+
521
+ ### Global Step 2: Run discovery
522
+
523
+ Locate and run the discovery script using this fallback chain:
524
+
525
+ ```bash
526
+ DISCOVER_BIN=""
527
+ [ -x ~/.claude/skills/gstack/bin/gstack-global-discover ] && DISCOVER_BIN=~/.claude/skills/gstack/bin/gstack-global-discover
528
+ [ -z "$DISCOVER_BIN" ] && [ -x .claude/skills/gstack/bin/gstack-global-discover ] && DISCOVER_BIN=.claude/skills/gstack/bin/gstack-global-discover
529
+ [ -z "$DISCOVER_BIN" ] && which gstack-global-discover >/dev/null 2>&1 && DISCOVER_BIN=$(which gstack-global-discover)
530
+ [ -z "$DISCOVER_BIN" ] && [ -f bin/gstack-global-discover.ts ] && DISCOVER_BIN="bun run bin/gstack-global-discover.ts"
531
+ echo "DISCOVER_BIN: $DISCOVER_BIN"
532
+ ```
533
+
534
+ 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.
535
+
536
+ Run the discovery:
537
+ ```bash
538
+ $DISCOVER_BIN --since "<window>" --format json 2>/tmp/gstack-discover-stderr
539
+ ```
540
+
541
+ Read the stderr output from `/tmp/gstack-discover-stderr` for diagnostic info. Parse the JSON output from stdout.
542
+
543
+ If `total_sessions` is 0, say: "No AI coding sessions found in the last <window>. Try a longer window: `/retro global 30d`" and stop.
544
+
545
+ ### Global Step 3: Run git log on each discovered repo
546
+
547
+ 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.
548
+
549
+ **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`.
550
+
551
+ **For repos with remotes:**
552
+
553
+ ```bash
554
+ git -C <path> fetch origin --quiet 2>/dev/null
555
+ ```
556
+
557
+ 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.
558
+
559
+ ```bash
560
+ # Commits with stats
561
+ git -C <path> log origin/$DEFAULT --since="<start_date>T00:00:00" --format="%H|%aN|%ai|%s" --shortstat
562
+
563
+ # Commit timestamps for session detection, streak, and context switching
564
+ git -C <path> log origin/$DEFAULT --since="<start_date>T00:00:00" --format="%at|%aN|%ai|%s" | sort -n
565
+
566
+ # Per-author commit counts
567
+ git -C <path> shortlog origin/$DEFAULT --since="<start_date>T00:00:00" -sn --no-merges
568
+
569
+ # PR numbers from commit messages
570
+ git -C <path> log origin/$DEFAULT --since="<start_date>T00:00:00" --format="%s" | grep -oE '#[0-9]+' | sort -n | uniq
571
+ ```
572
+
573
+ For repos that fail (deleted paths, network errors): skip and note "N repos could not be reached."
574
+
575
+ ### Global Step 4: Compute global shipping streak
576
+
577
+ For each repo, get commit dates (capped at 365 days):
578
+
579
+ ```bash
580
+ git -C <path> log origin/$DEFAULT --since="365 days ago" --format="%ad" --date=format:"%Y-%m-%d" | sort -u
581
+ ```
582
+
583
+ 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".
584
+
585
+ ### Global Step 5: Compute context switching metric
586
+
587
+ From the commit timestamps gathered in Step 3, group by date. For each date, count how many distinct repos had commits that day. Report:
588
+ - Average repos/day
589
+ - Maximum repos/day
590
+ - Which days were focused (1 repo) vs. fragmented (3+ repos)
591
+
592
+ ### Global Step 6: Per-tool productivity patterns
593
+
594
+ From the discovery JSON, analyze tool usage patterns:
595
+ - Which AI tool is used for which repos (exclusive vs. shared)
596
+ - Session count per tool
597
+ - Behavioral patterns (e.g., "Codex used exclusively for myapp, Claude Code for everything else")
598
+
599
+ ### Global Step 7: Aggregate and generate narrative
600
+
601
+ Structure the output with the **shareable personal card first**, then the full
602
+ team/project breakdown below. The personal card is designed to be screenshot-friendly
603
+ — everything someone would want to share on X/Twitter in one clean block.
604
+
605
+ ---
606
+
607
+ **Tweetable summary** (first line, before everything else):
608
+ ```
609
+ Week of Mar 14: 5 projects, 138 commits, 250k LOC across 5 repos | 48 AI sessions | Streak: 52d 🔥
610
+ ```
611
+
612
+ ## 🚀 Your Week: [user name] — [date range]
613
+
614
+ This section is the **shareable personal card**. It contains ONLY the current user's
615
+ stats — no team data, no project breakdowns. Designed to screenshot and post.
616
+
617
+ Use the user identity from `git config user.name` to filter all per-repo git data.
618
+ Aggregate across all repos to compute personal totals.
619
+
620
+ Render as a single visually clean block. Left border only — no right border (LLMs
621
+ can't align right borders reliably). Pad repo names to the longest name so columns
622
+ align cleanly. Never truncate project names.
623
+
624
+ ```
625
+ ╔═══════════════════════════════════════════════════════════════
626
+ ║ [USER NAME] — Week of [date]
627
+ ╠═══════════════════════════════════════════════════════════════
628
+
629
+ ║ [N] commits across [M] projects
630
+ ║ +[X]k LOC added · [Y]k LOC deleted · [Z]k net
631
+ ║ [N] AI coding sessions (CC: X, Codex: Y, Gemini: Z)
632
+ ║ [N]-day shipping streak 🔥
633
+
634
+ ║ PROJECTS
635
+ ║ ─────────────────────────────────────────────────────────
636
+ ║ [repo_name_full] [N] commits +[X]k LOC [solo/team]
637
+ ║ [repo_name_full] [N] commits +[X]k LOC [solo/team]
638
+ ║ [repo_name_full] [N] commits +[X]k LOC [solo/team]
639
+
640
+ ║ SHIP OF THE WEEK
641
+ ║ [PR title] — [LOC] lines across [N] files
642
+
643
+ ║ TOP WORK
644
+ ║ • [1-line description of biggest theme]
645
+ ║ • [1-line description of second theme]
646
+ ║ • [1-line description of third theme]
647
+
648
+ ║ Powered by gstack · github.com/garrytan/gstack
649
+ ╚═══════════════════════════════════════════════════════════════
650
+ ```
651
+
652
+ **Rules for the personal card:**
653
+ - Only show repos where the user has commits. Skip repos with 0 commits.
654
+ - Sort repos by user's commit count descending.
655
+ - **Never truncate repo names.** Use the full repo name (e.g., `analyze_transcripts`
656
+ not `analyze_trans`). Pad the name column to the longest repo name so all columns
657
+ align. If names are long, widen the box — the box width adapts to content.
658
+ - For LOC, use "k" formatting for thousands (e.g., "+64.0k" not "+64010").
659
+ - Role: "solo" if user is the only contributor, "team" if others contributed.
660
+ - Ship of the Week: the user's single highest-LOC PR across ALL repos.
661
+ - Top Work: 3 bullet points summarizing the user's major themes, inferred from
662
+ commit messages. Not individual commits — synthesize into themes.
663
+ E.g., "Built /retro global — cross-project retrospective with AI session discovery"
664
+ not "feat: gstack-global-discover" + "feat: /retro global template".
665
+ - The card must be self-contained. Someone seeing ONLY this block should understand
666
+ the user's week without any surrounding context.
667
+ - Do NOT include team members, project totals, or context switching data here.
668
+
669
+ **Personal streak:** Use the user's own commits across all repos (filtered by
670
+ `--author`) to compute a personal streak, separate from the team streak.
671
+
672
+ ---
673
+
674
+ ## Global Engineering Retro: [date range]
675
+
676
+ Everything below is the full analysis — team data, project breakdowns, patterns.
677
+ This is the "deep dive" that follows the shareable card.
678
+
679
+ ### All Projects Overview
680
+ | Metric | Value |
681
+ |--------|-------|
682
+ | Projects active | N |
683
+ | Total commits (all repos, all contributors) | N |
684
+ | Total LOC | +N / -N |
685
+ | AI coding sessions | N (CC: X, Codex: Y, Gemini: Z) |
686
+ | Active days | N |
687
+ | Global shipping streak (any contributor, any repo) | N consecutive days |
688
+ | Context switches/day | N avg (max: M) |
689
+
690
+ ### Per-Project Breakdown
691
+ For each repo (sorted by commits descending):
692
+ - Repo name (with % of total commits)
693
+ - Commits, LOC, PRs merged, top contributor
694
+ - Key work (inferred from commit messages)
695
+ - AI sessions by tool
696
+
697
+ **Your Contributions** (sub-section within each project):
698
+ For each project, add a "Your contributions" block showing the current user's
699
+ personal stats within that repo. Use the user identity from `git config user.name`
700
+ to filter. Include:
701
+ - Your commits / total commits (with %)
702
+ - Your LOC (+insertions / -deletions)
703
+ - Your key work (inferred from YOUR commit messages only)
704
+ - Your commit type mix (feat/fix/refactor/chore/docs breakdown)
705
+ - Your biggest ship in this repo (highest-LOC commit or PR)
706
+
707
+ If the user is the only contributor, say "Solo project — all commits are yours."
708
+ If the user has 0 commits in a repo (team project they didn't touch this period),
709
+ say "No commits this period — [N] AI sessions only." and skip the breakdown.
710
+
711
+ Format:
712
+ ```
713
+ **Your contributions:** 47/244 commits (19%), +4.2k/-0.3k LOC
714
+ Key work: Writer Chat, email blocking, security hardening
715
+ Biggest ship: PR #605 — Writer Chat eats the admin bar (2,457 ins, 46 files)
716
+ Mix: feat(3) fix(2) chore(1)
717
+ ```
718
+
719
+ ### Cross-Project Patterns
720
+ - Time allocation across projects (% breakdown, use YOUR commits not total)
721
+ - Peak productivity hours aggregated across all repos
722
+ - Focused vs. fragmented days
723
+ - Context switching trends
724
+
725
+ ### Tool Usage Analysis
726
+ Per-tool breakdown with behavioral patterns:
727
+ - Claude Code: N sessions across M repos — patterns observed
728
+ - Codex: N sessions across M repos — patterns observed
729
+ - Gemini: N sessions across M repos — patterns observed
730
+
731
+ ### Ship of the Week (Global)
732
+ Highest-impact PR across ALL projects. Identify by LOC and commit messages.
733
+
734
+ ### 3 Cross-Project Insights
735
+ What the global view reveals that no single-repo retro could show.
736
+
737
+ ### 3 Habits for Next Week
738
+ Considering the full cross-project picture.
739
+
740
+ ---
741
+
742
+ ### Global Step 8: Load history & compare
743
+
744
+ ```bash
745
+ ls -t ~/.gstack/retros/global-*.json 2>/dev/null | head -5
746
+ ```
747
+
748
+ **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."
749
+
750
+ 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.
751
+
752
+ If no prior global retros exist, append: "First global retro recorded — run again next week to see trends."
753
+
754
+ ### Global Step 9: Save snapshot
755
+
756
+ ```bash
757
+ mkdir -p ~/.gstack/retros
758
+ ```
759
+
760
+ Determine the next sequence number for today:
761
+ ```bash
762
+ today=$(date +%Y-%m-%d)
763
+ existing=$(ls ~/.gstack/retros/global-${today}-*.json 2>/dev/null | wc -l | tr -d ' ')
764
+ next=$((existing + 1))
765
+ ```
766
+
767
+ Use the Write tool to save JSON to `~/.gstack/retros/global-${today}-${next}.json`:
768
+
769
+ ```json
770
+ {
771
+ "type": "global",
772
+ "date": "2026-03-21",
773
+ "window": "7d",
774
+ "projects": [
775
+ {
776
+ "name": "gstack",
777
+ "remote": "https://github.com/garrytan/gstack",
778
+ "commits": 47,
779
+ "insertions": 3200,
780
+ "deletions": 800,
781
+ "sessions": { "claude_code": 15, "codex": 3, "gemini": 0 }
782
+ }
783
+ ],
784
+ "totals": {
785
+ "commits": 182,
786
+ "insertions": 15300,
787
+ "deletions": 4200,
788
+ "projects": 5,
789
+ "active_days": 6,
790
+ "sessions": { "claude_code": 48, "codex": 8, "gemini": 3 },
791
+ "global_streak_days": 52,
792
+ "avg_context_switches_per_day": 2.1
793
+ },
794
+ "tweetable": "Week of Mar 14: 5 projects, 182 commits, 15.3k LOC | CC: 48, Codex: 8, Gemini: 3 | Focus: gstack (58%) | Streak: 52d"
795
+ }
796
+ ```
797
+
798
+ ---
799
+
800
+ ## Compare Mode
801
+
802
+ When the user runs `/retro compare` (or `/retro compare 14d`):
803
+
804
+ 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"`)
805
+ 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"`)
806
+ 3. Show a side-by-side comparison table with deltas and arrows
807
+ 4. Write a brief narrative highlighting the biggest improvements and regressions
808
+ 5. Save only the current-window snapshot to `.context/retros/` (same as a normal retro run); do **not** persist the prior-window metrics.
809
+
810
+ ## Tone
811
+
812
+ - Encouraging but candid, no coddling
813
+ - Specific and concrete — always anchor in actual commits/code
814
+ - Skip generic praise ("great job!") — say exactly what was good and why
815
+ - Frame improvements as leveling up, not criticism
816
+ - **Praise should feel like something you'd actually say in a 1:1** — specific, earned, genuine
817
+ - **Growth suggestions should feel like investment advice** — "this is worth your time because..." not "you failed at..."
818
+ - Never compare teammates against each other negatively. Each person's section stands on its own.
819
+ - Keep total output around 3000-4500 words (slightly longer to accommodate team sections)
820
+ - Use markdown tables and code blocks for data, prose for narrative
821
+ - Output directly to the conversation — do NOT write to filesystem (except the `.context/retros/` JSON snapshot)
822
+
823
+ ## Important Rules
824
+
825
+ - ALL narrative output goes directly to the user in the conversation. The ONLY file written is the `.context/retros/` JSON snapshot.
826
+ - Use `origin/<default>` for all git queries (not local main which may be stale)
827
+ - Display all timestamps in the user's local timezone (do not override `TZ`)
828
+ - If the window has zero commits, say so and suggest a different window
829
+ - Round LOC/hour to nearest 50
830
+ - Treat merge commits as PR boundaries
831
+ - Do not read CLAUDE.md or other docs — this skill is self-contained
832
+ - On first run (no prior retros), skip comparison sections gracefully
833
+ - **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".