forked from bchanot/claude
feat(vendor): pin Modern Web Guidance v1.0.1 and chrome-extensions, doctor checks the pin
This commit is contained in:
1 parent
04b2d6a4cd
commit
8a8d77f98e
8 files changed
+114
-3
No files matched your search
@@ -12,6 +12,7 @@ skills/test-driven-development
|
||||
skills/requesting-code-review
|
||||
skills/using-git-worktrees
|
||||
skills/writing-skills
|
||||
skills/chrome-extensions
|
||||
|
||||
# Impeccable — `impeccable skills install --scope=global` writes
|
||||
# impeccable/ into the skills dir through the ~/.claude/skills symlink; install-plugins.sh
|
||||
@@ -150,6 +151,14 @@ skills-external/requesting-code-review/
|
||||
skills-external/using-git-worktrees/
|
||||
skills-external/writing-skills/
|
||||
|
||||
# Modern Web Guidance, vendored (plugins.lock.json 'modern-web-guidance',
|
||||
# managed_by git-tree) — machine-owned, fetched at the pinned commit by
|
||||
# install-plugins.sh Step 8e and update-all.sh 7.3 through
|
||||
# lib/vendor-skills.sh vendor_pinned_tree. Bump the commit deliberately.
|
||||
skills-external/mwg/
|
||||
skills-external/chrome-extensions/
|
||||
skills-external/.vendor-stage.*/
|
||||
|
||||
# 21st.dev skill pack — machine-owned: `21st skills install` output, staged by
|
||||
# install-plugins.sh Step 8.7 (the installer refuses to write through the
|
||||
# ~/.claude/skills symlink, so it runs under a throwaway HOME and the skills
|
||||
|
||||
@@ -131,6 +131,7 @@ echo ""
|
||||
# ────────────────────────────────────────────────────────────
|
||||
echo "── Vendored skills ──"
|
||||
check_vendored_skills "$REPO" "$HOME/.claude"
|
||||
check_vendored_trees "$REPO"
|
||||
|
||||
echo ""
|
||||
echo "── Profiles ──"
|
||||
|
||||
+4
-1
@@ -926,10 +926,13 @@ EXT_SKILL_NAMES=(observability-and-instrumentation deprecation-and-migration
|
||||
scroll-scrubbed-visual-sequence scroll-scrubbed-word-reveal
|
||||
scroll-progress-timeline brainstorming writing-plans
|
||||
subagent-driven-development test-driven-development
|
||||
requesting-code-review using-git-worktrees writing-skills)
|
||||
requesting-code-review using-git-worktrees writing-skills chrome-extensions)
|
||||
vendor_pinned_skills agent-skills
|
||||
vendor_pinned_skills mengto-skills
|
||||
vendor_pinned_skills superpowers
|
||||
if ! vendor_pinned_tree modern-web-guidance; then
|
||||
warn "Modern Web Guidance not vendored (previous copy kept, if any) — rerun: make plugin"
|
||||
fi
|
||||
for _ext_skill in "${EXT_SKILL_NAMES[@]}"; do
|
||||
if [ -L "$HOME/.claude/skills/$_ext_skill" ]; then
|
||||
ok "$_ext_skill symlink OK"
|
||||
|
||||
+46
-1
@@ -227,6 +227,51 @@ check skipped"
|
||||
item-name allowlist — skipped"
|
||||
continue
|
||||
fi
|
||||
_dv_check_name "$repo" "$claude_home" "$name" "$lock_out"
|
||||
# fail() reports a miss; doctor.sh (set -e) still reaches its summary.
|
||||
_dv_check_name "$repo" "$claude_home" "$name" "$lock_out" || true
|
||||
done <<< "$names"
|
||||
}
|
||||
|
||||
# _dv_tree_expectations <lockfile> — prints "<key>\t<dest>\t<commit>" for
|
||||
# every "managed_by": "git-tree" entry; dest and commit format-checked,
|
||||
# an invalid one skipped. Lockfile via argv, stderr discarded.
|
||||
_dv_tree_expectations() {
|
||||
python3 - "$1" 2>/dev/null <<'PY'
|
||||
import json, re, sys
|
||||
NAME = re.compile(r'^[A-Za-z0-9_-][A-Za-z0-9._-]*$')
|
||||
COMMIT = re.compile(r'^[0-9a-f]{40}$')
|
||||
with open(sys.argv[1]) as f:
|
||||
data = json.load(f)
|
||||
for key, entry in sorted(data.items()):
|
||||
if not isinstance(entry, dict) or entry.get("managed_by") != "git-tree":
|
||||
continue
|
||||
sha = entry.get("commit", "")
|
||||
trees = entry.get("trees", {})
|
||||
if not COMMIT.fullmatch(sha) or not isinstance(trees, dict):
|
||||
continue
|
||||
for dest in sorted(trees):
|
||||
if NAME.fullmatch(dest):
|
||||
print(f"{key}\t{dest}\t{sha}")
|
||||
PY
|
||||
}
|
||||
|
||||
# check_vendored_trees <repo> — every git-tree dest exists under
|
||||
# skills-external/ with a .vendored-commit equal to its pin. Never fails
|
||||
# and never trips doctor.sh's errexit: a missing or stale copy is a warn
|
||||
# naming `make plugin`.
|
||||
check_vendored_trees() {
|
||||
local repo="$1" key dest sha got
|
||||
while IFS=$'\t' read -r key dest sha; do
|
||||
[ -n "$key" ] || continue
|
||||
got="$(cat "$repo/skills-external/$dest/.vendored-commit" \
|
||||
2>/dev/null || true)"
|
||||
if [ -z "$got" ]; then
|
||||
warn "$key: skills-external/$dest missing — run: make plugin"
|
||||
elif [ "$got" != "$sha" ]; then
|
||||
warn "$key: skills-external/$dest at ${got:0:7}, pin ${sha:0:7} \
|
||||
— run: make plugin"
|
||||
else
|
||||
pass "$key: $dest at pin ${sha:0:7}"
|
||||
fi
|
||||
done < <(_dv_tree_expectations "$repo/plugins.lock.json")
|
||||
}
|
||||
@@ -183,5 +183,40 @@ check_bool REJECTS_BAD_NAME \
|
||||
&& ! printf '%s' "$out5" | grep -qF '../evil: symlink' \
|
||||
&& echo 1 || echo 0)"
|
||||
|
||||
# ── check_vendored_trees: git-tree lock entries; doctor survives errexit ──
|
||||
TR="$WORK/trees"
|
||||
mkdir -p "$TR/skills-external/at-pin" "$TR/skills-external/stale"
|
||||
printf '%s\n' 1111111111111111111111111111111111111111 \
|
||||
> "$TR/skills-external/at-pin/.vendored-commit"
|
||||
printf '%s\n' 2222222222222222222222222222222222222222 \
|
||||
> "$TR/skills-external/stale/.vendored-commit"
|
||||
cat > "$TR/plugins.lock.json" <<'JSON'
|
||||
{"t": {"managed_by": "git-tree", "commit": "1111111111111111111111111111111111111111",
|
||||
"trees": {"at-pin": {"x": "a"}, "stale": {"x": "a"}, "absent": {"x": "a"}}},
|
||||
"c": {"managed_by": "curl", "commit": "1111111111111111111111111111111111111111", "skills": ["s"]}}
|
||||
JSON
|
||||
printf 'EXTERNAL_SKILLS=(\n ghost-ext\n)\n' > "$TR/link.sh"
|
||||
out_t="$(check_vendored_trees "$TR" 2>&1)"
|
||||
printf '%s\n' "$out_t" | grep -q 't: at-pin at pin 1111111' && R1=1 || R1=0
|
||||
printf '%s\n' "$out_t" | grep -q 't: skills-external/stale at 2222222, pin 1111111' && R2=1 || R2=0
|
||||
printf '%s\n' "$out_t" | grep -q 't: skills-external/absent missing' && R3=1 || R3=0
|
||||
# Positive control first: the three lines above must exist.
|
||||
[ "$R1$R2$R3" = 111 ] && ! printf '%s\n' "$out_t" | grep -q '✗' \
|
||||
&& R4=1 || R4=0
|
||||
# doctor.sh runs under `set -euo pipefail`: a missing tree dest and a
|
||||
# missing external copy are reported and doctor goes on to its summary.
|
||||
# shellcheck disable=SC2016
|
||||
out_e="$(bash -c 'set -euo pipefail; source "$1"
|
||||
check_vendored_trees "$2"; check_vendored_skills "$2" "$2/home"
|
||||
echo DOCTOR_GOES_ON' _ "$LIB" "$TR" 2>&1)"
|
||||
printf '%s\n' "$out_e" | grep -qx 'DOCTOR_GOES_ON' \
|
||||
&& printf '%s\n' "$out_e" | grep -q 'ghost-ext: skills-external/ghost-ext/SKILL.md missing' \
|
||||
&& R5=1 || R5=0
|
||||
check_bool TREES_AT_PIN "$R1"
|
||||
check_bool TREES_STALE_WARN "$R2"
|
||||
check_bool TREES_MISSING_WARN "$R3"
|
||||
check_bool TREES_NEVER_FAIL "$R4"
|
||||
check_bool TREES_ERREXIT_SURVIVES "$R5"
|
||||
|
||||
echo "PASS=$pass FAIL=$fail"
|
||||
[ "$fail" -eq 0 ]
|
||||
@@ -78,7 +78,7 @@ fi
|
||||
EXTERNAL_SKILLS=(observability-and-instrumentation deprecation-and-migration
|
||||
ci-cd-and-automation brainstorming writing-plans
|
||||
subagent-driven-development test-driven-development
|
||||
requesting-code-review using-git-worktrees writing-skills)
|
||||
requesting-code-review using-git-worktrees writing-skills chrome-extensions)
|
||||
for _ext_skill in "${EXTERNAL_SKILLS[@]}"; do
|
||||
if [ -d "$REPO/skills-external/$_ext_skill" ]; then
|
||||
if [ -L "$CLAUDE/skills/$_ext_skill" ] && [ "$(readlink "$CLAUDE/skills/$_ext_skill")" = "$REPO/skills-external/$_ext_skill" ]; then
|
||||
|
||||
@@ -86,6 +86,19 @@
|
||||
"always_on": true,
|
||||
"note": "Seven superpowers skills vendored byte-for-byte at the v6.4.1 tag commit (obra/superpowers), always on (no profile lists them). Bump the commit deliberately. Scripts inside run as `bash scripts/<x>`, no exec bit needed. Upstream cross-references to the plugin prefix and to the 8 non-vendored skills stay in the text; CLAUDE.global.md Skill routing maps them."
|
||||
},
|
||||
"modern-web-guidance": {
|
||||
"source": "https://github.com/GoogleChrome/modern-web-guidance",
|
||||
"commit": "64a6d708f5a43f2cd3fde5d4d7db3905ba1bdf65",
|
||||
"tag": "v1.0.1",
|
||||
"license": "Apache-2.0 (code), CC-BY 4.0 (guides)",
|
||||
"managed_by": "git-tree",
|
||||
"always_on": true,
|
||||
"trees": {
|
||||
"mwg": {"guides": "skills/modern-web-guidance/guides", "LICENSE": "LICENSE", "README.md": "README.md"},
|
||||
"chrome-extensions": {".": "skills/chrome-extensions"}
|
||||
},
|
||||
"note": "Google Modern Web Guidance (Chrome, Edge, Firefox, MDN). Guides read locally by skills/modern-web-guidance; the upstream SKILL.md (npx @latest) is never copied. README.md feeds INDEX.md descriptions. chrome-extensions linked as is by link.sh. Bump commit + tag deliberately."
|
||||
},
|
||||
"impeccable": {
|
||||
"source": "npm:impeccable",
|
||||
"version": "4.1.0",
|
||||
|
||||
@@ -381,6 +381,11 @@ vendor_pinned_skills mengto-skills refresh
|
||||
echo ""
|
||||
echo "── Updating superpowers skills (obra/superpowers)..."
|
||||
vendor_pinned_skills superpowers refresh
|
||||
echo ""
|
||||
echo "── Updating Modern Web Guidance (GoogleChrome/modern-web-guidance)..."
|
||||
if ! vendor_pinned_tree modern-web-guidance; then
|
||||
warn "Modern Web Guidance not vendored (previous copy kept, if any) — rerun: make update"
|
||||
fi
|
||||
|
||||
# ── Impeccable (design detector + skill + subagents) ──
|
||||
# Global scope: the installer writes through the ~/.claude/{skills,agents}
|
||||
|
||||
Reference in new issue
Block a user