fix(skills): bstack-skills install lands every skill, status-visibly (BRO-1588)#83
Conversation
…(BRO-1588) The real `bstack-skills install` only installed the FIRST roster skill then stopped (`Installed: 1`), and that skill landed where `status` couldn't see it. Two compounding defects in cmd_install, caught by a clean-room end-to-end dogfood: - stdin drain: the loop reads the roster via `done < <(parse_roster)`, so the loop body's stdin IS that pipe; the per-skill `npx skills add` subprocess drained the remaining rows and the loop EOF'd after skill #1. Fix: `</dev/null` on the npx call. Empirically 1/13 -> 13/13 required installed. - global-install landing: add_args lacked `-g`, so installs went cwd-relative (./.agents/skills) while status checks ~/.{agents,claude}/skills. Fix: append `-g`. status then reconciles. Exits 0 even when exotic agents reject global. - interactive read (latent, same root cause): read roster rows as the y/N answer; now reads </dev/tty, declining safely under set -e when there is no tty. Regression test tests/skills-install-no-stdin-drain.test.sh mocks an NPX_CMD that drains stdin (like the real CLI) and asserts every roster skill is attempted (N, not 1) — proven red on pre-fix code, green on fixed. skills-install-uses- skill-flag.test.sh gains a -g assertion. Full tests/*.test.sh suite: 24/24. Pre-existing (predates the BRO-1584 --skill change). P20 cross-review: PASS 7/10. VERSION 0.28.0 -> 0.28.1. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughVersion 0.28.1 fixes three bugs in Changesbstack-skills install fixes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
VERSION (1)
1-2: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick winFix VERSION file to pass semver validation.
The pipeline fails because
VERSIONcontains a trailing newline/blank line, so the regex^[0-9]+\.[0-9]+\.[0-9]+$does not match. Remove the extra blank line at the end so the file contains exactly0.28.1with no trailing whitespace or empty lines.🔧 Proposed fix
-0.28.1 +0.28.1🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@VERSION` around lines 1 - 2, The VERSION file content is failing semver validation because it includes a trailing newline/blank line after the version string. Update VERSION so it contains only the exact version value already present, with no extra whitespace or empty lines; ensure the file ends immediately after the version text.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@VERSION`:
- Around line 1-2: The VERSION file content is failing semver validation because
it includes a trailing newline/blank line after the version string. Update
VERSION so it contains only the exact version value already present, with no
extra whitespace or empty lines; ensure the file ends immediately after the
version text.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 31ec5dd6-bdfe-4a00-9251-eef0955d3a9c
📒 Files selected for processing (5)
CHANGELOG.mdVERSIONbin/bstack-skillstests/skills-install-no-stdin-drain.test.shtests/skills-install-uses-skill-flag.test.sh
|
Re: CodeRabbit's The |
What & why
A clean-room end-to-end dogfood of the merged skills-monorepo setup (BRO-1570/1575/1584/1586) caught a real production defect: every guard test and the mocked install test pass, but the real
bstack-skills installonly installs the first roster skill then silently stops (Installed: 1), and even that one lands wherestatuscan't see it.Closes BRO-1588.
Root cause — two compounding defects in
cmd_installdone < <(parse_roster), so the loop body's stdin (fd 0) is that pipe. The per-skill$NPX_CMD …call had no stdin redirect, so the realnpx skills addsubprocess drained the remaining roster rows off the pipe and the enclosingreadhit EOF after skill feat(bstack): add P9 (CI watcher + productive-wait) to Foundation layer #1.… </dev/null >/dev/null 2>&1. Empirically 1/13 → 13/13 required installed.--skillchange; any stdin-reading subprocess in that loop drains it. Hits the production defaultNPX_CMD="npx --yes skills add"equally.add_argslacked-g, so the skills CLI installed cwd-relative (./.agents/skills), whilestatusonly checks~/.agents/skills+~/.claude/skills.-g.statusthen reconciles (13/61 installed). Exits 0 even when exotic agents (Eve/PromptScript) reject global install — the canonical.agents/.claudecopies still land.--interactive'sread -r -p … replyread roster rows as the y/N answer. Now reads</dev/tty, with|| reply="N"so it declines safely underset -ewhen there's no tty (CI/cron/piped) instead of aborting.Tests
tests/skills-install-no-stdin-drain.test.sh— mocks anNPX_CMDthat drains stdin (like the real CLI) and asserts every roster skill is attempted (count == N, not 1). The existingskills-install-uses-skill-flag.test.shmock does not read stdin, so it could never catch this. Proven red on pre-fix code (1/4) → green on fixed (4/4); deterministic over 5 runs.skills-install-uses-skill-flag.test.shgains a-gassertion (every install is global / status-visible).tests/*.test.shsuite: 24/24. shellcheck clean (CI profile).Validation evidence (P11)
autonomousonly (1/13), loop stops.</dev/null:Installed: 13, skipped: 0, failed: 0;bstack-skills status→13/61 installed.-glandskgin~/.agents/skills; status reportsinstalled.--interactive:reply=N, exit 0 (declines, no abort).P20 cross-model adversarial review — PASS (7/10), no must-fix
Acted on two should-considers from the review: hardened the
--interactiveno-tty path (|| reply="N") and scoped the CHANGELOG-glanding claim. Documented should-considers left for follow-up:is_installedreports a clean-HOME false-green (skill in~/.agents/skillsbut no~/.claude/skillssymlink when~/.claudedoesn't pre-exist). Pre-existingis_installedweakness; in practicebstack skills installruns from inside a Claude Code session where~/.claudeexists. Candidate follow-up: tightenis_installedto assert the~/.claude/skills/<name>entry.mapfilepre-read would kill the bug class. Deferred (bash-3.2 empty-array-under-set -uportability); current fix is complete for today's code.Notes
VERSION0.28.0 → 0.28.1.🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests