feat: dual-host setup + find-browse for Codex/Gemini/Cursor

- setup: add --host codex|claude|auto flag, install to ~/.codex/skills/
  when targeting Codex, auto-detect installed agents
- find-browse: priority chain .codex > .agents > .claude (both
  workspace-local and global)
- dev-setup/teardown: create .agents/skills/gstack symlinks for dev mode

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-03-19 00:57:43 -07:00
parent 0e76c81b01
commit 10e6d39f27
5 changed files with 179 additions and 51 deletions
+15 -1
View File
@@ -44,11 +44,25 @@ elif [ -d "$GSTACK_LINK" ]; then
fi
ln -s "$REPO_ROOT" "$GSTACK_LINK"
# 5. Run setup via the symlink so it detects .claude/skills/ as its parent
# 5. Create .agents/skills/gstack → repo root (for Codex/Gemini/Cursor)
mkdir -p "$REPO_ROOT/.agents/skills"
AGENTS_LINK="$REPO_ROOT/.agents/skills/gstack"
if [ -L "$AGENTS_LINK" ]; then
rm "$AGENTS_LINK"
elif [ -d "$AGENTS_LINK" ]; then
echo "Warning: .agents/skills/gstack is a real directory, skipping." >&2
fi
if [ ! -e "$AGENTS_LINK" ]; then
ln -s "$REPO_ROOT" "$AGENTS_LINK"
fi
# 6. Run setup via the symlink so it detects .claude/skills/ as its parent
"$GSTACK_LINK/setup"
echo ""
echo "Dev mode active. Skills resolve from this working tree."
echo " .claude/skills/gstack → $REPO_ROOT"
echo " .agents/skills/gstack → $REPO_ROOT"
echo "Edit any SKILL.md and test immediately — no copy/deploy needed."
echo ""
echo "To tear down: bin/dev-teardown"
+39 -22
View File
@@ -3,33 +3,50 @@
set -e
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
SKILLS_DIR="$REPO_ROOT/.claude/skills"
if [ ! -d "$SKILLS_DIR" ]; then
echo "Nothing to tear down — .claude/skills/ doesn't exist."
exit 0
fi
# Remove individual skill symlinks
removed=()
for link in "$SKILLS_DIR"/*/; do
name="$(basename "$link")"
[ "$name" = "gstack" ] && continue
if [ -L "${link%/}" ]; then
rm "${link%/}"
removed+=("$name")
fi
done
# Remove the gstack symlink
if [ -L "$SKILLS_DIR/gstack" ]; then
rm "$SKILLS_DIR/gstack"
removed+=("gstack")
# ─── Clean up .claude/skills/ ─────────────────────────────────
CLAUDE_SKILLS="$REPO_ROOT/.claude/skills"
if [ -d "$CLAUDE_SKILLS" ]; then
for link in "$CLAUDE_SKILLS"/*/; do
name="$(basename "$link")"
[ "$name" = "gstack" ] && continue
if [ -L "${link%/}" ]; then
rm "${link%/}"
removed+=("claude/$name")
fi
done
if [ -L "$CLAUDE_SKILLS/gstack" ]; then
rm "$CLAUDE_SKILLS/gstack"
removed+=("claude/gstack")
fi
rmdir "$CLAUDE_SKILLS" 2>/dev/null || true
rmdir "$REPO_ROOT/.claude" 2>/dev/null || true
fi
# Clean up empty dirs
rmdir "$SKILLS_DIR" 2>/dev/null || true
rmdir "$REPO_ROOT/.claude" 2>/dev/null || true
# ─── Clean up .agents/skills/ ────────────────────────────────
AGENTS_SKILLS="$REPO_ROOT/.agents/skills"
if [ -d "$AGENTS_SKILLS" ]; then
for link in "$AGENTS_SKILLS"/*/; do
name="$(basename "$link")"
[ "$name" = "gstack" ] && continue
if [ -L "${link%/}" ]; then
rm "${link%/}"
removed+=("agents/$name")
fi
done
if [ -L "$AGENTS_SKILLS/gstack" ]; then
rm "$AGENTS_SKILLS/gstack"
removed+=("agents/gstack")
fi
rmdir "$AGENTS_SKILLS" 2>/dev/null || true
rmdir "$REPO_ROOT/.agents" 2>/dev/null || true
fi
if [ ${#removed[@]} -gt 0 ]; then
echo "Removed: ${removed[*]}"