feat(setup): auto-install Claude Code agent skill during setup#216
Merged
Conversation
Detect Claude Code (~/.claude/) during `sentry cli setup` and install a version-pinned SKILL.md so the agent can use CLI commands effectively. - Add `src/lib/agent-skills.ts` with detection, versioned fetch, and install - Fetch SKILL.md from GitHub tagged to the CLI version, falling back to cli.sentry.dev for dev builds to avoid version mismatch - Add `--no-agent-skills` flag to opt out; silent when no agent detected - Add unit + integration tests for the new module and setup step - Regenerate SKILL.md to include the new flag
Contributor
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Cli
Other
Bug Fixes 🐛Upgrade
Documentation 📚
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Contributor
Codecov Results 📊✅ Patch coverage is 98.86%. Project has 3923 uncovered lines. Files with missing lines (63)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 67.04% 67.27% +0.23%
==========================================
Files 97 98 +1
Lines 11904 11986 +82
Branches 0 0 —
==========================================
+ Hits 7981 8063 +82
- Misses 3923 3923 —
- Partials 0 0 —Generated by Codecov Action |
Convert the 4 remaining camelCase flag keys to kebab-case literal strings, matching the pattern already used by `raw-field` and `dry-run`. Stricli was auto-converting them for CLI display, but the source definitions and generated SKILL.md still showed camelCase (e.g., --showToken, --noModifyPath). Flags changed: - showToken -> show-token (auth status) - noModifyPath -> no-modify-path (cli setup) - noCompletions -> no-completions (cli setup) - noAgentSkills -> no-agent-skills (cli setup)
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Wrap mkdirSync/Bun.write in try-catch so permission errors or full disk don't crash the setup command. Matches the documented contract that installAgentSkills returns null on any error.
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.
Summary
sentry cli setup~/.claude/directory; silent when absentcli.sentry.devfor dev builds or when the versioned tag isn't available--no-agent-skillsflag for opt-out, following the--no-completionspatternSetup flow (step 4 is new)
~/.claude/skills/sentry-cli/SKILL.mdTest plan
bun run typecheckpassesbun run lintpassestest/lib/agent-skills.test.ts(detection, URL construction, fetch fallback, install)test/commands/cli/setup.test.ts(installs when detected, silent skip, opt-out flag, network failure resilience)check-skillpasses