From 77624d785453e38ea4b4baab61691041d2b1f402 Mon Sep 17 00:00:00 2001 From: Koshkoshinsk Date: Sun, 19 Apr 2026 11:05:54 +0000 Subject: [PATCH] fix(new-setup): wrap probe in shell script for single-command permission check The chained `&& / ||` inline command tripped Claude Code's per-operation permission check. Move the Node-missing fallback into setup/probe.sh so the skill's `!` block is a single `bash setup/probe.sh` call. Co-Authored-By: Claude Opus 4.7 (1M context) --- .claude/skills/new-setup/SKILL.md | 4 ++-- setup/probe.sh | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100755 setup/probe.sh diff --git a/.claude/skills/new-setup/SKILL.md b/.claude/skills/new-setup/SKILL.md index 3643b92..4c2a1fe 100644 --- a/.claude/skills/new-setup/SKILL.md +++ b/.claude/skills/new-setup/SKILL.md @@ -1,7 +1,7 @@ --- name: new-setup description: Shortest path from zero to a working two-way agent chat, for any user regardless of technical background — ends at a running NanoClaw instance with at least one CLI-reachable agent. -allowed-tools: Bash(bash setup.sh) Bash(node setup/probe.mjs) Bash(pnpm exec tsx setup/index.ts *) Bash(pnpm run chat *) Bash(brew install *) Bash(curl -fsSL https://get.docker.com | sh) Bash(sudo usermod -aG docker *) Bash(open -a Docker) Bash(sudo systemctl start docker) +allowed-tools: Bash(bash setup.sh) Bash(bash setup/probe.sh) Bash(pnpm exec tsx setup/index.ts *) Bash(pnpm run chat *) Bash(brew install *) Bash(curl -fsSL https://get.docker.com | sh) Bash(sudo usermod -aG docker *) Bash(open -a Docker) Bash(sudo systemctl start docker) --- # NanoClaw bare-minimum setup @@ -18,7 +18,7 @@ Start with a probe: a single parallel scan that snapshots every prerequisite and ## Current state -!`command -v node >/dev/null 2>&1 && node setup/probe.mjs || printf '=== NANOCLAW SETUP: PROBE ===\nSTATUS: unavailable\nREASON: node_not_installed\n=== END ===\n'` +!`bash setup/probe.sh` ## Flow diff --git a/setup/probe.sh b/setup/probe.sh new file mode 100755 index 0000000..8be2948 --- /dev/null +++ b/setup/probe.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Wrapper for setup/probe.mjs so /new-setup's inline `!` block is a single +# shell command (permission-check friendly). When Node isn't installed yet, +# emit an "unavailable" status block so the skill's flow knows to skip the +# probe's skip-if conditions and run every step from 1. +set -u + +PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" + +if command -v node >/dev/null 2>&1; then + exec node "$PROJECT_ROOT/setup/probe.mjs" "$@" +fi + +cat <<'EOF' +=== NANOCLAW SETUP: PROBE === +STATUS: unavailable +REASON: node_not_installed +=== END === +EOF