Skip to content

Conversation

@sergical
Copy link
Member

@sergical sergical commented Jan 7, 2026

Summary

  • Add CLI tool to apply Sentry skills to any project for various AI agents (Cursor, Copilot, Aider, Zed, Cline, etc.)
  • Auto-detects and installs Ruler if missing
  • Generates agent-specific config files and copies only requested files to target

Usage

# Clone this repo
git clone git@github.com:getsentry/skills.git ~/sentry-skills
cd ~/sentry-skills && bun install

# Apply to your project
bun run apply /path/to/project --agent cursor
bun run apply /path/to/project --agent cursor,copilot,aider
bun run apply /path/to/project --all

Supported Agents

cursor, copilot, aider, zed, cline, windsurf, goose, opencode, gemini-cli, firebase-studio, warp, trae, kilo-code, roo-code, qwen-code, augment-code, amazon-q, kiro, junie, open-hands, crush, amp, antigravity, firebender, mistral-vibe, codex-cli, jules, claude

Test plan

  • bun run typecheck passes
  • bun run apply /tmp/test --agent cursor creates AGENTS.md in target
  • bun run apply /tmp/test --agent cursor,cline,goose creates multiple files
  • Auto-installs ruler when missing

🤖 Generated with Claude Code

Add CLI tool to apply Sentry skills to any project for various AI agents
(Cursor, Copilot, Aider, Zed, Cline, etc.)

Usage:
  bun run apply /path/to/project --agent cursor
  bun run apply /path/to/project --agent cursor,copilot,aider
  bun run apply /path/to/project --all

Features:
- Auto-detects and installs Ruler if missing
- Generates agent-specific config files (AGENTS.md, .clinerules, etc.)
- Copies only requested agent files to target project
- Prompts before overwriting existing files (use --force to skip)
- Cleans up temporary files after completion

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

function isCommandAvailable(command: string): boolean {
try {
execSync(`which ${command}`, { stdio: "pipe" });
Copy link

Choose a reason for hiding this comment

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

Bug: The isCommandAvailable function uses the Unix-specific which command, causing it to fail on Windows and rendering the script unusable on that platform.
Severity: CRITICAL | Confidence: High

🔍 Detailed Analysis

The isCommandAvailable function checks for command existence using execSync("which ${command}"). The which command is specific to Unix-like operating systems (Linux, macOS) and is not available on Windows, where the equivalent is where. Because the script uses this function to detect npm or bun, it will incorrectly determine that no package manager is installed on Windows systems. This causes the script to exit prematurely, making the tool completely unusable for developers on Windows.

💡 Suggested Fix

Update the isCommandAvailable function to be cross-platform. This can be achieved by checking process.platform. If the platform is win32, use the where command; otherwise, use the which command. Alternatively, use a cross-platform npm package like command-exists or which that handles this platform difference internally.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: scripts/apply.ts#L67

Potential issue: The `isCommandAvailable` function checks for command existence using
`execSync("which ${command}")`. The `which` command is specific to Unix-like operating
systems (Linux, macOS) and is not available on Windows, where the equivalent is `where`.
Because the script uses this function to detect `npm` or `bun`, it will incorrectly
determine that no package manager is installed on Windows systems. This causes the
script to exit prematurely, making the tool completely unusable for developers on
Windows.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 8255912

@sergical sergical closed this Jan 7, 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.

1 participant