one intelligent Git workflow assistants that streamline your development process:
- git-workflow: Topic-based branch management with safety checks and workflow guidance
- 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
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
-
Git Aliases Configuration (Required for git-workflow):
# Location: ./git/aliases.gitconfig # Contains core commands: tnr, tn, tmg, td, fixup, bdf, blg, etc.
-
Claude Code (Required):
- Version: Supports Skills functionality
- Configuration:
~/.claude/skills/directory exists
-
Optional Dependencies:
fzf: Interactive selection (fixup, blf, pif)ripgrep: Repository search (rg, rg-all)
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.jsongit-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
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 branchMore Scenarios:
- git-workflow scenarios: Conflict resolution, misoperation recovery
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 are defined in ~/.claude/skills/skill-rules.json.
Example Keywords: "ๅผๅงๆฐๅ่ฝ", "ๅฎๆๅ่ฝ", "git workflow", "branch diff", "fixup"
| Metric | Value |
|---|---|
| Total Skills | 1 |
| Total Documents | 6 |
| Total Lines | 3620 |
Breakdown:
- git-workflow: 6 documents, 3620 lines
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
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
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)
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
git-workflow Skill:
-
Modify Main Document:
vim skills/git-workflow/SKILL.md rsync -av --exclude 'docs/' --exclude 'examples/' skills/git-workflow/ ~/.claude/skills/git-workflow/
-
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:
-
Modify Trigger Rules:
vim ~/.claude/skills/skill-rules.json # Modify keywords or intentPatterns for git-workflow
-
Verify Modifications:
# JSON format check python3 -m json.tool ~/.claude/skills/skill-rules.json > /dev/null # Test triggers in Claude Code
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.gitconfiggh CLI Issues:
# Authenticate with GitHub
gh auth login
# Verify authentication
gh auth statusDetailed Troubleshooting:
- git-workflow troubleshooting: Trigger issues, command errors, state checks
MIT License
- Git Aliases:
Local:
git/aliases.gitconfigGithub: https://github.com/appleshan/dotfiles/blob/stow/git/.config/git/conf/aliases.gitconfig - Git Aliases Reference Manual:
Local:
git/Git-Aliases-Reference-Manual.mdGithub: https://github.com/appleshan/dotfiles/blob/stow/git/.config/git/conf/Git-Aliases-Reference-Manual.md
- Feature Branch Workflow: https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow
- Git Flight Rules: https://github.com/k88hudson/git-flight-rules
- Oh Shit, Git!: https://ohshitgit.com/
If you have questions or suggestions:
- Refer to the "Troubleshooting" section of this document
- Consult the Skill documentation:
~/.claude/skills/git-workflow/SKILL.md - Check Git Aliases Reference Manual:
git/Git-Aliases-Reference-Manual.md
Happy Coding! ๐