Skip to content

feat(setup): auto-install Claude Code agent skill during setup#216

Merged
BYK merged 3 commits intomainfrom
byk/agent-skills-setup
Feb 9, 2026
Merged

feat(setup): auto-install Claude Code agent skill during setup#216
BYK merged 3 commits intomainfrom
byk/agent-skills-setup

Conversation

@BYK
Copy link
Member

@BYK BYK commented Feb 9, 2026

Summary

  • Auto-install the Sentry CLI skill for Claude Code during sentry cli setup
  • Detect Claude Code by checking for ~/.claude/ directory; silent when absent
  • Fetch version-pinned SKILL.md from GitHub (matching the installed CLI version) to avoid documenting commands that don't exist in the binary
  • Fall back to cli.sentry.dev for dev builds or when the versioned tag isn't available
  • Add --no-agent-skills flag for opt-out, following the --no-completions pattern

Setup flow (step 4 is new)

  1. Record install metadata
  2. Add binary to PATH
  3. Install shell completions
  4. Install agent skills — auto-detect Claude Code, fetch + write ~/.claude/skills/sentry-cli/SKILL.md

Test plan

  • bun run typecheck passes
  • bun run lint passes
  • 18 unit tests in test/lib/agent-skills.test.ts (detection, URL construction, fetch fallback, install)
  • 4 new integration tests in test/commands/cli/setup.test.ts (installs when detected, silent skip, opt-out flag, network failure resilience)
  • SKILL.md regenerated and check-skill passes

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
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Cli

  • Add setup command for shell integration by BYK in #213
  • Add plural command aliases for list commands by betegon in #209

Other

  • (log) Add view command to display log entry details by betegon in #212
  • (setup) Auto-install Claude Code agent skill during setup by BYK in #216

Bug Fixes 🐛

Upgrade

  • Handle EPERM in isProcessRunning for cross-user locks by BYK in #211
  • Replace curl pipe with direct binary download by BYK in #208

Documentation 📚

  • (log) Add documentation for sentry log view command by betegon in #214
  • Add documentation for log command by betegon in #210

Internal Changes 🔧

  • (ci) Remove merge-artifacts job with Craft 2.21.1 by BYK in #215

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

Codecov Results 📊

✅ Patch coverage is 98.86%. Project has 3923 uncovered lines.
✅ Project coverage is 67.27%. Comparing base (base) to head (head).

Files with missing lines (63)
File Patch % Lines
human.ts 55.31% ⚠️ 391 Missing
resolve-target.ts 15.28% ⚠️ 366 Missing
list.ts 14.39% ⚠️ 345 Missing
list.ts 23.47% ⚠️ 212 Missing
api-client.ts 69.27% ⚠️ 197 Missing
oauth.ts 25.10% ⚠️ 194 Missing
list.ts 21.96% ⚠️ 167 Missing
view.ts 22.07% ⚠️ 166 Missing
plan.ts 19.37% ⚠️ 154 Missing
upgrade.ts 64.54% ⚠️ 128 Missing
help.ts 19.85% ⚠️ 109 Missing
interactive-login.ts 9.17% ⚠️ 99 Missing
view.ts 25.81% ⚠️ 92 Missing
view.ts 47.70% ⚠️ 91 Missing
clipboard.ts 4.49% ⚠️ 85 Missing
status.ts 24.07% ⚠️ 82 Missing
view.ts 49.07% ⚠️ 82 Missing
migration.ts 47.44% ⚠️ 82 Missing
list.ts 27.18% ⚠️ 75 Missing
browser.ts 4.11% ⚠️ 70 Missing
login.ts 33.33% ⚠️ 64 Missing
span-tree.ts 5.00% ⚠️ 57 Missing
explain.ts 33.33% ⚠️ 56 Missing
telemetry.ts 79.86% ⚠️ 56 Missing
api.ts 89.80% ⚠️ 47 Missing
seer.ts 75.54% ⚠️ 45 Missing
schema.ts 89.56% ⚠️ 40 Missing
refresh.ts 40.63% ⚠️ 38 Missing
seer.ts 79.87% ⚠️ 30 Missing
preload.ts 53.23% ⚠️ 29 Missing
utils.ts 88.94% ⚠️ 25 Missing
view.ts 61.54% ⚠️ 25 Missing
detector.ts 90.10% ⚠️ 20 Missing
app.ts 76.32% ⚠️ 18 Missing
output.ts 15.00% ⚠️ 17 Missing
code-scanner.ts 95.00% ⚠️ 16 Missing
help.ts 57.14% ⚠️ 15 Missing
arg-parsing.ts 90.00% ⚠️ 12 Missing
dsn-cache.ts 94.62% ⚠️ 12 Missing
logout.ts 56.00% ⚠️ 11 Missing
token.ts 52.17% ⚠️ 11 Missing
fix.ts 83.61% ⚠️ 10 Missing
qrcode.ts 33.33% ⚠️ 10 Missing
fs-utils.ts 57.14% ⚠️ 9 Missing
project-root.ts 97.73% ⚠️ 7 Missing
version-check.ts 91.76% ⚠️ 7 Missing
feedback.ts 84.21% ⚠️ 6 Missing
auth.ts 95.52% ⚠️ 6 Missing
shell.ts 96.23% ⚠️ 6 Missing
upgrade.ts 94.74% ⚠️ 5 Missing
resolver.ts 94.57% ⚠️ 5 Missing
setup.ts 97.01% ⚠️ 4 Missing
index.ts 95.96% ⚠️ 4 Missing
project-aliases.ts 97.40% ⚠️ 2 Missing
project-root-cache.ts 96.92% ⚠️ 2 Missing
json.ts 33.33% ⚠️ 2 Missing
alias.ts 99.42% ⚠️ 1 Missing
completions.ts 99.37% ⚠️ 1 Missing
env-file.ts 99.19% ⚠️ 1 Missing
parser.ts 98.63% ⚠️ 1 Missing
colors.ts 97.96% ⚠️ 1 Missing
helpers.ts 94.74% ⚠️ 1 Missing
helpers.ts 94.74% ⚠️ 1 Missing
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)
@BYK BYK marked this pull request as ready for review February 9, 2026 13:46
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

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.
@BYK BYK merged commit 86b835e into main Feb 9, 2026
23 checks passed
@BYK BYK deleted the byk/agent-skills-setup branch February 9, 2026 14:06
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