一键导入
git-workflow
Use when starting feature work needing isolation or when completing a development branch — covers worktree creation, setup, and branch finishing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when starting feature work needing isolation or when completing a development branch — covers worktree creation, setup, and branch finishing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use before any creative work — creating features, building components, adding functionality, or modifying behavior. Explores intent, requirements, and design before implementation.
Use when completing tasks, implementing major features, or before merging. Covers both performing self-review and responding to external review feedback.
Use at the start of every conversation to establish skill-driven workflows. Ensures relevant skills are loaded before any action or response.
Use when you have a spec or requirements for a multi-step task. Covers both writing implementation plans and executing them task-by-task with review checkpoints.
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
Use when implementing any feature or bugfix, before writing implementation code
| name | git-workflow |
| description | Use when starting feature work needing isolation or when completing a development branch — covers worktree creation, setup, and branch finishing. |
Follow this priority:
Check existing directories:
ls -d .worktrees 2>/dev/null
ls -d worktrees 2>/dev/null
If found, use it. .worktrees wins if both exist.
Check project docs for worktree directory preference.
Ask the user if neither exists.
For project-local directories: Verify the directory is git-ignored:
git check-ignore -q .worktrees 2>/dev/null
If NOT ignored: Add to .gitignore and commit before proceeding.
# 1. Create worktree
git worktree add <path> -b <branch-name>
cd <path>
# 2. Run project setup (auto-detect)
# Node.js: npm install
# Rust: cargo build
# Python: pip install -r requirements.txt
# Go: go mod download
# 3. Verify clean baseline
<test command>
If tests fail: Report failures, ask whether to proceed or investigate.
If tests pass: Report ready with location and test count.
<project test command>
If tests fail: Stop. Fix before offering options.
Implementation complete. What would you like to do?
1. Merge back to <base-branch> locally
2. Push and create a Pull Request
3. Keep the branch as-is (I'll handle it later)
4. Discard this work
Option 1 — Merge locally:
git checkout <base-branch>
git pull
git merge <feature-branch>
<test command> # Verify merged result
git branch -d <feature-branch>
Then cleanup worktree.
Option 2 — Push and PR:
git push -u origin <feature-branch>
gh pr create --title "<title>" --body "<summary>"
Then cleanup worktree.
Option 3 — Keep as-is: Report branch name and worktree path. Don't cleanup.
Option 4 — Discard: Confirm first — show branch name, commits, worktree path. Wait for explicit confirmation.
git checkout <base-branch>
git branch -D <feature-branch>
git worktree remove <path>
For Options 1, 2, 4:
git worktree remove <worktree-path>