slashdev 0.1.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitmodules +3 -0
- package/CLAUDE.md +87 -0
- package/README.md +158 -21
- package/bin/check-setup.js +27 -0
- package/claude-skills/agentswarm/SKILL.md +479 -0
- package/claude-skills/bug-diagnosis/SKILL.md +34 -0
- package/claude-skills/code-review/SKILL.md +26 -0
- package/claude-skills/frontend-design/LICENSE.txt +177 -0
- package/claude-skills/frontend-design/SKILL.md +42 -0
- package/claude-skills/pr-description/SKILL.md +35 -0
- package/claude-skills/scope-estimate/SKILL.md +37 -0
- package/hooks/post-response.sh +242 -0
- package/package.json +11 -3
- package/skills/front-end-design/prompts/system.md +37 -0
- package/skills/front-end-testing/prompts/system.md +66 -0
- package/skills/github-manager/prompts/system.md +79 -0
- package/skills/product-expert/prompts/system.md +52 -0
- package/skills/server-admin/prompts/system.md +39 -0
- package/src/auth/index.js +115 -0
- package/src/cli.js +188 -18
- package/src/commands/setup-internals.js +137 -0
- package/src/commands/setup.js +104 -0
- package/src/commands/update.js +60 -0
- package/src/connections/index.js +449 -0
- package/src/connections/providers/github.js +71 -0
- package/src/connections/providers/servers.js +175 -0
- package/src/connections/registry.js +21 -0
- package/src/core/claude.js +78 -0
- package/src/core/codebase.js +119 -0
- package/src/core/config.js +110 -0
- package/src/index.js +8 -1
- package/src/info.js +54 -21
- package/src/skills/index.js +252 -0
- package/src/utils/ssh-keys.js +67 -0
- package/vendor/gstack/.env.example +5 -0
- package/vendor/gstack/autoplan/SKILL.md +1116 -0
- package/vendor/gstack/browse/SKILL.md +538 -0
- package/vendor/gstack/canary/SKILL.md +587 -0
- package/vendor/gstack/careful/SKILL.md +59 -0
- package/vendor/gstack/codex/SKILL.md +862 -0
- package/vendor/gstack/connect-chrome/SKILL.md +549 -0
- package/vendor/gstack/cso/ACKNOWLEDGEMENTS.md +14 -0
- package/vendor/gstack/cso/SKILL.md +929 -0
- package/vendor/gstack/design-consultation/SKILL.md +962 -0
- package/vendor/gstack/design-review/SKILL.md +1314 -0
- package/vendor/gstack/design-shotgun/SKILL.md +730 -0
- package/vendor/gstack/document-release/SKILL.md +718 -0
- package/vendor/gstack/freeze/SKILL.md +82 -0
- package/vendor/gstack/gstack-upgrade/SKILL.md +232 -0
- package/vendor/gstack/guard/SKILL.md +82 -0
- package/vendor/gstack/investigate/SKILL.md +504 -0
- package/vendor/gstack/land-and-deploy/SKILL.md +1367 -0
- package/vendor/gstack/office-hours/SKILL.md +1317 -0
- package/vendor/gstack/plan-ceo-review/SKILL.md +1537 -0
- package/vendor/gstack/plan-design-review/SKILL.md +1227 -0
- package/vendor/gstack/plan-eng-review/SKILL.md +1120 -0
- package/vendor/gstack/qa/SKILL.md +1136 -0
- package/vendor/gstack/qa/references/issue-taxonomy.md +85 -0
- package/vendor/gstack/qa/templates/qa-report-template.md +126 -0
- package/vendor/gstack/qa-only/SKILL.md +726 -0
- package/vendor/gstack/retro/SKILL.md +1197 -0
- package/vendor/gstack/review/SKILL.md +1138 -0
- package/vendor/gstack/review/TODOS-format.md +62 -0
- package/vendor/gstack/review/checklist.md +220 -0
- package/vendor/gstack/review/design-checklist.md +132 -0
- package/vendor/gstack/review/greptile-triage.md +220 -0
- package/vendor/gstack/setup-browser-cookies/SKILL.md +348 -0
- package/vendor/gstack/setup-deploy/SKILL.md +528 -0
- package/vendor/gstack/ship/SKILL.md +1931 -0
- package/vendor/gstack/unfreeze/SKILL.md +40 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: freeze
|
|
3
|
+
version: 0.1.0
|
|
4
|
+
description: |
|
|
5
|
+
Restrict file edits to a specific directory for the session. Blocks Edit and
|
|
6
|
+
Write outside the allowed path. Use when debugging to prevent accidentally
|
|
7
|
+
"fixing" unrelated code, or when you want to scope changes to one module.
|
|
8
|
+
Use when asked to "freeze", "restrict edits", "only edit this folder",
|
|
9
|
+
or "lock down edits".
|
|
10
|
+
allowed-tools:
|
|
11
|
+
- Bash
|
|
12
|
+
- Read
|
|
13
|
+
- AskUserQuestion
|
|
14
|
+
hooks:
|
|
15
|
+
PreToolUse:
|
|
16
|
+
- matcher: "Edit"
|
|
17
|
+
hooks:
|
|
18
|
+
- type: command
|
|
19
|
+
command: "bash ${CLAUDE_SKILL_DIR}/bin/check-freeze.sh"
|
|
20
|
+
statusMessage: "Checking freeze boundary..."
|
|
21
|
+
- matcher: "Write"
|
|
22
|
+
hooks:
|
|
23
|
+
- type: command
|
|
24
|
+
command: "bash ${CLAUDE_SKILL_DIR}/bin/check-freeze.sh"
|
|
25
|
+
statusMessage: "Checking freeze boundary..."
|
|
26
|
+
---
|
|
27
|
+
<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->
|
|
28
|
+
<!-- Regenerate: bun run gen:skill-docs -->
|
|
29
|
+
|
|
30
|
+
# /freeze — Restrict Edits to a Directory
|
|
31
|
+
|
|
32
|
+
Lock file edits to a specific directory. Any Edit or Write operation targeting
|
|
33
|
+
a file outside the allowed path will be **blocked** (not just warned).
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
mkdir -p ~/.gstack/analytics
|
|
37
|
+
echo '{"skill":"freeze","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
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Setup
|
|
41
|
+
|
|
42
|
+
Ask the user which directory to restrict edits to. Use AskUserQuestion:
|
|
43
|
+
|
|
44
|
+
- Question: "Which directory should I restrict edits to? Files outside this path will be blocked from editing."
|
|
45
|
+
- Text input (not multiple choice) — the user types a path.
|
|
46
|
+
|
|
47
|
+
Once the user provides a directory path:
|
|
48
|
+
|
|
49
|
+
1. Resolve it to an absolute path:
|
|
50
|
+
```bash
|
|
51
|
+
FREEZE_DIR=$(cd "<user-provided-path>" 2>/dev/null && pwd)
|
|
52
|
+
echo "$FREEZE_DIR"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
2. Ensure trailing slash and save to the freeze state file:
|
|
56
|
+
```bash
|
|
57
|
+
FREEZE_DIR="${FREEZE_DIR%/}/"
|
|
58
|
+
STATE_DIR="${CLAUDE_PLUGIN_DATA:-$HOME/.gstack}"
|
|
59
|
+
mkdir -p "$STATE_DIR"
|
|
60
|
+
echo "$FREEZE_DIR" > "$STATE_DIR/freeze-dir.txt"
|
|
61
|
+
echo "Freeze boundary set: $FREEZE_DIR"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Tell the user: "Edits are now restricted to `<path>/`. Any Edit or Write
|
|
65
|
+
outside this directory will be blocked. To change the boundary, run `/freeze`
|
|
66
|
+
again. To remove it, run `/unfreeze` or end the session."
|
|
67
|
+
|
|
68
|
+
## How it works
|
|
69
|
+
|
|
70
|
+
The hook reads `file_path` from the Edit/Write tool input JSON, then checks
|
|
71
|
+
whether the path starts with the freeze directory. If not, it returns
|
|
72
|
+
`permissionDecision: "deny"` to block the operation.
|
|
73
|
+
|
|
74
|
+
The freeze boundary persists for the session via the state file. The hook
|
|
75
|
+
script reads it on every Edit/Write invocation.
|
|
76
|
+
|
|
77
|
+
## Notes
|
|
78
|
+
|
|
79
|
+
- The trailing `/` on the freeze directory prevents `/src` from matching `/src-old`
|
|
80
|
+
- Freeze applies to Edit and Write tools only — Read, Bash, Glob, Grep are unaffected
|
|
81
|
+
- This prevents accidental edits, not a security boundary — Bash commands like `sed` can still modify files outside the boundary
|
|
82
|
+
- To deactivate, run `/unfreeze` or end the conversation
|
|
@@ -0,0 +1,232 @@
|
|
|
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 "$HOME/.gstack/repos/gstack/.git" ]; then
|
|
83
|
+
INSTALL_TYPE="global-git"
|
|
84
|
+
INSTALL_DIR="$HOME/.gstack/repos/gstack"
|
|
85
|
+
elif [ -d ".claude/skills/gstack/.git" ]; then
|
|
86
|
+
INSTALL_TYPE="local-git"
|
|
87
|
+
INSTALL_DIR=".claude/skills/gstack"
|
|
88
|
+
elif [ -d ".agents/skills/gstack/.git" ]; then
|
|
89
|
+
INSTALL_TYPE="local-git"
|
|
90
|
+
INSTALL_DIR=".agents/skills/gstack"
|
|
91
|
+
elif [ -d ".claude/skills/gstack" ]; then
|
|
92
|
+
INSTALL_TYPE="vendored"
|
|
93
|
+
INSTALL_DIR=".claude/skills/gstack"
|
|
94
|
+
elif [ -d "$HOME/.claude/skills/gstack" ]; then
|
|
95
|
+
INSTALL_TYPE="vendored-global"
|
|
96
|
+
INSTALL_DIR="$HOME/.claude/skills/gstack"
|
|
97
|
+
else
|
|
98
|
+
echo "ERROR: gstack not found"
|
|
99
|
+
exit 1
|
|
100
|
+
fi
|
|
101
|
+
echo "Install type: $INSTALL_TYPE at $INSTALL_DIR"
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
The install type and directory path printed above will be used in all subsequent steps.
|
|
105
|
+
|
|
106
|
+
### Step 3: Save old version
|
|
107
|
+
|
|
108
|
+
Use the install directory from Step 2's output below:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
OLD_VERSION=$(cat "$INSTALL_DIR/VERSION" 2>/dev/null || echo "unknown")
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Step 4: Upgrade
|
|
115
|
+
|
|
116
|
+
Use the install type and directory detected in Step 2:
|
|
117
|
+
|
|
118
|
+
**For git installs** (global-git, local-git):
|
|
119
|
+
```bash
|
|
120
|
+
cd "$INSTALL_DIR"
|
|
121
|
+
STASH_OUTPUT=$(git stash 2>&1)
|
|
122
|
+
git fetch origin
|
|
123
|
+
git reset --hard origin/main
|
|
124
|
+
./setup
|
|
125
|
+
```
|
|
126
|
+
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."
|
|
127
|
+
|
|
128
|
+
**For vendored installs** (vendored, vendored-global):
|
|
129
|
+
```bash
|
|
130
|
+
PARENT=$(dirname "$INSTALL_DIR")
|
|
131
|
+
TMP_DIR=$(mktemp -d)
|
|
132
|
+
git clone --depth 1 https://github.com/garrytan/gstack.git "$TMP_DIR/gstack"
|
|
133
|
+
mv "$INSTALL_DIR" "$INSTALL_DIR.bak"
|
|
134
|
+
mv "$TMP_DIR/gstack" "$INSTALL_DIR"
|
|
135
|
+
cd "$INSTALL_DIR" && ./setup
|
|
136
|
+
rm -rf "$INSTALL_DIR.bak" "$TMP_DIR"
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Step 4.5: Sync local vendored copy
|
|
140
|
+
|
|
141
|
+
Use the install directory from Step 2. Check if there's also a local vendored copy that needs updating:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
|
|
145
|
+
LOCAL_GSTACK=""
|
|
146
|
+
if [ -n "$_ROOT" ] && [ -d "$_ROOT/.claude/skills/gstack" ]; then
|
|
147
|
+
_RESOLVED_LOCAL=$(cd "$_ROOT/.claude/skills/gstack" && pwd -P)
|
|
148
|
+
_RESOLVED_PRIMARY=$(cd "$INSTALL_DIR" && pwd -P)
|
|
149
|
+
if [ "$_RESOLVED_LOCAL" != "$_RESOLVED_PRIMARY" ]; then
|
|
150
|
+
LOCAL_GSTACK="$_ROOT/.claude/skills/gstack"
|
|
151
|
+
fi
|
|
152
|
+
fi
|
|
153
|
+
echo "LOCAL_GSTACK=$LOCAL_GSTACK"
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
If `LOCAL_GSTACK` is non-empty, update it by copying from the freshly-upgraded primary install (same approach as README vendored install):
|
|
157
|
+
```bash
|
|
158
|
+
mv "$LOCAL_GSTACK" "$LOCAL_GSTACK.bak"
|
|
159
|
+
cp -Rf "$INSTALL_DIR" "$LOCAL_GSTACK"
|
|
160
|
+
rm -rf "$LOCAL_GSTACK/.git"
|
|
161
|
+
cd "$LOCAL_GSTACK" && ./setup
|
|
162
|
+
rm -rf "$LOCAL_GSTACK.bak"
|
|
163
|
+
```
|
|
164
|
+
Tell user: "Also updated vendored copy at `$LOCAL_GSTACK` — commit `.claude/skills/gstack/` when you're ready."
|
|
165
|
+
|
|
166
|
+
If `./setup` fails, restore from backup and warn the user:
|
|
167
|
+
```bash
|
|
168
|
+
rm -rf "$LOCAL_GSTACK"
|
|
169
|
+
mv "$LOCAL_GSTACK.bak" "$LOCAL_GSTACK"
|
|
170
|
+
```
|
|
171
|
+
Tell user: "Sync failed — restored previous version at `$LOCAL_GSTACK`. Run `/gstack-upgrade` manually to retry."
|
|
172
|
+
|
|
173
|
+
### Step 5: Write marker + clear cache
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
mkdir -p ~/.gstack
|
|
177
|
+
echo "$OLD_VERSION" > ~/.gstack/just-upgraded-from
|
|
178
|
+
rm -f ~/.gstack/last-update-check
|
|
179
|
+
rm -f ~/.gstack/update-snoozed
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Step 6: Show What's New
|
|
183
|
+
|
|
184
|
+
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.
|
|
185
|
+
|
|
186
|
+
Format:
|
|
187
|
+
```
|
|
188
|
+
gstack v{new} — upgraded from v{old}!
|
|
189
|
+
|
|
190
|
+
What's new:
|
|
191
|
+
- [bullet 1]
|
|
192
|
+
- [bullet 2]
|
|
193
|
+
- ...
|
|
194
|
+
|
|
195
|
+
Happy shipping!
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Step 7: Continue
|
|
199
|
+
|
|
200
|
+
After showing What's New, continue with whatever skill the user originally invoked. The upgrade is done — no further action needed.
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Standalone usage
|
|
205
|
+
|
|
206
|
+
When invoked directly as `/gstack-upgrade` (not from a preamble):
|
|
207
|
+
|
|
208
|
+
1. Force a fresh update check (bypass cache):
|
|
209
|
+
```bash
|
|
210
|
+
~/.claude/skills/gstack/bin/gstack-update-check --force 2>/dev/null || \
|
|
211
|
+
.claude/skills/gstack/bin/gstack-update-check --force 2>/dev/null || true
|
|
212
|
+
```
|
|
213
|
+
Use the output to determine if an upgrade is available.
|
|
214
|
+
|
|
215
|
+
2. If `UPGRADE_AVAILABLE <old> <new>`: follow Steps 2-6 above.
|
|
216
|
+
|
|
217
|
+
3. If no output (primary is up to date): check for a stale local vendored copy.
|
|
218
|
+
|
|
219
|
+
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`).
|
|
220
|
+
|
|
221
|
+
**If `LOCAL_GSTACK` is empty** (no local vendored copy): tell the user "You're already on the latest version (v{version})."
|
|
222
|
+
|
|
223
|
+
**If `LOCAL_GSTACK` is non-empty**, compare versions:
|
|
224
|
+
```bash
|
|
225
|
+
PRIMARY_VER=$(cat "$INSTALL_DIR/VERSION" 2>/dev/null || echo "unknown")
|
|
226
|
+
LOCAL_VER=$(cat "$LOCAL_GSTACK/VERSION" 2>/dev/null || echo "unknown")
|
|
227
|
+
echo "PRIMARY=$PRIMARY_VER LOCAL=$LOCAL_VER"
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**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."
|
|
231
|
+
|
|
232
|
+
**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.
|