home / skills / atman36 / ai-vibe-prompts / git-workflow

This skill enforces professional Git workflows, ensuring clean commit history, proper branch naming, and effective collaboration through Conventional Commits

npx playbooks add skill atman36/ai-vibe-prompts --skill git-workflow

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

Files (1)
SKILL.md
1.7 KB
---
name: git-workflow
description: Git best practices for commits, branches, pull requests, and collaboration workflows following Conventional Commits and GitFlow patterns
version: 1.0.0
author: AI-Vibe-Prompts
tags: [git, workflow, version-control, collaboration, conventional-commits]
auto_invoke: true
---

# Git Workflow Skill

## Objective

Implement professional Git workflows ensuring clean commit history, proper branch management, effective collaboration, and code review best practices.

## When to Use This Skill

Auto-invoke when:
- User mentions "commit", "push", "branch", "merge", "pull request", "PR"
- Before code changes need to be saved
- Preparing for deployment or release
- Resolving merge conflicts

## Commit Message Standards (Conventional Commits)

**Format**: `<type>(<scope>): <subject>`

**Types**: feat, fix, docs, style, refactor, perf, test, chore, ci

**Examples**:
```bash
feat(auth): add OAuth2 login support
fix(api): handle null response in user endpoint
docs(readme): update installation instructions
```

## Branch Naming: `<type>/<ticket-id>-<description>`

**Examples**:
```bash
feature/AUTH-123-oauth-integration
bugfix/CORE-456-fix-null-pointer
hotfix/PROD-789-critical-security-patch
```

## GitFlow Workflow

**Main**: production, **Develop**: integration
**Features**: branch from develop → merge to develop
**Releases**: branch from develop → merge to main+develop
**Hotfixes**: branch from main → merge to main+develop

## Pre-Commit Checklist

```bash
# No secrets
git diff --cached | grep -iE "api[_-]?key|secret|password"

# Run quality gates
npm run lint && npm run typecheck && npm run test
```

## Version History

- **1.0.0** (2025-01-03): Initial Git workflow skill

Overview

This skill encapsulates professional Git best practices for commits, branches, pull requests, and team collaboration. It enforces Conventional Commits and a GitFlow-style branching model to maintain a clear history and safe releases. The goal is predictable workflows that scale for teams and CI/CD pipelines.

How this skill works

The skill inspects commit messages, branch names, and workflow actions, validating them against Conventional Commits and a type-based branch naming scheme. It recommends branch creation, merge targets, and release/hotfix procedures, and runs a pre-commit checklist that checks for secrets and runs linters, type checks, and tests. When conflicts or policy violations are detected, it suggests concrete fixes and the correct sequence of git commands.

When to use it

  • Before creating a commit or push to ensure message and staged changes meet standards
  • When creating new branches for features, bugfixes, releases, or hotfixes
  • When opening or reviewing pull requests to enforce merge targets and review checklist
  • Prior to deployments or release branching to ensure correct versioning and merges
  • While resolving merge conflicts to apply the team-approved conflict resolution flow

Best practices

  • Write commits using Conventional Commits: type(scope): subject — use types like feat, fix, docs, chore
  • Name branches as type/TICKET-ID-short-description (e.g., feature/AUTH-123-oauth-integration)
  • Follow GitFlow: develop for integration, main for production; merge features to develop and releases to main+develop
  • Run a pre-commit checklist: scan staged changes for secrets, lint, typecheck, and run tests before pushing
  • Open pull requests with a clear description, linked ticket, and request at least one reviewer before merge

Example use cases

  • Implementing a new feature: create feature/PROJ-456-description from develop, commit with feat(scope): subject, open PR to develop
  • Applying a critical fix in production: branch hotfix/PROD-789-critical-fix from main, apply fix, merge back to main and develop, publish a patch release
  • Preparing a release: create release/x.y.z from develop, finalize versioning, merge to main and back to develop, tag and deploy
  • Resolving CI failures: run pre-commit checks locally (lint, typecheck, tests), fix issues, and push clean commits

FAQ

What commit types should I use?

Use Conventional Commit types like feat, fix, docs, style, refactor, perf, test, chore, and ci to express intent and support changelog generation.

Which branch should I base a feature branch on?

Base feature branches on develop. Hotfixes start from main and merge back into both main and develop.