fix(phase5): final review wave: cc.sh width, design-gate remedy + resolve check, routing test on a fresh clone, doctor fail-closed, dead column

This commit is contained in:
bchanot committed 2026-11-02 09:47:13 +01:00
1 parent fc6e270b7c
commit 04b9b865f8
10 files changed
+84 -36

No files matched your search

+2 -1
View File
@@ -30,7 +30,8 @@ cc() {
fi
fi
mkdir -p "$HOME/.cache/claude-tmp" "$HOME/.dtach"
# shellcheck disable=SC2016,SC1003 # the inner shell expands $HOME; '^\' is dtach's detach key
# The inner shell expands $HOME; '^\' is dtach's detach key.
# shellcheck disable=SC2016,SC1003
CLAUDE_PROFILE="$profile" CLAUDE_PROFILE_SETTINGS="$settings" \
TMPDIR="$HOME/.cache/claude-tmp" \
systemd-run --user --quiet --collect --scope --slice=dev.slice \
+37 -11
View File
@@ -15,16 +15,20 @@
# Remedy on 10: source=flag → relaunch `cc <name> web` (a --settings
# conversation is frozen); else `profile.sh set web` (or `enable design`)
# then /reload-plugins. The CLI is a global npm install either way.
# Usage: design-tool-gate.sh (no argument; env DESIGN_GATE_PROFILE_SH)
# READY also needs the packs to resolve: every skills/pack-<n>/skills/*
# entry of pack-design and pack-gstack-design must have a SKILL.md.
# Usage: design-tool-gate.sh (no argument; env DESIGN_GATE_PROFILE_SH,
# DESIGN_GATE_SKILLS_DIR)
# ============================================================
set -euo pipefail
REPO="$(cd -P "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
PROFILE_SH="${DESIGN_GATE_PROFILE_SH:-$REPO/lib/profile.sh}"
SKILLS_DIR="${DESIGN_GATE_SKILLS_DIR:-$REPO/skills}"
NEEDED=(pack-design pack-gstack-design
"plugin:ui-ux-pro-max@ui-ux-pro-max-skill")
# ---- 21st CLI on PATH + sign-in state (kept from the previous version) ----
# ---- 21st CLI on PATH + sign-in state ---------------------------------------
# Same sanitized-PATH problem for `21st` (an npm global bin): a PATH repair
# for the 21st CLI only (claude is no longer called here). The npm global
# bin dir is often missing from a hook's PATH. Probe for the binary directly
@@ -94,6 +98,13 @@ for k in "${NEEDED[@]}"; do
[ "$(plain_get "$k")" = on ] || missing+=("$k")
done
source="$(plain_get source)"; profile="$(plain_get profile)"
dangling=()
for n in design gstack-design; do
for e in "$SKILLS_DIR/pack-$n/skills/"*; do
[ -e "$e" ] || [ -L "$e" ] || continue
[ -e "$e/SKILL.md" ] || dangling+=("pack-$n:${e##*/}")
done
done
# ---- 21st: CLI present, then signed in ---------------------------------------
cli_hint=""; auth=in
@@ -103,19 +114,34 @@ else
auth="$(twentyfirst_auth_state)"
fi
# ---- verdict -----------------------------------------------------------------
if [ "${#missing[@]}" -gt 0 ] || [ -n "$cli_hint" ]; then
echo "design toolchain: INCOMPLETE"
[ "${#missing[@]}" -gt 0 ] && echo " off: ${missing[*]}"
[ -n "$cli_hint" ] && echo "$cli_hint"
# ---- remedy lines: set web, one enable per missing pack ---------------------
print_remedy() {
local k
if [ "$source" = flag ]; then
echo " → relaunch this conversation with a design profile:" \
" cc <name> web"
else
echo " → run: bash ~/.claude/lib/profile.sh set web" \
" (or: enable design)"
echo " then /reload-plugins"
return
fi
echo " → run: bash ~/.claude/lib/profile.sh set web"
for k in "${missing[@]}"; do
case "$k" in
pack-*) echo " or: profile.sh enable ${k#pack-}" ;;
*) echo " (enable the plugin in a profile: set web)" ;;
esac
done
echo " then /reload-plugins"
}
# ---- verdict -----------------------------------------------------------------
if [ "${#missing[@]}" -gt 0 ] || [ "${#dangling[@]}" -gt 0 ] \
|| [ -n "$cli_hint" ]; then
echo "design toolchain: INCOMPLETE"
[ "${#missing[@]}" -gt 0 ] && echo " off: ${missing[*]}"
for e in ${dangling[@]+"${dangling[@]}"}; do
echo " not installed: $e (run make plugin)"
done
[ -n "$cli_hint" ] && echo "$cli_hint"
[ "${#missing[@]}" -gt 0 ] && print_remedy
exit 10
fi
case "$auth" in
+5 -9
View File
@@ -4,9 +4,8 @@
# skills (curl-pinned externals in plugins.lock.json + link.sh's
# EXTERNAL_SKILLS array). doctor.sh's "GStack submodule" section only
# covers the gstack submodule — this covers the OTHER external skill
# packs (emil-design-eng, the agent-skills trio, the five Mengto scroll
# skills, the seven superpowers skills, and any name link.sh links with
# no lock entry at all, e.g. frontend-design, design-motion-principles).
# packs (the agent-skills trio, the seven superpowers skills, and any
# name link.sh links with no lock entry at all).
#
# One entry point, `check_vendored_skills <repo> <claude_home>`, sourced
# and called by doctor.sh. Two things checked
@@ -56,9 +55,7 @@ fi
# _dv_lock_expectations <lockfile> — prints "<name>\t<file>" for every
# skill named under a plugins.lock.json entry whose "managed_by" is
# "curl", plus a THIRD column "\t1" when that entry is "always_on": true
# (the superpowers entry is), ignored by the
# $1==n {print $2} awk in _dv_check_files: a bare list defaults each name
# "curl". A bare list defaults each name
# to ["SKILL.md"]; a dict names its own per-skill file list; an entry
# with neither (the emil-design-eng single-file "path" shape) is itself
# the skill name, file "SKILL.md" (the literal "path" value is upstream
@@ -116,13 +113,12 @@ for key, entry in data.items():
sys.exit(1)
if not valid_skills(skills):
sys.exit(1)
suffix = "\t1" if entry.get("always_on") is True else ""
if skills is None:
print(f"{key}\tSKILL.md{suffix}")
print(f"{key}\tSKILL.md")
continue
for name, files in skill_files(skills).items():
for file in files:
print(f"{name}\t{file}{suffix}")
print(f"{name}\t{file}")
PY
}
+13 -1
View File
@@ -21,6 +21,7 @@ if PATH=/usr/bin:/bin command -v 21st >/dev/null 2>&1 \
fi
WORK="$(mktemp -d)"; trap 'rm -rf "$WORK"' EXIT
mkdir -p "$WORK/bin" "$WORK/home"; export WORK
export DESIGN_GATE_SKILLS_DIR="$WORK/none"
printf '#!/usr/bin/env bash\ncat "$WORK/plain.txt"\n' > "$WORK/bin/profile.sh"
cat > "$WORK/bin/21st" <<'EOF'
#!/usr/bin/env bash
@@ -49,11 +50,22 @@ expect T1-ready 0 "READY — packs design + gstack-design + ui-ux-pro-max on (we
plain off on on local dev; out="$(gate_run in "$WORK/bin")"; rc=$?
expect T2-incomplete 10 "INCOMPLETE"; expect T2-remedy-local 10 "bash ~/.claude/lib/profile.sh set web"
expect T2-names 10 "off: pack-design"
expect T2-enable 10 "profile.sh enable design"
plain on off off flag dev; out="$(gate_run in "$WORK/bin")"; rc=$?
expect T3-remedy-flag 10 "relaunch this conversation with a design profile: cc <name> web"
expect T3-names 10 "off: pack-gstack-design plugin:ui-ux-pro-max@ui-ux-pro-max-skill"
plain on on on local web; out="$(gate_run in "")"; rc=$?
plain on on off local web; out="$(gate_run in "$WORK/bin")"; rc=$?
expect T3a-plugin 10 "enable the plugin in a profile: set web"
plain on on on local web
mkdir -p "$WORK/repo/skills/pack-design/skills"
ln -s /nonexistent "$WORK/repo/skills/pack-design/skills/x"
out="$(DESIGN_GATE_SKILLS_DIR="$WORK/repo/skills" gate_run in "$WORK/bin")"
rc=$?
expect T3b-dangling 10 "not installed: pack-design:x (run make plugin)"
rm -r "$WORK/repo"
out="$(gate_run in "")"; rc=$?
expect T4-no-cli 10 "21st needs the CLI: npm i -g @21st-dev/cli then 21st login"
case "$out" in *"profile.sh set web"*) bad T4-no-remedy "pack remedy shown";; *) ok T4-no-remedy;; esac
out="$(gate_run out "$WORK/bin")"; rc=$?
expect T5-signed-out 12 "SIGN-IN REQUIRED"; expect T5-ask 12 "! 21st login"
out="$(gate_run garbage "$WORK/bin")"; rc=$?
+3 -2
View File
@@ -3,10 +3,11 @@
# check_vendored_skills(): a fixture repo under mktemp with a fake
# plugins.lock.json (single-path shape, list shape, dict shape with a
# references/ file), a fake link.sh holding a multi-line
# EXTERNAL_SKILLS=(...) array and a fake <claude_home>/skills dir. Cases: every file present + linked (ALL_PRESENT), a
# EXTERNAL_SKILLS=(...) array and a fake <claude_home>/skills dir.
# Cases: every file present + linked (ALL_PRESENT), a
# list-shape skill missing its SKILL.md (FILE_MISSING), a dict-shape
# skill missing one of two files — only that file is named
# (DICT_FILES_COMPLETE), a profile-listed name with no symlink
# (DICT_FILES_COMPLETE), a linked name with no symlink
# (SYMLINK_MISSING_ACTIVE) or a symlink to the wrong target
# (SYMLINK_WRONG_TARGET), an unreadable lock file degrading to a
# warn instead of a fail (LOCK_UNREADABLE, rc 0), a lock entry whose
+10 -4
View File
@@ -159,15 +159,21 @@ while IFS= read -r f; do check_skill "$f"; done < <(
cd "$R" && git ls-files 'skills/*/SKILL.md' 'skills-external/*/SKILL.md')
# ── (b2) every skills row resolves to a skill (short, pack entry, parked) ─
ext_named() { # ext_named <k>: <k> is in link.sh EXTERNAL_SKILLS
sed -n '/^EXTERNAL_SKILLS=(/,/)/p' "$R/link.sh" | grep -qw -- "$1"
}
row_resolves() { # row_resolves <key>
local k="$1" n
local k="$1" n p
case "$k" in
pack-*:*) n="${k%%:*}"; [ -e "$R/skills/$n/skills/${k#*:}/SKILL.md" ];;
*) [ -e "$R/skills/$k/SKILL.md" ] || [ -n "$(skdir "$k")" ] \
pack-*:*) n="${k%%:*}"; p="$R/skills/$n/skills/${k#*:}"
[ -L "$p" ] || [ -e "$p/SKILL.md" ];;
*) [ -e "$R/skills/$k/SKILL.md" ] || ext_named "$k" \
|| [ -L "$R/skills/$k" ] || [ -n "$(skdir "$k")" ] \
|| [ -e "$R/skills-external/$k/SKILL.md" ];;
esac
}
[ -n "$(skdir seo)" ] && ! row_resolves ghost-skill \
[ -L "$R/skills/pack-seo/skills/seo" ] || [ -d "$R/skills/pack-seo/skills/seo" ] \
&& ! row_resolves ghost-skill \
&& ! row_resolves pack-seo:ghost && ! row_resolves pack-ghost:seo \
&& ok || ko "row_resolves: flip-test (ghost rows must fail)"
while read -r kind key _; do