Skip to content

Intelligent Git topic workflow assistant for Claude Code with production-grade aliases

Notifications You must be signed in to change notification settings

appleshan/git-workflow-skill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Git-Workflow Skills for Claude Code

one intelligent Git workflow assistants that streamline your development process:

  • git-workflow: Topic-based branch management with safety checks and workflow guidance

Features

๐ŸŽฏ Core Capabilities

  • Intent Recognition: Intelligent mapping from natural language โ†’ Git commands
  • Safety Guardrails: Three-stage checks (pre/during/post-execution) to prevent misoperations
  • Context Awareness: Recommends appropriate actions based on current branch state
  • Learning Assistance: Provides workflow guidance and problem diagnosis

๐Ÿ“ฆ Skills Overview

Topic-based branch management with safety checks and workflow guidance.

Key Features: tnr/tn/tmg/td lifecycle | Three-stage safety checks | PR preparation | Advanced operations (fixup/amend) | Conflict resolution

โ†’ Full Documentation


Quick Start

Prerequisites

  1. Git Aliases Configuration (Required for git-workflow):

    # Location: ./git/aliases.gitconfig
    # Contains core commands: tnr, tn, tmg, td, fixup, bdf, blg, etc.
  2. Claude Code (Required):

    • Version: Supports Skills functionality
    • Configuration: ~/.claude/skills/ directory exists
  3. Optional Dependencies:

    • fzf: Interactive selection (fixup, blf, pif)
    • ripgrep: Repository search (rg, rg-all)

Installation

Skills are deployed to:

~/.claude/skills/git-workflow/
โ”œโ”€โ”€ SKILL.md
โ””โ”€โ”€ references/
    โ”œโ”€โ”€ git-topic-workflow.md
    โ”œโ”€โ”€ git-safety-mechanisms.md
    โ”œโ”€โ”€ git-pr-preparation.md
    โ”œโ”€โ”€ git-advanced-operations.md
    โ””โ”€โ”€ git-troubleshooting.md

Trigger rules added to:

~/.claude/skills/skill-rules.json

Verify Installation:

# Check git-workflow files
ls ~/.claude/skills/git-workflow/

# Verify trigger rules
grep -A 20 "git-workflow" ~/.claude/skills/skill-rules.json

Usage

Quick Examples

git-workflow: Natural language commands for branch management

"ๅผ€ๅง‹ๆ–ฐๅŠŸ่ƒฝ user-auth" โ†’ Creates and pushes feature branch
"ๅฎŒๆˆๅŠŸ่ƒฝ" โ†’ Merges and cleans up branch
"ๆŸฅ็œ‹ branch diff" โ†’ Shows changes vs base branch

โ†’ git-workflow Full Usage Guide


Typical Workflow

Complete Feature Development (End-to-End)

Combining both skills for a full development cycle:

# 1. Create branch (git-workflow)
You: "ๅผ€ๅง‹ๆ–ฐๅŠŸ่ƒฝ user-auth"
โ†’ git tnr feature/user-auth

# 2. Save progress during development (git-workflow)
You: "ไธดๆ—ถไฟๅญ˜"
โ†’ git save "WIP: implementing login"

# 3. Check progress (git-workflow)
You: "ๆŸฅ็œ‹ๆˆ‘ๆ”นไบ†ไป€ไนˆ"
โ†’ git bdf  # Diff
โ†’ git blg  # Log

# 4. Modify history (git-workflow)
You: "ไฟฎๆ”นไน‹ๅ‰็š„ commit"
โ†’ git fixup  # fzf selection

# 5. merged on GitHub, cleanup (git-workflow)
You: "ๅฎŒๆˆๅŠŸ่ƒฝ"
โ†’ git tmg  # merge and delete branch

More Scenarios:


Architecture

Design Principles

Separation of Concerns:

  • Skills Layer: Intent recognition, safety checks, guidance
  • Aliases Layer: Git operations, runtime safety, error handling

YAGNI Approach:

  • Don't rewrite aliases logic
  • Focus on intelligent wrapping and context awareness

โ†’ Full Architecture Documentation


Trigger Rules

Trigger rules are defined in ~/.claude/skills/skill-rules.json.

git-workflow

Example Keywords: "ๅผ€ๅง‹ๆ–ฐๅŠŸ่ƒฝ", "ๅฎŒๆˆๅŠŸ่ƒฝ", "git workflow", "branch diff", "fixup"

โ†’ Complete Trigger Rules


Project Statistics

Metric Value
Total Skills 1
Total Documents 6
Total Lines 3620

Breakdown:


Development History

Phase 1: MVP (Completed)

Goal: Validate core value - intent recognition + safety checks

Deliverables:

  • โœ… SKILL.md
  • โœ… git-topic-workflow.md
  • โœ… git-safety-mechanisms.md
  • โœ… skill-rules.json trigger rules

Validation Criteria:

  • โœ… Can recognize 5 types of user intents
  • โœ… State checks cover 4 dimensions
  • โœ… Generate correct and safe commands

Phase 2: Enhancement (Completed)

Goal: Add PR preparation, history modification, recovery guidance

Deliverables:

  • โœ… git-pr-preparation.md
  • โœ… git-advanced-operations.md
  • โœ… git-troubleshooting.md

Validation Criteria:

  • โœ… PR preparation checklist complete
  • โœ… Fixup/amend guidance clear
  • โœ… Conflict resolution workflow actionable
  • โœ… Recovery solutions cover common misoperations

Phase 3: Optimization (Optional)

Goal: Improve based on actual usage feedback

Plan:

  • Adjust trigger rules (based on effectiveness)
  • Add more common scenarios
  • Improve error messages
  • Workflow visualization (if valuable)

Contributing Guidelines

File Structure

git-workflow-skill/
โ”œโ”€โ”€ README.md                    # This file (English)
โ”œโ”€โ”€ README_zh-CN.md             # Chinese version
โ”œโ”€โ”€ skills/
โ”‚   โ””โ”€โ”€ git-workflow/           # Git workflow skill
โ”‚       โ”œโ”€โ”€ SKILL.md
โ”‚       โ”œโ”€โ”€ references/
โ”‚       โ”œโ”€โ”€ docs/
โ”‚       โ”‚   โ”œโ”€โ”€ README.md       # Development documentation (English)
โ”‚       โ”‚   โ”œโ”€โ”€ README_zh-CN.md # Development documentation (Chinese)
โ”‚       โ”‚   โ””โ”€โ”€ testing.md
โ”‚       โ””โ”€โ”€ examples/scenarios.md
โ””โ”€โ”€ git/                         # Git aliases configuration
    โ”œโ”€โ”€ aliases.gitconfig
    โ””โ”€โ”€ Git-Aliases-Reference-Manual.md

Modifying the Skills

git-workflow Skill:

  1. Modify Main Document:

    vim skills/git-workflow/SKILL.md
    rsync -av --exclude 'docs/' --exclude 'examples/' skills/git-workflow/ ~/.claude/skills/git-workflow/
  2. Modify Reference Documents:

    vim skills/git-workflow/references/<document>.md
    rsync -av --exclude 'docs/' --exclude 'examples/' skills/git-workflow/ ~/.claude/skills/git-workflow/

Trigger Rules:

  1. Modify Trigger Rules:

    vim ~/.claude/skills/skill-rules.json
    # Modify keywords or intentPatterns for git-workflow
  2. Verify Modifications:

    # JSON format check
    python3 -m json.tool ~/.claude/skills/skill-rules.json > /dev/null
    
    # Test triggers in Claude Code

Troubleshooting

Common Issues

Skills Not Triggering:

# Verify trigger rules
grep -E "git-workflow" ~/.claude/skills/skill-rules.json

# Verify skill files exist
ls ~/.claude/skills/git-workflow/

Git Aliases Not Found:

# Check if aliases are loaded
git config --get-regexp alias.tnr

# Verify aliases file
ls ./git/aliases.gitconfig

gh CLI Issues:

# Authenticate with GitHub
gh auth login

# Verify authentication
gh auth status

Detailed Troubleshooting:


License

MIT License


References

Related Documentation

External Resources


Contact

If you have questions or suggestions:

  1. Refer to the "Troubleshooting" section of this document
  2. Consult the Skill documentation: ~/.claude/skills/git-workflow/SKILL.md
  3. Check Git Aliases Reference Manual: git/Git-Aliases-Reference-Manual.md

Happy Coding! ๐Ÿš€

About

Intelligent Git topic workflow assistant for Claude Code with production-grade aliases

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published