Skip to content

Commit 8565654

Browse files
effinrichclaude
andauthored
chore: require gstack for AI-assisted work (#10)
Add gstack team mode (required) bootstrap: a CLAUDE.md section that checks for a global gstack install, a PreToolUse hook on the Skill tool that blocks skill use when gstack is missing, and the project settings registering it. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent bfc5482 commit 8565654

3 files changed

Lines changed: 74 additions & 0 deletions

File tree

‎.claude/hooks/check-gstack.sh‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
# Block skill usage when gstack is not installed globally.
3+
#
4+
# Resolve the install root the way gstack skill preambles do: the GSTACK_ROOT
5+
# env var first, then every host's global install location, then the migrated
6+
# repo location. Block only when NONE exist (#2500 — hardcoding
7+
# ~/.claude/skills/gstack false-blocked Codex-host and migrated-repo installs).
8+
_GSTACK_ROOT=""
9+
for _D in "${GSTACK_ROOT:-}" "$HOME/.claude/skills/gstack" "$HOME/.codex/skills/gstack" "$HOME/.factory/skills/gstack" "$HOME/.kiro/skills/gstack" "$HOME/.config/opencode/skills/gstack" "$HOME/.slate/skills/gstack" "$HOME/.cursor/skills/gstack" "$HOME/.openclaw/skills/gstack" "$HOME/.hermes/skills/gstack" "$HOME/.gbrain/skills/gstack" "$HOME/.gstack/repos/gstack"; do
10+
[ -z "$_GSTACK_ROOT" ] && [ -n "$_D" ] && [ -d "$_D/bin" ] && _GSTACK_ROOT="$_D"
11+
done
12+
13+
if [ -z "$_GSTACK_ROOT" ]; then
14+
cat >&2 <<'MSG'
15+
BLOCKED: gstack is not installed globally.
16+
17+
gstack is required for AI-assisted work in this repo.
18+
19+
Install it:
20+
git clone --depth 1 https://github.com/garrytan/gstack.git ~/.claude/skills/gstack
21+
cd ~/.claude/skills/gstack && ./setup --team
22+
23+
Then restart your AI coding tool.
24+
MSG
25+
echo '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"gstack is required but not installed. See stderr for install instructions."}}'
26+
exit 2
27+
fi
28+
29+
echo '{}'

‎.claude/settings.json‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"hooks": {
3+
"PreToolUse": [
4+
{
5+
"matcher": "Skill",
6+
"hooks": [
7+
{
8+
"type": "command",
9+
"command": "\"$CLAUDE_PROJECT_DIR/.claude/hooks/check-gstack.sh\""
10+
}
11+
]
12+
}
13+
]
14+
}
15+
}

‎CLAUDE.md‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## gstack (REQUIRED — global install)
2+
3+
**Before doing ANY work, verify gstack is installed:**
4+
5+
```bash
6+
_GS=""
7+
for _D in "${GSTACK_ROOT:-}" "$HOME/.claude/skills/gstack" "$HOME/.codex/skills/gstack" "$HOME/.factory/skills/gstack" "$HOME/.kiro/skills/gstack" "$HOME/.config/opencode/skills/gstack" "$HOME/.slate/skills/gstack" "$HOME/.cursor/skills/gstack" "$HOME/.openclaw/skills/gstack" "$HOME/.hermes/skills/gstack" "$HOME/.gbrain/skills/gstack" "$HOME/.gstack/repos/gstack"; do
8+
[ -z "$_GS" ] && [ -n "$_D" ] && [ -d "$_D/bin" ] && _GS="$_D"
9+
done
10+
[ -n "$_GS" ] && echo "GSTACK_OK: $_GS" || echo "GSTACK_MISSING"
11+
```
12+
13+
If GSTACK_MISSING: STOP. Do not proceed. Tell the user:
14+
15+
> gstack is required for all AI-assisted work in this repo.
16+
> Install it:
17+
>
18+
> ```bash
19+
> git clone --depth 1 https://github.com/garrytan/gstack.git ~/.claude/skills/gstack
20+
> cd ~/.claude/skills/gstack && ./setup --team
21+
> ```
22+
>
23+
> Then restart your AI coding tool.
24+
25+
Do not skip skills, ignore gstack errors, or work around missing gstack.
26+
27+
Using gstack skills: After install, skills like /qa, /ship, /review, /investigate,
28+
and /browse are available. Use /browse for all web browsing (Aside first, the bundled gstack browser as fallback).
29+
Use the resolved install path above for gstack file paths
30+
(default: ~/.claude/skills/gstack).

0 commit comments

Comments
 (0)