Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 80,
"tabWidth": 2,
"sortPackageJson": false,
"ignorePatterns": [
"apps/cli-docs/**",
"packages/cli/**",
"packages/mcp-server-mocks/src/fixtures/**",
"**/worker-configuration.d.ts",
"**/tsconfig*.json"
]
}
26 changes: 26 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["jsx-a11y"],
Comment thread
cursor[bot] marked this conversation as resolved.
Outdated
"categories": {
"correctness": "error"
},
"ignorePatterns": [
"apps/cli-docs/**",
"packages/cli/**",
"**/worker-configuration.d.ts",
"**/tsconfig*.json",
"packages/mcp-server-mocks/src/fixtures/**"
],
"rules": {
"no-unused-vars": "off",
"jsx-a11y/interactive-supports-focus": "off"
},
"overrides": [
{
"files": ["packages/mcp-cloudflare/src/client/**/*.tsx"],
"rules": {
"jsx-a11y/no-static-element-interactions": "off"
}
}
]
}
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"recommendations": ["biomejs.biome"],
"recommendations": ["oxc.oxc-vscode", "biomejs.biome"],
Comment thread
cursor[bot] marked this conversation as resolved.
"unwantedRecommendations": []
}
74 changes: 0 additions & 74 deletions biome.json

This file was deleted.

33 changes: 22 additions & 11 deletions docs/contributing/coding-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,24 @@ Essential patterns and standards for Sentry MCP development.

## Code Style

### Biome Configuration
### Formatting and linting

- 2 spaces, double quotes, semicolons
- Max line: 100 chars
- Formatter width: 80 characters
- Trailing commas in multiline
- MCP and root files use Oxfmt and Oxlint; CLI files still use their own Biome rules.
- CLI's custom Grit rules and inline suppressions remain active until their
equivalents are available in the new linter.

### Naming Conventions

- Files: `kebab-case.ts`
- Functions: `camelCase`
- Types/Classes: `PascalCase`
- Constants: `UPPER_SNAKE_CASE`

### Import Order

```typescript
// 1. Node built-ins
import { readFile } from "node:fs/promises";
Expand All @@ -50,14 +56,14 @@ export const toolName = {
description: "Clear, concise description",
parameters: z.object({
required: z.string().describe("Description"),
optional: z.string().optional()
optional: z.string().optional(),
}),
execute: async (params, context) => {
// 1. Validate inputs
// 2. Call API
// 3. Format output
return formatResponse(data);
}
},
};
```

Expand All @@ -68,17 +74,18 @@ describe("Component", () => {
it("handles normal case", async () => {
// Arrange
const input = createTestInput();

// Act
const result = await method(input);

// Assert
expect(result).toMatchInlineSnapshot();
});
});
```

Key practices:

- Use inline snapshots for formatting
- Mock with MSW
- Test success and error paths
Expand All @@ -87,29 +94,32 @@ Key practices:
## Quality Checklist

Before committing:

```bash
pnpm -w run lint # Biome check
pnpm -w run lint # Oxlint and ast-grep checks for MCP and root files
pnpm -w run lint:fix # Fix issues
pnpm -w run format # Format MCP and root files with Oxfmt
pnpm --filter sentry run lint # CLI Biome rules
pnpm tsc --noEmit # Type check
pnpm test # Run tests
pnpm -w run build # Build all
```

## JSDoc Pattern

```typescript
````typescript
/**
* Brief description.
*
*
* @param param - Description
* @returns What it returns
*
*
* @example
* ```typescript
* const result = func(param);
* ```
*/
```
````

## Security Essentials

Expand All @@ -121,6 +131,7 @@ pnpm -w run build # Build all
## Common Patterns

For shared patterns see:

- Error handling: [common-patterns.md](common-patterns.md#error-handling)
- Zod schemas: [common-patterns.md](common-patterns.md#zod-schema-patterns)
- API usage: [api-patterns.md](api-patterns.md)
Expand Down
17 changes: 11 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
"deploy:docs": "pnpm --filter sentry run generate:schema && pnpm --filter sentry run generate:docs && pnpm --filter sentry-cli-docs run build && pnpm --filter sentry-cli-docs run deploy",
"eval": "pnpm --filter '@sentry/mcp-server-evals...' --if-present run build && dotenv -e .env -e .env.local -- pnpm --filter @sentry/mcp-server-evals run eval",
"eval:ci": "pnpm --filter '@sentry/mcp-server-evals...' --if-present run build && CI=true dotenv -e .env -e .env.local -- pnpm --stream -r run eval:ci",
"format": "biome format --write",
"lint": "biome lint && pnpm run lint:ast-grep",
"format": "oxfmt --write",
"lint": "oxlint . && pnpm run lint:ast-grep",
"lint:ast-grep": "ast-grep scan && ast-grep test --skip-snapshot-tests",
"lint:fix": "biome lint --fix",
"lint:fix": "oxlint --fix .",
"pre-commit:generated": "node scripts/pre-commit-generated.mjs",
"inspector": "pnpx @modelcontextprotocol/inspector@latest",
"inspector:stdio": "pnpx @modelcontextprotocol/inspector@latest -- tsx packages/mcp-server/src/index.ts",
Expand All @@ -50,11 +50,12 @@
},
"dependencies": {
"@ast-grep/cli": "catalog:",
"@biomejs/biome": "catalog:",
"@types/node": "catalog:",
"dotenv": "catalog:",
"dotenv-cli": "catalog:",
"lint-staged": "catalog:",
"oxfmt": "catalog:",
"oxlint": "catalog:",
"simple-git-hooks": "catalog:",
"tsdown": "catalog:",
"tsx": "catalog:",
Expand All @@ -68,8 +69,12 @@
},
"lint-staged": {
"*": [
"biome format --write --no-errors-on-unmatched --files-ignore-unknown=true",
"biome lint --fix --no-errors-on-unmatched --files-ignore-unknown=true"
"oxfmt --write --no-error-on-unmatched-pattern",
"oxlint --fix --no-error-on-unmatched-pattern"
],
"packages/cli/**/*": [
"pnpm --filter sentry exec biome format --write --no-errors-on-unmatched --files-ignore-unknown=true",
"pnpm --filter sentry exec biome lint --fix --no-errors-on-unmatched --files-ignore-unknown=true"
]
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: sentry-cli
version: 0.47.0-dev.0
version: 0.48.0-dev.0
description: Guide for using the Sentry CLI to interact with Sentry from the command line. Use when the user asks about viewing issues, events, projects, organizations, making API calls, or authenticating with Sentry via CLI.
requires:
bins: ["sentry"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: sentry-cli-agent-conversation
version: 0.47.0-dev.0
version: 0.48.0-dev.0
description: List and view agent conversations
requires:
bins: ["sentry"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: sentry-cli-alert
version: 0.47.0-dev.0
version: 0.48.0-dev.0
description: Manage Sentry alert rules
requires:
bins: ["sentry"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: sentry-cli-api
version: 0.47.0-dev.0
version: 0.48.0-dev.0
description: Make an authenticated API request
requires:
bins: ["sentry"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: sentry-cli-auth
version: 0.47.0-dev.0
version: 0.48.0-dev.0
description: Authenticate with Sentry
requires:
bins: ["sentry"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: sentry-cli-build
version: 0.47.0-dev.0
version: 0.48.0-dev.0
description: Manage mobile build artifacts
requires:
bins: ["sentry"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: sentry-cli-cli
version: 0.47.0-dev.0
version: 0.48.0-dev.0
description: CLI-related commands
requires:
bins: ["sentry"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: sentry-cli-code-mappings
version: 0.47.0-dev.0
version: 0.48.0-dev.0
description: Manage code mappings for stack trace linking
requires:
bins: ["sentry"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: sentry-cli-dart-symbol-map
version: 0.47.0-dev.0
version: 0.48.0-dev.0
description: Work with Dart/Flutter symbol maps
requires:
bins: ["sentry"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: sentry-cli-dashboard
version: 0.47.0-dev.0
version: 0.48.0-dev.0
description: Manage Sentry dashboards
requires:
bins: ["sentry"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: sentry-cli-debug-files
version: 0.47.0-dev.0
version: 0.48.0-dev.0
description: Work with debug information files
requires:
bins: ["sentry"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: sentry-cli-docs
version: 0.47.0-dev.0
version: 0.48.0-dev.0
description: Search and query current Sentry documentation
requires:
bins: ["sentry"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: sentry-cli-dsn
version: 0.47.0-dev.0
version: 0.48.0-dev.0
description: Find Sentry DSNs
requires:
bins: ["sentry"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: sentry-cli-event
version: 0.47.0-dev.0
version: 0.48.0-dev.0
description: View, list, and send Sentry events
requires:
bins: ["sentry"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: sentry-cli-explore
version: 0.47.0-dev.0
version: 0.48.0-dev.0
description: Query aggregate event data (Explore)
requires:
bins: ["sentry"]
Expand Down
Loading
Loading