cursor-git-integration
БесплатноБез исполняемых скриптовНе проверенIntegrate Git workflows with Cursor IDE: AI commit messages, @Git context, diff review, and conflict resolution. Triggers on "cursor git", "git in cursor"…
от jeremylongshore★ 2 961 звезда на GitHubОб этом скилле
Cursor Git Integration
Overview
Use Cursor's Git features as a view and drafting aid while preserving repository branch protection, reviews, signed checks, and human ownership of commits/merges.
Prerequisites
- A clean or recoverable working tree, repository contribution rules, and correct remote identity.
- Required checks and reviewer/approval expectations for the target branch.
Instructions
- Inspect status and diff before staging; stage only reviewed, intended files.
- Draft but verify commit messages and never include secrets or unrelated changes.
- Run required local checks, push through the normal branch/PR workflow, and resolve feedback with evidence.
- Use revert or a new corrective commit for mistakes rather than rewriting shared history.
Output
- A scoped, reviewable Git change with validation evidence and a normal revert path.
Error Handling
| Condition | Safe response |
|---|---|
| Working tree has unrelated changes | Separate/stash them before staging. |
| Generated commit message misstates work | Edit it to match the actual diff. |
| Protected branch rejects push | Use the approved PR/check process; do not weaken controls. |
Examples
Review a Cursor-generated diff, stage only its intended files, run the focused suite, and push a topic branch for review. If an accidental file is staged, unstage it and recheck the diff before committing.
Leverage Cursor's AI features within Git workflows: AI-generated commit messages, @Git context for code review, merge conflict resolution, and branch management.
Source Control Panel
Access with Cmd+Shift+G / Ctrl+Shift+G:
┌─ SOURCE CONTROL ────────────────────────────────┐
│ main ← current branch │
│ │
│ Changes (3) │
│ M src/api/users.ts │
│ A src/api/products.ts │
│ M prisma/schema.prisma │
│ │
│ Commit message: [✨ Generate with AI] │
│ [Commit] [Commit & Push] │
└─────────────────────────────────────────────────┘
AI-Generated Commit Messages
Click the sparkle/AI icon next to the commit message input. Cursor reads the staged diff and generates a message:
Example output:
feat: add product catalog CRUD API with Prisma model
- Add Product model to Prisma schema with name, price, category fields
- Create GET/POST/PUT/DELETE endpoints in src/api/products.ts
- Add Zod validation for product creation and update inputs
Tips for better commit messages:
- Stage related changes together (not unrelated edits)
- The AI reads the diff, so clean diffs produce better messages
- Edit the generated message before committing if needed
- Configure Conventional Commits in project rules:
# .cursor/rules/git-conventions.mdc
---
description: "Git commit conventions"
globs: ""
alwaysApply: true
---
Use Conventional Commits format:
- feat: new feature
- fix: bug fix
- refactor: code restructure without behavior change
- docs: documentation only
- test: adding or updating tests
- chore: maintenance tasks
Keep subject line under 72 characters.
Body explains WHY, not WHAT (the diff shows what).
@Git Context in Chat
Use @Git in Chat or Composer to include git context:
@Git (Working State)
@Git
Review my uncommitted changes. Check for:
- Any debugging code left in (console.log, debugger)
- Missing error handling
- Type safety issues
- Potential performance problems
@Git includes the diff of all uncommitted changes (staged + unstaged).
@Git (Branch Diff)
@Git
Summarize all changes in this branch compared to main.
What features/fixes were implemented?
Are there any breaking changes?
When on a feature branch, @Git shows the cumulative diff between your branch and main.
Merge Conflict Resolution
When a merge conflict occurs, use Chat for AI assistance:
@src/api/users.ts
I have a merge conflict in this file. The markers show:
<<<<<<< HEAD (my changes)
Added email validation with Zod
=======
Added phone number field to user schema
>>>>>>> feature/phone-support
Help me resolve this to keep both changes:
- Keep the Zod email validation from my branch
- Add the phone number field from the other branch
- Ensure the Zod schema includes phone validation too
Systematic Conflict Resolution Workflow
# 1. Start the merge
git merge feature/other-branch
# 2. List conflicted files
git diff --name-only --diff-filter=U
# 3. For each conflicted file, open in Cursor and use Chat:
# @the-conflicted-file.ts
# "Resolve the merge conflict. Keep both sets of changes where possible."
# 4. After resolving, stage and commit
git add .
git commit -m "merge: resolve conflicts between feature branches"
Code Review with AI
Reviewing a PR Before Pushing
@Git
I'm ab
Установить cursor-git-integration в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditBash(cmd:*)Вложенные файлы
FAQ
Что делает скилл cursor-git-integration?
Integrate Git workflows with Cursor IDE: AI commit messages, @Git context, diff review, and conflict resolution. Triggers on "cursor git", "git in cursor", "cursor version control", "cursor commit", "cursor branch", "@Git".
Как установить скилл cursor-git-integration?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл cursor-git-integration запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic