@runchr/gstack-antigravity 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of @runchr/gstack-antigravity might be problematic. Click here for more details.

Files changed (231) hide show
  1. package/.agents/skills/gstack/.agents/skills/gstack/SKILL.md +651 -0
  2. package/.agents/skills/gstack/.agents/skills/gstack-autoplan/SKILL.md +678 -0
  3. package/.agents/skills/gstack/.agents/skills/gstack-benchmark/SKILL.md +482 -0
  4. package/.agents/skills/gstack/.agents/skills/gstack-browse/SKILL.md +511 -0
  5. package/.agents/skills/gstack/.agents/skills/gstack-canary/SKILL.md +486 -0
  6. package/.agents/skills/gstack/.agents/skills/gstack-careful/SKILL.md +50 -0
  7. package/.agents/skills/gstack/.agents/skills/gstack-cso/SKILL.md +607 -0
  8. package/.agents/skills/gstack/.agents/skills/gstack-design-consultation/SKILL.md +615 -0
  9. package/.agents/skills/gstack/.agents/skills/gstack-design-review/SKILL.md +988 -0
  10. package/.agents/skills/gstack/.agents/skills/gstack-document-release/SKILL.md +604 -0
  11. package/.agents/skills/gstack/.agents/skills/gstack-freeze/SKILL.md +67 -0
  12. package/.agents/skills/gstack/.agents/skills/gstack-guard/SKILL.md +62 -0
  13. package/.agents/skills/gstack/.agents/skills/gstack-investigate/SKILL.md +415 -0
  14. package/.agents/skills/gstack/.agents/skills/gstack-land-and-deploy/SKILL.md +873 -0
  15. package/.agents/skills/gstack/.agents/skills/gstack-office-hours/SKILL.md +986 -0
  16. package/.agents/skills/gstack/.agents/skills/gstack-plan-ceo-review/SKILL.md +1268 -0
  17. package/.agents/skills/gstack/.agents/skills/gstack-plan-design-review/SKILL.md +668 -0
  18. package/.agents/skills/gstack/.agents/skills/gstack-plan-eng-review/SKILL.md +826 -0
  19. package/.agents/skills/gstack/.agents/skills/gstack-qa/SKILL.md +1006 -0
  20. package/.agents/skills/gstack/.agents/skills/gstack-qa-only/SKILL.md +626 -0
  21. package/.agents/skills/gstack/.agents/skills/gstack-retro/SKILL.md +1065 -0
  22. package/.agents/skills/gstack/.agents/skills/gstack-review/SKILL.md +704 -0
  23. package/.agents/skills/gstack/.agents/skills/gstack-setup-browser-cookies/SKILL.md +325 -0
  24. package/.agents/skills/gstack/.agents/skills/gstack-setup-deploy/SKILL.md +450 -0
  25. package/.agents/skills/gstack/.agents/skills/gstack-ship/SKILL.md +1312 -0
  26. package/.agents/skills/gstack/.agents/skills/gstack-unfreeze/SKILL.md +36 -0
  27. package/.agents/skills/gstack/.agents/skills/gstack-upgrade/SKILL.md +220 -0
  28. package/.agents/skills/gstack/.env.example +5 -0
  29. package/.agents/skills/gstack/.github/workflows/skill-docs.yml +17 -0
  30. package/.agents/skills/gstack/AGENTS.md +49 -0
  31. package/.agents/skills/gstack/ARCHITECTURE.md +359 -0
  32. package/.agents/skills/gstack/BROWSER.md +271 -0
  33. package/.agents/skills/gstack/CHANGELOG.md +800 -0
  34. package/.agents/skills/gstack/CLAUDE.md +284 -0
  35. package/.agents/skills/gstack/CONTRIBUTING.md +370 -0
  36. package/.agents/skills/gstack/ETHOS.md +129 -0
  37. package/.agents/skills/gstack/LICENSE +21 -0
  38. package/.agents/skills/gstack/README.md +228 -0
  39. package/.agents/skills/gstack/SKILL.md +657 -0
  40. package/.agents/skills/gstack/SKILL.md.tmpl +281 -0
  41. package/.agents/skills/gstack/TODOS.md +564 -0
  42. package/.agents/skills/gstack/VERSION +1 -0
  43. package/.agents/skills/gstack/autoplan/SKILL.md +689 -0
  44. package/.agents/skills/gstack/autoplan/SKILL.md.tmpl +416 -0
  45. package/.agents/skills/gstack/benchmark/SKILL.md +489 -0
  46. package/.agents/skills/gstack/benchmark/SKILL.md.tmpl +233 -0
  47. package/.agents/skills/gstack/bin/dev-setup +68 -0
  48. package/.agents/skills/gstack/bin/dev-teardown +56 -0
  49. package/.agents/skills/gstack/bin/gstack-analytics +191 -0
  50. package/.agents/skills/gstack/bin/gstack-community-dashboard +113 -0
  51. package/.agents/skills/gstack/bin/gstack-config +38 -0
  52. package/.agents/skills/gstack/bin/gstack-diff-scope +71 -0
  53. package/.agents/skills/gstack/bin/gstack-global-discover.ts +591 -0
  54. package/.agents/skills/gstack/bin/gstack-repo-mode +93 -0
  55. package/.agents/skills/gstack/bin/gstack-review-log +9 -0
  56. package/.agents/skills/gstack/bin/gstack-review-read +12 -0
  57. package/.agents/skills/gstack/bin/gstack-slug +15 -0
  58. package/.agents/skills/gstack/bin/gstack-telemetry-log +158 -0
  59. package/.agents/skills/gstack/bin/gstack-telemetry-sync +127 -0
  60. package/.agents/skills/gstack/bin/gstack-update-check +196 -0
  61. package/.agents/skills/gstack/browse/SKILL.md +517 -0
  62. package/.agents/skills/gstack/browse/SKILL.md.tmpl +141 -0
  63. package/.agents/skills/gstack/browse/bin/find-browse +21 -0
  64. package/.agents/skills/gstack/browse/bin/remote-slug +14 -0
  65. package/.agents/skills/gstack/browse/scripts/build-node-server.sh +48 -0
  66. package/.agents/skills/gstack/browse/src/browser-manager.ts +634 -0
  67. package/.agents/skills/gstack/browse/src/buffers.ts +137 -0
  68. package/.agents/skills/gstack/browse/src/bun-polyfill.cjs +109 -0
  69. package/.agents/skills/gstack/browse/src/cli.ts +420 -0
  70. package/.agents/skills/gstack/browse/src/commands.ts +111 -0
  71. package/.agents/skills/gstack/browse/src/config.ts +150 -0
  72. package/.agents/skills/gstack/browse/src/cookie-import-browser.ts +417 -0
  73. package/.agents/skills/gstack/browse/src/cookie-picker-routes.ts +207 -0
  74. package/.agents/skills/gstack/browse/src/cookie-picker-ui.ts +541 -0
  75. package/.agents/skills/gstack/browse/src/find-browse.ts +61 -0
  76. package/.agents/skills/gstack/browse/src/meta-commands.ts +269 -0
  77. package/.agents/skills/gstack/browse/src/platform.ts +17 -0
  78. package/.agents/skills/gstack/browse/src/read-commands.ts +335 -0
  79. package/.agents/skills/gstack/browse/src/server.ts +369 -0
  80. package/.agents/skills/gstack/browse/src/snapshot.ts +398 -0
  81. package/.agents/skills/gstack/browse/src/url-validation.ts +91 -0
  82. package/.agents/skills/gstack/browse/src/write-commands.ts +352 -0
  83. package/.agents/skills/gstack/browse/test/bun-polyfill.test.ts +72 -0
  84. package/.agents/skills/gstack/browse/test/commands.test.ts +1836 -0
  85. package/.agents/skills/gstack/browse/test/config.test.ts +250 -0
  86. package/.agents/skills/gstack/browse/test/cookie-import-browser.test.ts +397 -0
  87. package/.agents/skills/gstack/browse/test/cookie-picker-routes.test.ts +205 -0
  88. package/.agents/skills/gstack/browse/test/find-browse.test.ts +50 -0
  89. package/.agents/skills/gstack/browse/test/fixtures/basic.html +33 -0
  90. package/.agents/skills/gstack/browse/test/fixtures/cursor-interactive.html +22 -0
  91. package/.agents/skills/gstack/browse/test/fixtures/dialog.html +15 -0
  92. package/.agents/skills/gstack/browse/test/fixtures/empty.html +2 -0
  93. package/.agents/skills/gstack/browse/test/fixtures/forms.html +55 -0
  94. package/.agents/skills/gstack/browse/test/fixtures/qa-eval-checkout.html +108 -0
  95. package/.agents/skills/gstack/browse/test/fixtures/qa-eval-spa.html +98 -0
  96. package/.agents/skills/gstack/browse/test/fixtures/qa-eval.html +51 -0
  97. package/.agents/skills/gstack/browse/test/fixtures/responsive.html +49 -0
  98. package/.agents/skills/gstack/browse/test/fixtures/snapshot.html +55 -0
  99. package/.agents/skills/gstack/browse/test/fixtures/spa.html +24 -0
  100. package/.agents/skills/gstack/browse/test/fixtures/states.html +17 -0
  101. package/.agents/skills/gstack/browse/test/fixtures/upload.html +25 -0
  102. package/.agents/skills/gstack/browse/test/gstack-config.test.ts +125 -0
  103. package/.agents/skills/gstack/browse/test/gstack-update-check.test.ts +467 -0
  104. package/.agents/skills/gstack/browse/test/handoff.test.ts +235 -0
  105. package/.agents/skills/gstack/browse/test/path-validation.test.ts +63 -0
  106. package/.agents/skills/gstack/browse/test/platform.test.ts +37 -0
  107. package/.agents/skills/gstack/browse/test/snapshot.test.ts +467 -0
  108. package/.agents/skills/gstack/browse/test/test-server.ts +57 -0
  109. package/.agents/skills/gstack/browse/test/url-validation.test.ts +72 -0
  110. package/.agents/skills/gstack/canary/SKILL.md +493 -0
  111. package/.agents/skills/gstack/canary/SKILL.md.tmpl +220 -0
  112. package/.agents/skills/gstack/careful/SKILL.md +59 -0
  113. package/.agents/skills/gstack/careful/SKILL.md.tmpl +57 -0
  114. package/.agents/skills/gstack/careful/bin/check-careful.sh +112 -0
  115. package/.agents/skills/gstack/codex/SKILL.md +677 -0
  116. package/.agents/skills/gstack/codex/SKILL.md.tmpl +356 -0
  117. package/.agents/skills/gstack/conductor.json +6 -0
  118. package/.agents/skills/gstack/cso/SKILL.md +615 -0
  119. package/.agents/skills/gstack/cso/SKILL.md.tmpl +376 -0
  120. package/.agents/skills/gstack/design-consultation/SKILL.md +625 -0
  121. package/.agents/skills/gstack/design-consultation/SKILL.md.tmpl +369 -0
  122. package/.agents/skills/gstack/design-review/SKILL.md +998 -0
  123. package/.agents/skills/gstack/design-review/SKILL.md.tmpl +262 -0
  124. package/.agents/skills/gstack/docs/images/github-2013.png +0 -0
  125. package/.agents/skills/gstack/docs/images/github-2026.png +0 -0
  126. package/.agents/skills/gstack/docs/skills.md +877 -0
  127. package/.agents/skills/gstack/document-release/SKILL.md +613 -0
  128. package/.agents/skills/gstack/document-release/SKILL.md.tmpl +357 -0
  129. package/.agents/skills/gstack/freeze/SKILL.md +82 -0
  130. package/.agents/skills/gstack/freeze/SKILL.md.tmpl +80 -0
  131. package/.agents/skills/gstack/freeze/bin/check-freeze.sh +68 -0
  132. package/.agents/skills/gstack/gstack-upgrade/SKILL.md +226 -0
  133. package/.agents/skills/gstack/gstack-upgrade/SKILL.md.tmpl +224 -0
  134. package/.agents/skills/gstack/guard/SKILL.md +82 -0
  135. package/.agents/skills/gstack/guard/SKILL.md.tmpl +80 -0
  136. package/.agents/skills/gstack/investigate/SKILL.md +435 -0
  137. package/.agents/skills/gstack/investigate/SKILL.md.tmpl +196 -0
  138. package/.agents/skills/gstack/land-and-deploy/SKILL.md +880 -0
  139. package/.agents/skills/gstack/land-and-deploy/SKILL.md.tmpl +575 -0
  140. package/.agents/skills/gstack/office-hours/SKILL.md +996 -0
  141. package/.agents/skills/gstack/office-hours/SKILL.md.tmpl +624 -0
  142. package/.agents/skills/gstack/package.json +55 -0
  143. package/.agents/skills/gstack/plan-ceo-review/SKILL.md +1277 -0
  144. package/.agents/skills/gstack/plan-ceo-review/SKILL.md.tmpl +838 -0
  145. package/.agents/skills/gstack/plan-design-review/SKILL.md +676 -0
  146. package/.agents/skills/gstack/plan-design-review/SKILL.md.tmpl +314 -0
  147. package/.agents/skills/gstack/plan-eng-review/SKILL.md +836 -0
  148. package/.agents/skills/gstack/plan-eng-review/SKILL.md.tmpl +279 -0
  149. package/.agents/skills/gstack/qa/SKILL.md +1016 -0
  150. package/.agents/skills/gstack/qa/SKILL.md.tmpl +316 -0
  151. package/.agents/skills/gstack/qa/references/issue-taxonomy.md +85 -0
  152. package/.agents/skills/gstack/qa/templates/qa-report-template.md +126 -0
  153. package/.agents/skills/gstack/qa-only/SKILL.md +633 -0
  154. package/.agents/skills/gstack/qa-only/SKILL.md.tmpl +101 -0
  155. package/.agents/skills/gstack/retro/SKILL.md +1072 -0
  156. package/.agents/skills/gstack/retro/SKILL.md.tmpl +833 -0
  157. package/.agents/skills/gstack/review/SKILL.md +849 -0
  158. package/.agents/skills/gstack/review/SKILL.md.tmpl +259 -0
  159. package/.agents/skills/gstack/review/TODOS-format.md +62 -0
  160. package/.agents/skills/gstack/review/checklist.md +190 -0
  161. package/.agents/skills/gstack/review/design-checklist.md +132 -0
  162. package/.agents/skills/gstack/review/greptile-triage.md +220 -0
  163. package/.agents/skills/gstack/scripts/analytics.ts +190 -0
  164. package/.agents/skills/gstack/scripts/dev-skill.ts +82 -0
  165. package/.agents/skills/gstack/scripts/eval-compare.ts +96 -0
  166. package/.agents/skills/gstack/scripts/eval-list.ts +116 -0
  167. package/.agents/skills/gstack/scripts/eval-select.ts +86 -0
  168. package/.agents/skills/gstack/scripts/eval-summary.ts +187 -0
  169. package/.agents/skills/gstack/scripts/eval-watch.ts +172 -0
  170. package/.agents/skills/gstack/scripts/gen-skill-docs.ts +2414 -0
  171. package/.agents/skills/gstack/scripts/skill-check.ts +167 -0
  172. package/.agents/skills/gstack/setup +269 -0
  173. package/.agents/skills/gstack/setup-browser-cookies/SKILL.md +330 -0
  174. package/.agents/skills/gstack/setup-browser-cookies/SKILL.md.tmpl +74 -0
  175. package/.agents/skills/gstack/setup-deploy/SKILL.md +459 -0
  176. package/.agents/skills/gstack/setup-deploy/SKILL.md.tmpl +220 -0
  177. package/.agents/skills/gstack/ship/SKILL.md +1457 -0
  178. package/.agents/skills/gstack/ship/SKILL.md.tmpl +528 -0
  179. package/.agents/skills/gstack/supabase/config.sh +10 -0
  180. package/.agents/skills/gstack/supabase/functions/community-pulse/index.ts +59 -0
  181. package/.agents/skills/gstack/supabase/functions/telemetry-ingest/index.ts +135 -0
  182. package/.agents/skills/gstack/supabase/functions/update-check/index.ts +37 -0
  183. package/.agents/skills/gstack/supabase/migrations/001_telemetry.sql +89 -0
  184. package/.agents/skills/gstack/test/analytics.test.ts +277 -0
  185. package/.agents/skills/gstack/test/codex-e2e.test.ts +197 -0
  186. package/.agents/skills/gstack/test/fixtures/coverage-audit-fixture.ts +76 -0
  187. package/.agents/skills/gstack/test/fixtures/eval-baselines.json +7 -0
  188. package/.agents/skills/gstack/test/fixtures/qa-eval-checkout-ground-truth.json +43 -0
  189. package/.agents/skills/gstack/test/fixtures/qa-eval-ground-truth.json +43 -0
  190. package/.agents/skills/gstack/test/fixtures/qa-eval-spa-ground-truth.json +43 -0
  191. package/.agents/skills/gstack/test/fixtures/review-eval-design-slop.css +86 -0
  192. package/.agents/skills/gstack/test/fixtures/review-eval-design-slop.html +41 -0
  193. package/.agents/skills/gstack/test/fixtures/review-eval-enum-diff.rb +30 -0
  194. package/.agents/skills/gstack/test/fixtures/review-eval-enum.rb +27 -0
  195. package/.agents/skills/gstack/test/fixtures/review-eval-vuln.rb +14 -0
  196. package/.agents/skills/gstack/test/gemini-e2e.test.ts +173 -0
  197. package/.agents/skills/gstack/test/gen-skill-docs.test.ts +1049 -0
  198. package/.agents/skills/gstack/test/global-discover.test.ts +187 -0
  199. package/.agents/skills/gstack/test/helpers/codex-session-runner.ts +282 -0
  200. package/.agents/skills/gstack/test/helpers/e2e-helpers.ts +239 -0
  201. package/.agents/skills/gstack/test/helpers/eval-store.test.ts +548 -0
  202. package/.agents/skills/gstack/test/helpers/eval-store.ts +689 -0
  203. package/.agents/skills/gstack/test/helpers/gemini-session-runner.test.ts +104 -0
  204. package/.agents/skills/gstack/test/helpers/gemini-session-runner.ts +201 -0
  205. package/.agents/skills/gstack/test/helpers/llm-judge.ts +130 -0
  206. package/.agents/skills/gstack/test/helpers/observability.test.ts +283 -0
  207. package/.agents/skills/gstack/test/helpers/session-runner.test.ts +96 -0
  208. package/.agents/skills/gstack/test/helpers/session-runner.ts +357 -0
  209. package/.agents/skills/gstack/test/helpers/skill-parser.ts +206 -0
  210. package/.agents/skills/gstack/test/helpers/touchfiles.ts +260 -0
  211. package/.agents/skills/gstack/test/hook-scripts.test.ts +373 -0
  212. package/.agents/skills/gstack/test/skill-e2e-browse.test.ts +293 -0
  213. package/.agents/skills/gstack/test/skill-e2e-deploy.test.ts +279 -0
  214. package/.agents/skills/gstack/test/skill-e2e-design.test.ts +614 -0
  215. package/.agents/skills/gstack/test/skill-e2e-plan.test.ts +538 -0
  216. package/.agents/skills/gstack/test/skill-e2e-qa-bugs.test.ts +194 -0
  217. package/.agents/skills/gstack/test/skill-e2e-qa-workflow.test.ts +412 -0
  218. package/.agents/skills/gstack/test/skill-e2e-review.test.ts +535 -0
  219. package/.agents/skills/gstack/test/skill-e2e-workflow.test.ts +586 -0
  220. package/.agents/skills/gstack/test/skill-e2e.test.ts +3325 -0
  221. package/.agents/skills/gstack/test/skill-llm-eval.test.ts +787 -0
  222. package/.agents/skills/gstack/test/skill-parser.test.ts +179 -0
  223. package/.agents/skills/gstack/test/skill-routing-e2e.test.ts +605 -0
  224. package/.agents/skills/gstack/test/skill-validation.test.ts +1520 -0
  225. package/.agents/skills/gstack/test/telemetry.test.ts +278 -0
  226. package/.agents/skills/gstack/test/touchfiles.test.ts +262 -0
  227. package/.agents/skills/gstack/unfreeze/SKILL.md +40 -0
  228. package/.agents/skills/gstack/unfreeze/SKILL.md.tmpl +38 -0
  229. package/README.md +12 -7
  230. package/README_KO.md +12 -6
  231. package/package.json +3 -2
@@ -0,0 +1,226 @@
1
+ ---
2
+ name: gstack-upgrade
3
+ version: 1.1.0
4
+ description: |
5
+ Upgrade gstack to the latest version. Detects global vs vendored install,
6
+ runs the upgrade, and shows what's new. Use when asked to "upgrade gstack",
7
+ "update gstack", or "get latest version".
8
+ allowed-tools:
9
+ - Bash
10
+ - Read
11
+ - Write
12
+ - AskUserQuestion
13
+ ---
14
+ <!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->
15
+ <!-- Regenerate: bun run gen:skill-docs -->
16
+
17
+ # /gstack-upgrade
18
+
19
+ Upgrade gstack to the latest version and show what's new.
20
+
21
+ ## Inline upgrade flow
22
+
23
+ This section is referenced by all skill preambles when they detect `UPGRADE_AVAILABLE`.
24
+
25
+ ### Step 1: Ask the user (or auto-upgrade)
26
+
27
+ First, check if auto-upgrade is enabled:
28
+ ```bash
29
+ _AUTO=""
30
+ [ "${GSTACK_AUTO_UPGRADE:-}" = "1" ] && _AUTO="true"
31
+ [ -z "$_AUTO" ] && _AUTO=$(~/.claude/skills/gstack/bin/gstack-config get auto_upgrade 2>/dev/null || true)
32
+ echo "AUTO_UPGRADE=$_AUTO"
33
+ ```
34
+
35
+ **If `AUTO_UPGRADE=true` or `AUTO_UPGRADE=1`:** Skip AskUserQuestion. Log "Auto-upgrading gstack v{old} → v{new}..." and proceed directly to Step 2. If `./setup` fails during auto-upgrade, restore from backup (`.bak` directory) and warn the user: "Auto-upgrade failed — restored previous version. Run `/gstack-upgrade` manually to retry."
36
+
37
+ **Otherwise**, use AskUserQuestion:
38
+ - Question: "gstack **v{new}** is available (you're on v{old}). Upgrade now?"
39
+ - Options: ["Yes, upgrade now", "Always keep me up to date", "Not now", "Never ask again"]
40
+
41
+ **If "Yes, upgrade now":** Proceed to Step 2.
42
+
43
+ **If "Always keep me up to date":**
44
+ ```bash
45
+ ~/.claude/skills/gstack/bin/gstack-config set auto_upgrade true
46
+ ```
47
+ Tell user: "Auto-upgrade enabled. Future updates will install automatically." Then proceed to Step 2.
48
+
49
+ **If "Not now":** Write snooze state with escalating backoff (first snooze = 24h, second = 48h, third+ = 1 week), then continue with the current skill. Do not mention the upgrade again.
50
+ ```bash
51
+ _SNOOZE_FILE=~/.gstack/update-snoozed
52
+ _REMOTE_VER="{new}"
53
+ _CUR_LEVEL=0
54
+ if [ -f "$_SNOOZE_FILE" ]; then
55
+ _SNOOZED_VER=$(awk '{print $1}' "$_SNOOZE_FILE")
56
+ if [ "$_SNOOZED_VER" = "$_REMOTE_VER" ]; then
57
+ _CUR_LEVEL=$(awk '{print $2}' "$_SNOOZE_FILE")
58
+ case "$_CUR_LEVEL" in *[!0-9]*) _CUR_LEVEL=0 ;; esac
59
+ fi
60
+ fi
61
+ _NEW_LEVEL=$((_CUR_LEVEL + 1))
62
+ [ "$_NEW_LEVEL" -gt 3 ] && _NEW_LEVEL=3
63
+ echo "$_REMOTE_VER $_NEW_LEVEL $(date +%s)" > "$_SNOOZE_FILE"
64
+ ```
65
+ Note: `{new}` is the remote version from the `UPGRADE_AVAILABLE` output — substitute it from the update check result.
66
+
67
+ Tell user the snooze duration: "Next reminder in 24h" (or 48h or 1 week, depending on level). Tip: "Set `auto_upgrade: true` in `~/.gstack/config.yaml` for automatic upgrades."
68
+
69
+ **If "Never ask again":**
70
+ ```bash
71
+ ~/.claude/skills/gstack/bin/gstack-config set update_check false
72
+ ```
73
+ Tell user: "Update checks disabled. Run `~/.claude/skills/gstack/bin/gstack-config set update_check true` to re-enable."
74
+ Continue with the current skill.
75
+
76
+ ### Step 2: Detect install type
77
+
78
+ ```bash
79
+ if [ -d "$HOME/.claude/skills/gstack/.git" ]; then
80
+ INSTALL_TYPE="global-git"
81
+ INSTALL_DIR="$HOME/.claude/skills/gstack"
82
+ elif [ -d ".claude/skills/gstack/.git" ]; then
83
+ INSTALL_TYPE="local-git"
84
+ INSTALL_DIR=".claude/skills/gstack"
85
+ elif [ -d ".claude/skills/gstack" ]; then
86
+ INSTALL_TYPE="vendored"
87
+ INSTALL_DIR=".claude/skills/gstack"
88
+ elif [ -d "$HOME/.claude/skills/gstack" ]; then
89
+ INSTALL_TYPE="vendored-global"
90
+ INSTALL_DIR="$HOME/.claude/skills/gstack"
91
+ else
92
+ echo "ERROR: gstack not found"
93
+ exit 1
94
+ fi
95
+ echo "Install type: $INSTALL_TYPE at $INSTALL_DIR"
96
+ ```
97
+
98
+ The install type and directory path printed above will be used in all subsequent steps.
99
+
100
+ ### Step 3: Save old version
101
+
102
+ Use the install directory from Step 2's output below:
103
+
104
+ ```bash
105
+ OLD_VERSION=$(cat "$INSTALL_DIR/VERSION" 2>/dev/null || echo "unknown")
106
+ ```
107
+
108
+ ### Step 4: Upgrade
109
+
110
+ Use the install type and directory detected in Step 2:
111
+
112
+ **For git installs** (global-git, local-git):
113
+ ```bash
114
+ cd "$INSTALL_DIR"
115
+ STASH_OUTPUT=$(git stash 2>&1)
116
+ git fetch origin
117
+ git reset --hard origin/main
118
+ ./setup
119
+ ```
120
+ If `$STASH_OUTPUT` contains "Saved working directory", warn the user: "Note: local changes were stashed. Run `git stash pop` in the skill directory to restore them."
121
+
122
+ **For vendored installs** (vendored, vendored-global):
123
+ ```bash
124
+ PARENT=$(dirname "$INSTALL_DIR")
125
+ TMP_DIR=$(mktemp -d)
126
+ git clone --depth 1 https://github.com/garrytan/gstack.git "$TMP_DIR/gstack"
127
+ mv "$INSTALL_DIR" "$INSTALL_DIR.bak"
128
+ mv "$TMP_DIR/gstack" "$INSTALL_DIR"
129
+ cd "$INSTALL_DIR" && ./setup
130
+ rm -rf "$INSTALL_DIR.bak" "$TMP_DIR"
131
+ ```
132
+
133
+ ### Step 4.5: Sync local vendored copy
134
+
135
+ Use the install directory from Step 2. Check if there's also a local vendored copy that needs updating:
136
+
137
+ ```bash
138
+ _ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
139
+ LOCAL_GSTACK=""
140
+ if [ -n "$_ROOT" ] && [ -d "$_ROOT/.claude/skills/gstack" ]; then
141
+ _RESOLVED_LOCAL=$(cd "$_ROOT/.claude/skills/gstack" && pwd -P)
142
+ _RESOLVED_PRIMARY=$(cd "$INSTALL_DIR" && pwd -P)
143
+ if [ "$_RESOLVED_LOCAL" != "$_RESOLVED_PRIMARY" ]; then
144
+ LOCAL_GSTACK="$_ROOT/.claude/skills/gstack"
145
+ fi
146
+ fi
147
+ echo "LOCAL_GSTACK=$LOCAL_GSTACK"
148
+ ```
149
+
150
+ If `LOCAL_GSTACK` is non-empty, update it by copying from the freshly-upgraded primary install (same approach as README vendored install):
151
+ ```bash
152
+ mv "$LOCAL_GSTACK" "$LOCAL_GSTACK.bak"
153
+ cp -Rf "$INSTALL_DIR" "$LOCAL_GSTACK"
154
+ rm -rf "$LOCAL_GSTACK/.git"
155
+ cd "$LOCAL_GSTACK" && ./setup
156
+ rm -rf "$LOCAL_GSTACK.bak"
157
+ ```
158
+ Tell user: "Also updated vendored copy at `$LOCAL_GSTACK` — commit `.claude/skills/gstack/` when you're ready."
159
+
160
+ If `./setup` fails, restore from backup and warn the user:
161
+ ```bash
162
+ rm -rf "$LOCAL_GSTACK"
163
+ mv "$LOCAL_GSTACK.bak" "$LOCAL_GSTACK"
164
+ ```
165
+ Tell user: "Sync failed — restored previous version at `$LOCAL_GSTACK`. Run `/gstack-upgrade` manually to retry."
166
+
167
+ ### Step 5: Write marker + clear cache
168
+
169
+ ```bash
170
+ mkdir -p ~/.gstack
171
+ echo "$OLD_VERSION" > ~/.gstack/just-upgraded-from
172
+ rm -f ~/.gstack/last-update-check
173
+ rm -f ~/.gstack/update-snoozed
174
+ ```
175
+
176
+ ### Step 6: Show What's New
177
+
178
+ Read `$INSTALL_DIR/CHANGELOG.md`. Find all version entries between the old version and the new version. Summarize as 5-7 bullets grouped by theme. Don't overwhelm — focus on user-facing changes. Skip internal refactors unless they're significant.
179
+
180
+ Format:
181
+ ```
182
+ gstack v{new} — upgraded from v{old}!
183
+
184
+ What's new:
185
+ - [bullet 1]
186
+ - [bullet 2]
187
+ - ...
188
+
189
+ Happy shipping!
190
+ ```
191
+
192
+ ### Step 7: Continue
193
+
194
+ After showing What's New, continue with whatever skill the user originally invoked. The upgrade is done — no further action needed.
195
+
196
+ ---
197
+
198
+ ## Standalone usage
199
+
200
+ When invoked directly as `/gstack-upgrade` (not from a preamble):
201
+
202
+ 1. Force a fresh update check (bypass cache):
203
+ ```bash
204
+ ~/.claude/skills/gstack/bin/gstack-update-check --force 2>/dev/null || \
205
+ .claude/skills/gstack/bin/gstack-update-check --force 2>/dev/null || true
206
+ ```
207
+ Use the output to determine if an upgrade is available.
208
+
209
+ 2. If `UPGRADE_AVAILABLE <old> <new>`: follow Steps 2-6 above.
210
+
211
+ 3. If no output (primary is up to date): check for a stale local vendored copy.
212
+
213
+ Run the Step 2 bash block above to detect the primary install type and directory (`INSTALL_TYPE` and `INSTALL_DIR`). Then run the Step 4.5 detection bash block above to check for a local vendored copy (`LOCAL_GSTACK`).
214
+
215
+ **If `LOCAL_GSTACK` is empty** (no local vendored copy): tell the user "You're already on the latest version (v{version})."
216
+
217
+ **If `LOCAL_GSTACK` is non-empty**, compare versions:
218
+ ```bash
219
+ PRIMARY_VER=$(cat "$INSTALL_DIR/VERSION" 2>/dev/null || echo "unknown")
220
+ LOCAL_VER=$(cat "$LOCAL_GSTACK/VERSION" 2>/dev/null || echo "unknown")
221
+ echo "PRIMARY=$PRIMARY_VER LOCAL=$LOCAL_VER"
222
+ ```
223
+
224
+ **If versions differ:** follow the Step 4.5 sync bash block above to update the local copy from the primary. Tell user: "Global v{PRIMARY_VER} is up to date. Updated local vendored copy from v{LOCAL_VER} → v{PRIMARY_VER}. Commit `.claude/skills/gstack/` when you're ready."
225
+
226
+ **If versions match:** tell the user "You're on the latest version (v{PRIMARY_VER}). Global and local vendored copy are both up to date."
@@ -0,0 +1,224 @@
1
+ ---
2
+ name: gstack-upgrade
3
+ version: 1.1.0
4
+ description: |
5
+ Upgrade gstack to the latest version. Detects global vs vendored install,
6
+ runs the upgrade, and shows what's new. Use when asked to "upgrade gstack",
7
+ "update gstack", or "get latest version".
8
+ allowed-tools:
9
+ - Bash
10
+ - Read
11
+ - Write
12
+ - AskUserQuestion
13
+ ---
14
+
15
+ # /gstack-upgrade
16
+
17
+ Upgrade gstack to the latest version and show what's new.
18
+
19
+ ## Inline upgrade flow
20
+
21
+ This section is referenced by all skill preambles when they detect `UPGRADE_AVAILABLE`.
22
+
23
+ ### Step 1: Ask the user (or auto-upgrade)
24
+
25
+ First, check if auto-upgrade is enabled:
26
+ ```bash
27
+ _AUTO=""
28
+ [ "${GSTACK_AUTO_UPGRADE:-}" = "1" ] && _AUTO="true"
29
+ [ -z "$_AUTO" ] && _AUTO=$(~/.claude/skills/gstack/bin/gstack-config get auto_upgrade 2>/dev/null || true)
30
+ echo "AUTO_UPGRADE=$_AUTO"
31
+ ```
32
+
33
+ **If `AUTO_UPGRADE=true` or `AUTO_UPGRADE=1`:** Skip AskUserQuestion. Log "Auto-upgrading gstack v{old} → v{new}..." and proceed directly to Step 2. If `./setup` fails during auto-upgrade, restore from backup (`.bak` directory) and warn the user: "Auto-upgrade failed — restored previous version. Run `/gstack-upgrade` manually to retry."
34
+
35
+ **Otherwise**, use AskUserQuestion:
36
+ - Question: "gstack **v{new}** is available (you're on v{old}). Upgrade now?"
37
+ - Options: ["Yes, upgrade now", "Always keep me up to date", "Not now", "Never ask again"]
38
+
39
+ **If "Yes, upgrade now":** Proceed to Step 2.
40
+
41
+ **If "Always keep me up to date":**
42
+ ```bash
43
+ ~/.claude/skills/gstack/bin/gstack-config set auto_upgrade true
44
+ ```
45
+ Tell user: "Auto-upgrade enabled. Future updates will install automatically." Then proceed to Step 2.
46
+
47
+ **If "Not now":** Write snooze state with escalating backoff (first snooze = 24h, second = 48h, third+ = 1 week), then continue with the current skill. Do not mention the upgrade again.
48
+ ```bash
49
+ _SNOOZE_FILE=~/.gstack/update-snoozed
50
+ _REMOTE_VER="{new}"
51
+ _CUR_LEVEL=0
52
+ if [ -f "$_SNOOZE_FILE" ]; then
53
+ _SNOOZED_VER=$(awk '{print $1}' "$_SNOOZE_FILE")
54
+ if [ "$_SNOOZED_VER" = "$_REMOTE_VER" ]; then
55
+ _CUR_LEVEL=$(awk '{print $2}' "$_SNOOZE_FILE")
56
+ case "$_CUR_LEVEL" in *[!0-9]*) _CUR_LEVEL=0 ;; esac
57
+ fi
58
+ fi
59
+ _NEW_LEVEL=$((_CUR_LEVEL + 1))
60
+ [ "$_NEW_LEVEL" -gt 3 ] && _NEW_LEVEL=3
61
+ echo "$_REMOTE_VER $_NEW_LEVEL $(date +%s)" > "$_SNOOZE_FILE"
62
+ ```
63
+ Note: `{new}` is the remote version from the `UPGRADE_AVAILABLE` output — substitute it from the update check result.
64
+
65
+ Tell user the snooze duration: "Next reminder in 24h" (or 48h or 1 week, depending on level). Tip: "Set `auto_upgrade: true` in `~/.gstack/config.yaml` for automatic upgrades."
66
+
67
+ **If "Never ask again":**
68
+ ```bash
69
+ ~/.claude/skills/gstack/bin/gstack-config set update_check false
70
+ ```
71
+ Tell user: "Update checks disabled. Run `~/.claude/skills/gstack/bin/gstack-config set update_check true` to re-enable."
72
+ Continue with the current skill.
73
+
74
+ ### Step 2: Detect install type
75
+
76
+ ```bash
77
+ if [ -d "$HOME/.claude/skills/gstack/.git" ]; then
78
+ INSTALL_TYPE="global-git"
79
+ INSTALL_DIR="$HOME/.claude/skills/gstack"
80
+ elif [ -d ".claude/skills/gstack/.git" ]; then
81
+ INSTALL_TYPE="local-git"
82
+ INSTALL_DIR=".claude/skills/gstack"
83
+ elif [ -d ".claude/skills/gstack" ]; then
84
+ INSTALL_TYPE="vendored"
85
+ INSTALL_DIR=".claude/skills/gstack"
86
+ elif [ -d "$HOME/.claude/skills/gstack" ]; then
87
+ INSTALL_TYPE="vendored-global"
88
+ INSTALL_DIR="$HOME/.claude/skills/gstack"
89
+ else
90
+ echo "ERROR: gstack not found"
91
+ exit 1
92
+ fi
93
+ echo "Install type: $INSTALL_TYPE at $INSTALL_DIR"
94
+ ```
95
+
96
+ The install type and directory path printed above will be used in all subsequent steps.
97
+
98
+ ### Step 3: Save old version
99
+
100
+ Use the install directory from Step 2's output below:
101
+
102
+ ```bash
103
+ OLD_VERSION=$(cat "$INSTALL_DIR/VERSION" 2>/dev/null || echo "unknown")
104
+ ```
105
+
106
+ ### Step 4: Upgrade
107
+
108
+ Use the install type and directory detected in Step 2:
109
+
110
+ **For git installs** (global-git, local-git):
111
+ ```bash
112
+ cd "$INSTALL_DIR"
113
+ STASH_OUTPUT=$(git stash 2>&1)
114
+ git fetch origin
115
+ git reset --hard origin/main
116
+ ./setup
117
+ ```
118
+ If `$STASH_OUTPUT` contains "Saved working directory", warn the user: "Note: local changes were stashed. Run `git stash pop` in the skill directory to restore them."
119
+
120
+ **For vendored installs** (vendored, vendored-global):
121
+ ```bash
122
+ PARENT=$(dirname "$INSTALL_DIR")
123
+ TMP_DIR=$(mktemp -d)
124
+ git clone --depth 1 https://github.com/garrytan/gstack.git "$TMP_DIR/gstack"
125
+ mv "$INSTALL_DIR" "$INSTALL_DIR.bak"
126
+ mv "$TMP_DIR/gstack" "$INSTALL_DIR"
127
+ cd "$INSTALL_DIR" && ./setup
128
+ rm -rf "$INSTALL_DIR.bak" "$TMP_DIR"
129
+ ```
130
+
131
+ ### Step 4.5: Sync local vendored copy
132
+
133
+ Use the install directory from Step 2. Check if there's also a local vendored copy that needs updating:
134
+
135
+ ```bash
136
+ _ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
137
+ LOCAL_GSTACK=""
138
+ if [ -n "$_ROOT" ] && [ -d "$_ROOT/.claude/skills/gstack" ]; then
139
+ _RESOLVED_LOCAL=$(cd "$_ROOT/.claude/skills/gstack" && pwd -P)
140
+ _RESOLVED_PRIMARY=$(cd "$INSTALL_DIR" && pwd -P)
141
+ if [ "$_RESOLVED_LOCAL" != "$_RESOLVED_PRIMARY" ]; then
142
+ LOCAL_GSTACK="$_ROOT/.claude/skills/gstack"
143
+ fi
144
+ fi
145
+ echo "LOCAL_GSTACK=$LOCAL_GSTACK"
146
+ ```
147
+
148
+ If `LOCAL_GSTACK` is non-empty, update it by copying from the freshly-upgraded primary install (same approach as README vendored install):
149
+ ```bash
150
+ mv "$LOCAL_GSTACK" "$LOCAL_GSTACK.bak"
151
+ cp -Rf "$INSTALL_DIR" "$LOCAL_GSTACK"
152
+ rm -rf "$LOCAL_GSTACK/.git"
153
+ cd "$LOCAL_GSTACK" && ./setup
154
+ rm -rf "$LOCAL_GSTACK.bak"
155
+ ```
156
+ Tell user: "Also updated vendored copy at `$LOCAL_GSTACK` — commit `.claude/skills/gstack/` when you're ready."
157
+
158
+ If `./setup` fails, restore from backup and warn the user:
159
+ ```bash
160
+ rm -rf "$LOCAL_GSTACK"
161
+ mv "$LOCAL_GSTACK.bak" "$LOCAL_GSTACK"
162
+ ```
163
+ Tell user: "Sync failed — restored previous version at `$LOCAL_GSTACK`. Run `/gstack-upgrade` manually to retry."
164
+
165
+ ### Step 5: Write marker + clear cache
166
+
167
+ ```bash
168
+ mkdir -p ~/.gstack
169
+ echo "$OLD_VERSION" > ~/.gstack/just-upgraded-from
170
+ rm -f ~/.gstack/last-update-check
171
+ rm -f ~/.gstack/update-snoozed
172
+ ```
173
+
174
+ ### Step 6: Show What's New
175
+
176
+ Read `$INSTALL_DIR/CHANGELOG.md`. Find all version entries between the old version and the new version. Summarize as 5-7 bullets grouped by theme. Don't overwhelm — focus on user-facing changes. Skip internal refactors unless they're significant.
177
+
178
+ Format:
179
+ ```
180
+ gstack v{new} — upgraded from v{old}!
181
+
182
+ What's new:
183
+ - [bullet 1]
184
+ - [bullet 2]
185
+ - ...
186
+
187
+ Happy shipping!
188
+ ```
189
+
190
+ ### Step 7: Continue
191
+
192
+ After showing What's New, continue with whatever skill the user originally invoked. The upgrade is done — no further action needed.
193
+
194
+ ---
195
+
196
+ ## Standalone usage
197
+
198
+ When invoked directly as `/gstack-upgrade` (not from a preamble):
199
+
200
+ 1. Force a fresh update check (bypass cache):
201
+ ```bash
202
+ ~/.claude/skills/gstack/bin/gstack-update-check --force 2>/dev/null || \
203
+ .claude/skills/gstack/bin/gstack-update-check --force 2>/dev/null || true
204
+ ```
205
+ Use the output to determine if an upgrade is available.
206
+
207
+ 2. If `UPGRADE_AVAILABLE <old> <new>`: follow Steps 2-6 above.
208
+
209
+ 3. If no output (primary is up to date): check for a stale local vendored copy.
210
+
211
+ Run the Step 2 bash block above to detect the primary install type and directory (`INSTALL_TYPE` and `INSTALL_DIR`). Then run the Step 4.5 detection bash block above to check for a local vendored copy (`LOCAL_GSTACK`).
212
+
213
+ **If `LOCAL_GSTACK` is empty** (no local vendored copy): tell the user "You're already on the latest version (v{version})."
214
+
215
+ **If `LOCAL_GSTACK` is non-empty**, compare versions:
216
+ ```bash
217
+ PRIMARY_VER=$(cat "$INSTALL_DIR/VERSION" 2>/dev/null || echo "unknown")
218
+ LOCAL_VER=$(cat "$LOCAL_GSTACK/VERSION" 2>/dev/null || echo "unknown")
219
+ echo "PRIMARY=$PRIMARY_VER LOCAL=$LOCAL_VER"
220
+ ```
221
+
222
+ **If versions differ:** follow the Step 4.5 sync bash block above to update the local copy from the primary. Tell user: "Global v{PRIMARY_VER} is up to date. Updated local vendored copy from v{LOCAL_VER} → v{PRIMARY_VER}. Commit `.claude/skills/gstack/` when you're ready."
223
+
224
+ **If versions match:** tell the user "You're on the latest version (v{PRIMARY_VER}). Global and local vendored copy are both up to date."
@@ -0,0 +1,82 @@
1
+ ---
2
+ name: guard
3
+ version: 0.1.0
4
+ description: |
5
+ Full safety mode: destructive command warnings + directory-scoped edits.
6
+ Combines /careful (warns before rm -rf, DROP TABLE, force-push, etc.) with
7
+ /freeze (blocks edits outside a specified directory). Use for maximum safety
8
+ when touching prod or debugging live systems. Use when asked to "guard mode",
9
+ "full safety", "lock it down", or "maximum safety".
10
+ allowed-tools:
11
+ - Bash
12
+ - Read
13
+ - AskUserQuestion
14
+ hooks:
15
+ PreToolUse:
16
+ - matcher: "Bash"
17
+ hooks:
18
+ - type: command
19
+ command: "bash ${CLAUDE_SKILL_DIR}/../careful/bin/check-careful.sh"
20
+ statusMessage: "Checking for destructive commands..."
21
+ - matcher: "Edit"
22
+ hooks:
23
+ - type: command
24
+ command: "bash ${CLAUDE_SKILL_DIR}/../freeze/bin/check-freeze.sh"
25
+ statusMessage: "Checking freeze boundary..."
26
+ - matcher: "Write"
27
+ hooks:
28
+ - type: command
29
+ command: "bash ${CLAUDE_SKILL_DIR}/../freeze/bin/check-freeze.sh"
30
+ statusMessage: "Checking freeze boundary..."
31
+ ---
32
+ <!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->
33
+ <!-- Regenerate: bun run gen:skill-docs -->
34
+
35
+ # /guard — Full Safety Mode
36
+
37
+ Activates both destructive command warnings and directory-scoped edit restrictions.
38
+ This is the combination of `/careful` + `/freeze` in a single command.
39
+
40
+ **Dependency note:** This skill references hook scripts from the sibling `/careful`
41
+ and `/freeze` skill directories. Both must be installed (they are installed together
42
+ by the gstack setup script).
43
+
44
+ ```bash
45
+ mkdir -p ~/.gstack/analytics
46
+ echo '{"skill":"guard","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true
47
+ ```
48
+
49
+ ## Setup
50
+
51
+ Ask the user which directory to restrict edits to. Use AskUserQuestion:
52
+
53
+ - Question: "Guard mode: which directory should edits be restricted to? Destructive command warnings are always on. Files outside the chosen path will be blocked from editing."
54
+ - Text input (not multiple choice) — the user types a path.
55
+
56
+ Once the user provides a directory path:
57
+
58
+ 1. Resolve it to an absolute path:
59
+ ```bash
60
+ FREEZE_DIR=$(cd "<user-provided-path>" 2>/dev/null && pwd)
61
+ echo "$FREEZE_DIR"
62
+ ```
63
+
64
+ 2. Ensure trailing slash and save to the freeze state file:
65
+ ```bash
66
+ FREEZE_DIR="${FREEZE_DIR%/}/"
67
+ STATE_DIR="${CLAUDE_PLUGIN_DATA:-$HOME/.gstack}"
68
+ mkdir -p "$STATE_DIR"
69
+ echo "$FREEZE_DIR" > "$STATE_DIR/freeze-dir.txt"
70
+ echo "Freeze boundary set: $FREEZE_DIR"
71
+ ```
72
+
73
+ Tell the user:
74
+ - "**Guard mode active.** Two protections are now running:"
75
+ - "1. **Destructive command warnings** — rm -rf, DROP TABLE, force-push, etc. will warn before executing (you can override)"
76
+ - "2. **Edit boundary** — file edits restricted to `<path>/`. Edits outside this directory are blocked."
77
+ - "To remove the edit boundary, run `/unfreeze`. To deactivate everything, end the session."
78
+
79
+ ## What's protected
80
+
81
+ See `/careful` for the full list of destructive command patterns and safe exceptions.
82
+ See `/freeze` for how edit boundary enforcement works.
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: guard
3
+ version: 0.1.0
4
+ description: |
5
+ Full safety mode: destructive command warnings + directory-scoped edits.
6
+ Combines /careful (warns before rm -rf, DROP TABLE, force-push, etc.) with
7
+ /freeze (blocks edits outside a specified directory). Use for maximum safety
8
+ when touching prod or debugging live systems. Use when asked to "guard mode",
9
+ "full safety", "lock it down", or "maximum safety".
10
+ allowed-tools:
11
+ - Bash
12
+ - Read
13
+ - AskUserQuestion
14
+ hooks:
15
+ PreToolUse:
16
+ - matcher: "Bash"
17
+ hooks:
18
+ - type: command
19
+ command: "bash ${CLAUDE_SKILL_DIR}/../careful/bin/check-careful.sh"
20
+ statusMessage: "Checking for destructive commands..."
21
+ - matcher: "Edit"
22
+ hooks:
23
+ - type: command
24
+ command: "bash ${CLAUDE_SKILL_DIR}/../freeze/bin/check-freeze.sh"
25
+ statusMessage: "Checking freeze boundary..."
26
+ - matcher: "Write"
27
+ hooks:
28
+ - type: command
29
+ command: "bash ${CLAUDE_SKILL_DIR}/../freeze/bin/check-freeze.sh"
30
+ statusMessage: "Checking freeze boundary..."
31
+ ---
32
+
33
+ # /guard — Full Safety Mode
34
+
35
+ Activates both destructive command warnings and directory-scoped edit restrictions.
36
+ This is the combination of `/careful` + `/freeze` in a single command.
37
+
38
+ **Dependency note:** This skill references hook scripts from the sibling `/careful`
39
+ and `/freeze` skill directories. Both must be installed (they are installed together
40
+ by the gstack setup script).
41
+
42
+ ```bash
43
+ mkdir -p ~/.gstack/analytics
44
+ echo '{"skill":"guard","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
45
+ ```
46
+
47
+ ## Setup
48
+
49
+ Ask the user which directory to restrict edits to. Use AskUserQuestion:
50
+
51
+ - Question: "Guard mode: which directory should edits be restricted to? Destructive command warnings are always on. Files outside the chosen path will be blocked from editing."
52
+ - Text input (not multiple choice) — the user types a path.
53
+
54
+ Once the user provides a directory path:
55
+
56
+ 1. Resolve it to an absolute path:
57
+ ```bash
58
+ FREEZE_DIR=$(cd "<user-provided-path>" 2>/dev/null && pwd)
59
+ echo "$FREEZE_DIR"
60
+ ```
61
+
62
+ 2. Ensure trailing slash and save to the freeze state file:
63
+ ```bash
64
+ FREEZE_DIR="${FREEZE_DIR%/}/"
65
+ STATE_DIR="${CLAUDE_PLUGIN_DATA:-$HOME/.gstack}"
66
+ mkdir -p "$STATE_DIR"
67
+ echo "$FREEZE_DIR" > "$STATE_DIR/freeze-dir.txt"
68
+ echo "Freeze boundary set: $FREEZE_DIR"
69
+ ```
70
+
71
+ Tell the user:
72
+ - "**Guard mode active.** Two protections are now running:"
73
+ - "1. **Destructive command warnings** — rm -rf, DROP TABLE, force-push, etc. will warn before executing (you can override)"
74
+ - "2. **Edit boundary** — file edits restricted to `<path>/`. Edits outside this directory are blocked."
75
+ - "To remove the edit boundary, run `/unfreeze`. To deactivate everything, end the session."
76
+
77
+ ## What's protected
78
+
79
+ See `/careful` for the full list of destructive command patterns and safe exceptions.
80
+ See `/freeze` for how edit boundary enforcement works.