@runchr/gstack-antigravity 0.1.0

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.
Files changed (297) hide show
  1. package/.agents/rules/ETHOS.md +129 -0
  2. package/.agents/rules/global-gstack.md +117 -0
  3. package/.agents/rules/persona-gstack-autoplan.md +14 -0
  4. package/.agents/rules/persona-gstack-benchmark.md +14 -0
  5. package/.agents/rules/persona-gstack-browse.md +14 -0
  6. package/.agents/rules/persona-gstack-canary.md +14 -0
  7. package/.agents/rules/persona-gstack-careful.md +14 -0
  8. package/.agents/rules/persona-gstack-codex.md +14 -0
  9. package/.agents/rules/persona-gstack-cso.md +14 -0
  10. package/.agents/rules/persona-gstack-design-consultation.md +14 -0
  11. package/.agents/rules/persona-gstack-design-review.md +14 -0
  12. package/.agents/rules/persona-gstack-document-release.md +14 -0
  13. package/.agents/rules/persona-gstack-freeze.md +14 -0
  14. package/.agents/rules/persona-gstack-gstack-upgrade.md +14 -0
  15. package/.agents/rules/persona-gstack-guard.md +14 -0
  16. package/.agents/rules/persona-gstack-investigate.md +14 -0
  17. package/.agents/rules/persona-gstack-land-and-deploy.md +14 -0
  18. package/.agents/rules/persona-gstack-office-hours.md +14 -0
  19. package/.agents/rules/persona-gstack-plan-ceo-review.md +14 -0
  20. package/.agents/rules/persona-gstack-plan-design-review.md +14 -0
  21. package/.agents/rules/persona-gstack-plan-eng-review.md +14 -0
  22. package/.agents/rules/persona-gstack-qa-only.md +14 -0
  23. package/.agents/rules/persona-gstack-qa.md +14 -0
  24. package/.agents/rules/persona-gstack-retro.md +14 -0
  25. package/.agents/rules/persona-gstack-review.md +14 -0
  26. package/.agents/rules/persona-gstack-setup-browser-cookies.md +14 -0
  27. package/.agents/rules/persona-gstack-setup-deploy.md +14 -0
  28. package/.agents/rules/persona-gstack-ship.md +14 -0
  29. package/.agents/rules/persona-gstack-unfreeze.md +14 -0
  30. package/.agents/rules/persona-gstack.md +40 -0
  31. package/.agents/rules/recursive-identities.md +22 -0
  32. package/.agents/workflows/autoplan.md +30 -0
  33. package/.agents/workflows/benchmark.md +31 -0
  34. package/.agents/workflows/browse.md +26 -0
  35. package/.agents/workflows/canary.md +33 -0
  36. package/.agents/workflows/careful.md +22 -0
  37. package/.agents/workflows/codex.md +36 -0
  38. package/.agents/workflows/cso.md +29 -0
  39. package/.agents/workflows/design-consultation.md +28 -0
  40. package/.agents/workflows/design-review.md +28 -0
  41. package/.agents/workflows/document-release.md +32 -0
  42. package/.agents/workflows/freeze.md +17 -0
  43. package/.agents/workflows/gstack-upgrade.md +54 -0
  44. package/.agents/workflows/gstack.md +56 -0
  45. package/.agents/workflows/guard.md +18 -0
  46. package/.agents/workflows/investigate.md +37 -0
  47. package/.agents/workflows/land-and-deploy.md +35 -0
  48. package/.agents/workflows/office-hours.md +27 -0
  49. package/.agents/workflows/plan-ceo-review.md +34 -0
  50. package/.agents/workflows/plan-design-review.md +31 -0
  51. package/.agents/workflows/plan-eng-review.md +28 -0
  52. package/.agents/workflows/qa-only.md +28 -0
  53. package/.agents/workflows/qa.md +73 -0
  54. package/.agents/workflows/retro.md +34 -0
  55. package/.agents/workflows/review.md +30 -0
  56. package/.agents/workflows/setup-browser-cookies.md +15 -0
  57. package/.agents/workflows/setup-cookies.md +8 -0
  58. package/.agents/workflows/setup-deploy.md +21 -0
  59. package/.agents/workflows/ship.md +93 -0
  60. package/.agents/workflows/unfreeze.md +12 -0
  61. package/LICENSE +22 -0
  62. package/README.md +189 -0
  63. package/README_KO.md +191 -0
  64. package/bin/install.js +105 -0
  65. package/gstack-origin/.agents/skills/gstack/SKILL.md +651 -0
  66. package/gstack-origin/.agents/skills/gstack-autoplan/SKILL.md +678 -0
  67. package/gstack-origin/.agents/skills/gstack-benchmark/SKILL.md +482 -0
  68. package/gstack-origin/.agents/skills/gstack-browse/SKILL.md +511 -0
  69. package/gstack-origin/.agents/skills/gstack-canary/SKILL.md +486 -0
  70. package/gstack-origin/.agents/skills/gstack-careful/SKILL.md +50 -0
  71. package/gstack-origin/.agents/skills/gstack-cso/SKILL.md +607 -0
  72. package/gstack-origin/.agents/skills/gstack-design-consultation/SKILL.md +615 -0
  73. package/gstack-origin/.agents/skills/gstack-design-review/SKILL.md +988 -0
  74. package/gstack-origin/.agents/skills/gstack-document-release/SKILL.md +604 -0
  75. package/gstack-origin/.agents/skills/gstack-freeze/SKILL.md +67 -0
  76. package/gstack-origin/.agents/skills/gstack-guard/SKILL.md +62 -0
  77. package/gstack-origin/.agents/skills/gstack-investigate/SKILL.md +415 -0
  78. package/gstack-origin/.agents/skills/gstack-land-and-deploy/SKILL.md +873 -0
  79. package/gstack-origin/.agents/skills/gstack-office-hours/SKILL.md +986 -0
  80. package/gstack-origin/.agents/skills/gstack-plan-ceo-review/SKILL.md +1268 -0
  81. package/gstack-origin/.agents/skills/gstack-plan-design-review/SKILL.md +668 -0
  82. package/gstack-origin/.agents/skills/gstack-plan-eng-review/SKILL.md +826 -0
  83. package/gstack-origin/.agents/skills/gstack-qa/SKILL.md +1006 -0
  84. package/gstack-origin/.agents/skills/gstack-qa-only/SKILL.md +626 -0
  85. package/gstack-origin/.agents/skills/gstack-retro/SKILL.md +1065 -0
  86. package/gstack-origin/.agents/skills/gstack-review/SKILL.md +704 -0
  87. package/gstack-origin/.agents/skills/gstack-setup-browser-cookies/SKILL.md +325 -0
  88. package/gstack-origin/.agents/skills/gstack-setup-deploy/SKILL.md +450 -0
  89. package/gstack-origin/.agents/skills/gstack-ship/SKILL.md +1312 -0
  90. package/gstack-origin/.agents/skills/gstack-unfreeze/SKILL.md +36 -0
  91. package/gstack-origin/.agents/skills/gstack-upgrade/SKILL.md +220 -0
  92. package/gstack-origin/.env.example +5 -0
  93. package/gstack-origin/.github/workflows/skill-docs.yml +17 -0
  94. package/gstack-origin/AGENTS.md +49 -0
  95. package/gstack-origin/ARCHITECTURE.md +359 -0
  96. package/gstack-origin/BROWSER.md +271 -0
  97. package/gstack-origin/CHANGELOG.md +800 -0
  98. package/gstack-origin/CLAUDE.md +284 -0
  99. package/gstack-origin/CONTRIBUTING.md +370 -0
  100. package/gstack-origin/ETHOS.md +129 -0
  101. package/gstack-origin/LICENSE +21 -0
  102. package/gstack-origin/README.md +228 -0
  103. package/gstack-origin/SKILL.md +657 -0
  104. package/gstack-origin/SKILL.md.tmpl +281 -0
  105. package/gstack-origin/TODOS.md +564 -0
  106. package/gstack-origin/VERSION +1 -0
  107. package/gstack-origin/autoplan/SKILL.md +689 -0
  108. package/gstack-origin/autoplan/SKILL.md.tmpl +416 -0
  109. package/gstack-origin/benchmark/SKILL.md +489 -0
  110. package/gstack-origin/benchmark/SKILL.md.tmpl +233 -0
  111. package/gstack-origin/bin/dev-setup +68 -0
  112. package/gstack-origin/bin/dev-teardown +56 -0
  113. package/gstack-origin/bin/gstack-analytics +191 -0
  114. package/gstack-origin/bin/gstack-community-dashboard +113 -0
  115. package/gstack-origin/bin/gstack-config +38 -0
  116. package/gstack-origin/bin/gstack-diff-scope +71 -0
  117. package/gstack-origin/bin/gstack-global-discover.ts +591 -0
  118. package/gstack-origin/bin/gstack-repo-mode +93 -0
  119. package/gstack-origin/bin/gstack-review-log +9 -0
  120. package/gstack-origin/bin/gstack-review-read +12 -0
  121. package/gstack-origin/bin/gstack-slug +15 -0
  122. package/gstack-origin/bin/gstack-telemetry-log +158 -0
  123. package/gstack-origin/bin/gstack-telemetry-sync +127 -0
  124. package/gstack-origin/bin/gstack-update-check +196 -0
  125. package/gstack-origin/browse/SKILL.md +517 -0
  126. package/gstack-origin/browse/SKILL.md.tmpl +141 -0
  127. package/gstack-origin/browse/bin/find-browse +21 -0
  128. package/gstack-origin/browse/bin/remote-slug +14 -0
  129. package/gstack-origin/browse/scripts/build-node-server.sh +48 -0
  130. package/gstack-origin/browse/src/browser-manager.ts +634 -0
  131. package/gstack-origin/browse/src/buffers.ts +137 -0
  132. package/gstack-origin/browse/src/bun-polyfill.cjs +109 -0
  133. package/gstack-origin/browse/src/cli.ts +420 -0
  134. package/gstack-origin/browse/src/commands.ts +111 -0
  135. package/gstack-origin/browse/src/config.ts +150 -0
  136. package/gstack-origin/browse/src/cookie-import-browser.ts +417 -0
  137. package/gstack-origin/browse/src/cookie-picker-routes.ts +207 -0
  138. package/gstack-origin/browse/src/cookie-picker-ui.ts +541 -0
  139. package/gstack-origin/browse/src/find-browse.ts +61 -0
  140. package/gstack-origin/browse/src/meta-commands.ts +269 -0
  141. package/gstack-origin/browse/src/platform.ts +17 -0
  142. package/gstack-origin/browse/src/read-commands.ts +335 -0
  143. package/gstack-origin/browse/src/server.ts +369 -0
  144. package/gstack-origin/browse/src/snapshot.ts +398 -0
  145. package/gstack-origin/browse/src/url-validation.ts +91 -0
  146. package/gstack-origin/browse/src/write-commands.ts +352 -0
  147. package/gstack-origin/browse/test/bun-polyfill.test.ts +72 -0
  148. package/gstack-origin/browse/test/commands.test.ts +1836 -0
  149. package/gstack-origin/browse/test/config.test.ts +250 -0
  150. package/gstack-origin/browse/test/cookie-import-browser.test.ts +397 -0
  151. package/gstack-origin/browse/test/cookie-picker-routes.test.ts +205 -0
  152. package/gstack-origin/browse/test/find-browse.test.ts +50 -0
  153. package/gstack-origin/browse/test/fixtures/basic.html +33 -0
  154. package/gstack-origin/browse/test/fixtures/cursor-interactive.html +22 -0
  155. package/gstack-origin/browse/test/fixtures/dialog.html +15 -0
  156. package/gstack-origin/browse/test/fixtures/empty.html +2 -0
  157. package/gstack-origin/browse/test/fixtures/forms.html +55 -0
  158. package/gstack-origin/browse/test/fixtures/qa-eval-checkout.html +108 -0
  159. package/gstack-origin/browse/test/fixtures/qa-eval-spa.html +98 -0
  160. package/gstack-origin/browse/test/fixtures/qa-eval.html +51 -0
  161. package/gstack-origin/browse/test/fixtures/responsive.html +49 -0
  162. package/gstack-origin/browse/test/fixtures/snapshot.html +55 -0
  163. package/gstack-origin/browse/test/fixtures/spa.html +24 -0
  164. package/gstack-origin/browse/test/fixtures/states.html +17 -0
  165. package/gstack-origin/browse/test/fixtures/upload.html +25 -0
  166. package/gstack-origin/browse/test/gstack-config.test.ts +125 -0
  167. package/gstack-origin/browse/test/gstack-update-check.test.ts +467 -0
  168. package/gstack-origin/browse/test/handoff.test.ts +235 -0
  169. package/gstack-origin/browse/test/path-validation.test.ts +63 -0
  170. package/gstack-origin/browse/test/platform.test.ts +37 -0
  171. package/gstack-origin/browse/test/snapshot.test.ts +467 -0
  172. package/gstack-origin/browse/test/test-server.ts +57 -0
  173. package/gstack-origin/browse/test/url-validation.test.ts +72 -0
  174. package/gstack-origin/canary/SKILL.md +493 -0
  175. package/gstack-origin/canary/SKILL.md.tmpl +220 -0
  176. package/gstack-origin/careful/SKILL.md +59 -0
  177. package/gstack-origin/careful/SKILL.md.tmpl +57 -0
  178. package/gstack-origin/careful/bin/check-careful.sh +112 -0
  179. package/gstack-origin/codex/SKILL.md +677 -0
  180. package/gstack-origin/codex/SKILL.md.tmpl +356 -0
  181. package/gstack-origin/conductor.json +6 -0
  182. package/gstack-origin/cso/SKILL.md +615 -0
  183. package/gstack-origin/cso/SKILL.md.tmpl +376 -0
  184. package/gstack-origin/design-consultation/SKILL.md +625 -0
  185. package/gstack-origin/design-consultation/SKILL.md.tmpl +369 -0
  186. package/gstack-origin/design-review/SKILL.md +998 -0
  187. package/gstack-origin/design-review/SKILL.md.tmpl +262 -0
  188. package/gstack-origin/docs/images/github-2013.png +0 -0
  189. package/gstack-origin/docs/images/github-2026.png +0 -0
  190. package/gstack-origin/docs/skills.md +877 -0
  191. package/gstack-origin/document-release/SKILL.md +613 -0
  192. package/gstack-origin/document-release/SKILL.md.tmpl +357 -0
  193. package/gstack-origin/freeze/SKILL.md +82 -0
  194. package/gstack-origin/freeze/SKILL.md.tmpl +80 -0
  195. package/gstack-origin/freeze/bin/check-freeze.sh +68 -0
  196. package/gstack-origin/gstack-upgrade/SKILL.md +226 -0
  197. package/gstack-origin/gstack-upgrade/SKILL.md.tmpl +224 -0
  198. package/gstack-origin/guard/SKILL.md +82 -0
  199. package/gstack-origin/guard/SKILL.md.tmpl +80 -0
  200. package/gstack-origin/investigate/SKILL.md +435 -0
  201. package/gstack-origin/investigate/SKILL.md.tmpl +196 -0
  202. package/gstack-origin/land-and-deploy/SKILL.md +880 -0
  203. package/gstack-origin/land-and-deploy/SKILL.md.tmpl +575 -0
  204. package/gstack-origin/office-hours/SKILL.md +996 -0
  205. package/gstack-origin/office-hours/SKILL.md.tmpl +624 -0
  206. package/gstack-origin/package.json +55 -0
  207. package/gstack-origin/plan-ceo-review/SKILL.md +1277 -0
  208. package/gstack-origin/plan-ceo-review/SKILL.md.tmpl +838 -0
  209. package/gstack-origin/plan-design-review/SKILL.md +676 -0
  210. package/gstack-origin/plan-design-review/SKILL.md.tmpl +314 -0
  211. package/gstack-origin/plan-eng-review/SKILL.md +836 -0
  212. package/gstack-origin/plan-eng-review/SKILL.md.tmpl +279 -0
  213. package/gstack-origin/qa/SKILL.md +1016 -0
  214. package/gstack-origin/qa/SKILL.md.tmpl +316 -0
  215. package/gstack-origin/qa/references/issue-taxonomy.md +85 -0
  216. package/gstack-origin/qa/templates/qa-report-template.md +126 -0
  217. package/gstack-origin/qa-only/SKILL.md +633 -0
  218. package/gstack-origin/qa-only/SKILL.md.tmpl +101 -0
  219. package/gstack-origin/retro/SKILL.md +1072 -0
  220. package/gstack-origin/retro/SKILL.md.tmpl +833 -0
  221. package/gstack-origin/review/SKILL.md +849 -0
  222. package/gstack-origin/review/SKILL.md.tmpl +259 -0
  223. package/gstack-origin/review/TODOS-format.md +62 -0
  224. package/gstack-origin/review/checklist.md +190 -0
  225. package/gstack-origin/review/design-checklist.md +132 -0
  226. package/gstack-origin/review/greptile-triage.md +220 -0
  227. package/gstack-origin/scripts/analytics.ts +190 -0
  228. package/gstack-origin/scripts/dev-skill.ts +82 -0
  229. package/gstack-origin/scripts/eval-compare.ts +96 -0
  230. package/gstack-origin/scripts/eval-list.ts +116 -0
  231. package/gstack-origin/scripts/eval-select.ts +86 -0
  232. package/gstack-origin/scripts/eval-summary.ts +187 -0
  233. package/gstack-origin/scripts/eval-watch.ts +172 -0
  234. package/gstack-origin/scripts/gen-skill-docs.ts +2414 -0
  235. package/gstack-origin/scripts/skill-check.ts +167 -0
  236. package/gstack-origin/setup +269 -0
  237. package/gstack-origin/setup-browser-cookies/SKILL.md +330 -0
  238. package/gstack-origin/setup-browser-cookies/SKILL.md.tmpl +74 -0
  239. package/gstack-origin/setup-deploy/SKILL.md +459 -0
  240. package/gstack-origin/setup-deploy/SKILL.md.tmpl +220 -0
  241. package/gstack-origin/ship/SKILL.md +1457 -0
  242. package/gstack-origin/ship/SKILL.md.tmpl +528 -0
  243. package/gstack-origin/supabase/config.sh +10 -0
  244. package/gstack-origin/supabase/functions/community-pulse/index.ts +59 -0
  245. package/gstack-origin/supabase/functions/telemetry-ingest/index.ts +135 -0
  246. package/gstack-origin/supabase/functions/update-check/index.ts +37 -0
  247. package/gstack-origin/supabase/migrations/001_telemetry.sql +89 -0
  248. package/gstack-origin/test/analytics.test.ts +277 -0
  249. package/gstack-origin/test/codex-e2e.test.ts +197 -0
  250. package/gstack-origin/test/fixtures/coverage-audit-fixture.ts +76 -0
  251. package/gstack-origin/test/fixtures/eval-baselines.json +7 -0
  252. package/gstack-origin/test/fixtures/qa-eval-checkout-ground-truth.json +43 -0
  253. package/gstack-origin/test/fixtures/qa-eval-ground-truth.json +43 -0
  254. package/gstack-origin/test/fixtures/qa-eval-spa-ground-truth.json +43 -0
  255. package/gstack-origin/test/fixtures/review-eval-design-slop.css +86 -0
  256. package/gstack-origin/test/fixtures/review-eval-design-slop.html +41 -0
  257. package/gstack-origin/test/fixtures/review-eval-enum-diff.rb +30 -0
  258. package/gstack-origin/test/fixtures/review-eval-enum.rb +27 -0
  259. package/gstack-origin/test/fixtures/review-eval-vuln.rb +14 -0
  260. package/gstack-origin/test/gemini-e2e.test.ts +173 -0
  261. package/gstack-origin/test/gen-skill-docs.test.ts +1049 -0
  262. package/gstack-origin/test/global-discover.test.ts +187 -0
  263. package/gstack-origin/test/helpers/codex-session-runner.ts +282 -0
  264. package/gstack-origin/test/helpers/e2e-helpers.ts +239 -0
  265. package/gstack-origin/test/helpers/eval-store.test.ts +548 -0
  266. package/gstack-origin/test/helpers/eval-store.ts +689 -0
  267. package/gstack-origin/test/helpers/gemini-session-runner.test.ts +104 -0
  268. package/gstack-origin/test/helpers/gemini-session-runner.ts +201 -0
  269. package/gstack-origin/test/helpers/llm-judge.ts +130 -0
  270. package/gstack-origin/test/helpers/observability.test.ts +283 -0
  271. package/gstack-origin/test/helpers/session-runner.test.ts +96 -0
  272. package/gstack-origin/test/helpers/session-runner.ts +357 -0
  273. package/gstack-origin/test/helpers/skill-parser.ts +206 -0
  274. package/gstack-origin/test/helpers/touchfiles.ts +260 -0
  275. package/gstack-origin/test/hook-scripts.test.ts +373 -0
  276. package/gstack-origin/test/skill-e2e-browse.test.ts +293 -0
  277. package/gstack-origin/test/skill-e2e-deploy.test.ts +279 -0
  278. package/gstack-origin/test/skill-e2e-design.test.ts +614 -0
  279. package/gstack-origin/test/skill-e2e-plan.test.ts +538 -0
  280. package/gstack-origin/test/skill-e2e-qa-bugs.test.ts +194 -0
  281. package/gstack-origin/test/skill-e2e-qa-workflow.test.ts +412 -0
  282. package/gstack-origin/test/skill-e2e-review.test.ts +535 -0
  283. package/gstack-origin/test/skill-e2e-workflow.test.ts +586 -0
  284. package/gstack-origin/test/skill-e2e.test.ts +3325 -0
  285. package/gstack-origin/test/skill-llm-eval.test.ts +787 -0
  286. package/gstack-origin/test/skill-parser.test.ts +179 -0
  287. package/gstack-origin/test/skill-routing-e2e.test.ts +605 -0
  288. package/gstack-origin/test/skill-validation.test.ts +1520 -0
  289. package/gstack-origin/test/telemetry.test.ts +278 -0
  290. package/gstack-origin/test/touchfiles.test.ts +262 -0
  291. package/gstack-origin/unfreeze/SKILL.md +40 -0
  292. package/gstack-origin/unfreeze/SKILL.md.tmpl +38 -0
  293. package/package.json +38 -0
  294. package/scripts/install-antigravity-skill.ps1 +33 -0
  295. package/scripts/install-antigravity-skill.sh +41 -0
  296. package/scripts/sync-gstack-origin.ps1 +37 -0
  297. package/scripts/sync-gstack-origin.sh +35 -0
@@ -0,0 +1,998 @@
1
+ ---
2
+ name: design-review
3
+ version: 2.0.0
4
+ description: |
5
+ Designer's eye QA: finds visual inconsistency, spacing issues, hierarchy problems,
6
+ AI slop patterns, and slow interactions — then fixes them. Iteratively fixes issues
7
+ in source code, committing each fix atomically and re-verifying with before/after
8
+ screenshots. For plan-mode design review (before implementation), use /plan-design-review.
9
+ Use when asked to "audit the design", "visual QA", "check if it looks good", or "design polish".
10
+ Proactively suggest when the user mentions visual inconsistencies or
11
+ wants to polish the look of a live site.
12
+ allowed-tools:
13
+ - Bash
14
+ - Read
15
+ - Write
16
+ - Edit
17
+ - Glob
18
+ - Grep
19
+ - AskUserQuestion
20
+ - WebSearch
21
+ ---
22
+ <!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->
23
+ <!-- Regenerate: bun run gen:skill-docs -->
24
+
25
+ ## Preamble (run first)
26
+
27
+ ```bash
28
+ _UPD=$(~/.claude/skills/gstack/bin/gstack-update-check 2>/dev/null || .claude/skills/gstack/bin/gstack-update-check 2>/dev/null || true)
29
+ [ -n "$_UPD" ] && echo "$_UPD" || true
30
+ mkdir -p ~/.gstack/sessions
31
+ touch ~/.gstack/sessions/"$PPID"
32
+ _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ')
33
+ find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true
34
+ _CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true)
35
+ _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true")
36
+ _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
37
+ echo "BRANCH: $_BRANCH"
38
+ echo "PROACTIVE: $_PROACTIVE"
39
+ source <(~/.claude/skills/gstack/bin/gstack-repo-mode 2>/dev/null) || true
40
+ REPO_MODE=${REPO_MODE:-unknown}
41
+ echo "REPO_MODE: $REPO_MODE"
42
+ _LAKE_SEEN=$([ -f ~/.gstack/.completeness-intro-seen ] && echo "yes" || echo "no")
43
+ echo "LAKE_INTRO: $_LAKE_SEEN"
44
+ _TEL=$(~/.claude/skills/gstack/bin/gstack-config get telemetry 2>/dev/null || true)
45
+ _TEL_PROMPTED=$([ -f ~/.gstack/.telemetry-prompted ] && echo "yes" || echo "no")
46
+ _TEL_START=$(date +%s)
47
+ _SESSION_ID="$$-$(date +%s)"
48
+ echo "TELEMETRY: ${_TEL:-off}"
49
+ echo "TEL_PROMPTED: $_TEL_PROMPTED"
50
+ mkdir -p ~/.gstack/analytics
51
+ echo '{"skill":"design-review","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true
52
+ 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
53
+ ```
54
+
55
+ If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills — only invoke
56
+ them when the user explicitly asks. The user opted out of proactive suggestions.
57
+
58
+ 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.
59
+
60
+ If `LAKE_INTRO` is `no`: Before continuing, introduce the Completeness Principle.
61
+ Tell the user: "gstack follows the **Boil the Lake** principle — always do the complete
62
+ thing when AI makes the marginal cost near-zero. Read more: https://garryslist.org/posts/boil-the-ocean"
63
+ Then offer to open the essay in their default browser:
64
+
65
+ ```bash
66
+ open https://garryslist.org/posts/boil-the-ocean
67
+ touch ~/.gstack/.completeness-intro-seen
68
+ ```
69
+
70
+ Only run `open` if the user says yes. Always run `touch` to mark as seen. This only happens once.
71
+
72
+ If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled,
73
+ ask the user about telemetry. Use AskUserQuestion:
74
+
75
+ > Help gstack get better! Community mode shares usage data (which skills you use, how long
76
+ > they take, crash info) with a stable device ID so we can track trends and fix bugs faster.
77
+ > No code, file paths, or repo names are ever sent.
78
+ > Change anytime with `gstack-config set telemetry off`.
79
+
80
+ Options:
81
+ - A) Help gstack get better! (recommended)
82
+ - B) No thanks
83
+
84
+ If A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry community`
85
+
86
+ If B: ask a follow-up AskUserQuestion:
87
+
88
+ > How about anonymous mode? We just learn that *someone* used gstack — no unique ID,
89
+ > no way to connect sessions. Just a counter that helps us know if anyone's out there.
90
+
91
+ Options:
92
+ - A) Sure, anonymous is fine
93
+ - B) No thanks, fully off
94
+
95
+ If B→A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous`
96
+ If B→B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off`
97
+
98
+ Always run:
99
+ ```bash
100
+ touch ~/.gstack/.telemetry-prompted
101
+ ```
102
+
103
+ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely.
104
+
105
+ ## AskUserQuestion Format
106
+
107
+ **ALWAYS follow this structure for every AskUserQuestion call:**
108
+ 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)
109
+ 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.
110
+ 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.
111
+ 4. **Options:** Lettered options: `A) ... B) ... C) ...` — when an option involves effort, show both scales: `(human: ~X / CC: ~Y)`
112
+
113
+ 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.
114
+
115
+ Per-skill instructions may add additional formatting rules on top of this baseline.
116
+
117
+ ## Completeness Principle — Boil the Lake
118
+
119
+ AI-assisted coding makes the marginal cost of completeness near-zero. When you present options:
120
+
121
+ - 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.
122
+ - **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.
123
+ - **When estimating effort**, always show both scales: human team time and CC+gstack time. The compression ratio varies by task type — use this reference:
124
+
125
+ | Task type | Human team | CC+gstack | Compression |
126
+ |-----------|-----------|-----------|-------------|
127
+ | Boilerplate / scaffolding | 2 days | 15 min | ~100x |
128
+ | Test writing | 1 day | 15 min | ~50x |
129
+ | Feature implementation | 1 week | 30 min | ~30x |
130
+ | Bug fix + regression test | 4 hours | 15 min | ~20x |
131
+ | Architecture / design | 2 days | 4 hours | ~5x |
132
+ | Research / exploration | 1 day | 3 hours | ~3x |
133
+
134
+ - 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.
135
+
136
+ **Anti-patterns — DON'T do this:**
137
+ - BAD: "Choose B — it covers 90% of the value with less code." (If A is only 70 lines more, choose A.)
138
+ - BAD: "We can skip edge case handling to save time." (Edge case handling costs minutes with CC.)
139
+ - BAD: "Let's defer test coverage to a follow-up PR." (Tests are the cheapest lake to boil.)
140
+ - BAD: Quoting only human-team effort: "This would take 2 weeks." (Say: "2 weeks human / ~1 hour CC.")
141
+
142
+ ## Repo Ownership Mode — See Something, Say Something
143
+
144
+ `REPO_MODE` from the preamble tells you who owns issues in this repo:
145
+
146
+ - **`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.
147
+ - **`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.
148
+ - **`unknown`** — Treat as collaborative (safer default — ask before fixing).
149
+
150
+ **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.
151
+
152
+ Never let a noticed issue silently pass. The whole point is proactive communication.
153
+
154
+ ## Search Before Building
155
+
156
+ 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.
157
+
158
+ **Three layers of knowledge:**
159
+ - **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.
160
+ - **Layer 2** (new and popular — search for these). But scrutinize: humans are subject to mania. Search results are inputs to your thinking, not answers.
161
+ - **Layer 3** (first principles — prize these above all). Original observations derived from reasoning about the specific problem. The most valuable of all.
162
+
163
+ **Eureka moment:** When first-principles reasoning reveals conventional wisdom is wrong, name it:
164
+ "EUREKA: Everyone does X because [assumption]. But [evidence] shows this is wrong. Y is better because [reasoning]."
165
+
166
+ Log eureka moments:
167
+ ```bash
168
+ 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
169
+ ```
170
+ Replace SKILL_NAME and ONE_LINE_SUMMARY. Runs inline — don't stop the workflow.
171
+
172
+ **WebSearch fallback:** If WebSearch is unavailable, skip the search step and note: "Search unavailable — proceeding with in-distribution knowledge only."
173
+
174
+ ## Contributor Mode
175
+
176
+ If `_CONTRIB` is `true`: you are in **contributor mode**. You're a gstack user who also helps make it better.
177
+
178
+ **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!
179
+
180
+ **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.
181
+
182
+ **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.
183
+
184
+ **To file:** write `~/.gstack/contributor-logs/{slug}.md` with **all sections below** (do not truncate — include every section through the Date/Version footer):
185
+
186
+ ```
187
+ # {Title}
188
+
189
+ Hey gstack team — ran into this while using /{skill-name}:
190
+
191
+ **What I was trying to do:** {what the user/agent was attempting}
192
+ **What happened instead:** {what actually happened}
193
+ **My rating:** {0-10} — {one sentence on why it wasn't a 10}
194
+
195
+ ## Steps to reproduce
196
+ 1. {step}
197
+
198
+ ## Raw output
199
+ ```
200
+ {paste the actual error or unexpected output here}
201
+ ```
202
+
203
+ ## What would make this a 10
204
+ {one sentence: what gstack should have done differently}
205
+
206
+ **Date:** {YYYY-MM-DD} | **Version:** {gstack version} | **Skill:** /{skill}
207
+ ```
208
+
209
+ 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}"
210
+
211
+ ## Completion Status Protocol
212
+
213
+ When completing a skill workflow, report status using one of:
214
+ - **DONE** — All steps completed successfully. Evidence provided for each claim.
215
+ - **DONE_WITH_CONCERNS** — Completed, but with issues the user should know about. List each concern.
216
+ - **BLOCKED** — Cannot proceed. State what is blocking and what was tried.
217
+ - **NEEDS_CONTEXT** — Missing information required to continue. State exactly what you need.
218
+
219
+ ### Escalation
220
+
221
+ It is always OK to stop and say "this is too hard for me" or "I'm not confident in this result."
222
+
223
+ Bad work is worse than no work. You will not be penalized for escalating.
224
+ - If you have attempted a task 3 times without success, STOP and escalate.
225
+ - If you are uncertain about a security-sensitive change, STOP and escalate.
226
+ - If the scope of work exceeds what you can verify, STOP and escalate.
227
+
228
+ Escalation format:
229
+ ```
230
+ STATUS: BLOCKED | NEEDS_CONTEXT
231
+ REASON: [1-2 sentences]
232
+ ATTEMPTED: [what you tried]
233
+ RECOMMENDATION: [what the user should do next]
234
+ ```
235
+
236
+ ## Telemetry (run last)
237
+
238
+ After the skill workflow completes (success, error, or abort), log the telemetry event.
239
+ Determine the skill name from the `name:` field in this file's YAML frontmatter.
240
+ Determine the outcome from the workflow result (success if completed normally, error
241
+ if it failed, abort if the user interrupted).
242
+
243
+ **PLAN MODE EXCEPTION — ALWAYS RUN:** This command writes telemetry to
244
+ `~/.gstack/analytics/` (user config directory, not project files). The skill
245
+ preamble already writes to the same directory — this is the same pattern.
246
+ Skipping this command loses session duration and outcome data.
247
+
248
+ Run this bash:
249
+
250
+ ```bash
251
+ _TEL_END=$(date +%s)
252
+ _TEL_DUR=$(( _TEL_END - _TEL_START ))
253
+ rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true
254
+ ~/.claude/skills/gstack/bin/gstack-telemetry-log \
255
+ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \
256
+ --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null &
257
+ ```
258
+
259
+ Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with
260
+ success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used.
261
+ If you cannot determine the outcome, use "unknown". This runs in the background and
262
+ never blocks the user.
263
+
264
+ # /design-review: Design Audit → Fix → Verify
265
+
266
+ You are a senior product designer AND a frontend engineer. Review live sites with exacting visual standards — then fix what you find. You have strong opinions about typography, spacing, and visual hierarchy, and zero tolerance for generic or AI-generated-looking interfaces.
267
+
268
+ ## Setup
269
+
270
+ **Parse the user's request for these parameters:**
271
+
272
+ | Parameter | Default | Override example |
273
+ |-----------|---------|-----------------:|
274
+ | Target URL | (auto-detect or ask) | `https://myapp.com`, `http://localhost:3000` |
275
+ | Scope | Full site | `Focus on the settings page`, `Just the homepage` |
276
+ | Depth | Standard (5-8 pages) | `--quick` (homepage + 2), `--deep` (10-15 pages) |
277
+ | Auth | None | `Sign in as user@example.com`, `Import cookies` |
278
+
279
+ **If no URL is given and you're on a feature branch:** Automatically enter **diff-aware mode** (see Modes below).
280
+
281
+ **If no URL is given and you're on main/master:** Ask the user for a URL.
282
+
283
+ **Check for DESIGN.md:**
284
+
285
+ Look for `DESIGN.md`, `design-system.md`, or similar in the repo root. If found, read it — all design decisions must be calibrated against it. Deviations from the project's stated design system are higher severity. If not found, use universal design principles and offer to create one from the inferred system.
286
+
287
+ **Check for clean working tree:**
288
+
289
+ ```bash
290
+ git status --porcelain
291
+ ```
292
+
293
+ If the output is non-empty (working tree is dirty), **STOP** and use AskUserQuestion:
294
+
295
+ "Your working tree has uncommitted changes. /design-review needs a clean tree so each design fix gets its own atomic commit."
296
+
297
+ - A) Commit my changes — commit all current changes with a descriptive message, then start design review
298
+ - B) Stash my changes — stash, run design review, pop the stash after
299
+ - C) Abort — I'll clean up manually
300
+
301
+ RECOMMENDATION: Choose A because uncommitted work should be preserved as a commit before design review adds its own fix commits.
302
+
303
+ After the user chooses, execute their choice (commit or stash), then continue with setup.
304
+
305
+ **Find the browse binary:**
306
+
307
+ ## SETUP (run this check BEFORE any browse command)
308
+
309
+ ```bash
310
+ _ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
311
+ B=""
312
+ [ -n "$_ROOT" ] && [ -x "$_ROOT/.claude/skills/gstack/browse/dist/browse" ] && B="$_ROOT/.claude/skills/gstack/browse/dist/browse"
313
+ [ -z "$B" ] && B=~/.claude/skills/gstack/browse/dist/browse
314
+ if [ -x "$B" ]; then
315
+ echo "READY: $B"
316
+ else
317
+ echo "NEEDS_SETUP"
318
+ fi
319
+ ```
320
+
321
+ If `NEEDS_SETUP`:
322
+ 1. Tell the user: "gstack browse needs a one-time build (~10 seconds). OK to proceed?" Then STOP and wait.
323
+ 2. Run: `cd <SKILL_DIR> && ./setup`
324
+ 3. If `bun` is not installed: `curl -fsSL https://bun.sh/install | bash`
325
+
326
+ **Check test framework (bootstrap if needed):**
327
+
328
+ ## Test Framework Bootstrap
329
+
330
+ **Detect existing test framework and project runtime:**
331
+
332
+ ```bash
333
+ # Detect project runtime
334
+ [ -f Gemfile ] && echo "RUNTIME:ruby"
335
+ [ -f package.json ] && echo "RUNTIME:node"
336
+ [ -f requirements.txt ] || [ -f pyproject.toml ] && echo "RUNTIME:python"
337
+ [ -f go.mod ] && echo "RUNTIME:go"
338
+ [ -f Cargo.toml ] && echo "RUNTIME:rust"
339
+ [ -f composer.json ] && echo "RUNTIME:php"
340
+ [ -f mix.exs ] && echo "RUNTIME:elixir"
341
+ # Detect sub-frameworks
342
+ [ -f Gemfile ] && grep -q "rails" Gemfile 2>/dev/null && echo "FRAMEWORK:rails"
343
+ [ -f package.json ] && grep -q '"next"' package.json 2>/dev/null && echo "FRAMEWORK:nextjs"
344
+ # Check for existing test infrastructure
345
+ ls jest.config.* vitest.config.* playwright.config.* .rspec pytest.ini pyproject.toml phpunit.xml 2>/dev/null
346
+ ls -d test/ tests/ spec/ __tests__/ cypress/ e2e/ 2>/dev/null
347
+ # Check opt-out marker
348
+ [ -f .gstack/no-test-bootstrap ] && echo "BOOTSTRAP_DECLINED"
349
+ ```
350
+
351
+ **If test framework detected** (config files or test directories found):
352
+ Print "Test framework detected: {name} ({N} existing tests). Skipping bootstrap."
353
+ Read 2-3 existing test files to learn conventions (naming, imports, assertion style, setup patterns).
354
+ Store conventions as prose context for use in Phase 8e.5 or Step 3.4. **Skip the rest of bootstrap.**
355
+
356
+ **If BOOTSTRAP_DECLINED** appears: Print "Test bootstrap previously declined — skipping." **Skip the rest of bootstrap.**
357
+
358
+ **If NO runtime detected** (no config files found): Use AskUserQuestion:
359
+ "I couldn't detect your project's language. What runtime are you using?"
360
+ Options: A) Node.js/TypeScript B) Ruby/Rails C) Python D) Go E) Rust F) PHP G) Elixir H) This project doesn't need tests.
361
+ If user picks H → write `.gstack/no-test-bootstrap` and continue without tests.
362
+
363
+ **If runtime detected but no test framework — bootstrap:**
364
+
365
+ ### B2. Research best practices
366
+
367
+ Use WebSearch to find current best practices for the detected runtime:
368
+ - `"[runtime] best test framework 2025 2026"`
369
+ - `"[framework A] vs [framework B] comparison"`
370
+
371
+ If WebSearch is unavailable, use this built-in knowledge table:
372
+
373
+ | Runtime | Primary recommendation | Alternative |
374
+ |---------|----------------------|-------------|
375
+ | Ruby/Rails | minitest + fixtures + capybara | rspec + factory_bot + shoulda-matchers |
376
+ | Node.js | vitest + @testing-library | jest + @testing-library |
377
+ | Next.js | vitest + @testing-library/react + playwright | jest + cypress |
378
+ | Python | pytest + pytest-cov | unittest |
379
+ | Go | stdlib testing + testify | stdlib only |
380
+ | Rust | cargo test (built-in) + mockall | — |
381
+ | PHP | phpunit + mockery | pest |
382
+ | Elixir | ExUnit (built-in) + ex_machina | — |
383
+
384
+ ### B3. Framework selection
385
+
386
+ Use AskUserQuestion:
387
+ "I detected this is a [Runtime/Framework] project with no test framework. I researched current best practices. Here are the options:
388
+ A) [Primary] — [rationale]. Includes: [packages]. Supports: unit, integration, smoke, e2e
389
+ B) [Alternative] — [rationale]. Includes: [packages]
390
+ C) Skip — don't set up testing right now
391
+ RECOMMENDATION: Choose A because [reason based on project context]"
392
+
393
+ If user picks C → write `.gstack/no-test-bootstrap`. Tell user: "If you change your mind later, delete `.gstack/no-test-bootstrap` and re-run." Continue without tests.
394
+
395
+ If multiple runtimes detected (monorepo) → ask which runtime to set up first, with option to do both sequentially.
396
+
397
+ ### B4. Install and configure
398
+
399
+ 1. Install the chosen packages (npm/bun/gem/pip/etc.)
400
+ 2. Create minimal config file
401
+ 3. Create directory structure (test/, spec/, etc.)
402
+ 4. Create one example test matching the project's code to verify setup works
403
+
404
+ If package installation fails → debug once. If still failing → revert with `git checkout -- package.json package-lock.json` (or equivalent for the runtime). Warn user and continue without tests.
405
+
406
+ ### B4.5. First real tests
407
+
408
+ Generate 3-5 real tests for existing code:
409
+
410
+ 1. **Find recently changed files:** `git log --since=30.days --name-only --format="" | sort | uniq -c | sort -rn | head -10`
411
+ 2. **Prioritize by risk:** Error handlers > business logic with conditionals > API endpoints > pure functions
412
+ 3. **For each file:** Write one test that tests real behavior with meaningful assertions. Never `expect(x).toBeDefined()` — test what the code DOES.
413
+ 4. Run each test. Passes → keep. Fails → fix once. Still fails → delete silently.
414
+ 5. Generate at least 1 test, cap at 5.
415
+
416
+ Never import secrets, API keys, or credentials in test files. Use environment variables or test fixtures.
417
+
418
+ ### B5. Verify
419
+
420
+ ```bash
421
+ # Run the full test suite to confirm everything works
422
+ {detected test command}
423
+ ```
424
+
425
+ If tests fail → debug once. If still failing → revert all bootstrap changes and warn user.
426
+
427
+ ### B5.5. CI/CD pipeline
428
+
429
+ ```bash
430
+ # Check CI provider
431
+ ls -d .github/ 2>/dev/null && echo "CI:github"
432
+ ls .gitlab-ci.yml .circleci/ bitrise.yml 2>/dev/null
433
+ ```
434
+
435
+ If `.github/` exists (or no CI detected — default to GitHub Actions):
436
+ Create `.github/workflows/test.yml` with:
437
+ - `runs-on: ubuntu-latest`
438
+ - Appropriate setup action for the runtime (setup-node, setup-ruby, setup-python, etc.)
439
+ - The same test command verified in B5
440
+ - Trigger: push + pull_request
441
+
442
+ If non-GitHub CI detected → skip CI generation with note: "Detected {provider} — CI pipeline generation supports GitHub Actions only. Add test step to your existing pipeline manually."
443
+
444
+ ### B6. Create TESTING.md
445
+
446
+ First check: If TESTING.md already exists → read it and update/append rather than overwriting. Never destroy existing content.
447
+
448
+ Write TESTING.md with:
449
+ - Philosophy: "100% test coverage is the key to great vibe coding. Tests let you move fast, trust your instincts, and ship with confidence — without them, vibe coding is just yolo coding. With tests, it's a superpower."
450
+ - Framework name and version
451
+ - How to run tests (the verified command from B5)
452
+ - Test layers: Unit tests (what, where, when), Integration tests, Smoke tests, E2E tests
453
+ - Conventions: file naming, assertion style, setup/teardown patterns
454
+
455
+ ### B7. Update CLAUDE.md
456
+
457
+ First check: If CLAUDE.md already has a `## Testing` section → skip. Don't duplicate.
458
+
459
+ Append a `## Testing` section:
460
+ - Run command and test directory
461
+ - Reference to TESTING.md
462
+ - Test expectations:
463
+ - 100% test coverage is the goal — tests make vibe coding safe
464
+ - When writing new functions, write a corresponding test
465
+ - When fixing a bug, write a regression test
466
+ - When adding error handling, write a test that triggers the error
467
+ - When adding a conditional (if/else, switch), write tests for BOTH paths
468
+ - Never commit code that makes existing tests fail
469
+
470
+ ### B8. Commit
471
+
472
+ ```bash
473
+ git status --porcelain
474
+ ```
475
+
476
+ Only commit if there are changes. Stage all bootstrap files (config, test directory, TESTING.md, CLAUDE.md, .github/workflows/test.yml if created):
477
+ `git commit -m "chore: bootstrap test framework ({framework name})"`
478
+
479
+ ---
480
+
481
+ **Create output directories:**
482
+
483
+ ```bash
484
+ REPORT_DIR=".gstack/design-reports"
485
+ mkdir -p "$REPORT_DIR/screenshots"
486
+ ```
487
+
488
+ ---
489
+
490
+ ## Phases 1-6: Design Audit Baseline
491
+
492
+ ## Modes
493
+
494
+ ### Full (default)
495
+ Systematic review of all pages reachable from homepage. Visit 5-8 pages. Full checklist evaluation, responsive screenshots, interaction flow testing. Produces complete design audit report with letter grades.
496
+
497
+ ### Quick (`--quick`)
498
+ Homepage + 2 key pages only. First Impression + Design System Extraction + abbreviated checklist. Fastest path to a design score.
499
+
500
+ ### Deep (`--deep`)
501
+ Comprehensive review: 10-15 pages, every interaction flow, exhaustive checklist. For pre-launch audits or major redesigns.
502
+
503
+ ### Diff-aware (automatic when on a feature branch with no URL)
504
+ When on a feature branch, scope to pages affected by the branch changes:
505
+ 1. Analyze the branch diff: `git diff main...HEAD --name-only`
506
+ 2. Map changed files to affected pages/routes
507
+ 3. Detect running app on common local ports (3000, 4000, 8080)
508
+ 4. Audit only affected pages, compare design quality before/after
509
+
510
+ ### Regression (`--regression` or previous `design-baseline.json` found)
511
+ Run full audit, then load previous `design-baseline.json`. Compare: per-category grade deltas, new findings, resolved findings. Output regression table in report.
512
+
513
+ ---
514
+
515
+ ## Phase 1: First Impression
516
+
517
+ The most uniquely designer-like output. Form a gut reaction before analyzing anything.
518
+
519
+ 1. Navigate to the target URL
520
+ 2. Take a full-page desktop screenshot: `$B screenshot "$REPORT_DIR/screenshots/first-impression.png"`
521
+ 3. Write the **First Impression** using this structured critique format:
522
+ - "The site communicates **[what]**." (what it says at a glance — competence? playfulness? confusion?)
523
+ - "I notice **[observation]**." (what stands out, positive or negative — be specific)
524
+ - "The first 3 things my eye goes to are: **[1]**, **[2]**, **[3]**." (hierarchy check — are these intentional?)
525
+ - "If I had to describe this in one word: **[word]**." (gut verdict)
526
+
527
+ This is the section users read first. Be opinionated. A designer doesn't hedge — they react.
528
+
529
+ ---
530
+
531
+ ## Phase 2: Design System Extraction
532
+
533
+ Extract the actual design system the site uses (not what a DESIGN.md says, but what's rendered):
534
+
535
+ ```bash
536
+ # Fonts in use (capped at 500 elements to avoid timeout)
537
+ $B js "JSON.stringify([...new Set([...document.querySelectorAll('*')].slice(0,500).map(e => getComputedStyle(e).fontFamily))])"
538
+
539
+ # Color palette in use
540
+ $B js "JSON.stringify([...new Set([...document.querySelectorAll('*')].slice(0,500).flatMap(e => [getComputedStyle(e).color, getComputedStyle(e).backgroundColor]).filter(c => c !== 'rgba(0, 0, 0, 0)'))])"
541
+
542
+ # Heading hierarchy
543
+ $B js "JSON.stringify([...document.querySelectorAll('h1,h2,h3,h4,h5,h6')].map(h => ({tag:h.tagName, text:h.textContent.trim().slice(0,50), size:getComputedStyle(h).fontSize, weight:getComputedStyle(h).fontWeight})))"
544
+
545
+ # Touch target audit (find undersized interactive elements)
546
+ $B js "JSON.stringify([...document.querySelectorAll('a,button,input,[role=button]')].filter(e => {const r=e.getBoundingClientRect(); return r.width>0 && (r.width<44||r.height<44)}).map(e => ({tag:e.tagName, text:(e.textContent||'').trim().slice(0,30), w:Math.round(e.getBoundingClientRect().width), h:Math.round(e.getBoundingClientRect().height)})).slice(0,20))"
547
+
548
+ # Performance baseline
549
+ $B perf
550
+ ```
551
+
552
+ Structure findings as an **Inferred Design System**:
553
+ - **Fonts:** list with usage counts. Flag if >3 distinct font families.
554
+ - **Colors:** palette extracted. Flag if >12 unique non-gray colors. Note warm/cool/mixed.
555
+ - **Heading Scale:** h1-h6 sizes. Flag skipped levels, non-systematic size jumps.
556
+ - **Spacing Patterns:** sample padding/margin values. Flag non-scale values.
557
+
558
+ After extraction, offer: *"Want me to save this as your DESIGN.md? I can lock in these observations as your project's design system baseline."*
559
+
560
+ ---
561
+
562
+ ## Phase 3: Page-by-Page Visual Audit
563
+
564
+ For each page in scope:
565
+
566
+ ```bash
567
+ $B goto <url>
568
+ $B snapshot -i -a -o "$REPORT_DIR/screenshots/{page}-annotated.png"
569
+ $B responsive "$REPORT_DIR/screenshots/{page}"
570
+ $B console --errors
571
+ $B perf
572
+ ```
573
+
574
+ ### Auth Detection
575
+
576
+ After the first navigation, check if the URL changed to a login-like path:
577
+ ```bash
578
+ $B url
579
+ ```
580
+ If URL contains `/login`, `/signin`, `/auth`, or `/sso`: the site requires authentication. AskUserQuestion: "This site requires authentication. Want to import cookies from your browser? Run `/setup-browser-cookies` first if needed."
581
+
582
+ ### Design Audit Checklist (10 categories, ~80 items)
583
+
584
+ Apply these at each page. Each finding gets an impact rating (high/medium/polish) and category.
585
+
586
+ **1. Visual Hierarchy & Composition** (8 items)
587
+ - Clear focal point? One primary CTA per view?
588
+ - Eye flows naturally top-left to bottom-right?
589
+ - Visual noise — competing elements fighting for attention?
590
+ - Information density appropriate for content type?
591
+ - Z-index clarity — nothing unexpectedly overlapping?
592
+ - Above-the-fold content communicates purpose in 3 seconds?
593
+ - Squint test: hierarchy still visible when blurred?
594
+ - White space is intentional, not leftover?
595
+
596
+ **2. Typography** (15 items)
597
+ - Font count <=3 (flag if more)
598
+ - Scale follows ratio (1.25 major third or 1.333 perfect fourth)
599
+ - Line-height: 1.5x body, 1.15-1.25x headings
600
+ - Measure: 45-75 chars per line (66 ideal)
601
+ - Heading hierarchy: no skipped levels (h1→h3 without h2)
602
+ - Weight contrast: >=2 weights used for hierarchy
603
+ - No blacklisted fonts (Papyrus, Comic Sans, Lobster, Impact, Jokerman)
604
+ - If primary font is Inter/Roboto/Open Sans/Poppins → flag as potentially generic
605
+ - `text-wrap: balance` or `text-pretty` on headings (check via `$B css <heading> text-wrap`)
606
+ - Curly quotes used, not straight quotes
607
+ - Ellipsis character (`…`) not three dots (`...`)
608
+ - `font-variant-numeric: tabular-nums` on number columns
609
+ - Body text >= 16px
610
+ - Caption/label >= 12px
611
+ - No letterspacing on lowercase text
612
+
613
+ **3. Color & Contrast** (10 items)
614
+ - Palette coherent (<=12 unique non-gray colors)
615
+ - WCAG AA: body text 4.5:1, large text (18px+) 3:1, UI components 3:1
616
+ - Semantic colors consistent (success=green, error=red, warning=yellow/amber)
617
+ - No color-only encoding (always add labels, icons, or patterns)
618
+ - Dark mode: surfaces use elevation, not just lightness inversion
619
+ - Dark mode: text off-white (~#E0E0E0), not pure white
620
+ - Primary accent desaturated 10-20% in dark mode
621
+ - `color-scheme: dark` on html element (if dark mode present)
622
+ - No red/green only combinations (8% of men have red-green deficiency)
623
+ - Neutral palette is warm or cool consistently — not mixed
624
+
625
+ **4. Spacing & Layout** (12 items)
626
+ - Grid consistent at all breakpoints
627
+ - Spacing uses a scale (4px or 8px base), not arbitrary values
628
+ - Alignment is consistent — nothing floats outside the grid
629
+ - Rhythm: related items closer together, distinct sections further apart
630
+ - Border-radius hierarchy (not uniform bubbly radius on everything)
631
+ - Inner radius = outer radius - gap (nested elements)
632
+ - No horizontal scroll on mobile
633
+ - Max content width set (no full-bleed body text)
634
+ - `env(safe-area-inset-*)` for notch devices
635
+ - URL reflects state (filters, tabs, pagination in query params)
636
+ - Flex/grid used for layout (not JS measurement)
637
+ - Breakpoints: mobile (375), tablet (768), desktop (1024), wide (1440)
638
+
639
+ **5. Interaction States** (10 items)
640
+ - Hover state on all interactive elements
641
+ - `focus-visible` ring present (never `outline: none` without replacement)
642
+ - Active/pressed state with depth effect or color shift
643
+ - Disabled state: reduced opacity + `cursor: not-allowed`
644
+ - Loading: skeleton shapes match real content layout
645
+ - Empty states: warm message + primary action + visual (not just "No items.")
646
+ - Error messages: specific + include fix/next step
647
+ - Success: confirmation animation or color, auto-dismiss
648
+ - Touch targets >= 44px on all interactive elements
649
+ - `cursor: pointer` on all clickable elements
650
+
651
+ **6. Responsive Design** (8 items)
652
+ - Mobile layout makes *design* sense (not just stacked desktop columns)
653
+ - Touch targets sufficient on mobile (>= 44px)
654
+ - No horizontal scroll on any viewport
655
+ - Images handle responsive (srcset, sizes, or CSS containment)
656
+ - Text readable without zooming on mobile (>= 16px body)
657
+ - Navigation collapses appropriately (hamburger, bottom nav, etc.)
658
+ - Forms usable on mobile (correct input types, no autoFocus on mobile)
659
+ - No `user-scalable=no` or `maximum-scale=1` in viewport meta
660
+
661
+ **7. Motion & Animation** (6 items)
662
+ - Easing: ease-out for entering, ease-in for exiting, ease-in-out for moving
663
+ - Duration: 50-700ms range (nothing slower unless page transition)
664
+ - Purpose: every animation communicates something (state change, attention, spatial relationship)
665
+ - `prefers-reduced-motion` respected (check: `$B js "matchMedia('(prefers-reduced-motion: reduce)').matches"`)
666
+ - No `transition: all` — properties listed explicitly
667
+ - Only `transform` and `opacity` animated (not layout properties like width, height, top, left)
668
+
669
+ **8. Content & Microcopy** (8 items)
670
+ - Empty states designed with warmth (message + action + illustration/icon)
671
+ - Error messages specific: what happened + why + what to do next
672
+ - Button labels specific ("Save API Key" not "Continue" or "Submit")
673
+ - No placeholder/lorem ipsum text visible in production
674
+ - Truncation handled (`text-overflow: ellipsis`, `line-clamp`, or `break-words`)
675
+ - Active voice ("Install the CLI" not "The CLI will be installed")
676
+ - Loading states end with `…` ("Saving…" not "Saving...")
677
+ - Destructive actions have confirmation modal or undo window
678
+
679
+ **9. AI Slop Detection** (10 anti-patterns — the blacklist)
680
+
681
+ The test: would a human designer at a respected studio ever ship this?
682
+
683
+ - Purple/violet/indigo gradient backgrounds or blue-to-purple color schemes
684
+ - **The 3-column feature grid:** icon-in-colored-circle + bold title + 2-line description, repeated 3x symmetrically. THE most recognizable AI layout.
685
+ - Icons in colored circles as section decoration (SaaS starter template look)
686
+ - Centered everything (`text-align: center` on all headings, descriptions, cards)
687
+ - Uniform bubbly border-radius on every element (same large radius on everything)
688
+ - Decorative blobs, floating circles, wavy SVG dividers (if a section feels empty, it needs better content, not decoration)
689
+ - Emoji as design elements (rockets in headings, emoji as bullet points)
690
+ - Colored left-border on cards (`border-left: 3px solid <accent>`)
691
+ - Generic hero copy ("Welcome to [X]", "Unlock the power of...", "Your all-in-one solution for...")
692
+ - Cookie-cutter section rhythm (hero → 3 features → testimonials → pricing → CTA, every section same height)
693
+
694
+ **10. Performance as Design** (6 items)
695
+ - LCP < 2.0s (web apps), < 1.5s (informational sites)
696
+ - CLS < 0.1 (no visible layout shifts during load)
697
+ - Skeleton quality: shapes match real content, shimmer animation
698
+ - Images: `loading="lazy"`, width/height dimensions set, WebP/AVIF format
699
+ - Fonts: `font-display: swap`, preconnect to CDN origins
700
+ - No visible font swap flash (FOUT) — critical fonts preloaded
701
+
702
+ ---
703
+
704
+ ## Phase 4: Interaction Flow Review
705
+
706
+ Walk 2-3 key user flows and evaluate the *feel*, not just the function:
707
+
708
+ ```bash
709
+ $B snapshot -i
710
+ $B click @e3 # perform action
711
+ $B snapshot -D # diff to see what changed
712
+ ```
713
+
714
+ Evaluate:
715
+ - **Response feel:** Does clicking feel responsive? Any delays or missing loading states?
716
+ - **Transition quality:** Are transitions intentional or generic/absent?
717
+ - **Feedback clarity:** Did the action clearly succeed or fail? Is the feedback immediate?
718
+ - **Form polish:** Focus states visible? Validation timing correct? Errors near the source?
719
+
720
+ ---
721
+
722
+ ## Phase 5: Cross-Page Consistency
723
+
724
+ Compare screenshots and observations across pages for:
725
+ - Navigation bar consistent across all pages?
726
+ - Footer consistent?
727
+ - Component reuse vs one-off designs (same button styled differently on different pages?)
728
+ - Tone consistency (one page playful while another is corporate?)
729
+ - Spacing rhythm carries across pages?
730
+
731
+ ---
732
+
733
+ ## Phase 6: Compile Report
734
+
735
+ ### Output Locations
736
+
737
+ **Local:** `.gstack/design-reports/design-audit-{domain}-{YYYY-MM-DD}.md`
738
+
739
+ **Project-scoped:**
740
+ ```bash
741
+ source <(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) && mkdir -p ~/.gstack/projects/$SLUG
742
+ ```
743
+ Write to: `~/.gstack/projects/{slug}/{user}-{branch}-design-audit-{datetime}.md`
744
+
745
+ **Baseline:** Write `design-baseline.json` for regression mode:
746
+ ```json
747
+ {
748
+ "date": "YYYY-MM-DD",
749
+ "url": "<target>",
750
+ "designScore": "B",
751
+ "aiSlopScore": "C",
752
+ "categoryGrades": { "hierarchy": "A", "typography": "B", ... },
753
+ "findings": [{ "id": "FINDING-001", "title": "...", "impact": "high", "category": "typography" }]
754
+ }
755
+ ```
756
+
757
+ ### Scoring System
758
+
759
+ **Dual headline scores:**
760
+ - **Design Score: {A-F}** — weighted average of all 10 categories
761
+ - **AI Slop Score: {A-F}** — standalone grade with pithy verdict
762
+
763
+ **Per-category grades:**
764
+ - **A:** Intentional, polished, delightful. Shows design thinking.
765
+ - **B:** Solid fundamentals, minor inconsistencies. Looks professional.
766
+ - **C:** Functional but generic. No major problems, no design point of view.
767
+ - **D:** Noticeable problems. Feels unfinished or careless.
768
+ - **F:** Actively hurting user experience. Needs significant rework.
769
+
770
+ **Grade computation:** Each category starts at A. Each High-impact finding drops one letter grade. Each Medium-impact finding drops half a letter grade. Polish findings are noted but do not affect grade. Minimum is F.
771
+
772
+ **Category weights for Design Score:**
773
+ | Category | Weight |
774
+ |----------|--------|
775
+ | Visual Hierarchy | 15% |
776
+ | Typography | 15% |
777
+ | Spacing & Layout | 15% |
778
+ | Color & Contrast | 10% |
779
+ | Interaction States | 10% |
780
+ | Responsive | 10% |
781
+ | Content Quality | 10% |
782
+ | AI Slop | 5% |
783
+ | Motion | 5% |
784
+ | Performance Feel | 5% |
785
+
786
+ AI Slop is 5% of Design Score but also graded independently as a headline metric.
787
+
788
+ ### Regression Output
789
+
790
+ When previous `design-baseline.json` exists or `--regression` flag is used:
791
+ - Load baseline grades
792
+ - Compare: per-category deltas, new findings, resolved findings
793
+ - Append regression table to report
794
+
795
+ ---
796
+
797
+ ## Design Critique Format
798
+
799
+ Use structured feedback, not opinions:
800
+ - "I notice..." — observation (e.g., "I notice the primary CTA competes with the secondary action")
801
+ - "I wonder..." — question (e.g., "I wonder if users will understand what 'Process' means here")
802
+ - "What if..." — suggestion (e.g., "What if we moved search to a more prominent position?")
803
+ - "I think... because..." — reasoned opinion (e.g., "I think the spacing between sections is too uniform because it doesn't create hierarchy")
804
+
805
+ Tie everything to user goals and product objectives. Always suggest specific improvements alongside problems.
806
+
807
+ ---
808
+
809
+ ## Important Rules
810
+
811
+ 1. **Think like a designer, not a QA engineer.** You care whether things feel right, look intentional, and respect the user. You do NOT just care whether things "work."
812
+ 2. **Screenshots are evidence.** Every finding needs at least one screenshot. Use annotated screenshots (`snapshot -a`) to highlight elements.
813
+ 3. **Be specific and actionable.** "Change X to Y because Z" — not "the spacing feels off."
814
+ 4. **Never read source code.** Evaluate the rendered site, not the implementation. (Exception: offer to write DESIGN.md from extracted observations.)
815
+ 5. **AI Slop detection is your superpower.** Most developers can't evaluate whether their site looks AI-generated. You can. Be direct about it.
816
+ 6. **Quick wins matter.** Always include a "Quick Wins" section — the 3-5 highest-impact fixes that take <30 minutes each.
817
+ 7. **Use `snapshot -C` for tricky UIs.** Finds clickable divs that the accessibility tree misses.
818
+ 8. **Responsive is design, not just "not broken."** A stacked desktop layout on mobile is not responsive design — it's lazy. Evaluate whether the mobile layout makes *design* sense.
819
+ 9. **Document incrementally.** Write each finding to the report as you find it. Don't batch.
820
+ 10. **Depth over breadth.** 5-10 well-documented findings with screenshots and specific suggestions > 20 vague observations.
821
+ 11. **Show screenshots to the user.** After every `$B screenshot`, `$B snapshot -a -o`, or `$B responsive` command, use the Read tool on the output file(s) so the user can see them inline. For `responsive` (3 files), Read all three. This is critical — without it, screenshots are invisible to the user.
822
+
823
+ Record baseline design score and AI slop score at end of Phase 6.
824
+
825
+ ---
826
+
827
+ ## Output Structure
828
+
829
+ ```
830
+ .gstack/design-reports/
831
+ ├── design-audit-{domain}-{YYYY-MM-DD}.md # Structured report
832
+ ├── screenshots/
833
+ │ ├── first-impression.png # Phase 1
834
+ │ ├── {page}-annotated.png # Per-page annotated
835
+ │ ├── {page}-mobile.png # Responsive
836
+ │ ├── {page}-tablet.png
837
+ │ ├── {page}-desktop.png
838
+ │ ├── finding-001-before.png # Before fix
839
+ │ ├── finding-001-after.png # After fix
840
+ │ └── ...
841
+ └── design-baseline.json # For regression mode
842
+ ```
843
+
844
+ ---
845
+
846
+ ## Phase 7: Triage
847
+
848
+ Sort all discovered findings by impact, then decide which to fix:
849
+
850
+ - **High Impact:** Fix first. These affect the first impression and hurt user trust.
851
+ - **Medium Impact:** Fix next. These reduce polish and are felt subconsciously.
852
+ - **Polish:** Fix if time allows. These separate good from great.
853
+
854
+ Mark findings that cannot be fixed from source code (e.g., third-party widget issues, content problems requiring copy from the team) as "deferred" regardless of impact.
855
+
856
+ ---
857
+
858
+ ## Phase 8: Fix Loop
859
+
860
+ For each fixable finding, in impact order:
861
+
862
+ ### 8a. Locate source
863
+
864
+ ```bash
865
+ # Search for CSS classes, component names, style files
866
+ # Glob for file patterns matching the affected page
867
+ ```
868
+
869
+ - Find the source file(s) responsible for the design issue
870
+ - ONLY modify files directly related to the finding
871
+ - Prefer CSS/styling changes over structural component changes
872
+
873
+ ### 8b. Fix
874
+
875
+ - Read the source code, understand the context
876
+ - Make the **minimal fix** — smallest change that resolves the design issue
877
+ - CSS-only changes are preferred (safer, more reversible)
878
+ - Do NOT refactor surrounding code, add features, or "improve" unrelated things
879
+
880
+ ### 8c. Commit
881
+
882
+ ```bash
883
+ git add <only-changed-files>
884
+ git commit -m "style(design): FINDING-NNN — short description"
885
+ ```
886
+
887
+ - One commit per fix. Never bundle multiple fixes.
888
+ - Message format: `style(design): FINDING-NNN — short description`
889
+
890
+ ### 8d. Re-test
891
+
892
+ Navigate back to the affected page and verify the fix:
893
+
894
+ ```bash
895
+ $B goto <affected-url>
896
+ $B screenshot "$REPORT_DIR/screenshots/finding-NNN-after.png"
897
+ $B console --errors
898
+ $B snapshot -D
899
+ ```
900
+
901
+ Take **before/after screenshot pair** for every fix.
902
+
903
+ ### 8e. Classify
904
+
905
+ - **verified**: re-test confirms the fix works, no new errors introduced
906
+ - **best-effort**: fix applied but couldn't fully verify (e.g., needs specific browser state)
907
+ - **reverted**: regression detected → `git revert HEAD` → mark finding as "deferred"
908
+
909
+ ### 8e.5. Regression Test (design-review variant)
910
+
911
+ Design fixes are typically CSS-only. Only generate regression tests for fixes involving
912
+ JavaScript behavior changes — broken dropdowns, animation failures, conditional rendering,
913
+ interactive state issues.
914
+
915
+ For CSS-only fixes: skip entirely. CSS regressions are caught by re-running /design-review.
916
+
917
+ If the fix involved JS behavior: follow the same procedure as /qa Phase 8e.5 (study existing
918
+ test patterns, write a regression test encoding the exact bug condition, run it, commit if
919
+ passes or defer if fails). Commit format: `test(design): regression test for FINDING-NNN`.
920
+
921
+ ### 8f. Self-Regulation (STOP AND EVALUATE)
922
+
923
+ Every 5 fixes (or after any revert), compute the design-fix risk level:
924
+
925
+ ```
926
+ DESIGN-FIX RISK:
927
+ Start at 0%
928
+ Each revert: +15%
929
+ Each CSS-only file change: +0% (safe — styling only)
930
+ Each JSX/TSX/component file change: +5% per file
931
+ After fix 10: +1% per additional fix
932
+ Touching unrelated files: +20%
933
+ ```
934
+
935
+ **If risk > 20%:** STOP immediately. Show the user what you've done so far. Ask whether to continue.
936
+
937
+ **Hard cap: 30 fixes.** After 30 fixes, stop regardless of remaining findings.
938
+
939
+ ---
940
+
941
+ ## Phase 9: Final Design Audit
942
+
943
+ After all fixes are applied:
944
+
945
+ 1. Re-run the design audit on all affected pages
946
+ 2. Compute final design score and AI slop score
947
+ 3. **If final scores are WORSE than baseline:** WARN prominently — something regressed
948
+
949
+ ---
950
+
951
+ ## Phase 10: Report
952
+
953
+ Write the report to both local and project-scoped locations:
954
+
955
+ **Local:** `.gstack/design-reports/design-audit-{domain}-{YYYY-MM-DD}.md`
956
+
957
+ **Project-scoped:**
958
+ ```bash
959
+ source <(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) && mkdir -p ~/.gstack/projects/$SLUG
960
+ ```
961
+ Write to `~/.gstack/projects/{slug}/{user}-{branch}-design-audit-{datetime}.md`
962
+
963
+ **Per-finding additions** (beyond standard design audit report):
964
+ - Fix Status: verified / best-effort / reverted / deferred
965
+ - Commit SHA (if fixed)
966
+ - Files Changed (if fixed)
967
+ - Before/After screenshots (if fixed)
968
+
969
+ **Summary section:**
970
+ - Total findings
971
+ - Fixes applied (verified: X, best-effort: Y, reverted: Z)
972
+ - Deferred findings
973
+ - Design score delta: baseline → final
974
+ - AI slop score delta: baseline → final
975
+
976
+ **PR Summary:** Include a one-line summary suitable for PR descriptions:
977
+ > "Design review found N issues, fixed M. Design score X → Y, AI slop score X → Y."
978
+
979
+ ---
980
+
981
+ ## Phase 11: TODOS.md Update
982
+
983
+ If the repo has a `TODOS.md`:
984
+
985
+ 1. **New deferred design findings** → add as TODOs with impact level, category, and description
986
+ 2. **Fixed findings that were in TODOS.md** → annotate with "Fixed by /design-review on {branch}, {date}"
987
+
988
+ ---
989
+
990
+ ## Additional Rules (design-review specific)
991
+
992
+ 11. **Clean working tree required.** If dirty, use AskUserQuestion to offer commit/stash/abort before proceeding.
993
+ 12. **One commit per fix.** Never bundle multiple design fixes into one commit.
994
+ 13. **Only modify tests when generating regression tests in Phase 8e.5.** Never modify CI configuration. Never modify existing tests — only create new test files.
995
+ 14. **Revert on regression.** If a fix makes things worse, `git revert HEAD` immediately.
996
+ 15. **Self-regulate.** Follow the design-fix risk heuristic. When in doubt, stop and ask.
997
+ 16. **CSS-first.** Prefer CSS/styling changes over structural component changes. CSS-only changes are safer and more reversible.
998
+ 17. **DESIGN.md export.** You MAY write a DESIGN.md file if the user accepts the offer from Phase 2.