Skip to content

feat(cli-box-skill): interactive installer + slim postinstall (0.2.7)#40

Merged
Shadow-Azure merged 14 commits into
mainfrom
feat/cli-box-skill-installer-0.2.7
Jun 16, 2026
Merged

feat(cli-box-skill): interactive installer + slim postinstall (0.2.7)#40
Shadow-Azure merged 14 commits into
mainfrom
feat/cli-box-skill-installer-0.2.7

Conversation

@Shadow-Azure

Copy link
Copy Markdown
Owner

Problem

After npm install -g cli-box-skill, the skill was copied into every harness dir unconditionally (0.2.6 behavior). Users who only use one harness got it dropped into places they don't want, there was no way to choose the target, and OpenClaw (~/.openclaw/skills/) was not supported. The user wants to choose where the skill goes — interactively or via args — mirroring oh-my-openagent.

Solution

A dedicated cli-box-skill install command (mirrors oh-my-openagent; npm has no clean postinstall-param mechanism):

  • npx cli-box-skill install → interactive @clack/prompts multiselect (pre-checks detected harnesses)
  • cli-box-skill install claude opencode / install all / install --no-tui claude → explicit
  • Non-TTY + no target → exits 1 with guidance (never hangs)
  • postinstall.mjs slimmed to binaries-only + a guidance message (reverts 0.2.6's unconditional skill copy)
  • install.sh (curl) takes a target arg (claude|opencode|openclaw|all, or CLI_BOX_TARGETS env); prints a usage hint + exits 1 if none
  • Targets: Claude Code ~/.claude/skills/cli-box/, OpenCode ~/.config/opencode/skills/cli-box/, OpenClaw ~/.openclaw/skills/ (AgentSkills spec)
  • Zero-dep installer/shared.mjs (pure logic) + node:test unit + integration tests
  • READMEs/SKILL/installation.md carry one self-contained, AI-agent-executable sentence (npx cli-box-skill install all) + a human one-liner

Test Plan

  • packages/cli-box-skill/test/ — 15 node:test (9 shared logic + 6 CLI integration: install claude, install all, no-target→1, unknown→nonzero, --no-tui no-target→1, --no-tui claude→0)
  • tests/e2e-skill-install.sh — postinstall (binaries only, no skill copy); install.sh claude (target-only), no-target (exit 1 + hint), all (3 harnesses), mixed claude all (expands), unknown (nonzero)
  • test.sh wired with a "Skill Package Tests" (node --test) section
  • Final review found + fixed 2 Critical install.sh bugs (usage hint never printed; all mixed-target expansion); tests added to lock them
  • Merge → tag v0.2.7gh release create → CI builds + publishes 3 npm packages → out-of-the-box verify

🤖 Generated with Claude Code

ZN-Ice and others added 14 commits June 16, 2026 23:50
Design for a dedicated 'cli-box-skill install' command (commander +
@clack/prompts) that lets users choose Claude Code / OpenCode / OpenClaw,
mirroring oh-my-openagent's pattern. Slims postinstall to binaries-only +
guidance (reverting 0.2.6's unconditional skill copy). install.sh takes a
target arg (hint + exit if none). READMEs get an agent-executable sentence
plus a human one-liner.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…ent)

Co-Authored-By: Claude <noreply@anthropic.com>
…er/ files

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…de:test into test.sh

Rewrites tests/e2e-skill-install.sh to match the new installer behavior:
- Test 1: postinstall.mjs symlinks binaries and does NOT copy SKILL.md
- Test 2: install.sh <target> installs the skill into the chosen target
  only (claude), leaving other harness dirs untouched
- Test 2b: install.sh with no target exits 1

Wires the skill-package node:test suite (shared.test.mjs + cli.test.mjs)
into test.sh as a new "Skill Package Tests (node:test)" section that runs
before the E2E skill installation tests. Uses node --test with a glob
pattern (test/**/*.test.mjs) for Node 25 compatibility.

Co-Authored-By: Claude <noreply@anthropic.com>
…scovery

- tests/e2e-skill-install.sh: test_postinstall cleanup was rm -rf'ing the whole
  node_modules (inherited from when it only held the platform symlink), which
  nuked the legitimately-installed commander/@Clack and broke later node --test.
  Now removes only the cli-box-darwin-arm64 symlink it created.
- test.sh + package.json: use 'node --test' (auto-discovery) instead of
  'node --test test/' which fails with ERR_MODULE_NOT_FOUND on Node 25.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…ed (C1); add tests

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🔒 门禁检查结果

检查项 状态
Rust 格式化 ✅ success
Rust Clippy ✅ success
Rust 测试 & 覆盖率 ✅ success
前端测试 & 覆盖率 ✅ success
Playwright E2E ✅ success
统一测试 (test.sh) ✅ success
安全检查 ✅ success

Rust 测试覆盖率

指标 覆盖率
行覆盖率 66.0%
分支覆盖率 0.0%
模块 行覆盖率
crates.cli-box-core.src.daemon ██████████░░░░░░░░░░ 51.5%
crates.cli-box-core.src.capture ████████████████████ 100.0%
crates.cli-box-core.src.automation ███████████░░░░░░░░░ 58.3%
crates.cli-box-core.src.instance ███████████████████░ 99.1%
crates.cli-box-core.src.server █████████████████░░░ 87.7%
crates.cli-box-core.src.process █████████░░░░░░░░░░░ 46.4%
crates.cli-box-core.src ███████████░░░░░░░░░ 55.3%
crates.cli-box-core.src.sandbox ███████████████████░ 98.8%

详细报告见 Rust 覆盖率 artifact

前端测试覆盖率

指标 覆盖率
行覆盖率 ██████████████░░░░░░ 67.8%
分支覆盖率 57.3%
函数覆盖率 71.2%
语句覆盖率 67.6%
文件 行覆盖率
src/tests/mocks/websocket.ts ██████████████████░░ 88.0%
src/tests/mocks/xterm.ts ████████████████████ 100.0%
src/main/daemon-bridge.ts ████████░░░░░░░░░░░░ 40.0%
src/renderer/api.ts ██████████████░░░░░░ 68.2%
src/renderer/tabState.ts ████████████████████ 100.0%

详细报告见前端覆盖率 artifact

✅ 所有检查通过,可以合入

点击 Squash and merge 合并此PR

@Shadow-Azure
Shadow-Azure merged commit 7379338 into main Jun 16, 2026
9 checks passed
@Shadow-Azure
Shadow-Azure deleted the feat/cli-box-skill-installer-0.2.7 branch June 16, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant