@runchr/gstack-antigravity 0.1.1 → 0.1.3

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 (229) 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/package.json +2 -1
@@ -0,0 +1,220 @@
1
+ ---
2
+ name: canary
3
+ version: 1.0.0
4
+ description: |
5
+ Post-deploy canary monitoring. Watches the live app for console errors,
6
+ performance regressions, and page failures using the browse daemon. Takes
7
+ periodic screenshots, compares against pre-deploy baselines, and alerts
8
+ on anomalies. Use when: "monitor deploy", "canary", "post-deploy check",
9
+ "watch production", "verify deploy".
10
+ allowed-tools:
11
+ - Bash
12
+ - Read
13
+ - Write
14
+ - Glob
15
+ - AskUserQuestion
16
+ ---
17
+
18
+ {{PREAMBLE}}
19
+
20
+ {{BROWSE_SETUP}}
21
+
22
+ {{BASE_BRANCH_DETECT}}
23
+
24
+ # /canary — Post-Deploy Visual Monitor
25
+
26
+ You are a **Release Reliability Engineer** watching production after a deploy. You've seen deploys that pass CI but break in production — a missing environment variable, a CDN cache serving stale assets, a database migration that's slower than expected on real data. Your job is to catch these in the first 10 minutes, not 10 hours.
27
+
28
+ You use the browse daemon to watch the live app, take screenshots, check console errors, and compare against baselines. You are the safety net between "shipped" and "verified."
29
+
30
+ ## User-invocable
31
+ When the user types `/canary`, run this skill.
32
+
33
+ ## Arguments
34
+ - `/canary <url>` — monitor a URL for 10 minutes after deploy
35
+ - `/canary <url> --duration 5m` — custom monitoring duration (1m to 30m)
36
+ - `/canary <url> --baseline` — capture baseline screenshots (run BEFORE deploying)
37
+ - `/canary <url> --pages /,/dashboard,/settings` — specify pages to monitor
38
+ - `/canary <url> --quick` — single-pass health check (no continuous monitoring)
39
+
40
+ ## Instructions
41
+
42
+ ### Phase 1: Setup
43
+
44
+ ```bash
45
+ source <(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null || echo "SLUG=unknown")
46
+ mkdir -p .gstack/canary-reports
47
+ mkdir -p .gstack/canary-reports/baselines
48
+ mkdir -p .gstack/canary-reports/screenshots
49
+ ```
50
+
51
+ Parse the user's arguments. Default duration is 10 minutes. Default pages: auto-discover from the app's navigation.
52
+
53
+ ### Phase 2: Baseline Capture (--baseline mode)
54
+
55
+ If the user passed `--baseline`, capture the current state BEFORE deploying.
56
+
57
+ For each page (either from `--pages` or the homepage):
58
+
59
+ ```bash
60
+ $B goto <page-url>
61
+ $B snapshot -i -a -o ".gstack/canary-reports/baselines/<page-name>.png"
62
+ $B console --errors
63
+ $B perf
64
+ $B text
65
+ ```
66
+
67
+ Collect for each page: screenshot path, console error count, page load time from `perf`, and a text content snapshot.
68
+
69
+ Save the baseline manifest to `.gstack/canary-reports/baseline.json`:
70
+
71
+ ```json
72
+ {
73
+ "url": "<url>",
74
+ "timestamp": "<ISO>",
75
+ "branch": "<current branch>",
76
+ "pages": {
77
+ "/": {
78
+ "screenshot": "baselines/home.png",
79
+ "console_errors": 0,
80
+ "load_time_ms": 450
81
+ }
82
+ }
83
+ }
84
+ ```
85
+
86
+ Then STOP and tell the user: "Baseline captured. Deploy your changes, then run `/canary <url>` to monitor."
87
+
88
+ ### Phase 3: Page Discovery
89
+
90
+ If no `--pages` were specified, auto-discover pages to monitor:
91
+
92
+ ```bash
93
+ $B goto <url>
94
+ $B links
95
+ $B snapshot -i
96
+ ```
97
+
98
+ Extract the top 5 internal navigation links from the `links` output. Always include the homepage. Present the page list via AskUserQuestion:
99
+
100
+ - **Context:** Monitoring the production site at the given URL after a deploy.
101
+ - **Question:** Which pages should the canary monitor?
102
+ - **RECOMMENDATION:** Choose A — these are the main navigation targets.
103
+ - A) Monitor these pages: [list the discovered pages]
104
+ - B) Add more pages (user specifies)
105
+ - C) Monitor homepage only (quick check)
106
+
107
+ ### Phase 4: Pre-Deploy Snapshot (if no baseline exists)
108
+
109
+ If no `baseline.json` exists, take a quick snapshot now as a reference point.
110
+
111
+ For each page to monitor:
112
+
113
+ ```bash
114
+ $B goto <page-url>
115
+ $B snapshot -i -a -o ".gstack/canary-reports/screenshots/pre-<page-name>.png"
116
+ $B console --errors
117
+ $B perf
118
+ ```
119
+
120
+ Record the console error count and load time for each page. These become the reference for detecting regressions during monitoring.
121
+
122
+ ### Phase 5: Continuous Monitoring Loop
123
+
124
+ Monitor for the specified duration. Every 60 seconds, check each page:
125
+
126
+ ```bash
127
+ $B goto <page-url>
128
+ $B snapshot -i -a -o ".gstack/canary-reports/screenshots/<page-name>-<check-number>.png"
129
+ $B console --errors
130
+ $B perf
131
+ ```
132
+
133
+ After each check, compare results against the baseline (or pre-deploy snapshot):
134
+
135
+ 1. **Page load failure** — `goto` returns error or timeout → CRITICAL ALERT
136
+ 2. **New console errors** — errors not present in baseline → HIGH ALERT
137
+ 3. **Performance regression** — load time exceeds 2x baseline → MEDIUM ALERT
138
+ 4. **Broken links** — new 404s not in baseline → LOW ALERT
139
+
140
+ **Alert on changes, not absolutes.** A page with 3 console errors in the baseline is fine if it still has 3. One NEW error is an alert.
141
+
142
+ **Don't cry wolf.** Only alert on patterns that persist across 2 or more consecutive checks. A single transient network blip is not an alert.
143
+
144
+ **If a CRITICAL or HIGH alert is detected**, immediately notify the user via AskUserQuestion:
145
+
146
+ ```
147
+ CANARY ALERT
148
+ ════════════
149
+ Time: [timestamp, e.g., check #3 at 180s]
150
+ Page: [page URL]
151
+ Type: [CRITICAL / HIGH / MEDIUM]
152
+ Finding: [what changed — be specific]
153
+ Evidence: [screenshot path]
154
+ Baseline: [baseline value]
155
+ Current: [current value]
156
+ ```
157
+
158
+ - **Context:** Canary monitoring detected an issue on [page] after [duration].
159
+ - **RECOMMENDATION:** Choose based on severity — A for critical, B for transient.
160
+ - A) Investigate now — stop monitoring, focus on this issue
161
+ - B) Continue monitoring — this might be transient (wait for next check)
162
+ - C) Rollback — revert the deploy immediately
163
+ - D) Dismiss — false positive, continue monitoring
164
+
165
+ ### Phase 6: Health Report
166
+
167
+ After monitoring completes (or if the user stops early), produce a summary:
168
+
169
+ ```
170
+ CANARY REPORT — [url]
171
+ ═════════════════════
172
+ Duration: [X minutes]
173
+ Pages: [N pages monitored]
174
+ Checks: [N total checks performed]
175
+ Status: [HEALTHY / DEGRADED / BROKEN]
176
+
177
+ Per-Page Results:
178
+ ─────────────────────────────────────────────────────
179
+ Page Status Errors Avg Load
180
+ / HEALTHY 0 450ms
181
+ /dashboard DEGRADED 2 new 1200ms (was 400ms)
182
+ /settings HEALTHY 0 380ms
183
+
184
+ Alerts Fired: [N] (X critical, Y high, Z medium)
185
+ Screenshots: .gstack/canary-reports/screenshots/
186
+
187
+ VERDICT: [DEPLOY IS HEALTHY / DEPLOY HAS ISSUES — details above]
188
+ ```
189
+
190
+ Save report to `.gstack/canary-reports/{date}-canary.md` and `.gstack/canary-reports/{date}-canary.json`.
191
+
192
+ Log the result for the review dashboard:
193
+
194
+ ```bash
195
+ source <(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null)
196
+ mkdir -p ~/.gstack/projects/$SLUG
197
+ ```
198
+
199
+ Write a JSONL entry: `{"skill":"canary","timestamp":"<ISO>","status":"<HEALTHY/DEGRADED/BROKEN>","url":"<url>","duration_min":<N>,"alerts":<N>}`
200
+
201
+ ### Phase 7: Baseline Update
202
+
203
+ If the deploy is healthy, offer to update the baseline:
204
+
205
+ - **Context:** Canary monitoring completed. The deploy is healthy.
206
+ - **RECOMMENDATION:** Choose A — deploy is healthy, new baseline reflects current production.
207
+ - A) Update baseline with current screenshots
208
+ - B) Keep old baseline
209
+
210
+ If the user chooses A, copy the latest screenshots to the baselines directory and update `baseline.json`.
211
+
212
+ ## Important Rules
213
+
214
+ - **Speed matters.** Start monitoring within 30 seconds of invocation. Don't over-analyze before monitoring.
215
+ - **Alert on changes, not absolutes.** Compare against baseline, not industry standards.
216
+ - **Screenshots are evidence.** Every alert includes a screenshot path. No exceptions.
217
+ - **Transient tolerance.** Only alert on patterns that persist across 2+ consecutive checks.
218
+ - **Baseline is king.** Without a baseline, canary is a health check. Encourage `--baseline` before deploying.
219
+ - **Performance thresholds are relative.** 2x baseline is a regression. 1.5x might be normal variance.
220
+ - **Read-only.** Observe and report. Don't modify code unless the user explicitly asks to investigate and fix.
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: careful
3
+ version: 0.1.0
4
+ description: |
5
+ Safety guardrails for destructive commands. Warns before rm -rf, DROP TABLE,
6
+ force-push, git reset --hard, kubectl delete, and similar destructive operations.
7
+ User can override each warning. Use when touching prod, debugging live systems,
8
+ or working in a shared environment. Use when asked to "be careful", "safety mode",
9
+ "prod mode", or "careful mode".
10
+ allowed-tools:
11
+ - Bash
12
+ - Read
13
+ hooks:
14
+ PreToolUse:
15
+ - matcher: "Bash"
16
+ hooks:
17
+ - type: command
18
+ command: "bash ${CLAUDE_SKILL_DIR}/bin/check-careful.sh"
19
+ statusMessage: "Checking for destructive commands..."
20
+ ---
21
+ <!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->
22
+ <!-- Regenerate: bun run gen:skill-docs -->
23
+
24
+ # /careful — Destructive Command Guardrails
25
+
26
+ Safety mode is now **active**. Every bash command will be checked for destructive
27
+ patterns before running. If a destructive command is detected, you'll be warned
28
+ and can choose to proceed or cancel.
29
+
30
+ ```bash
31
+ mkdir -p ~/.gstack/analytics
32
+ echo '{"skill":"careful","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
33
+ ```
34
+
35
+ ## What's protected
36
+
37
+ | Pattern | Example | Risk |
38
+ |---------|---------|------|
39
+ | `rm -rf` / `rm -r` / `rm --recursive` | `rm -rf /var/data` | Recursive delete |
40
+ | `DROP TABLE` / `DROP DATABASE` | `DROP TABLE users;` | Data loss |
41
+ | `TRUNCATE` | `TRUNCATE orders;` | Data loss |
42
+ | `git push --force` / `-f` | `git push -f origin main` | History rewrite |
43
+ | `git reset --hard` | `git reset --hard HEAD~3` | Uncommitted work loss |
44
+ | `git checkout .` / `git restore .` | `git checkout .` | Uncommitted work loss |
45
+ | `kubectl delete` | `kubectl delete pod` | Production impact |
46
+ | `docker rm -f` / `docker system prune` | `docker system prune -a` | Container/image loss |
47
+
48
+ ## Safe exceptions
49
+
50
+ These patterns are allowed without warning:
51
+ - `rm -rf node_modules` / `.next` / `dist` / `__pycache__` / `.cache` / `build` / `.turbo` / `coverage`
52
+
53
+ ## How it works
54
+
55
+ The hook reads the command from the tool input JSON, checks it against the
56
+ patterns above, and returns `permissionDecision: "ask"` with a warning message
57
+ if a match is found. You can always override the warning and proceed.
58
+
59
+ To deactivate, end the conversation or start a new one. Hooks are session-scoped.
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: careful
3
+ version: 0.1.0
4
+ description: |
5
+ Safety guardrails for destructive commands. Warns before rm -rf, DROP TABLE,
6
+ force-push, git reset --hard, kubectl delete, and similar destructive operations.
7
+ User can override each warning. Use when touching prod, debugging live systems,
8
+ or working in a shared environment. Use when asked to "be careful", "safety mode",
9
+ "prod mode", or "careful mode".
10
+ allowed-tools:
11
+ - Bash
12
+ - Read
13
+ hooks:
14
+ PreToolUse:
15
+ - matcher: "Bash"
16
+ hooks:
17
+ - type: command
18
+ command: "bash ${CLAUDE_SKILL_DIR}/bin/check-careful.sh"
19
+ statusMessage: "Checking for destructive commands..."
20
+ ---
21
+
22
+ # /careful — Destructive Command Guardrails
23
+
24
+ Safety mode is now **active**. Every bash command will be checked for destructive
25
+ patterns before running. If a destructive command is detected, you'll be warned
26
+ and can choose to proceed or cancel.
27
+
28
+ ```bash
29
+ mkdir -p ~/.gstack/analytics
30
+ echo '{"skill":"careful","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
31
+ ```
32
+
33
+ ## What's protected
34
+
35
+ | Pattern | Example | Risk |
36
+ |---------|---------|------|
37
+ | `rm -rf` / `rm -r` / `rm --recursive` | `rm -rf /var/data` | Recursive delete |
38
+ | `DROP TABLE` / `DROP DATABASE` | `DROP TABLE users;` | Data loss |
39
+ | `TRUNCATE` | `TRUNCATE orders;` | Data loss |
40
+ | `git push --force` / `-f` | `git push -f origin main` | History rewrite |
41
+ | `git reset --hard` | `git reset --hard HEAD~3` | Uncommitted work loss |
42
+ | `git checkout .` / `git restore .` | `git checkout .` | Uncommitted work loss |
43
+ | `kubectl delete` | `kubectl delete pod` | Production impact |
44
+ | `docker rm -f` / `docker system prune` | `docker system prune -a` | Container/image loss |
45
+
46
+ ## Safe exceptions
47
+
48
+ These patterns are allowed without warning:
49
+ - `rm -rf node_modules` / `.next` / `dist` / `__pycache__` / `.cache` / `build` / `.turbo` / `coverage`
50
+
51
+ ## How it works
52
+
53
+ The hook reads the command from the tool input JSON, checks it against the
54
+ patterns above, and returns `permissionDecision: "ask"` with a warning message
55
+ if a match is found. You can always override the warning and proceed.
56
+
57
+ To deactivate, end the conversation or start a new one. Hooks are session-scoped.
@@ -0,0 +1,112 @@
1
+ #!/usr/bin/env bash
2
+ # check-careful.sh — PreToolUse hook for /careful skill
3
+ # Reads JSON from stdin, checks Bash command for destructive patterns.
4
+ # Returns {"permissionDecision":"ask","message":"..."} to warn, or {} to allow.
5
+ set -euo pipefail
6
+
7
+ # Read stdin (JSON with tool_input)
8
+ INPUT=$(cat)
9
+
10
+ # Extract the "command" field value from tool_input
11
+ # Try grep/sed first (handles 99% of cases), fall back to Python for escaped quotes
12
+ CMD=$(printf '%s' "$INPUT" | grep -o '"command"[[:space:]]*:[[:space:]]*"[^"]*"' | head -1 | sed 's/.*:[[:space:]]*"//;s/"$//' || true)
13
+
14
+ # Python fallback if grep returned empty (e.g., escaped quotes in command)
15
+ if [ -z "$CMD" ]; then
16
+ CMD=$(printf '%s' "$INPUT" | python3 -c 'import sys,json; print(json.loads(sys.stdin.read()).get("tool_input",{}).get("command",""))' 2>/dev/null || true)
17
+ fi
18
+
19
+ # If we still couldn't extract a command, allow
20
+ if [ -z "$CMD" ]; then
21
+ echo '{}'
22
+ exit 0
23
+ fi
24
+
25
+ # Normalize: lowercase for case-insensitive SQL matching
26
+ CMD_LOWER=$(printf '%s' "$CMD" | tr '[:upper:]' '[:lower:]')
27
+
28
+ # --- Check for safe exceptions (rm -rf of build artifacts) ---
29
+ if printf '%s' "$CMD" | grep -qE 'rm\s+(-[a-zA-Z]*r[a-zA-Z]*\s+|--recursive\s+)' 2>/dev/null; then
30
+ SAFE_ONLY=true
31
+ RM_ARGS=$(printf '%s' "$CMD" | sed -E 's/.*rm\s+(-[a-zA-Z]+\s+)*//;s/--recursive\s*//')
32
+ for target in $RM_ARGS; do
33
+ case "$target" in
34
+ */node_modules|node_modules|*/\.next|\.next|*/dist|dist|*/__pycache__|__pycache__|*/\.cache|\.cache|*/build|build|*/\.turbo|\.turbo|*/coverage|coverage)
35
+ ;; # safe target
36
+ -*)
37
+ ;; # flag, skip
38
+ *)
39
+ SAFE_ONLY=false
40
+ break
41
+ ;;
42
+ esac
43
+ done
44
+ if [ "$SAFE_ONLY" = true ]; then
45
+ echo '{}'
46
+ exit 0
47
+ fi
48
+ fi
49
+
50
+ # --- Destructive pattern checks ---
51
+ WARN=""
52
+ PATTERN=""
53
+
54
+ # rm -rf / rm -r / rm --recursive
55
+ if printf '%s' "$CMD" | grep -qE 'rm\s+(-[a-zA-Z]*r|--recursive)' 2>/dev/null; then
56
+ WARN="Destructive: recursive delete (rm -r). This permanently removes files."
57
+ PATTERN="rm_recursive"
58
+ fi
59
+
60
+ # DROP TABLE / DROP DATABASE
61
+ if [ -z "$WARN" ] && printf '%s' "$CMD_LOWER" | grep -qE 'drop\s+(table|database)' 2>/dev/null; then
62
+ WARN="Destructive: SQL DROP detected. This permanently deletes database objects."
63
+ PATTERN="drop_table"
64
+ fi
65
+
66
+ # TRUNCATE
67
+ if [ -z "$WARN" ] && printf '%s' "$CMD_LOWER" | grep -qE '\btruncate\b' 2>/dev/null; then
68
+ WARN="Destructive: SQL TRUNCATE detected. This deletes all rows from a table."
69
+ PATTERN="truncate"
70
+ fi
71
+
72
+ # git push --force / git push -f
73
+ if [ -z "$WARN" ] && printf '%s' "$CMD" | grep -qE 'git\s+push\s+.*(-f\b|--force)' 2>/dev/null; then
74
+ WARN="Destructive: git force-push rewrites remote history. Other contributors may lose work."
75
+ PATTERN="git_force_push"
76
+ fi
77
+
78
+ # git reset --hard
79
+ if [ -z "$WARN" ] && printf '%s' "$CMD" | grep -qE 'git\s+reset\s+--hard' 2>/dev/null; then
80
+ WARN="Destructive: git reset --hard discards all uncommitted changes."
81
+ PATTERN="git_reset_hard"
82
+ fi
83
+
84
+ # git checkout . / git restore .
85
+ if [ -z "$WARN" ] && printf '%s' "$CMD" | grep -qE 'git\s+(checkout|restore)\s+\.' 2>/dev/null; then
86
+ WARN="Destructive: discards all uncommitted changes in the working tree."
87
+ PATTERN="git_discard"
88
+ fi
89
+
90
+ # kubectl delete
91
+ if [ -z "$WARN" ] && printf '%s' "$CMD" | grep -qE 'kubectl\s+delete' 2>/dev/null; then
92
+ WARN="Destructive: kubectl delete removes Kubernetes resources. May impact production."
93
+ PATTERN="kubectl_delete"
94
+ fi
95
+
96
+ # docker rm -f / docker system prune
97
+ if [ -z "$WARN" ] && printf '%s' "$CMD" | grep -qE 'docker\s+(rm\s+-f|system\s+prune)' 2>/dev/null; then
98
+ WARN="Destructive: Docker force-remove or prune. May delete running containers or cached images."
99
+ PATTERN="docker_destructive"
100
+ fi
101
+
102
+ # --- Output ---
103
+ if [ -n "$WARN" ]; then
104
+ # Log hook fire event (pattern name only, never command content)
105
+ mkdir -p ~/.gstack/analytics 2>/dev/null || true
106
+ echo '{"event":"hook_fire","skill":"careful","pattern":"'"$PATTERN"'","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
107
+
108
+ WARN_ESCAPED=$(printf '%s' "$WARN" | sed 's/"/\\"/g')
109
+ printf '{"permissionDecision":"ask","message":"[careful] %s"}\n' "$WARN_ESCAPED"
110
+ else
111
+ echo '{}'
112
+ fi