home / skills / nickcrew / claude-cortex / git-ops

git-ops skill

/skills/git-ops

This skill helps you manage git operations safely, generate conventional commit messages, and provide workflow guidance for branching and merges.

npx playbooks add skill nickcrew/claude-cortex --skill git-ops

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
1.0 KB
---
name: git-ops
description: Use when performing git operations or generating smart commit messages - provides safe git workflow guidance, validation checks, and conventional commit formatting.
---

# Git Ops

## Overview
Execute git operations safely while producing clear, conventional commit messages and workflow guidance.

## When to Use
- Running git commands (status, add, commit, push, pull)
- Generating smart commit messages
- Managing branches and merges

Avoid when:
- The task is unrelated to git operations

## Quick Reference

| Task | Load reference |
| --- | --- |
| Git operations | `skills/git-ops/references/git.md` |
| **Branching Strategies** | `skills/git-ops/references/branching-strategies.md` |

## Workflow
1. Confirm repository state and intent.
2. Load the git operations reference.
3. Execute the command safely.
4. Provide status summary and next steps.

## Output
- Operation result summary
- Suggested follow-ups or warnings

## Common Mistakes
- Running destructive commands without confirmation
- Writing non-standard commit messages

Overview

This skill helps you perform git operations safely while generating clear, conventional commit messages and workflow guidance. It focuses on validating repository state, recommending safe commands, and producing smart, human-readable commit summaries. Use it to reduce mistakes, enforce conventions, and speed up routine git tasks.

How this skill works

The skill inspects the current repository state, staged changes, branch relationships, and relevant branching strategy guidance. It validates commands for potential destructive effects, suggests safe alternatives, and formats commit messages according to conventional commit rules. After executing or simulating an operation, it returns a concise result summary and recommended next steps.

When to use it

  • Running or preparing git commands like status, add, commit, push, pull, fetch, and merge
  • Generating concise, conventional commit messages from staged changes or commit intent
  • Creating, switching, or cleaning up branches and resolving simple merge scenarios
  • Validating commands before running potentially destructive operations (force pushes, resets)
  • When you need a safe, documented workflow step-by-step for team consistency

Best practices

  • Always confirm repository status and uncommitted changes before destructive commands
  • Use conventional commit format for clear intent and automated tooling compatibility
  • Prefer creating feature or fix branches rather than committing directly to main
  • Run a dry-run or simulate the effect of complex operations when unsure
  • Include concise scope and description in commit messages and reference issue IDs when applicable

Example use cases

  • Generate a conventional commit message from staged diff for a bug fix
  • Validate and run a safe git push sequence that prevents accidental force pushes
  • Recommend branch naming and merging steps for a release workflow
  • Summarize repository status and propose next actions after a failed merge
  • Prepare a safe sequence to rebase a feature branch onto an updated main branch

FAQ

Can the skill run destructive commands like git reset --hard?

It will warn and require explicit confirmation before recommending or running destructive commands; it prefers safer alternatives and dry-run simulations.

How are commit messages formatted?

Commit messages follow conventional commit guidelines: type(scope): short description, optional body and footer for breaking changes or issue references.