Skip to content

Add competitive research agent#6

Open
codyde wants to merge 3 commits intomainfrom
feature/competitive-research-agent
Open

Add competitive research agent#6
codyde wants to merge 3 commits intomainfrom
feature/competitive-research-agent

Conversation

@codyde
Copy link
Owner

@codyde codyde commented Feb 11, 2026

Summary

  • Adds a new Competitive Research agent that compares Sentry against competitors in the error monitoring and observability space (Datadog, New Relic, Bugsnag, Rollbar, etc.)
  • Includes a reusable skill definition in .agents/skills/competitive-research/ with structured research methodology
  • Agent uses web search to provide current, factual comparisons with feature tables, pricing analysis, and developer experience insights

What's included

  • Agent skill (.agents/skills/competitive-research/SKILL.md) — defines research methodology, competitor catalog, and output format
  • API route (src/app/api/competitive-research/route.ts) — streaming SSE endpoint using Claude Agent SDK with full Sentry instrumentation
  • React component (src/components/desktop/apps/CompetitiveResearch.tsx) — chat UI with quick-prompt buttons for common comparisons
  • Desktop registration (src/components/desktop/Desktop.tsx) — agent appears in the Agents folder and launches as a windowed app

Test plan

  • Open the Agents folder on the desktop and verify "Competitive Research" appears
  • Double-click to launch the agent window
  • Verify quick prompt buttons render on first load
  • Send a comparison query (e.g., "Compare Sentry vs Datadog") and confirm streaming response with web search tool activity
  • Verify Sentry metrics and logs fire correctly (competitive_research.* namespace)

🤖 Generated with Claude Code

codyde and others added 2 commits February 11, 2026 13:27
Introduces a new agent that provides competitive intelligence analysis,
comparing Sentry against other error monitoring and observability products
(Datadog, New Relic, Bugsnag, Rollbar, etc.) with structured feature
comparisons, pricing analysis, and developer experience insights.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sentry.metrics.increment is not available as a function in the client-side
bundle of @sentry/nextjs v10. Use optional chaining on all client-side
metrics calls so they gracefully no-op instead of throwing a TypeError.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Same issue as the client-side fix — Sentry.metrics.increment and
Sentry.metrics.distribution are not available as functions in
@sentry/nextjs v10. Apply optional chaining to both API routes
so the SDK query() call can actually execute.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment on lines +73 to +81
prompt: fullPrompt,
options: {
maxTurns: 10,
tools: { type: 'preset', preset: 'claude_code' },
permissionMode: 'bypassPermissions',
allowDangerouslySkipPermissions: true,
includePartialMessages: true,
cwd: process.cwd(),
}
Copy link

Choose a reason for hiding this comment

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

Bug: The system prompt is concatenated into the prompt string instead of being passed to the dedicated systemPrompt option in the query() call, leading to wasted tokens.
Severity: MEDIUM

Suggested Fix

Refactor the query() call to separate the system prompt from the user prompt. Pass the SYSTEM_PROMPT constant to the systemPrompt property within the options object. The prompt parameter should only contain the user's message and conversation context.

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: src/app/api/competitive-research/route.ts#L73-L81

Potential issue: The `query()` function for the Claude Agent SDK is called with the
system prompt concatenated directly into the `prompt` parameter. The SDK provides a
dedicated `systemPrompt` option for this purpose. By combining them, the system prompt
is resent with every turn in a multi-turn conversation, which wastes tokens and
increases costs. This also risks the model misinterpreting system-level directives as
part of the user's query, potentially leading to incorrect or inconsistent behavior. The
new `competitive-research` route introduces this incorrect pattern.

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