feat(cli-box-skill): interactive installer + slim postinstall (0.2.7)#40
Merged
Conversation
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>
🔒 门禁检查结果
Rust 测试覆盖率
前端测试覆盖率
✅ 所有检查通过,可以合入
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 — mirroringoh-my-openagent.Solution
A dedicated
cli-box-skill installcommand (mirrors oh-my-openagent; npm has no clean postinstall-param mechanism):npx cli-box-skill install→ interactive@clack/promptsmultiselect (pre-checks detected harnesses)cli-box-skill install claude opencode/install all/install --no-tui claude→ explicitpostinstall.mjsslimmed 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, orCLI_BOX_TARGETSenv); prints a usage hint + exits 1 if none~/.claude/skills/cli-box/, OpenCode~/.config/opencode/skills/cli-box/, OpenClaw~/.openclaw/skills/(AgentSkills spec)installer/shared.mjs(pure logic) +node:testunit + integration testsnpx cli-box-skill install all) + a human one-linerTest Plan
packages/cli-box-skill/test/— 15node:test(9 shared logic + 6 CLI integration:install claude,install all, no-target→1, unknown→nonzero,--no-tuino-target→1,--no-tui claude→0)tests/e2e-skill-install.sh— postinstall (binaries only, no skill copy); install.shclaude(target-only), no-target (exit 1 + hint),all(3 harnesses), mixedclaude all(expands), unknown (nonzero)test.shwired with a "Skill Package Tests" (node --test) sectionallmixed-target expansion); tests added to lock themv0.2.7→gh release create→ CI builds + publishes 3 npm packages → out-of-the-box verify🤖 Generated with Claude Code