一键导入
git
Git version control best practices for AI coding agents. Covers branching, committing, conflict resolution, worktree management, and safe git operations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Git version control best practices for AI coding agents. Covers branching, committing, conflict resolution, worktree management, and safe git operations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | git |
| description | Git version control best practices for AI coding agents. Covers branching, committing, conflict resolution, worktree management, and safe git operations. |
You are working with Git in an automated workflow context. Follow these guidelines for all Git operations.
git push --force unless explicitly instructed.--no-verify) unless explicitly instructed.# Create and switch to a new branch
git checkout -b <branch-name>
# Branch naming conventions
# Feature: feature/<ticket-id>-<short-description>
# Bugfix: bugfix/<ticket-id>-<short-description>
# Hotfix: hotfix/<ticket-id>-<short-description>
# Always check before acting
git status
git branch -a # List all branches
git log --oneline -10 # Recent history
git diff --stat # What changed
Follow the repository's existing commit message convention. Check git log --oneline -10 first.
If no clear convention exists, use:
<type>(<scope>): <description>
[optional body]
Types: feat, fix, refactor, test, docs, chore, style, perf
# 1. Review what will be committed
git status
git diff
git diff --staged
# 2. Stage specific files (avoid git add -A or git add .)
git add path/to/file1.ts path/to/file2.ts
# 3. Commit with a meaningful message
git commit -m "type(scope): description of change"
# 4. Verify the commit
git log --oneline -1
git show --stat HEAD
.env files or any file containing secrets/tokens/credentialsnode_modules/ or build output directories.idea/, .vscode/) unless already tracked.db, .sqlite)In this project, workflows use Git worktrees for isolation.
# List worktrees
git worktree list
# Create a worktree
git worktree add <path> -b <branch-name>
# Remove a worktree after work is done
git worktree remove <path>
# Force remove if unclean
git worktree remove --force <path>
git worktree list before creating to avoid path conflicts.git merge for integrating branches. It preserves full history.git rebase when explicitly instructed and on local-only branches.# 1. See which files have conflicts
git status
# 2. Open each conflicted file and look for <<<<<<< markers
# 3. Resolve by choosing the correct code (never blindly accept ours or theirs)
# 4. Stage the resolved file
git add <resolved-file>
# 5. Continue the merge
git merge --continue
# If you need to abort
git merge --abort
# Save current work temporarily
git stash push -m "description of stash"
# List stashes
git stash list
# Apply most recent stash
git stash pop
# Apply specific stash
git stash apply stash@{0}
# Fetch without merging
git fetch origin
# Pull with rebase (safer for linear history)
git pull --rebase origin <branch>
# Push current branch
git push origin <branch>
# Push and set upstream for new branch
git push -u origin <branch>
# Unstage a file (keeps working directory changes)
git restore --staged <file>
# Discard unstaged changes to a file (DESTRUCTIVE - confirm first)
git restore <file>
# Undo last commit (keeps changes staged)
git reset --soft HEAD~1
# View a specific commit
git show <commit-hash>
--no-verify) unless explicitly instructed.Built-in skill for asking the user questions during task execution. Use this when you need clarification, decisions, or choices from the user before proceeding.
Built-in skill for splitting tasks into sub-tasks with project matching and dependency mapping.
Built-in skill for asking the user questions during task execution. Use this when you need clarification, decisions, or choices from the user before proceeding.
End-to-end browser testing with Playwright. Provides guidance on writing, running, and debugging Playwright tests.
Structured design methodology for AI coding agents. Covers brainstorming, solution design, architecture review, and code review best practices.
Test-Driven Development methodology for AI coding agents. Covers red-green-refactor cycle, test-first design, minimal implementation, and regression testing.