feat(skill): self-install OpenHop on first use if CLI is missing#92
Conversation
The previous bootstrap text told the agent to give up and ask the user
to run `npx openhop init` if the CLI was missing. Updated so the agent
runs `npx openhop init` itself — no human round-trip to set up the
skill on a fresh machine.
Two changes:
1. **`allowed-tools`** — added `Bash(npx openhop:*)` alongside the
existing `Bash(openhop:*)`. Without this the agent literally
couldn't invoke `npx openhop init` (or `npx openhop demo` /
`npx openhop serve`, which the rest of the section already
instructs).
2. **"Before Creating Flows" bootstrap text** — replaced "tell the
user to run npx openhop init and stop" with "run `npx openhop init`
yourself to install it, then continue". Added a one-line note that
`init` only primes the npm cache + drops the skill (it doesn't do
`npm install -g`); the user can run `npm install -g openhop` for a
global binary, otherwise the agent keeps using `npx openhop …`.
Bumped the post-install verification from `openhop --version` to
`openhop --version (or npx openhop --version)` to acknowledge both
modes work.
This closes the audit's S7 ("No 'CLI not found' branch in the
bootstrap" — `17:80`) by making the agent self-install instead of
escalating.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughUpdated the OpenHop skill doc to allow ChangesOpenHop CLI Tool Support
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@skills/openhop/SKILL.md`:
- Around line 93-95: Update the documentation to require using the npx-prefixed
CLI unless a global binary is explicitly confirmed: after the `npx openhop init`
and the `openhop --version` check, add a sentence that all subsequent commands
(e.g., `openhop push`, `openhop deploy`) should be run as `npx openhop …` unless
the user has verified `openhop --version` succeeds without `npx` or has run `npm
install -g openhop`; mention `npx openhop init` as the installer step and call
out `npx openhop push …` as the safe form to avoid later failures.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: fb23516a-4db2-4ba8-9912-278fae2f0b0b
📒 Files selected for processing (1)
skills/openhop/SKILL.md
CodeRabbit flagged that after the new self-install branch, the rest of the skill body still uses bare `openhop push …` etc. — which fails when the agent had to bootstrap via `npx openhop init` (no global binary). Added a one-line rule right after the version check telling the agent to lock in whichever form worked (bare `openhop` if globally installed, else `npx openhop`) and use it consistently for every subsequent command in the session. Doesn't rewrite the rest of the skill (which would be a larger, churnier change to substitute `npx openhop` everywhere). The rule is enough — agents substitute correctly given clear preceding guidance. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Updates
skills/openhop/SKILL.mdso the agent installs OpenHop itself when the CLI isn't available, instead of stopping and telling the user to do it.Why
Previous bootstrap text:
That introduces a human round-trip on first use — agent stalls, user runs init, user re-prompts, agent retries. The fix is to let the agent run init itself.
What changed
1.
allowed-toolsfrontmatterBefore:
```yaml
allowed-tools: Bash(openhop:*)
```
After:
```yaml
allowed-tools: Bash(openhop:), Bash(npx openhop:)
```
Without
Bash(npx openhop:*)the agent literally couldn't invokenpx openhop init— ornpx openhop demo/npx openhop serve, which the rest of the bootstrap already instructs.2. Bootstrap text
Before:
After:
Also bumped the next-step from
openhop --versiontoopenhop --version (or npx openhop --version)to acknowledge both modes work.Behavior change
openhop --versionworks)npx openhop inititself → continuesLinked context
Closes audit's S7: "No 'CLI not found' branch in the bootstrap" (
READINESS-AUDIT.md§S7,17:80).Compatible with the prior S2 finding (over-scoped
allowed-tools) —Bash(npx openhop:*)is narrowly scoped to OpenHop invocations only, not the wholenpxtool surface.Testing
npx prettier --check skills/openhop/SKILL.md→ cleanskill-md-synclock-in test (which checks SKILL.md ↔ NodeTypeEnum schema parity) is unaffected — this PR doesn't touch any node-type list.🤖 Generated with Claude Code
Summary by CodeRabbit