mcpField
G
git-workflow

git-workflow

github.com/yonatangrossDevelopment30394 installsUpdated today
Repository

About git-workflow

git-workflow is a skill that provides guidance for GitHub Flow branching, atomic commits, and recovery operations. It helps development teams maintain reviewable history and offers on-demand rules and checklists for common workflows.

Key features

  1. 01GitHub Flow branching guidance
  2. 02Atomic commit checklist
  3. 03Interactive staging patterns
  4. 04Reflog-based recovery guidance
  5. 05Rules for stacked PRs and rebasing
  6. 06On-demand workflow checklists

Use cases

  1. 01Create branches for tracked work
  2. 02Split changes into reviewable commits
  3. 03Recover commits or branches using reflog
  4. 04Manage dependent stacked pull requests

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/yonatangross/orchestkit --skill git-workflow

After installing, type/git-workflowin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

test-cases.json
checklists/
branch-checklist.md
pre-commit-checklist.md
references/
github-flow.md
interactive-staging.md
recovery-decision-tree.md
reflog-recovery.md
rules/
_sections.md
_template.md
branch-protection.md
history-hygiene.md
merge-strategy.md
monorepo-context.md
recovery-reflog.md
recovery-reset.md
recovery-stash.md
stacked-pr-rebase.md
stacked-pr-workflow.md

Details

From the project README

Git Workflow

Complete git workflow patterns: GitHub Flow branching, atomic commits, and recovery operations. Essential for maintaining clean, reviewable history.

Argument Resolution

SUBCOMMAND = "$ARGUMENTS[0]"  # Optional subcommand, e.g., "recovery", "branch", "stacked"
# If no arguments, show full workflow reference.
# $ARGUMENTS is the full string (CC 2.1.59 indexed access)

Branch Naming Convention

# Feature branches (link to issue)
issue/<number>-<brief-description>
issue/123-add-user-auth

# When no issue exists
feature/<description>
fix/<description>
hotfix/<description>

Branch Rules:

  1. main is always deployable
  2. Branch from main, PR back to main
  3. Branches live < 1-3 days
  4. Delete branch after merge

Atomic Commit Checklist

[ ] Does ONE logical thing
[ ] Leaves codebase working (tests pass)
[ ] Message doesn't need "and" in title
[ ] Can be reverted independently
[ ] Title < 50 chars, body wraps at 72
Interactive Staging
# Stage changes hunk-by-hunk
git add -p

# Options:
# y - stage this hunk
# n - skip this hunk
# s - split into smaller hunks
# e - manually edit the hunk
# q - quit

# Review what's staged
git diff --staged    # What will be committed
git diff             # What won't be committed
Commit Patterns
# Separate concerns
git add -p && git commit -m "refactor: Extract database pool"
git add -p && git commit -m "feat(#456): Add query caching"

# Never combine unrelated changes
# BAD:  "feat: Add auth and fix formatting"
# GOOD: Two separate commits

Recovery Quick Reference

The Safety Net
# ALWAYS check reflog first - it has everything
git reflog

# Shows ALL recent HEAD movements
# Even "deleted" commits live here for 90 days
Common Recovery Scenarios
ScenarioNot PushedAlready Pushed
Undo commitgit reset --soft HEAD~1git revert HEAD
Wrong branchcherry-pick + resetcherry-pick + revert
Lost commitsgit reset --hard HEAD@{N}N/A
Bad rebasegit rebase --abort or reflogreflog + force-with-lease
Quick Recovery Commands
# Undo last commit, keep changes staged
git reset --soft HEAD~1

# Find lost commits
git reflog | grep "your message"

# Recover to previous state
git reset --hard HEAD@{1}

# Safe force push (feature branches only)
git push --force-with-lease

Standard Workflow

# 1. Start fresh
git checkout main && git pull origin main
git checkout -b issue/123-my-feature

# 2. Work with atomic commits
git add -p
git commit -m "feat(#123): Add User model"

# 3. Stay updated
git fetch origin && git rebase origin/main

# 4. Push and PR
git push -u origin issue/123-my-feature
gh pr create --fill

# 5. Cleanup after merge
git checkout main && git pull
git branch -d issue/123-my-feature

Anti-Patterns

Avoid:
- Long-lived branches (> 1 week)
- Merging main into feature (use rebase)
- Direct commits to main
- Force push to shared branches
- Commits that need "and" in message
- Committing broken code

Best Practices Summary

  1. Branch from main - Always start fresh
  2. Stage interactively - Use git add -p
  3. One thing per commit - If you say "and", split it
  4. Rebase, don't merge - Keep history clean
  5. Check reflog first - When something goes wrong
  6. Force-with-lease - Safer than force push
  7. Delete after merge - No stale branches

Related Skills

  • ork:commit - Create commits with conventional format and pre-commit validation
  • git-recovery - Quick recovery from common git mistakes using reflog operations
  • stacked-prs - Multi-PR development for large features with dependent PRs
  • ork:create-pr - Comprehensive PR creation with proper formatting

Key Decisions

DecisionChoiceRationale
Branching modelGitHub FlowSimple single-branch workflow, main is always deployable
Merge strategyRebase over mergeKeeps history clean and linear, easier to bisect
Branch namingissue/-Links work to tracking, enables automation
Commit granularityAtomic (one thing)Independent revert, clear history, easier review
Force push--force-with-lease onlyPrevents overwriting others' work on shared branches

Rules

Each category has individual rule files in rules/ loaded on-demand:

CategoryRuleImpactKey Pattern
Branch Protection${CLAUDE_PLUGIN_ROOT}/skills/git-workflow/rules/branch-protection.mdCRITICALProtected branches, required PR workflow
Merge Strategy${CLAUDE_PLUGIN_ROOT}/skills/git-workflow/rules/merge-strategy.mdHIGHRebase-first, conflict resolution, force-with-lease
History Hygiene${CLAUDE_PLUGIN_ROOT}/skills/git-workflow/rules/history-hygiene.mdHIGHSquash WIP, fixup commits, clean history
Recovery${CLAUDE_PLUGIN_ROOT}/skills/git-workflow/rules/recovery-reflog.mdCRITICALReflog recovery for lost commits and branches
Recovery${CLAUDE_PLUGIN_ROOT}/skills/git-workflow/rules/recovery-reset.mdCRITICALSafe vs dangerous reset modes
Recovery${CLAUDE_PLUGIN_ROOT}/skills/git-workflow/rules/recovery-stash.mdHIGHStash management and dropped stash recovery
Stacked PRs${CLAUDE_PLUGIN_ROOT}/skills/git-workflow/rules/stacked-pr-workflow.mdHIGHStack planning, PR creation, dependency tracking
Stacked PRs${CLAUDE_PLUGIN_ROOT}/skills/git-workflow/rules/stacked-pr-rebase.mdHIGHRebase management, force-with-lease, retargeting
Monorepo${CLAUDE_PLUGIN_ROOT}/skills/git-workflow/rules/monorepo-context.mdMEDIUM--add-dir, per-service CLAUDE.md, workspace detection

Total: 9 rules across 6 categories

References

Load on demand with Read("${CLAUDE_PLUGIN_ROOT}/skills/git-workflow/references/<file>"):

FileContent
github-flow.mdGitHub Flow branching guide
interactive-staging.mdInteractive staging patterns
reflog-recovery.mdReflog recovery techniques
recovery-decision-tree.mdRecovery scenario decision tree

Checklists

Load on demand with Read("${CLAUDE_PLUGIN_ROOT}/skills/git-workflow/checklists/<file>"):

FileContent
branch-checklist.mdPre-flight checks before creating branches
pre-commit-checklist.mdValidation before committing

Comments

Markdown supported