Skip to content

feat(skill): self-install OpenHop on first use if CLI is missing#92

Merged
naorsabag merged 2 commits into
masterfrom
feat/skill-self-install-on-missing
May 8, 2026
Merged

feat(skill): self-install OpenHop on first use if CLI is missing#92
naorsabag merged 2 commits into
masterfrom
feat/skill-self-install-on-missing

Conversation

@naorsabag
Copy link
Copy Markdown
Owner

@naorsabag naorsabag commented May 8, 2026

Summary

Updates skills/openhop/SKILL.md so 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:

If `openhop --version` fails with `command not found`, tell the user to run `npx openhop init` and stop — do not attempt to install the CLI yourself.

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-tools frontmatter

Before:

```yaml
allowed-tools: Bash(openhop:*)
```

After:

```yaml
allowed-tools: Bash(openhop:), Bash(npx openhop:)
```

Without Bash(npx openhop:*) the agent literally couldn't invoke npx openhop init — or npx openhop demo / npx openhop serve, which the rest of the bootstrap already instructs.

2. Bootstrap text

Before:

If `openhop --version` fails with `command not found`, tell the user to run `npx openhop init` and stop — do not attempt to install the CLI yourself.

After:

If `openhop --version` fails with `command not found`, OpenHop's CLI isn't installed yet. Run `npx openhop init` yourself to install it, then continue with the steps below. (`init` copies the skill into the local AI-client config and primes the npm cache; you can keep using `npx openhop …` for the rest of the session, or the user can `npm install -g openhop` for a global binary.)

Also bumped the next-step from openhop --version to openhop --version (or npx openhop --version) to acknowledge both modes work.

Behavior change

Scenario Before After
CLI globally installed (openhop --version works) unchanged — proceeds to health check unchanged
CLI missing, npm available agent says "tell user to run init" → stops agent runs npx openhop init itself → continues

Linked 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 whole npx tool surface.

Testing

  • npx prettier --check skills/openhop/SKILL.md → clean
  • The skill-md-sync lock-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

  • Documentation
    • OpenHop docs updated to allow running OpenHop commands via npx (e.g., npx openhop ...).
    • CLI initialization guidance streamlined: if the CLI isn’t found, run npx openhop init and continue; guidance also recommends settling on either plain or npx command form for the session.

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>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b5c34374-6005-47d1-8107-1777cafdd8da

📥 Commits

Reviewing files that changed from the base of the PR and between a1f0945 and 119ff07.

📒 Files selected for processing (1)
  • skills/openhop/SKILL.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • skills/openhop/SKILL.md

Walkthrough

Updated the OpenHop skill doc to allow npx openhop:* tool invocations and to change the missing-CLI guidance to run npx openhop init, then continue while consistently using the working CLI form for subsequent commands.

Changes

OpenHop CLI Tool Support

Layer / File(s) Summary
Tool Capability
skills/openhop/SKILL.md
Frontmatter allowed-tools expanded to permit Bash(npx openhop:*) in addition to Bash(openhop:*).
User Guidance Documentation
skills/openhop/SKILL.md
"Before Creating Flows" updated to instruct running npx openhop init when openhop --version fails, then continue and lock in the working CLI prefix (openhop vs npx openhop) for subsequent commands.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • naorsabag/OpenHop#67: Modifies the same SKILL.md guidance and allowed-tools frontmatter related to npx openhop usage.
  • naorsabag/openhop#72: Documentation updates adopting npx openhop init installation/usage form.
  • naorsabag/openhop#88: Related docs changes standardizing npx openhop init invocation.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: enabling self-installation of OpenHop CLI on first use when missing, which aligns with the core behavioral change in the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/skill-self-install-on-missing

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between c46f181 and a1f0945.

📒 Files selected for processing (1)
  • skills/openhop/SKILL.md

Comment thread skills/openhop/SKILL.md Outdated
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>
@naorsabag naorsabag merged commit f6c4ffa into master May 8, 2026
7 checks passed
@naorsabag naorsabag deleted the feat/skill-self-install-on-missing branch May 10, 2026 17:38
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