Skip to content

feat(skills): bunny skills install for AI coding tools - #160

Merged
jamie-at-bunny merged 5 commits into
mainfrom
agent-skills
Aug 18, 2026
Merged

feat(skills): bunny skills install for AI coding tools#160
jamie-at-bunny merged 5 commits into
mainfrom
agent-skills

Conversation

@jamie-at-bunny

Copy link
Copy Markdown
Member

What

bunny skills install installs the bunny agent skill so AI coding tools (Claude Code, Cursor, Codex, and anything else that reads AGENTS.md) know the CLI exists and how to drive it.

Two scopes:

  • Project (default): upserts a compact, marked block (<!-- bunny-cli:start/end -->) into the project's AGENTS.md, creating the file if missing and replacing the block in place on reinstall. When the project uses Claude Code (.claude/ or CLAUDE.md exists), it also writes the full skill with all references to .claude/skills/bunny-cli/.
  • Global (--global): writes the skill to ~/.claude/skills/bunny-cli/ so Claude Code picks it up in every project. This is the hook for "install the skill when you install the CLI" (the install script or a post-login nudge can invoke it later).
bunny skills install
bunny skills install --global
bunny skills install --output json

How

  • The generic machinery lives in core/agent-skill.ts (marker upsert, Claude detection, project/global writers). Markers are per-skill, so future per-resource skills (for example database migrations) can maintain their own blocks alongside this one and reuse the same installer.
  • The installed content is the shipped skills/bunny-cli/**, embedded at bundle time via Bun text imports in commands/skills/content.ts; there is a single source of truth and no runtime file lookup, so the compiled binaries and the npm launcher both carry it. A test fails if SKILL.md routes to a reference that is not embedded.
  • Only the short AGENTS.md section is authored separately, and it is kept deliberately compact (auth, discovery via --help, --output json, --force, key namespaces, bunny api fallback).

Notes

  • Idempotent: reruns refresh the same files; existing AGENTS.md content is never touched outside the marked block.
  • Non-Claude projects get no .claude/ litter; they get only the AGENTS.md block.
  • Follow-up: the db-migrations PR (feat(db): migrations create, list, and apply #136) will build on this by documenting migrations in the database reference, and first-use prompts (for example after a first migrations create) can offer this install via isProjectSkillInstalled().

@bunnynet-devops

Copy link
Copy Markdown

@codex review

@changeset-bot

changeset-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ef0857f

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

@greptile-apps

greptile-apps Bot commented Aug 18, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds project and global installation/removal of the bundled bunny CLI agent skill.

  • Registers the new skills install and skills remove command namespace.
  • Maintains a marked AGENTS.md section and conditionally installs Claude Code skill files.
  • Embeds the shipped skill and references into compiled CLI artifacts.
  • Adds marker validation, symlink-boundary checks, idempotency coverage, and installation/removal tests.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
packages/cli/src/core/agent-skill.ts Implements marked-block management, project-boundary validation, and project/global skill file lifecycle; the previously reported functional marker and project-symlink issues are addressed.
packages/cli/src/commands/skills/install.ts Adds project/global installation dispatch and structured JSON output.
packages/cli/src/commands/skills/remove.ts Adds confirmed project/global removal with force and JSON modes.
packages/cli/src/commands/skills/content.ts Embeds the shipped skill and reference documents as the installation payload.
packages/cli/src/core/agent-skill.test.ts Covers idempotency, malformed markers, Claude detection, project symlink boundaries, and removal behavior.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  User["bunny skills install/remove"] --> Scope{"Project or global?"}
  Scope -->|Project| Agents["Upsert/remove marked AGENTS.md block"]
  Scope -->|Project + Claude detected| ProjectSkill["Write/remove .claude/skills/bunny-cli"]
  Scope -->|Global| AgentsSkill["Write/remove ~/.agents/skills/bunny-cli"]
  Scope -->|Global| ClaudeSkill["Write/remove ~/.claude/skills/bunny-cli"]
Loading

Reviews (3): Last reviewed commit: "refactor(skills): tighten comments and c..." | Re-trigger Greptile

Comment thread packages/cli/src/core/agent-skill.ts Outdated
Comment thread packages/cli/src/core/agent-skill.ts Outdated
Comment thread packages/cli/src/core/agent-skill.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: c95da7ecab

ℹ️ 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/content.ts Outdated
Comment thread packages/cli/src/commands/skills/content.ts Outdated
Comment thread packages/cli/src/core/agent-skill.ts Outdated
Comment thread packages/cli/src/core/agent-skill.ts Outdated
…lled guidance

- refuse installer writes that a symlink would redirect outside the project (project scope only; in-project symlinks like AGENTS.md -> CLAUDE.md still work)
- treat duplicated managed markers as malformed instead of slicing across them
- installed AGENTS.md section no longer claims every command emits JSON or that prompts auto-skip without a TTY; it now tells agents to pass value flags and --force
…s and skills remove

- --global now writes to both ~/.agents/skills/bunny-cli (the cross-tool Agent Skills directory read by Cursor, Codex, OpenCode, Copilot, and others) and ~/.claude/skills/bunny-cli
- install gains an update alias since reinstalling refreshes in place
- new skills remove (rm, uninstall) strips the AGENTS.md block (deleting the file only when the installer's own scaffold heading is all that remains), deletes the skill dirs for either scope, confirms unless --force, and reuses the symlink-escape guard
- collapse multi-line docstrings in agent-skill.ts to one-liners
- writeSkillFiles iterates Object.entries, dropping the string cast
- remove.ts drops the filesystem re-check for its AGENTS.md message
- merge single-assertion marker/predicate tests; assertion count unchanged
@jamie-at-bunny
jamie-at-bunny merged commit ef0857f into main Aug 18, 2026
3 checks passed
@jamie-at-bunny
jamie-at-bunny deleted the agent-skills branch August 18, 2026 12:59
@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.

2 participants