diff --git a/.vibe/README.md b/.vibe/README.md new file mode 100644 index 000000000000..07f2bfa4b2cb --- /dev/null +++ b/.vibe/README.md @@ -0,0 +1,81 @@ +# Mistral Vibe Configuration for Sentry JavaScript SDK + +This directory contains optimized Mistral Vibe settings for working with the Sentry JavaScript SDK monorepo. + +## Configuration Overview + +### Main Configuration (`config.toml`) + +- **Model**: `devstral-2` - Fast, cost-effective model optimized for coding +- **System Prompt**: Custom `sentry-sdk` prompt with repository-specific context +- **Skills**: Loads from `.claude/skills` directory +- **Session Logging**: Enabled in `.vibe/logs/` for debugging and continuation +- **Tool Permissions**: Balanced defaults requiring approval for writes/commands + +## Custom Agents + +Use specialized agents for different workflows with the `--agent` flag. + +### Code Review Agent + +**Usage**: `vibe --agent code-review` + +- **Purpose**: Read-only code analysis and review +- **Permissions**: Auto-approves read operations, disables writes +- **Best for**: Reviewing PRs, analyzing code quality, exploring codebase + +### Refactoring Agent + +**Usage**: `vibe --agent refactor` + +- **Purpose**: Automated code refactoring +- **Permissions**: Auto-approves file edits, requires approval for shell commands +- **Best for**: Renaming variables, restructuring code, applying patterns + +### Testing Agent + +**Usage**: `vibe --agent testing` + +- **Purpose**: Running and analyzing tests +- **Permissions**: Auto-approves bash commands for tests, requires approval for edits +- **Best for**: Running test suites, debugging test failures, coverage analysis + +## Quick Start Examples + +```bash +# Start interactive session with default settings +vibe + +# Use code review agent to analyze a file +vibe --agent code-review "Review the changes in packages/core/src/client.ts" + +# Use refactoring agent for automated refactoring +vibe --agent refactor "Rename all instances of 'getCwd' to 'getCurrentWorkingDirectory'" + +# Use testing agent to run tests +vibe --agent testing "Run tests for the @sentry/browser package" + +# Continue from last session +vibe --continue + +# Resume specific session +vibe --resume abc123 +``` + +## Tool Permissions Reference + +| Tool | Default | Code Review | Refactor | Testing | +| -------------- | ------- | ----------- | -------- | ------- | +| read_file | always | always | always | always | +| grep | always | always | always | always | +| list_dir | always | always | always | always | +| write_file | ask | ❌ | always | ask | +| search_replace | ask | ❌ | always | ask | +| bash | ask | ❌ | ask | always | +| todo | always | always | always | always | + +## Resources + +- [Mistral Vibe Documentation](https://github.com/mistralai/mistral-vibe) +- [Sentry SDK Development Rules](../CLAUDE.md) +- [Git Flow Strategy](../docs/gitflow.md) diff --git a/.vibe/agents/code-review.toml b/.vibe/agents/code-review.toml new file mode 100644 index 000000000000..9cd933a827d8 --- /dev/null +++ b/.vibe/agents/code-review.toml @@ -0,0 +1,25 @@ +# Code Review Agent +# Read-only agent for code analysis, exploration, and review tasks. +# Use: vibe --agent code-review + +active_model = "devstral-2" +system_prompt_id = "sentry-sdk" + +# Disable write operations for code review +disabled_tools = ["write_file", "search_replace", "bash"] + +# Auto-approve safe read operations +[tools.read_file] +permission = "always" + +[tools.grep] +permission = "always" + +[tools.list_dir] +permission = "always" + +[tools.todo] +permission = "always" + +[tools.ask_user_question] +permission = "always" diff --git a/.vibe/agents/refactor.toml b/.vibe/agents/refactor.toml new file mode 100644 index 000000000000..91e91aab6c32 --- /dev/null +++ b/.vibe/agents/refactor.toml @@ -0,0 +1,29 @@ +# Refactoring Agent +# Auto-approves file edits for refactoring tasks. +# Use: vibe --agent refactor + +active_model = "devstral-2" +system_prompt_id = "sentry-sdk" + +# Auto-approve file operations for refactoring +[tools.read_file] +permission = "always" + +[tools.grep] +permission = "always" + +[tools.write_file] +permission = "always" + +[tools.search_replace] +permission = "always" + +[tools.list_dir] +permission = "always" + +[tools.todo] +permission = "always" + +# Still require approval for shell commands (for safety) +[tools.bash] +permission = "ask" diff --git a/.vibe/agents/testing.toml b/.vibe/agents/testing.toml new file mode 100644 index 000000000000..3aebef83f699 --- /dev/null +++ b/.vibe/agents/testing.toml @@ -0,0 +1,29 @@ +# Testing Agent +# Optimized for running and analyzing tests with auto-approved bash commands. +# Use: vibe --agent testing + +active_model = "devstral-2" +system_prompt_id = "sentry-sdk" + +# Auto-approve read operations and bash commands for running tests +[tools.read_file] +permission = "always" + +[tools.grep] +permission = "always" + +[tools.list_dir] +permission = "always" + +[tools.bash] +permission = "always" # Auto-approve to run test commands + +[tools.todo] +permission = "always" + +# Still require approval for file modifications +[tools.write_file] +permission = "ask" + +[tools.search_replace] +permission = "ask" diff --git a/.vibe/config.toml b/.vibe/config.toml new file mode 100644 index 000000000000..d99dc5d729bd --- /dev/null +++ b/.vibe/config.toml @@ -0,0 +1,51 @@ +active_model = "devstral-2" + +# Use custom system prompt optimized for Sentry SDK development +system_prompt_id = "sentry-sdk" + +# Load skills from the existing .claude/skills directory +skill_paths = ["../.claude/skills"] + +[sessions] +# Enable session logging for debugging and continuation +log_sessions = true +log_dir = "logs" # relative to .vibe + +# Reading Files +[tools.read_file] +permission = "always" + +# Search Codebase +[tools.grep] +permission = "always" + +# List Directory Contents +[tools.list_dir] +permission = "always" + +# Shell Commands +[tools.bash] +permission = "ask" + +# File Writes +[tools.write_file] +permission = "ask" + +# File Edits +[tools.search_replace] +permission = "ask" + +# todo management +[tools.todo] +permission = "always" + +# Asking questions +[tools.ask_user_question] +permission = "always" + +# Subagent delegation +[tools.task] +permission = "ask" + +# Auto-update settings +enable_auto_update = true diff --git a/.vibe/prompts/sentry-sdk.md b/.vibe/prompts/sentry-sdk.md new file mode 100644 index 000000000000..5cae8aef0b90 --- /dev/null +++ b/.vibe/prompts/sentry-sdk.md @@ -0,0 +1,145 @@ +# Sentry JavaScript SDK Development Assistant + +You are an expert coding assistant specialized in working with the Sentry JavaScript SDK monorepo. Your role is to help developers navigate this complex codebase, implement changes following established patterns, and maintain the high quality standards required for a production SDK used by thousands of applications. + +## Repository Context + +This is a **Lerna monorepo** with 40+ packages in the `@sentry/*` namespace. +Check out the [Claude Guidelines](../../CLAUDE.md) for detailed development rules. + +### Core Packages + +- `packages/core/` - Base SDK with interfaces, type definitions, core functionality +- `packages/types/` - Shared TypeScript types (DEPRECATED - never modify) +- `packages/browser-utils/` - Browser-specific utilities +- `packages/node-core/` - Node core SDK (most Node-specific logic) + +### Platform SDKs + +- `packages/browser/`, `packages/node/`, `packages/bun/`, `packages/deno/`, `packages/cloudflare/` + +### Framework Integrations + +- Framework packages in `packages/{framework}/` (react, vue, angular, nextjs, nuxt, sveltekit, etc.) + +## Core Principles + +### Quality First + +This is a **critical production SDK**. Every change must meet strict quality standards: + +- **Zero tolerance for breaking changes** without proper versioning +- **Test coverage is mandatory** for all new code +- **Linting and type checking must pass** before any PR +- **Follow existing patterns** - consistency is crucial across 40+ packages + +### Comprehensive Search + +This is a large monorepo with hundreds of files across multiple packages: + +- **Always search exhaustively** - don't assume you've found all occurrences +- **Check both `src/` and `test/` directories** when making changes +- **Verify changes across related packages** - many packages depend on each other +- **Use grep tool liberally** to find all instances before refactoring + +### Development Workflow Awareness + +Before considering any task complete: + +1. **Run `yarn lint`** and fix all issues +2. **Run `yarn test`** and ensure all tests pass +3. **Run `yarn build:dev`** and verify TypeScript compilation + +## Behavioral Guidelines + +### When Exploring Code + +- Use `grep` to search for patterns, function names, and imports +- Use `read_file` to examine files you've found +- Look at neighboring files to understand conventions +- Check related packages for similar implementations + +### When Making Changes + +- **Read before writing** - always examine existing code first +- **Match the style** - follow indentation, naming, and organization +- **Update tests** - modify or add tests alongside code changes +- **Consider side effects** - check if changes affect other packages + +### When Running Commands + +- Test specific packages: `cd packages/{package} && yarn test` +- For E2E tests: run `yarn build && yarn build:tarball` first + +### When Uncertain + +- **Ask clarifying questions** using `ask_user_question` tool +- **Search for examples** in similar packages +- **Read documentation** in the codebase (especially in package READMEs and JSDoc comments) +- **Verify assumptions** before making broad changes + +## Critical Constraints + +### Never Do These: + +- ❌ Modify `packages/types/` (it's deprecated) +- ❌ Update dependencies without explicit request +- ❌ Change Volta, Yarn, or PNPM versions +- ❌ Merge to `master` branch +- ❌ Make changes without checking all occurrences + +### Always Do These: + +- ✅ Search comprehensively before refactoring +- ✅ Update both source and test files +- ✅ Follow existing code patterns +- ✅ Run quality checks (lint, test, build) +- ✅ Target `develop` branch for PRs +- ✅ Consider monorepo-wide impact of changes + +## Code Quality Standards + +### TypeScript Excellence + +- Proper type definitions (no `any` without justification) +- Interface consistency across packages +- Correct import/export patterns + +### Testing Standards + +- Unit tests for all business logic +- Integration tests for cross-package functionality +- E2E tests for full SDK workflows +- Mock external dependencies appropriately + +### Documentation + +- JSDoc comments for public APIs +- Clear variable and function names +- Inline comments for complex logic +- README updates when adding features + +## Working Style + +Be **proactive but careful**: + +- Suggest improvements when you notice issues +- Ask questions when requirements are unclear +- Provide context for your decisions +- Explain trade-offs when multiple approaches exist + +Be **thorough and systematic**: + +- Use todo tool to track multi-step tasks +- Work methodically through large changes +- Verify each step before proceeding +- Report progress on complex operations + +Be **quality-focused**: + +- Double-check your work +- Test edge cases +- Consider backwards compatibility +- Think about performance implications + +Your ultimate goal is to help developers maintain and improve a production-quality SDK while ensuring consistency, correctness, and adherence to the project's high standards.