-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
chore: add commit skill for Claude, Cursor, and Codex #16804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,160 @@ | ||
| --- | ||
| name: commit | ||
| description: ALWAYS use this skill when committing code changes — never commit directly without it. Creates commits following Sentry conventions with proper conventional commit format and issue references. Trigger on any commit, git commit, save changes, or commit message task. | ||
| --- | ||
|
|
||
| # Sentry Commit Messages | ||
|
|
||
| Follow these conventions when creating commits for Sentry projects. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| Before committing, always check the current branch: | ||
|
|
||
| ```bash | ||
| git branch --show-current | ||
| ``` | ||
|
|
||
| **If you're on `main` or `master`, you MUST create a feature branch first** — unless the user explicitly asked to commit to main. Do not ask the user whether to create a branch; just proceed with branch creation. The `create-branch` skill will still propose a branch name for the user to confirm. | ||
|
|
||
| Use the `create-branch` skill to create the branch. After `create-branch` completes, verify the current branch has changed before proceeding: | ||
|
|
||
| ```bash | ||
| git branch --show-current | ||
| ``` | ||
|
|
||
| If still on `main` or `master` (e.g., the user aborted branch creation), stop — do not commit. | ||
|
|
||
| ## Format | ||
|
|
||
| ``` | ||
| <type>(<scope>): <subject> | ||
|
|
||
| <body> | ||
|
|
||
| <footer> | ||
| ``` | ||
|
|
||
| The header is required. Scope is optional. All lines must stay under 100 characters. | ||
|
|
||
| ## Commit Types | ||
|
|
||
| | Type | Purpose | | ||
| |------|---------| | ||
| | `feat` | New feature | | ||
| | `fix` | Bug fix | | ||
| | `ref` | Refactoring (no behavior change) | | ||
| | `perf` | Performance improvement | | ||
| | `docs` | Documentation only | | ||
| | `test` | Test additions or corrections | | ||
| | `build` | Build system or dependencies | | ||
| | `ci` | CI configuration | | ||
| | `chore` | Maintenance tasks | | ||
| | `style` | Code formatting (no logic change) | | ||
| | `meta` | Repository metadata | | ||
| | `license` | License changes | | ||
|
|
||
| ## Subject Line Rules | ||
|
|
||
| - Use imperative, present tense: "Add feature" not "Added feature" | ||
| - Capitalize the first letter | ||
| - No period at the end | ||
| - Maximum 70 characters | ||
|
|
||
| ## Body Guidelines | ||
|
|
||
| - Explain **what** and **why**, not how | ||
| - Use imperative mood and present tense | ||
| - Include motivation for the change | ||
| - Contrast with previous behavior when relevant | ||
|
|
||
| ## Footer: Issue References | ||
|
|
||
| Reference issues in the footer using these patterns: | ||
|
|
||
| ``` | ||
| Fixes GH-1234 | ||
| Fixes #1234 | ||
| Fixes SENTRY-1234 | ||
| Refs LINEAR-ABC-123 | ||
| ``` | ||
|
|
||
| - `Fixes` closes the issue when merged | ||
| - `Refs` links without closing | ||
|
|
||
| ## AI-Generated Changes | ||
|
|
||
| When changes were primarily generated by a coding agent (like Claude Code), include the Co-Authored-By attribution in the commit footer: | ||
|
|
||
| ``` | ||
| Co-Authored-By: Claude <noreply@anthropic.com> | ||
| ``` | ||
|
|
||
| This is the only indicator of AI involvement that should appear in commits. Do not add phrases like "Generated by AI", "Written with Claude", or similar markers in the subject, body, or anywhere else in the commit message. | ||
|
|
||
| ## Examples | ||
|
|
||
| ### Simple fix | ||
|
|
||
| ``` | ||
| fix(api): Handle null response in user endpoint | ||
|
|
||
| The user API could return null for deleted accounts, causing a crash | ||
| in the dashboard. Add null check before accessing user properties. | ||
|
|
||
| Fixes SENTRY-5678 | ||
| Co-Authored-By: Claude <noreply@anthropic.com> | ||
| ``` | ||
|
|
||
| ### Feature with scope | ||
|
|
||
| ``` | ||
| feat(alerts): Add Slack thread replies for alert updates | ||
|
|
||
| When an alert is updated or resolved, post a reply to the original | ||
| Slack thread instead of creating a new message. This keeps related | ||
| notifications grouped together. | ||
|
|
||
| Refs GH-1234 | ||
| ``` | ||
|
|
||
| ### Refactor | ||
|
|
||
| ``` | ||
| ref: Extract common validation logic to shared module | ||
|
|
||
| Move duplicate validation code from three endpoints into a shared | ||
| validator class. No behavior change. | ||
| ``` | ||
|
|
||
| ### Breaking change | ||
|
|
||
| ``` | ||
| feat(api)!: Remove deprecated v1 endpoints | ||
|
|
||
| Remove all v1 API endpoints that were deprecated in version 23.1. | ||
| Clients should migrate to v2 endpoints. | ||
|
|
||
| BREAKING CHANGE: v1 endpoints no longer available | ||
| Fixes SENTRY-9999 | ||
| ``` | ||
|
|
||
| ## Revert Format | ||
|
|
||
| ``` | ||
| revert: feat(api): Add new endpoint | ||
|
|
||
| This reverts commit abc123def456. | ||
|
|
||
| Reason: Caused performance regression in production. | ||
| ``` | ||
|
|
||
| ## Principles | ||
|
|
||
| - Each commit should be a single, stable change | ||
| - Commits should be independently reviewable | ||
| - The repository should be in a working state after each commit | ||
|
|
||
| ## References | ||
|
|
||
| - [Sentry Commit Messages](https://develop.sentry.dev/engineering-practices/commit-messages/) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cursor contribution guidelines deleted without equivalent replacementMedium Severity The 310-line |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| --- | ||
| name: create-branch | ||
| description: Create a git branch following Sentry naming conventions. Use when asked to "create a branch", "new branch", "start a branch", "make a branch", "switch to a new branch", or when starting new work on the default branch. | ||
| argument-hint: '[optional description of the work]' | ||
| --- | ||
|
|
||
| # Create Branch | ||
|
|
||
| Create a git branch with the correct type prefix and a descriptive name following Sentry conventions. | ||
|
|
||
| ## Step 1: Get the Username Prefix | ||
|
|
||
| Run `gh api user --jq .login` to get the GitHub username. | ||
|
|
||
| If the command fails (e.g. not authenticated), ask the user for their preferred prefix. | ||
|
|
||
| ## Step 2: Determine the Branch Description | ||
|
|
||
| **If `$ARGUMENTS` is provided**, use it as the description of the work. | ||
|
|
||
| **If no arguments**, check for local changes: | ||
|
|
||
| ```bash | ||
| git diff | ||
| git diff --cached | ||
| git status --short | ||
| ``` | ||
|
|
||
| - **Changes exist**: read the diff content to understand what the work is about and generate a description. | ||
| - **No changes**: ask the user what they are about to work on. | ||
|
|
||
| ## Step 3: Classify the Type | ||
|
|
||
| Pick the type from this table based on the description: | ||
|
|
||
| | Type | Use when | | ||
| | --------- | --------------------------------------------------------------------- | | ||
| | `feat` | New user-facing functionality | | ||
| | `fix` | Broken behavior now works | | ||
| | `ref` | Same behavior, different structure | | ||
| | `chore` | Deps, config, version bumps, updating existing tooling — no new logic | | ||
| | `perf` | Same behavior, faster | | ||
| | `style` | CSS, formatting, visual-only | | ||
| | `docs` | Documentation only | | ||
| | `test` | Tests only | | ||
| | `ci` | CI/CD config | | ||
| | `build` | Build system | | ||
| | `meta` | Repo metadata changes | | ||
| | `license` | License changes | | ||
|
|
||
| When unsure: `feat` for new things (including new scripts, skills, or tools), `ref` for restructuring existing things, `chore` only when updating/maintaining something that already exists. | ||
|
|
||
| ## Step 4: Generate and Propose | ||
|
|
||
| Build the branch name as `<username>/<type>/<short-description>`. | ||
|
|
||
| Rules for `<short-description>`: | ||
|
|
||
| - Kebab-case, lowercase | ||
| - 3 to 6 words, concise but clear | ||
| - Describe the change, not file names | ||
| - Only use ASCII letters, digits, and hyphens — no spaces, dots, colons, tildes, or other git-forbidden characters | ||
|
|
||
| Present it to the user and ask if they want to use it, modify it, or change the type. | ||
|
|
||
| ### Examples | ||
|
|
||
| | Work description | Branch name | | ||
| | ------------------------------------------ | ------------------------------------------- | | ||
| | Dropdown menu not closing on outside click | `priscila/fix/dropdown-not-closing-on-blur` | | ||
| | Adding search to conversations page | `priscila/feat/add-search-to-conversations` | | ||
| | Restructuring drawer components | `priscila/ref/simplify-drawer-components` | | ||
| | Updating test fixtures | `priscila/chore/update-test-fixtures` | | ||
| | Bumping @sentry/react to latest version | `priscila/chore/bump-sentry-react` | | ||
| | Adding a new agent skill | `priscila/feat/add-create-branch-skill` | | ||
|
|
||
| ## Step 5: Create the Branch | ||
|
|
||
| Once confirmed, detect the current and default branch: | ||
|
|
||
| ```bash | ||
| git branch --show-current | ||
| git remote | grep -qx origin && echo origin || git remote | head -1 | ||
| git symbolic-ref refs/remotes/<remote>/HEAD 2>/dev/null | sed 's|refs/remotes/<remote>/||' | tr -d '[:space:]' | ||
| ``` | ||
|
|
||
| If `symbolic-ref` fails, fall back to `git branch --list main master`: use the one that exists; if both or neither exist, ask the user. | ||
|
|
||
| If `git branch --show-current` is empty (detached HEAD), show the current commit (`git rev-parse --short HEAD`) and ask whether to branch from it or switch to the default branch first. | ||
|
|
||
| Otherwise, if the current branch is not the default branch, warn the user and ask whether to branch from the current branch or switch to the default branch first. | ||
|
|
||
| If the user wants to switch to the default branch, handle any uncommitted changes appropriately (offer to stash them if present), then run `git checkout <default-branch>`. On any failure, restore stashed changes if applicable and stop. | ||
|
|
||
| Before creating the branch, check that the name doesn't already exist locally or on the remote (`git show-ref`). If it does, ask the user to choose a different name. | ||
|
|
||
| Create the branch: | ||
|
|
||
| ```bash | ||
| git checkout -b <branch-name> | ||
| ``` | ||
|
|
||
| Restore any stashed changes after the branch is created. | ||
|
|
||
| ## References | ||
|
|
||
| - [Sentry Branch Naming](https://develop.sentry.dev/sdk/getting-started/standards/code-submission/#branch-naming) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../.agents/skills/commit |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../.agents/skills/create-branch |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "version": 1, | ||
| "skills": { | ||
| "commit": { | ||
| "source": "getsentry/skills", | ||
| "sourceType": "github", | ||
| "computedHash": "62f7951cf7fe07e1f4b07d3c5ceb3cd27fde5d1bfe90fbab2639558f8dc044b0" | ||
| }, | ||
| "create-branch": { | ||
| "source": "getsentry/skills", | ||
| "sourceType": "github", | ||
| "computedHash": "70b71bcb53bcdf81fa44ef7518923e640add2c338908607171e99cb387378127" | ||
| } | ||
| } | ||
| } |


Uh oh!
There was an error while loading. Please reload this page.