Agent Skill
2/7/2026

git-operations

Handle all Git operations for code changes

R
rom
0GitHub Stars
1Views
npx skills add rom-orlovich/agents-system

SKILL.md

Namegit-operations
DescriptionHandle all Git operations for code changes

name: git-operations description: Handle all Git operations for code changes

Git Operations Skill

This skill handles all Git operations required for implementing and committing code changes.

Purpose

Execute Git operations reliably and consistently, following best practices for branching, committing, and pushing code changes.

When to Use

  • Setting up workspace for a new task
  • Creating feature branches
  • Committing code changes
  • Pushing to remote
  • Updating PRs

Available Operations

1. Clone Repository

git clone <repository-url> <workspace-path>
cd <workspace-path>

2. Checkout Branch

# Checkout existing branch
git checkout <branch-name>

# Create and checkout new branch
git checkout -b <new-branch-name>

3. Pull Latest Changes

git fetch origin
git pull origin <branch-name>

4. Create Feature Branch

# Branch naming convention
fix/sentry-<issue-id>     # For Sentry-triggered fixes
fix/<jira-key>-<summary>  # For Jira-triggered fixes
feat/<feature-name>       # For new features

5. Stage and Commit

git add <files>
git commit -m "<type>: <description>"

6. Push to Remote

git push origin <branch-name>

# Force push if needed (after rebase)
git push --force-with-lease origin <branch-name>

Commit Convention

Use Conventional Commits format:

TypeDescriptionExample
fix:Bug fixfix: handle null user session
feat:New featurefeat: add password reset flow
test:Adding teststest: add auth service tests
docs:Documentationdocs: update API documentation
refactor:Code refactoringrefactor: extract auth logic
chore:Maintenancechore: update dependencies

Commit Message Format

<type>: <short description> (<issue-key>)

[optional body]

[optional footer]

Examples:

test: add tests for null check in auth service

- Add test for expired session handling
- Add test for missing user object

Refs: PROJ-123
fix: add null check for user session (PROJ-123)

The session object could be undefined when the user's
session expires. This adds a guard clause to prevent
the null pointer exception.

Co-authored-by: AI Agent <ai-agent@company.com>

Process

Workspace Setup Flow

1. Check if workspace exists
   ├─ Yes: Pull latest changes
   └─ No: Clone repository

2. Checkout feature branch
   ├─ Exists: Checkout and pull
   └─ New: Create from main/master

3. Verify clean state
   └─ No uncommitted changes

Commit Flow

1. Run tests (verify passing)
2. Stage specific files (not git add .)
3. Create commit with conventional message
4. Verify commit succeeded

Push Flow

1. Verify local branch is ahead of remote
2. Push to origin
3. If conflict: Report and request intervention
4. Verify push succeeded

Output Format

{
  "operation": "setup|commit|push",
  "status": "success|failed",
  "details": {
    "repository": "org/repo",
    "branch": "fix/sentry-PROJ-123",
    "commits": ["abc123", "def456"],
    "pushed": true
  },
  "errors": []
}

Error Handling

ErrorAction
Clone failedCheck credentials, report error
Merge conflictReport conflict, do NOT auto-resolve
Push rejectedPull latest, report if still failing
Authentication failedReport credential issue

Important

  • NEVER force push without --force-with-lease
  • NEVER commit directly to main/master
  • ALWAYS use specific file staging, not git add .
  • ALWAYS verify tests pass before committing
  • Include issue key in commit messages
Skills Info
Original Name:git-operationsAuthor:rom