opengstack 0.13.4
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.
- package/AGENTS.md +47 -0
- package/CLAUDE.md +370 -0
- package/LICENSE +21 -0
- package/README.md +80 -0
- package/SKILL.md +226 -0
- package/autoplan/SKILL.md +96 -0
- package/autoplan/SKILL.md.tmpl +694 -0
- package/benchmark/SKILL.md +358 -0
- package/benchmark/SKILL.md.tmpl +222 -0
- package/browse/SKILL.md +396 -0
- package/browse/SKILL.md.tmpl +131 -0
- package/canary/SKILL.md +89 -0
- package/canary/SKILL.md.tmpl +212 -0
- package/careful/SKILL.md +58 -0
- package/careful/SKILL.md.tmpl +56 -0
- package/codex/SKILL.md +90 -0
- package/codex/SKILL.md.tmpl +417 -0
- package/connect-chrome/SKILL.md +87 -0
- package/connect-chrome/SKILL.md.tmpl +195 -0
- package/cso/SKILL.md +93 -0
- package/cso/SKILL.md.tmpl +606 -0
- package/design-consultation/SKILL.md +94 -0
- package/design-consultation/SKILL.md.tmpl +415 -0
- package/design-review/SKILL.md +94 -0
- package/design-review/SKILL.md.tmpl +290 -0
- package/design-shotgun/SKILL.md +91 -0
- package/design-shotgun/SKILL.md.tmpl +285 -0
- package/docs/designs/CHROME_VS_CHROMIUM_EXPLORATION.md +84 -0
- package/docs/designs/CONDUCTOR_CHROME_SIDEBAR_INTEGRATION.md +57 -0
- package/docs/designs/CONDUCTOR_SESSION_API.md +108 -0
- package/docs/designs/DESIGN_SHOTGUN.md +451 -0
- package/docs/designs/DESIGN_TOOLS_V1.md +622 -0
- package/docs/skills.md +880 -0
- package/document-release/SKILL.md +91 -0
- package/document-release/SKILL.md.tmpl +359 -0
- package/freeze/SKILL.md +78 -0
- package/freeze/SKILL.md.tmpl +77 -0
- package/gstack-upgrade/SKILL.md +224 -0
- package/gstack-upgrade/SKILL.md.tmpl +222 -0
- package/guard/SKILL.md +78 -0
- package/guard/SKILL.md.tmpl +77 -0
- package/investigate/SKILL.md +105 -0
- package/investigate/SKILL.md.tmpl +194 -0
- package/land-and-deploy/SKILL.md +88 -0
- package/land-and-deploy/SKILL.md.tmpl +881 -0
- package/office-hours/SKILL.md +96 -0
- package/office-hours/SKILL.md.tmpl +645 -0
- package/package.json +43 -0
- package/plan-ceo-review/SKILL.md +94 -0
- package/plan-ceo-review/SKILL.md.tmpl +811 -0
- package/plan-design-review/SKILL.md +92 -0
- package/plan-design-review/SKILL.md.tmpl +446 -0
- package/plan-eng-review/SKILL.md +93 -0
- package/plan-eng-review/SKILL.md.tmpl +303 -0
- package/qa/SKILL.md +95 -0
- package/qa/SKILL.md.tmpl +316 -0
- package/qa-only/SKILL.md +89 -0
- package/qa-only/SKILL.md.tmpl +101 -0
- package/retro/SKILL.md +89 -0
- package/retro/SKILL.md.tmpl +820 -0
- package/review/SKILL.md +92 -0
- package/review/SKILL.md.tmpl +281 -0
- package/scripts/cleanup.py +100 -0
- package/scripts/filter-skills.sh +114 -0
- package/scripts/filter_skills.py +140 -0
- package/setup-browser-cookies/SKILL.md +216 -0
- package/setup-browser-cookies/SKILL.md.tmpl +81 -0
- package/setup-deploy/SKILL.md +92 -0
- package/setup-deploy/SKILL.md.tmpl +215 -0
- package/ship/SKILL.md +90 -0
- package/ship/SKILL.md.tmpl +636 -0
- package/unfreeze/SKILL.md +37 -0
- package/unfreeze/SKILL.md.tmpl +36 -0
|
@@ -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
|
+
<!-- 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 `
|
|
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=$(echo get auto_upgrade 2>/dev/null || true)
|
|
32
|
+
echo "AUTO_UPGRADE=$_AUTO"
|
|
33
|
+
|
|
34
|
+
**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."
|
|
35
|
+
|
|
36
|
+
**Otherwise**, use AskUserQuestion:
|
|
37
|
+
- Question: "gstack **v{new}** is available (you're on v{old}). Upgrade now?"
|
|
38
|
+
- Options:
|
|
39
|
+
|
|
40
|
+
**If "Yes, upgrade now":** Proceed to Step 2.
|
|
41
|
+
|
|
42
|
+
**If "Always keep me up to date":**
|
|
43
|
+
```bash
|
|
44
|
+
echo set auto_upgrade true
|
|
45
|
+
|
|
46
|
+
Tell user: "Auto-upgrade enabled. Future updates will install automatically." Then proceed to Step 2.
|
|
47
|
+
|
|
48
|
+
**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.
|
|
49
|
+
```bash
|
|
50
|
+
_SNOOZE_FILE=~/.gstack/update-snoozed
|
|
51
|
+
_REMOTE_VER="{new}"
|
|
52
|
+
_CUR_LEVEL=0
|
|
53
|
+
if [ -f "$_SNOOZE_FILE" ]; then
|
|
54
|
+
_SNOOZED_VER=$(awk '{print $1}' "$_SNOOZE_FILE")
|
|
55
|
+
if [ "$_SNOOZED_VER" = "$_REMOTE_VER" ]; then
|
|
56
|
+
_CUR_LEVEL=$(awk '{print $2}' "$_SNOOZE_FILE")
|
|
57
|
+
case "$_CUR_LEVEL" in *[!0-9]*) _CUR_LEVEL=0 ;; esac
|
|
58
|
+
fi
|
|
59
|
+
fi
|
|
60
|
+
_NEW_LEVEL=$((_CUR_LEVEL + 1))
|
|
61
|
+
[ "$_NEW_LEVEL" -gt 3 ] && _NEW_LEVEL=3
|
|
62
|
+
echo "$_REMOTE_VER $_NEW_LEVEL $(date +%s)" > "$_SNOOZE_FILE"
|
|
63
|
+
|
|
64
|
+
Note: `{new}` is the remote version from the `
|
|
65
|
+
|
|
66
|
+
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."
|
|
67
|
+
|
|
68
|
+
**If "Never ask again":**
|
|
69
|
+
```bash
|
|
70
|
+
echo set update_check false
|
|
71
|
+
|
|
72
|
+
Tell user: "Update checks disabled. Run `echo set update_check true` to re-enable."
|
|
73
|
+
Continue with the current skill.
|
|
74
|
+
|
|
75
|
+
### Step 2: Detect install type
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
if [ -d "$HOME/.claude/skills/gstack/.git" ]; then
|
|
79
|
+
INSTALL_TYPE="global-git"
|
|
80
|
+
INSTALL_DIR="$HOME/.claude/skills/gstack"
|
|
81
|
+
elif [ -d "$HOME/.gstack/repos/gstack/.git" ]; then
|
|
82
|
+
INSTALL_TYPE="global-git"
|
|
83
|
+
INSTALL_DIR="$HOME/.gstack/repos/gstack"
|
|
84
|
+
elif [ -d ".claude/skills/gstack/.git" ]; then
|
|
85
|
+
INSTALL_TYPE="local-git"
|
|
86
|
+
INSTALL_DIR=".claude/skills/gstack"
|
|
87
|
+
elif [ -d ".agents/skills/gstack/.git" ]; then
|
|
88
|
+
INSTALL_TYPE="local-git"
|
|
89
|
+
INSTALL_DIR=".agents/skills/gstack"
|
|
90
|
+
elif [ -d ".claude/skills/gstack" ]; then
|
|
91
|
+
INSTALL_TYPE="vendored"
|
|
92
|
+
INSTALL_DIR=".claude/skills/gstack"
|
|
93
|
+
elif [ -d "$HOME/.claude/skills/gstack" ]; then
|
|
94
|
+
INSTALL_TYPE="vendored-global"
|
|
95
|
+
INSTALL_DIR="$HOME/.claude/skills/gstack"
|
|
96
|
+
else
|
|
97
|
+
echo "ERROR: gstack not found"
|
|
98
|
+
exit 1
|
|
99
|
+
fi
|
|
100
|
+
echo "Install type: $INSTALL_TYPE at $INSTALL_DIR"
|
|
101
|
+
|
|
102
|
+
The install type and directory path printed above will be used in all subsequent steps.
|
|
103
|
+
|
|
104
|
+
### Step 3: Save old version
|
|
105
|
+
|
|
106
|
+
Use the install directory from Step 2's output below:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
OLD_VERSION=$(cat "$INSTALL_DIR/VERSION" 2>/dev/null || echo "unknown")
|
|
110
|
+
|
|
111
|
+
### Step 4: Upgrade
|
|
112
|
+
|
|
113
|
+
Use the install type and directory detected in Step 2:
|
|
114
|
+
|
|
115
|
+
**For git installs** (global-git, local-git):
|
|
116
|
+
```bash
|
|
117
|
+
cd "$INSTALL_DIR"
|
|
118
|
+
STASH_OUTPUT=$(git stash 2>&1)
|
|
119
|
+
git fetch origin
|
|
120
|
+
git reset --hard origin/main
|
|
121
|
+
./setup
|
|
122
|
+
|
|
123
|
+
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."
|
|
124
|
+
|
|
125
|
+
**For vendored installs** (vendored, vendored-global):
|
|
126
|
+
```bash
|
|
127
|
+
PARENT=$(dirname "$INSTALL_DIR")
|
|
128
|
+
TMP_DIR=$(mktemp -d)
|
|
129
|
+
git clone --depth 1 https://github.com/Ambisphaeric/opengstack.git "$TMP_DIR/gstack"
|
|
130
|
+
mv "$INSTALL_DIR" "$INSTALL_DIR.bak"
|
|
131
|
+
mv "$TMP_DIR/gstack" "$INSTALL_DIR"
|
|
132
|
+
cd "$INSTALL_DIR" && ./setup
|
|
133
|
+
rm -rf "$INSTALL_DIR.bak" "$TMP_DIR"
|
|
134
|
+
|
|
135
|
+
### Step 4.5: Sync local vendored copy
|
|
136
|
+
|
|
137
|
+
Use the install directory from Step 2. Check if there's also a local vendored copy that needs updating:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
|
|
141
|
+
LOCAL_GSTACK=""
|
|
142
|
+
if [ -n "$_ROOT" ] && [ -d "$_ROOT/.claude/skills/gstack" ]; then
|
|
143
|
+
_RESOLVED_LOCAL=$(cd "$_ROOT/.claude/skills/gstack" && pwd -P)
|
|
144
|
+
_RESOLVED_PRIMARY=$(cd "$INSTALL_DIR" && pwd -P)
|
|
145
|
+
if [ "$_RESOLVED_LOCAL" != "$_RESOLVED_PRIMARY" ]; then
|
|
146
|
+
LOCAL_GSTACK="$_ROOT/.claude/skills/gstack"
|
|
147
|
+
fi
|
|
148
|
+
fi
|
|
149
|
+
echo "LOCAL_GSTACK=$LOCAL_GSTACK"
|
|
150
|
+
|
|
151
|
+
If `LOCAL_GSTACK` is non-empty, update it by copying from the freshly-upgraded primary install (same approach as README vendored install):
|
|
152
|
+
```bash
|
|
153
|
+
mv "$LOCAL_GSTACK" "$LOCAL_GSTACK.bak"
|
|
154
|
+
cp -Rf "$INSTALL_DIR" "$LOCAL_GSTACK"
|
|
155
|
+
rm -rf "$LOCAL_GSTACK/.git"
|
|
156
|
+
cd "$LOCAL_GSTACK" && ./setup
|
|
157
|
+
rm -rf "$LOCAL_GSTACK.bak"
|
|
158
|
+
|
|
159
|
+
Tell user: "Also updated vendored copy at `$LOCAL_GSTACK` — commit `.claude/skills/gstack/` when you're ready."
|
|
160
|
+
|
|
161
|
+
If `./setup` fails, restore from backup and warn the user:
|
|
162
|
+
```bash
|
|
163
|
+
rm -rf "$LOCAL_GSTACK"
|
|
164
|
+
mv "$LOCAL_GSTACK.bak" "$LOCAL_GSTACK"
|
|
165
|
+
|
|
166
|
+
Tell user: "Sync failed — restored previous version at `$LOCAL_GSTACK`. Run `/gstack-upgrade` manually to retry."
|
|
167
|
+
|
|
168
|
+
### Step 5: Write marker + clear cache
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
mkdir -p ~/.gstack
|
|
172
|
+
echo "$OLD_VERSION" > ~/.gstack/just-upgraded-from
|
|
173
|
+
rm -f ~/.gstack/last-update-check
|
|
174
|
+
rm -f ~/.gstack/update-snoozed
|
|
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
|
+
-
|
|
186
|
+
-
|
|
187
|
+
- ...
|
|
188
|
+
|
|
189
|
+
Happy shipping!
|
|
190
|
+
|
|
191
|
+
### Step 7: Continue
|
|
192
|
+
|
|
193
|
+
After showing What's New, continue with whatever skill the user originally invoked. The upgrade is done — no further action needed.
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Standalone usage
|
|
198
|
+
|
|
199
|
+
When invoked directly as `/gstack-upgrade` (not from a preamble):
|
|
200
|
+
|
|
201
|
+
1. Force a fresh update check (bypass cache):
|
|
202
|
+
```bash
|
|
203
|
+
~/.claude/skills/opengstack/bin/echo --force 2>/dev/null || \
|
|
204
|
+
.claude/skills/gstack/bin/echo --force 2>/dev/null || true
|
|
205
|
+
|
|
206
|
+
Use the output to determine if an upgrade is available.
|
|
207
|
+
|
|
208
|
+
2. If `
|
|
209
|
+
|
|
210
|
+
3. If no output (primary is up to date): check for a stale local vendored copy.
|
|
211
|
+
|
|
212
|
+
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`).
|
|
213
|
+
|
|
214
|
+
**If `LOCAL_GSTACK` is empty** (no local vendored copy): tell the user "You're already on the latest version (v{version})."
|
|
215
|
+
|
|
216
|
+
**If `LOCAL_GSTACK` is non-empty**, compare versions:
|
|
217
|
+
```bash
|
|
218
|
+
PRIMARY_VER=$(cat "$INSTALL_DIR/VERSION" 2>/dev/null || echo "unknown")
|
|
219
|
+
LOCAL_VER=$(cat "$LOCAL_GSTACK/VERSION" 2>/dev/null || echo "unknown")
|
|
220
|
+
echo "PRIMARY=$PRIMARY_VER LOCAL=$LOCAL_VER"
|
|
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,222 @@
|
|
|
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 `
|
|
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/opengstack/bin/gstack-config get auto_upgrade 2>/dev/null || true)
|
|
30
|
+
echo "AUTO_UPGRADE=$_AUTO"
|
|
31
|
+
|
|
32
|
+
**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."
|
|
33
|
+
|
|
34
|
+
**Otherwise**, use AskUserQuestion:
|
|
35
|
+
- Question: "gstack **v{new}** is available (you're on v{old}). Upgrade now?"
|
|
36
|
+
- Options: ["Yes, upgrade now", "Always keep me up to date", "Not now", "Never ask again"]
|
|
37
|
+
|
|
38
|
+
**If "Yes, upgrade now":** Proceed to Step 2.
|
|
39
|
+
|
|
40
|
+
**If "Always keep me up to date":**
|
|
41
|
+
```bash
|
|
42
|
+
~/.claude/skills/opengstack/bin/gstack-config set auto_upgrade true
|
|
43
|
+
|
|
44
|
+
Tell user: "Auto-upgrade enabled. Future updates will install automatically." Then proceed to Step 2.
|
|
45
|
+
|
|
46
|
+
**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.
|
|
47
|
+
```bash
|
|
48
|
+
_SNOOZE_FILE=~/.gstack/update-snoozed
|
|
49
|
+
_REMOTE_VER="{new}"
|
|
50
|
+
_CUR_LEVEL=0
|
|
51
|
+
if [ -f "$_SNOOZE_FILE" ]; then
|
|
52
|
+
_SNOOZED_VER=$(awk '{print $1}' "$_SNOOZE_FILE")
|
|
53
|
+
if [ "$_SNOOZED_VER" = "$_REMOTE_VER" ]; then
|
|
54
|
+
_CUR_LEVEL=$(awk '{print $2}' "$_SNOOZE_FILE")
|
|
55
|
+
case "$_CUR_LEVEL" in *[!0-9]*) _CUR_LEVEL=0 ;; esac
|
|
56
|
+
fi
|
|
57
|
+
fi
|
|
58
|
+
_NEW_LEVEL=$((_CUR_LEVEL + 1))
|
|
59
|
+
[ "$_NEW_LEVEL" -gt 3 ] && _NEW_LEVEL=3
|
|
60
|
+
echo "$_REMOTE_VER $_NEW_LEVEL $(date +%s)" > "$_SNOOZE_FILE"
|
|
61
|
+
|
|
62
|
+
Note: `{new}` is the remote version from the `
|
|
63
|
+
|
|
64
|
+
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."
|
|
65
|
+
|
|
66
|
+
**If "Never ask again":**
|
|
67
|
+
```bash
|
|
68
|
+
~/.claude/skills/opengstack/bin/gstack-config set update_check false
|
|
69
|
+
|
|
70
|
+
Tell user: "Update checks disabled. Run `~/.claude/skills/opengstack/bin/gstack-config set update_check true` to re-enable."
|
|
71
|
+
Continue with the current skill.
|
|
72
|
+
|
|
73
|
+
### Step 2: Detect install type
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
if [ -d "$HOME/.claude/skills/gstack/.git" ]; then
|
|
77
|
+
INSTALL_TYPE="global-git"
|
|
78
|
+
INSTALL_DIR="$HOME/.claude/skills/gstack"
|
|
79
|
+
elif [ -d "$HOME/.gstack/repos/gstack/.git" ]; then
|
|
80
|
+
INSTALL_TYPE="global-git"
|
|
81
|
+
INSTALL_DIR="$HOME/.gstack/repos/gstack"
|
|
82
|
+
elif [ -d ".claude/skills/gstack/.git" ]; then
|
|
83
|
+
INSTALL_TYPE="local-git"
|
|
84
|
+
INSTALL_DIR=".claude/skills/gstack"
|
|
85
|
+
elif [ -d ".agents/skills/gstack/.git" ]; then
|
|
86
|
+
INSTALL_TYPE="local-git"
|
|
87
|
+
INSTALL_DIR=".agents/skills/gstack"
|
|
88
|
+
elif [ -d ".claude/skills/gstack" ]; then
|
|
89
|
+
INSTALL_TYPE="vendored"
|
|
90
|
+
INSTALL_DIR=".claude/skills/gstack"
|
|
91
|
+
elif [ -d "$HOME/.claude/skills/gstack" ]; then
|
|
92
|
+
INSTALL_TYPE="vendored-global"
|
|
93
|
+
INSTALL_DIR="$HOME/.claude/skills/gstack"
|
|
94
|
+
else
|
|
95
|
+
echo "ERROR: gstack not found"
|
|
96
|
+
exit 1
|
|
97
|
+
fi
|
|
98
|
+
echo "Install type: $INSTALL_TYPE at $INSTALL_DIR"
|
|
99
|
+
|
|
100
|
+
The install type and directory path printed above will be used in all subsequent steps.
|
|
101
|
+
|
|
102
|
+
### Step 3: Save old version
|
|
103
|
+
|
|
104
|
+
Use the install directory from Step 2's output below:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
OLD_VERSION=$(cat "$INSTALL_DIR/VERSION" 2>/dev/null || echo "unknown")
|
|
108
|
+
|
|
109
|
+
### Step 4: Upgrade
|
|
110
|
+
|
|
111
|
+
Use the install type and directory detected in Step 2:
|
|
112
|
+
|
|
113
|
+
**For git installs** (global-git, local-git):
|
|
114
|
+
```bash
|
|
115
|
+
cd "$INSTALL_DIR"
|
|
116
|
+
STASH_OUTPUT=$(git stash 2>&1)
|
|
117
|
+
git fetch origin
|
|
118
|
+
git reset --hard origin/main
|
|
119
|
+
./setup
|
|
120
|
+
|
|
121
|
+
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."
|
|
122
|
+
|
|
123
|
+
**For vendored installs** (vendored, vendored-global):
|
|
124
|
+
```bash
|
|
125
|
+
PARENT=$(dirname "$INSTALL_DIR")
|
|
126
|
+
TMP_DIR=$(mktemp -d)
|
|
127
|
+
git clone --depth 1 https://github.com/garrytan/gstack.git "$TMP_DIR/gstack"
|
|
128
|
+
mv "$INSTALL_DIR" "$INSTALL_DIR.bak"
|
|
129
|
+
mv "$TMP_DIR/gstack" "$INSTALL_DIR"
|
|
130
|
+
cd "$INSTALL_DIR" && ./setup
|
|
131
|
+
rm -rf "$INSTALL_DIR.bak" "$TMP_DIR"
|
|
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
|
+
If `LOCAL_GSTACK` is non-empty, update it by copying from the freshly-upgraded primary install (same approach as README vendored install):
|
|
150
|
+
```bash
|
|
151
|
+
mv "$LOCAL_GSTACK" "$LOCAL_GSTACK.bak"
|
|
152
|
+
cp -Rf "$INSTALL_DIR" "$LOCAL_GSTACK"
|
|
153
|
+
rm -rf "$LOCAL_GSTACK/.git"
|
|
154
|
+
cd "$LOCAL_GSTACK" && ./setup
|
|
155
|
+
rm -rf "$LOCAL_GSTACK.bak"
|
|
156
|
+
|
|
157
|
+
Tell user: "Also updated vendored copy at `$LOCAL_GSTACK` — commit `.claude/skills/gstack/` when you're ready."
|
|
158
|
+
|
|
159
|
+
If `./setup` fails, restore from backup and warn the user:
|
|
160
|
+
```bash
|
|
161
|
+
rm -rf "$LOCAL_GSTACK"
|
|
162
|
+
mv "$LOCAL_GSTACK.bak" "$LOCAL_GSTACK"
|
|
163
|
+
|
|
164
|
+
Tell user: "Sync failed — restored previous version at `$LOCAL_GSTACK`. Run `/gstack-upgrade` manually to retry."
|
|
165
|
+
|
|
166
|
+
### Step 5: Write marker + clear cache
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
mkdir -p ~/.gstack
|
|
170
|
+
echo "$OLD_VERSION" > ~/.gstack/just-upgraded-from
|
|
171
|
+
rm -f ~/.gstack/last-update-check
|
|
172
|
+
rm -f ~/.gstack/update-snoozed
|
|
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
|
+
### Step 7: Continue
|
|
190
|
+
|
|
191
|
+
After showing What's New, continue with whatever skill the user originally invoked. The upgrade is done — no further action needed.
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## Standalone usage
|
|
196
|
+
|
|
197
|
+
When invoked directly as `/gstack-upgrade` (not from a preamble):
|
|
198
|
+
|
|
199
|
+
1. Force a fresh update check (bypass cache):
|
|
200
|
+
```bash
|
|
201
|
+
~/.claude/skills/opengstack/bin/echo --force 2>/dev/null || \
|
|
202
|
+
.claude/skills/gstack/bin/echo --force 2>/dev/null || true
|
|
203
|
+
|
|
204
|
+
Use the output to determine if an upgrade is available.
|
|
205
|
+
|
|
206
|
+
2. If `
|
|
207
|
+
|
|
208
|
+
3. If no output (primary is up to date): check for a stale local vendored copy.
|
|
209
|
+
|
|
210
|
+
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`).
|
|
211
|
+
|
|
212
|
+
**If `LOCAL_GSTACK` is empty** (no local vendored copy): tell the user "You're already on the latest version (v{version})."
|
|
213
|
+
|
|
214
|
+
**If `LOCAL_GSTACK` is non-empty**, compare versions:
|
|
215
|
+
```bash
|
|
216
|
+
PRIMARY_VER=$(cat "$INSTALL_DIR/VERSION" 2>/dev/null || echo "unknown")
|
|
217
|
+
LOCAL_VER=$(cat "$LOCAL_GSTACK/VERSION" 2>/dev/null || echo "unknown")
|
|
218
|
+
echo "PRIMARY=$PRIMARY_VER LOCAL=$LOCAL_VER"
|
|
219
|
+
|
|
220
|
+
**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."
|
|
221
|
+
|
|
222
|
+
**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."
|
package/guard/SKILL.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
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
|
+
## Setup
|
|
49
|
+
|
|
50
|
+
Ask the user which directory to restrict edits to. Use AskUserQuestion:
|
|
51
|
+
|
|
52
|
+
- 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."
|
|
53
|
+
- Text input (not multiple choice) — the user types a path.
|
|
54
|
+
|
|
55
|
+
Once the user provides a directory path:
|
|
56
|
+
|
|
57
|
+
1. Resolve it to an absolute path:
|
|
58
|
+
```bash
|
|
59
|
+
FREEZE_DIR=$(cd "<user-provided-path>" 2>/dev/null && pwd)
|
|
60
|
+
echo "$FREEZE_DIR"
|
|
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
|
+
- "**Guard mode active.** Two protections are now running:"
|
|
71
|
+
- "1. **Destructive command warnings** — rm -rf, DROP TABLE, force-push, etc. will warn before executing (you can override)"
|
|
72
|
+
- "2. **Edit boundary** — file edits restricted to `<path>/`. Edits outside this directory are blocked."
|
|
73
|
+
- "To remove the edit boundary, run `/unfreeze`. To deactivate everything, end the session."
|
|
74
|
+
|
|
75
|
+
## What's protected
|
|
76
|
+
|
|
77
|
+
See `/careful` for the full list of destructive command patterns and safe exceptions.
|
|
78
|
+
See `/freeze` for how edit boundary enforcement works.
|
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
## Setup
|
|
47
|
+
|
|
48
|
+
Ask the user which directory to restrict edits to. Use AskUserQuestion:
|
|
49
|
+
|
|
50
|
+
- 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."
|
|
51
|
+
- Text input (not multiple choice) — the user types a path.
|
|
52
|
+
|
|
53
|
+
Once the user provides a directory path:
|
|
54
|
+
|
|
55
|
+
1. Resolve it to an absolute path:
|
|
56
|
+
```bash
|
|
57
|
+
FREEZE_DIR=$(cd "<user-provided-path>" 2>/dev/null && pwd)
|
|
58
|
+
echo "$FREEZE_DIR"
|
|
59
|
+
|
|
60
|
+
2. Ensure trailing slash and save to the freeze state file:
|
|
61
|
+
```bash
|
|
62
|
+
FREEZE_DIR="${FREEZE_DIR%/}/"
|
|
63
|
+
STATE_DIR="${CLAUDE_PLUGIN_DATA:-$HOME/.gstack}"
|
|
64
|
+
mkdir -p "$STATE_DIR"
|
|
65
|
+
echo "$FREEZE_DIR" > "$STATE_DIR/freeze-dir.txt"
|
|
66
|
+
echo "Freeze boundary set: $FREEZE_DIR"
|
|
67
|
+
|
|
68
|
+
Tell the user:
|
|
69
|
+
- "**Guard mode active.** Two protections are now running:"
|
|
70
|
+
- "1. **Destructive command warnings** — rm -rf, DROP TABLE, force-push, etc. will warn before executing (you can override)"
|
|
71
|
+
- "2. **Edit boundary** — file edits restricted to `<path>/`. Edits outside this directory are blocked."
|
|
72
|
+
- "To remove the edit boundary, run `/unfreeze`. To deactivate everything, end the session."
|
|
73
|
+
|
|
74
|
+
## What's protected
|
|
75
|
+
|
|
76
|
+
See `/careful` for the full list of destructive command patterns and safe exceptions.
|
|
77
|
+
See `/freeze` for how edit boundary enforcement works.
|