Skip to content

feat(skills): offer the agent skill install during onboarding - #161

Merged
jamie-at-bunny merged 7 commits into
mainfrom
skills-onboarding
Aug 18, 2026
Merged

feat(skills): offer the agent skill install during onboarding#161
jamie-at-bunny merged 7 commits into
mainfrom
skills-onboarding

Conversation

@jamie-at-bunny

Copy link
Copy Markdown
Member

What

Two onboarding hooks for the agent skill that shipped in #160, so users actually find it:

  • bunny login now makes a one-time offer to install the skill globally after authenticating (packages/cli/src/commands/skills/offer.ts). Guards, in order: interactive runs only (non-TTY and --output json never see a prompt), a marker file in the XDG cache dir (bunnynet/skills-offered, same state dir as the update check) so it fires at most once, and an already-installed check via the new isGlobalSkillInstalled() in core/agent-skill.ts. Declining prints the bunny skills install --global hint; the whole offer is wrapped so no failure can break login.
  • install.sh outro now mentions bunny skills install --global next to the "Run 'bunny --help'" line. Text only: the script never runs the install itself, since it may execute under sudo with a different HOME.

Why

The skill is only useful if people know it exists. Nothing offered it before: no postinstall (hostile in CI), no first-run hook. Login is the natural moment; the user is authenticated, interactive, and has just committed to using the CLI.

Notes for review

  • The marker is written before prompting, so an interrupted prompt still counts as offered and can never nag twice. A wiped cache re-offers once, matching update-check behavior; this seemed better than adding a preference field to the config file.
  • login.ts importing from ../skills/offer.ts follows existing lateral command imports (e.g. storage/docs.ts -> ../docs.ts).
  • Verified: 500 tests pass (new coverage for isGlobalSkillInstalled), bash -n install.sh, and a headless run confirming the non-TTY guard returns silently without writing the marker.

- bunny login makes a one-time offer after authenticating: interactive runs only, marker in the XDG cache dir, skipped when any global root already has the skill; failures never break login
- install.sh outro points AI-tool users at bunny skills install --global
- new isGlobalSkillInstalled() in core/agent-skill.ts backs the already-installed check
@changeset-bot

changeset-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9bc8635

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@bunny.net/cli Minor
@bunny.net/cli-linux-x64 Minor
@bunny.net/cli-linux-arm64 Minor
@bunny.net/cli-darwin-x64 Minor
@bunny.net/cli-darwin-arm64 Minor
@bunny.net/cli-windows-x64 Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

…lled-check test

- offer.ts reuses CACHE_DIR from core/update-check.ts instead of rebuilding the XDG path
- the three offer guards collapse into one condition
- isGlobalSkillInstalled assertions fold into the existing global-install test
@jamie-at-bunny
jamie-at-bunny marked this pull request as ready for review August 18, 2026 16:21
@bunnynet-devops

Copy link
Copy Markdown

@codex review

@greptile-apps

greptile-apps Bot commented Aug 18, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds agent-skill discovery to onboarding while making interrupted or failed installations retryable.

  • Offers global skill installation after successful interactive login, with explicit install/skip flags.
  • Adds a passive post-command hint for authenticated users who do not use the login flow.
  • Uses per-root completion sentinels and all-root checks to detect and repair partial installations.
  • Documents the onboarding behavior and adds an installation hint to install.sh.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
packages/cli/src/commands/skills/offer.ts Implements guarded login offers and passive hints, marking completion only after a decline or successful installation.
packages/cli/src/core/agent-skill.ts Writes each root's SKILL.md sentinel last and requires completed sentinels in both global roots.
packages/cli/src/commands/auth/login.ts Adds explicit skill-install flags and invokes onboarding after profile persistence and best-effort credential verification.
packages/cli/src/index.ts Runs the passive skill hint after normal command execution while excluding skill-management commands.
packages/cli/src/core/ui.ts Adds a confirmation helper that distinguishes cancellation from an explicit decline.
packages/cli/src/core/agent-skill.test.ts Covers all-root completion checks and failed-refresh sentinel removal.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[CLI command completes] --> B{Login handled offer?}
  B -->|Yes| Z[No passive hint]
  B -->|No| C{Interactive and authenticated?}
  C -->|No| Z
  C -->|Yes| D{Marker absent and global install incomplete?}
  D -->|No| Z
  D -->|Yes| E[Show passive installation hint]
  E --> F[Write shared offer marker]

  L[Successful bunny login] --> G{install-skill flag}
  G -->|true| H[Install both global roots]
  G -->|false| Z
  G -->|unset| I{Interactive and not previously offered?}
  I -->|No| Z
  I -->|Yes| J[Prompt user]
  J -->|Decline| F
  J -->|Accept| H
  J -->|Cancel| K[Leave marker absent for retry]
  H --> M{Installation succeeds?}
  M -->|Yes| F
  M -->|No| N[Warn and leave marker absent]
Loading

Reviews (4): Last reviewed commit: "fix(skills): clear the SKILL.md sentinel..." | Re-trigger Greptile

Comment thread packages/cli/src/commands/skills/offer.ts
Comment thread packages/cli/src/commands/skills/offer.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1a568be929

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/cli/src/commands/skills/offer.ts Outdated
logger.success(
"Agent skill installed to ~/.agents/skills and ~/.claude/skills.",
);
} catch {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Allow retrying after a failed skill installation

If the marker is written successfully but installGlobalSkill() then fails—for example because one of the home-directory skill roots is not writable—this empty catch suppresses the error while leaving skills-offered in place. Every later login returns at the marker check even though the skill is not installed, and the user receives neither an error nor another offer. Clear or defer the marker on installation failure and report a non-fatal warning.

Useful? React with 👍 / 👎.

function installAndReport(): void {
try {
installGlobalSkill(BUNNY_CLI_SKILL);
markOffered();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Partial installs suppress retries

If writing a later skill file or the second global root fails after SKILL.md has been written, installGlobalSkill leaves that partial output while skipping markOffered. The any-root installed check then suppresses subsequent offers, leaving the global skill incomplete instead of retrying the failed installation.

Fix in Claude Code

Comment thread packages/cli/src/core/agent-skill.ts Outdated
@bogdan-at-bunny
bogdan-at-bunny self-requested a review August 18, 2026 17:02
@jamie-at-bunny
jamie-at-bunny merged commit 80115c0 into main Aug 18, 2026
2 checks passed
@jamie-at-bunny
jamie-at-bunny deleted the skills-onboarding branch August 18, 2026 17:10
@github-actions github-actions Bot mentioned this pull request Aug 18, 2026
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.

3 participants