Git — Intelligent Git Operations
Smart git workflow with automatic Conventional Commit message generation.
Safety Rules
- Conventional Commits: All commit messages MUST follow
type(scope): description format
- Types:
feat, fix, refactor, docs, test, chore, perf, ci, build, style
- Scope: optional, derived from changed files/directories
- Description: imperative mood, lowercase, no period
- Destructive operations require user confirmation:
push --force, reset --hard, branch -D, rebase on shared branches, clean -f
- Never skip hooks: Do not use
--no-verify unless user explicitly requests it
- Smart Commit always active: Analyze staged changes to generate meaningful messages automatically
Operations
status
Analyze repository state and provide actionable summary.
- Run
git status (never use -uall flag)
- Run
git diff --stat for 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 status and git diff --cached (staged) and git diff (unstaged)
- Run
git log --oneline -5 to match existing commit style
- Analyze changes:
- Determine
type from nature of changes (new feature → feat, bug fix → fix, etc.)
- Determine
scope from affected directories/files
- Write concise description focusing on "why" not "what"
- If nothing is staged, ask user what to stage
- Stage files with specific file names (avoid
git add -A or git 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 convention type/description (e.g., feat/add-login, fix/header-alignment)
- Switch:
git checkout <name>
- List:
git branch -a with upstream status
- Delete:
git branch -d <name> (use -D only 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 (or apply to 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)
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: laststance-skills-git3description: Git — Intelligent Git Operations4---56# Git — Intelligent Git Operations78Smart git workflow with automatic Conventional Commit message generation.910<essential_principles>1112## Safety Rules1314- **Conventional Commits**: All commit messages MUST follow `type(scope): description` format15 - Types: `feat`, `fix`, `refactor`, `docs`, `test`, `chore`, `perf`, `ci`, `build`, `style`16 - Scope: optional, derived from changed files/directories17 - Description: imperative mood, lowercase, no period18- **Destructive operations require user confirmation**: `push --force`, `reset --hard`, `branch -D`, `rebase` on shared branches, `clean -f`19- **Never skip hooks**: Do not use `--no-verify` unless user explicitly requests it20- **Smart Commit always active**: Analyze staged changes to generate meaningful messages automatically2122</essential_principles>2324## Operations2526### status2728Analyze repository state and provide actionable summary.29301. Run `git status` (never use `-uall` flag)312. Run `git diff --stat` for change overview323. Present:33 - Staged / unstaged / untracked file counts34 - Branch info and upstream tracking status35 - Recommended next action (e.g., "Ready to commit", "Changes need staging")3637### commit3839Generate a Conventional Commit from change analysis.40411. Run `git status` and `git diff --cached` (staged) and `git diff` (unstaged)422. Run `git log --oneline -5` to match existing commit style433. Analyze changes:44 - Determine `type` from nature of changes (new feature → `feat`, bug fix → `fix`, etc.)45 - Determine `scope` from affected directories/files46 - Write concise description focusing on "why" not "what"474. If nothing is staged, ask user what to stage485. Stage files with specific file names (avoid `git add -A` or `git add .`)496. Commit using HEREDOC format:50 ```bash51 git commit -m "$(cat <<'EOF'52 type(scope): description53 EOF54 )"55 ```5657### push5859Sync local commits with remote.60611. Check upstream tracking: `git rev-parse --abbrev-ref --symbolic-full-name @{u}`622. If no upstream, push with `-u`: `git push -u origin <branch>`633. If upstream exists: `git push`644. **Never force-push without user confirmation**6566### pull6768Fetch and integrate remote changes.69701. `git pull --rebase` (prefer rebase over merge for clean history)712. If conflicts arise, guide user through resolution7273### branch7475Create, switch, or manage branches.76771. **Create**: `git checkout -b <name>` with naming convention `type/description` (e.g., `feat/add-login`, `fix/header-alignment`)782. **Switch**: `git checkout <name>`793. **List**: `git branch -a` with upstream status804. **Delete**: `git branch -d <name>` (use `-D` only with user confirmation)8182### merge8384Guided merge with conflict resolution support.85861. Check target branch is up to date: `git fetch origin`872. Execute merge: `git merge <source>`883. If conflicts:89 - List conflicting files90 - Show conflict markers for each file91 - Guide user through resolution options92 - After resolution: `git add <resolved-files> && git commit`9394### stash9596Temporarily save uncommitted changes.97981. **Save**: `git stash push -m "description"`992. **List**: `git stash list`1003. **Apply**: `git stash pop` (or `apply` to keep in stash)101102### log103104View commit history with useful formatting.1051061. Default: `git log --oneline -20`1072. Detailed: `git log --oneline --graph --all -20`108109## Examples110111```112/git status113/git commit114/git push115/git branch feat/dark-mode116/git merge main117/git stash save work in progress118/git log119```120121## Boundaries122123**Will:**124- Execute git operations with intelligent automation125- Generate Conventional Commit messages from change analysis126- Provide workflow guidance and best practice recommendations127- Handle conflict resolution with step-by-step guidance128129**Will Not:**130- Modify repository configuration without explicit authorization131- Execute destructive operations without user confirmation132- Include project-specific workflow rules (those belong in CLAUDE.md or AGENTS.md)133134---135> Converted and distributed by [TomeVault](https://tomevault.io/claim/laststance) — claim your Tome and manage your conversions.136<!-- tomevault:4.0:skill_md:2026-04-13 -->