git
4
总安装量
4
周安装量
#51670
全站排名
安装命令
npx skills add https://github.com/laststance/skills --skill git
Agent 安装分布
opencode
4
antigravity
4
claude-code
4
github-copilot
4
windsurf
4
codex
4
Skill 文档
Git â Intelligent Git Operations
Smart git workflow with automatic Conventional Commit message generation.
<essential_principles>
Safety Rules
- Conventional Commits: All commit messages MUST follow
type(scope): descriptionformat- Types:
feat,fix,refactor,docs,test,chore,perf,ci,build,style - Scope: optional, derived from changed files/directories
- Description: imperative mood, lowercase, no period
- Types:
- Destructive operations require user confirmation:
push --force,reset --hard,branch -D,rebaseon shared branches,clean -f - Never skip hooks: Do not use
--no-verifyunless user explicitly requests it - Smart Commit always active: Analyze staged changes to generate meaningful messages automatically
</essential_principles>
Operations
status
Analyze repository state and provide actionable summary.
- Run
git status(never use-uallflag) - Run
git diff --statfor change overview - Present:
- Staged / unstaged / untracked file counts
- Branch info and upstream tracking status
- Recommended next action (e.g., “Ready to commit”, “Changes need staging”)
commit
Generate a Conventional Commit from change analysis.
- Run
git statusandgit diff --cached(staged) andgit diff(unstaged) - Run
git log --oneline -5to match existing commit style - Analyze changes:
- Determine
typefrom nature of changes (new feature âfeat, bug fix âfix, etc.) - Determine
scopefrom affected directories/files - Write concise description focusing on “why” not “what”
- Determine
- If nothing is staged, ask user what to stage
- Stage files with specific file names (avoid
git add -Aorgit add .) - Commit using HEREDOC format:
git commit -m "$(cat <<'EOF' type(scope): description EOF )"
push
Sync local commits with remote.
- Check upstream tracking:
git rev-parse --abbrev-ref --symbolic-full-name @{u} - If no upstream, push with
-u:git push -u origin <branch> - If upstream exists:
git push - Never force-push without user confirmation
pull
Fetch and integrate remote changes.
git pull --rebase(prefer rebase over merge for clean history)- If conflicts arise, guide user through resolution
branch
Create, switch, or manage branches.
- Create:
git checkout -b <name>with naming conventiontype/description(e.g.,feat/add-login,fix/header-alignment) - Switch:
git checkout <name> - List:
git branch -awith upstream status - Delete:
git branch -d <name>(use-Donly with user confirmation)
merge
Guided merge with conflict resolution support.
- Check target branch is up to date:
git fetch origin - Execute merge:
git merge <source> - If conflicts:
- List conflicting files
- Show conflict markers for each file
- Guide user through resolution options
- After resolution:
git add <resolved-files> && git commit
stash
Temporarily save uncommitted changes.
- Save:
git stash push -m "description" - List:
git stash list - Apply:
git stash pop(orapplyto keep in stash)
log
View commit history with useful formatting.
- Default:
git log --oneline -20 - Detailed:
git log --oneline --graph --all -20
Examples
/git status
/git commit
/git push
/git branch feat/dark-mode
/git merge main
/git stash save work in progress
/git log
Boundaries
Will:
- Execute git operations with intelligent automation
- Generate Conventional Commit messages from change analysis
- Provide workflow guidance and best practice recommendations
- Handle conflict resolution with step-by-step guidance
Will Not:
- Modify repository configuration without explicit authorization
- Execute destructive operations without user confirmation
- Include project-specific workflow rules (those belong in CLAUDE.md or AGENTS.md)