mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-29 19:34:29 +01:00
gstack's shipping skill now installs as `/gstack-ship`, because Claude Code keeps the name `/ship` for its own built-in and silently drops gstack's. Upgrading removes gstack's old `ship` entry and leaves your own `ship` skill alone. The resume command and most recovery messages now say `/gstack-ship`; nothing to do but upgrade. This replaces #4813, which ran out of budget before its last fixes. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> Review-Finding: p2/adversarial-native#1 reader=adversarial-native Review-Finding: p2/outside-voice#3 reader=outside-voice Review-Finding: p2/outside-voice#4 reader=outside-voice Review-Finding: p2/outside-voice#1 reader=outside-voice Review-Finding: p2/outside-voice#2 reader=outside-voice Review-Finding: p2/red-team#1 reader=red-team Review-Finding: p3/outside-voice#1 reader=outside-voice Review-Finding: p3/outside-voice#3 reader=outside-voice Review-Finding: p7/outside-voice#1 reader=outside-voice
50 lines
2.2 KiB
Bash
50 lines
2.2 KiB
Bash
# shellcheck shell=bash
|
|
# gstack-skill-name.sh: sourced helper (bash 3.2). gstack_skill_md_name FILE
|
|
# sets GSTACK_SKILL_NAME to the first column-0 "name:" line of FILE with every
|
|
# whitespace character removed (CR included), or to "" when there is none or
|
|
# FILE cannot be read. Always returns 0.
|
|
#
|
|
# It starts no process: no subshell, pipe or command substitution, and callers
|
|
# must not wrap it in $( ). Setup reads ~55 names per run, and the
|
|
# grep | sed | tr pipeline it replaces deadlocked MSYS2's fork() under x64
|
|
# emulation on Windows ARM64 (#2120).
|
|
gstack_skill_md_name() {
|
|
GSTACK_SKILL_NAME=
|
|
[ -f "$1" ] && [ -r "$1" ] || return 0
|
|
local _gsn_line
|
|
while IFS= read -r _gsn_line || [ -n "$_gsn_line" ]; do
|
|
case "$_gsn_line" in
|
|
name:*) _gsn_line=${_gsn_line#name:}; GSTACK_SKILL_NAME=${_gsn_line//[[:space:]]/}; return 0 ;;
|
|
esac
|
|
done < "$1"
|
|
return 0
|
|
}
|
|
|
|
# GSTACK_RENDER_NAMES is written into a render's .overlay record as
|
|
# names=<it> (gstack_claude_render_settle). A record without it, or with an
|
|
# older value, comes from a gstack whose always-prefixed skills still had
|
|
# their plain names (#4775).
|
|
GSTACK_RENDER_NAMES=2
|
|
|
|
# gstack_render_serves RENDER_DIR SKILL returns 0 when RENDER_DIR's copy of
|
|
# SKILL may be served instead of the checkout's. An always-prefixed skill
|
|
# (GSTACK_PREFIXED_SKILLS, bin/gstack-install-registry.sh) is served from a
|
|
# render only when the render's record carries names=$GSTACK_RENDER_NAMES: a
|
|
# render made before the skill took its gstack- name, which a failed
|
|
# regeneration keeps with its old record, still says to run the plain name the
|
|
# host's built-in hides. A per-install render (GSTACK_USER_RENDER_PER_INSTALL=1)
|
|
# is always served: it is the only copy that names its install root, and the
|
|
# checkout's copy would run the default install. Starts no process, like the
|
|
# helper above.
|
|
gstack_render_serves() {
|
|
[ -f "$1/$2/SKILL.md" ] || return 1
|
|
[ "${GSTACK_USER_RENDER_PER_INSTALL:-}" != 1 ] || return 0
|
|
case " ${GSTACK_PREFIXED_SKILLS:-} " in *" $2 "*) ;; *) return 0 ;; esac
|
|
[ -f "$1.overlay" ] || return 1
|
|
local _grs_line
|
|
while IFS= read -r _grs_line || [ -n "$_grs_line" ]; do
|
|
[ "${_grs_line//[[:space:]]/}" = "names=$GSTACK_RENDER_NAMES" ] && return 0
|
|
done < "$1.overlay"
|
|
return 1
|
|
}
|